#include <TargetPhraseCollection.h>
Public Types | |
typedef CollType::iterator | iterator |
typedef CollType::const_iterator | const_iterator |
typedef boost::shared_ptr < TargetPhraseCollection > | shared_ptr |
typedef boost::shared_ptr < TargetPhraseCollection const > | shared_const_ptr |
Public Member Functions | |
TargetPhrase const * | operator[] (size_t const i) const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
TargetPhraseCollection () | |
TargetPhraseCollection (const TargetPhraseCollection ©) | |
virtual | ~TargetPhraseCollection () |
const CollType & | GetCollection () const |
void | Remove (const size_t pos) |
delete an entry from the collection | |
const TargetPhrase * | GetTargetPhrase (const size_t pos) const |
return an entry of the collection | |
void | NthElement (size_t tableLimit) |
divide collection into 2 buckets using std::nth_element, the top & bottom according to table limit | |
size_t | GetSize () const |
number of target phrases in this collection | |
bool | IsEmpty () const |
wether collection has any phrases | |
void | Add (TargetPhrase *targetPhrase) |
add a new entry into collection | |
void | Prune (bool adhereTableLimit, size_t tableLimit) |
void | Sort (bool adhereTableLimit, size_t tableLimit) |
void | Remove () |
void | Detach () |
Protected Types | |
typedef std::vector< const TargetPhrase * > | CollType |
Protected Attributes | |
CollType | m_collection |
Friends | |
std::ostream & | operator<< (std::ostream &, const TargetPhraseCollection &) |
Definition at line 35 of file TargetPhraseCollection.h.
typedef std::vector<const TargetPhrase*> Moses::TargetPhraseCollection::CollType [protected] |
Definition at line 40 of file TargetPhraseCollection.h.
typedef CollType::const_iterator Moses::TargetPhraseCollection::const_iterator |
Definition at line 46 of file TargetPhraseCollection.h.
typedef CollType::iterator Moses::TargetPhraseCollection::iterator |
Definition at line 45 of file TargetPhraseCollection.h.
typedef boost::shared_ptr<TargetPhraseCollection const> Moses::TargetPhraseCollection::shared_const_ptr |
Reimplemented in Moses::TargetPhraseCollectionWithSourcePhrase.
Definition at line 48 of file TargetPhraseCollection.h.
typedef boost::shared_ptr<TargetPhraseCollection> Moses::TargetPhraseCollection::shared_ptr |
Reimplemented in Moses::TargetPhraseCollectionWithSourcePhrase.
Definition at line 47 of file TargetPhraseCollection.h.
Moses::TargetPhraseCollection::TargetPhraseCollection | ( | ) | [inline] |
Definition at line 68 of file TargetPhraseCollection.h.
Moses::TargetPhraseCollection::TargetPhraseCollection | ( | const TargetPhraseCollection & | copy | ) |
Definition at line 46 of file TargetPhraseCollection.cpp.
References Add(), begin(), and end().
virtual Moses::TargetPhraseCollection::~TargetPhraseCollection | ( | ) | [inline, virtual] |
Definition at line 73 of file TargetPhraseCollection.h.
References Remove().
void Moses::TargetPhraseCollection::Add | ( | TargetPhrase * | targetPhrase | ) | [inline] |
add a new entry into collection
Reimplemented in Moses::TargetPhraseCollectionWithSourcePhrase.
Definition at line 105 of file TargetPhraseCollection.h.
References m_collection.
Referenced by Moses::ProbingPT::CreateTargetPhrases(), Moses::Sentence::GetXmlChartTranslationOptions(), Moses::PhraseDictionaryMemoryPerSentenceOnDemand::InitializeForInput(), Moses::PhraseDictionaryMemoryPerSentence::InitializeForInput(), and TargetPhraseCollection().
const_iterator Moses::TargetPhraseCollection::begin | ( | ) | const [inline] |
iterator Moses::TargetPhraseCollection::begin | ( | ) | [inline] |
Definition at line 55 of file TargetPhraseCollection.h.
References m_collection.
Referenced by Moses::CompletedRuleCollection::Add(), Moses::ChartTranslationOptionList::Add(), Moses::ChartTranslationOptions::ChartTranslationOptions(), main(), Moses::operator<<(), Remove(), and TargetPhraseCollection().
void Moses::TargetPhraseCollection::Detach | ( | ) | [inline] |
const_iterator Moses::TargetPhraseCollection::end | ( | ) | const [inline] |
iterator Moses::TargetPhraseCollection::end | ( | ) | [inline] |
Definition at line 58 of file TargetPhraseCollection.h.
References m_collection.
Referenced by Moses::ChartTranslationOptions::ChartTranslationOptions(), main(), Moses::operator<<(), and TargetPhraseCollection().
const CollType& Moses::TargetPhraseCollection::GetCollection | ( | ) | const [inline] |
size_t Moses::TargetPhraseCollection::GetSize | ( | ) | const [inline] |
number of target phrases in this collection
Definition at line 97 of file TargetPhraseCollection.h.
References m_collection.
const TargetPhrase* Moses::TargetPhraseCollection::GetTargetPhrase | ( | const size_t | pos | ) | const [inline] |
return an entry of the collection
Definition at line 89 of file TargetPhraseCollection.h.
References m_collection.
bool Moses::TargetPhraseCollection::IsEmpty | ( | ) | const [inline] |
wether collection has any phrases
Definition at line 101 of file TargetPhraseCollection.h.
References m_collection.
Referenced by Moses::CompletedRuleCollection::Add(), and Moses::ChartTranslationOptionList::Add().
void Moses::TargetPhraseCollection::NthElement | ( | size_t | tableLimit | ) |
divide collection into 2 buckets using std::nth_element, the top & bottom according to table limit
Definition at line 55 of file TargetPhraseCollection.cpp.
References m_collection, and NTH_ELEMENT4.
Referenced by Prune().
TargetPhrase const* Moses::TargetPhraseCollection::operator[] | ( | size_t const | i | ) | const [inline] |
void Moses::TargetPhraseCollection::Prune | ( | bool | adhereTableLimit, | |
size_t | tableLimit | |||
) |
Definition at line 64 of file TargetPhraseCollection.cpp.
References m_collection, and NthElement().
Referenced by Moses::ProbingPT::CreateTargetPhrases().
void Moses::TargetPhraseCollection::Remove | ( | ) | [inline] |
Definition at line 112 of file TargetPhraseCollection.h.
References m_collection, and Moses::RemoveAllInColl().
Referenced by ~TargetPhraseCollection().
void Moses::TargetPhraseCollection::Remove | ( | const size_t | pos | ) | [inline] |
delete an entry from the collection
Definition at line 82 of file TargetPhraseCollection.h.
References begin(), and m_collection.
void Moses::TargetPhraseCollection::Sort | ( | bool | adhereTableLimit, | |
size_t | tableLimit | |||
) |
std::ostream& operator<< | ( | std::ostream & | out, | |
const TargetPhraseCollection & | obj | |||
) | [friend] |
Definition at line 96 of file TargetPhraseCollection.cpp.
CollType Moses::TargetPhraseCollection::m_collection [protected] |
Definition at line 41 of file TargetPhraseCollection.h.
Referenced by Add(), Moses::TargetPhraseCollectionWithSourcePhrase::Add(), begin(), Detach(), end(), GetCollection(), GetSize(), GetTargetPhrase(), IsEmpty(), NthElement(), operator[](), Prune(), Remove(), and Sort().