Moses::TargetPhraseCollection Class Reference

a list of target phrases that is translated from the same source phrase More...

#include <TargetPhraseCollection.h>

Inheritance diagram for Moses::TargetPhraseCollection:

Inheritance graph
[legend]

List of all members.

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 &copy)
virtual ~TargetPhraseCollection ()
const CollTypeGetCollection () const
void Remove (const size_t pos)
 delete an entry from the collection
const TargetPhraseGetTargetPhrase (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 &)


Detailed Description

a list of target phrases that is translated from the same source phrase

Definition at line 35 of file TargetPhraseCollection.h.


Member Typedef Documentation

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.

Reimplemented in Moses::TargetPhraseCollectionWithSourcePhrase.

Definition at line 48 of file TargetPhraseCollection.h.

Reimplemented in Moses::TargetPhraseCollectionWithSourcePhrase.

Definition at line 47 of file TargetPhraseCollection.h.


Constructor & Destructor Documentation

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().

Here is the call graph for this function:

virtual Moses::TargetPhraseCollection::~TargetPhraseCollection (  )  [inline, virtual]

Definition at line 73 of file TargetPhraseCollection.h.

References Remove().

Here is the call graph for this function:


Member Function Documentation

void Moses::TargetPhraseCollection::Add ( TargetPhrase targetPhrase  )  [inline]

const_iterator Moses::TargetPhraseCollection::begin (  )  const [inline]

Definition at line 61 of file TargetPhraseCollection.h.

References m_collection.

iterator Moses::TargetPhraseCollection::begin (  )  [inline]

void Moses::TargetPhraseCollection::Detach (  )  [inline]

Definition at line 115 of file TargetPhraseCollection.h.

References m_collection.

const_iterator Moses::TargetPhraseCollection::end (  )  const [inline]

Definition at line 64 of file TargetPhraseCollection.h.

References m_collection.

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().

Here is the caller graph for this function:

const CollType& Moses::TargetPhraseCollection::GetCollection (  )  const [inline]

Definition at line 77 of file TargetPhraseCollection.h.

References m_collection.

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().

Here is the caller graph for this function:

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().

Here is the caller graph for this function:

TargetPhrase const* Moses::TargetPhraseCollection::operator[] ( size_t const   i  )  const [inline]

Definition at line 51 of file TargetPhraseCollection.h.

References m_collection.

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().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::TargetPhraseCollection::Remove (  )  [inline]

Definition at line 112 of file TargetPhraseCollection.h.

References m_collection, and Moses::RemoveAllInColl().

Referenced by ~TargetPhraseCollection().

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

void Moses::TargetPhraseCollection::Sort ( bool  adhereTableLimit,
size_t  tableLimit 
)

Definition at line 77 of file TargetPhraseCollection.cpp.

References m_collection.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const TargetPhraseCollection obj 
) [friend]

Definition at line 96 of file TargetPhraseCollection.cpp.


Member Data Documentation


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:33:36 2017 for Moses by  doxygen 1.5.9