Moses::PartialTranslOptColl Class Reference

#include <PartialTranslOptColl.h>

List of all members.

Public Types

typedef Coll::iterator iterator
typedef Coll::const_iterator const_iterator

Public Member Functions

const_iterator begin () const
const_iterator end () const
 PartialTranslOptColl (size_t const maxSize)
 ~PartialTranslOptColl ()
void AddNoPrune (TranslationOption *partialTranslOpt)
void Add (TranslationOption *partialTranslOpt)
void Prune ()
const std::vector
< TranslationOption * > & 
GetList () const
void DetachAll ()
size_t GetPrunedCount ()

Protected Types

typedef std::vector
< TranslationOption * > 
Coll

Protected Attributes

Coll m_list
float m_bestScore
float m_worstScore
size_t m_maxSize
size_t m_totalPruned

Friends

std::ostream & operator<< (std::ostream &out, const PartialTranslOptColl &possibleTranslation)


Detailed Description

Contains partial translation options, while these are constructed in the class TranslationOption. The factored translation model allows for multiple translation and generation steps during a single Hypothesis expansion. For efficiency, all these expansions are precomputed and stored as TranslationOption. The expansion process itself may be still explode, so efficient handling of partial translation options during expansion is required. This class assists in this tasks by implementing pruning. This implementation is similar to the one in HypothesisStack.

Definition at line 44 of file PartialTranslOptColl.h.


Member Typedef Documentation

typedef std::vector<TranslationOption*> Moses::PartialTranslOptColl::Coll [protected]

Definition at line 49 of file PartialTranslOptColl.h.

typedef Coll::const_iterator Moses::PartialTranslOptColl::const_iterator

Definition at line 58 of file PartialTranslOptColl.h.

typedef Coll::iterator Moses::PartialTranslOptColl::iterator

Definition at line 57 of file PartialTranslOptColl.h.


Constructor & Destructor Documentation

Moses::PartialTranslOptColl::PartialTranslOptColl ( size_t const   maxSize  ) 

constructor, intializes counters and thresholds

Definition at line 31 of file PartialTranslOptColl.cpp.

References m_bestScore, m_maxSize, m_totalPruned, and m_worstScore.

Moses::PartialTranslOptColl::~PartialTranslOptColl (  )  [inline]

destructor, cleans out list

Definition at line 70 of file PartialTranslOptColl.h.

References m_list, and Moses::RemoveAllInColl().

Here is the call graph for this function:


Member Function Documentation

void Moses::PartialTranslOptColl::Add ( TranslationOption partialTranslOpt  ) 

add a partial translation option to the collection, prune if necessary. This is done similar to the Prune() in TranslationOptionCollection

Definition at line 56 of file PartialTranslOptColl.cpp.

References AddNoPrune(), m_list, m_maxSize, and Prune().

Referenced by Moses::DecodeStepTranslation::Process(), Moses::DecodeStepGeneration::Process(), Moses::DecodeStepTranslation::ProcessInitialTranslation(), Moses::DecodeStepTranslation::ProcessInitialTransLEGACY(), and Moses::DecodeStepTranslation::ProcessLEGACY().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::PartialTranslOptColl::AddNoPrune ( TranslationOption partialTranslOpt  ) 

add a partial translation option to the collection (without pruning)

Definition at line 41 of file PartialTranslOptColl.cpp.

References Moses::TranslationOption::GetFutureScore(), m_bestScore, m_list, m_totalPruned, and m_worstScore.

Referenced by Add().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 60 of file PartialTranslOptColl.h.

References m_list.

void Moses::PartialTranslOptColl::DetachAll (  )  [inline]

clear out the list

Definition at line 84 of file PartialTranslOptColl.h.

References m_list.

Referenced by Moses::TranslationOptionCollection::CreateTranslationOptionsForRange(), and Moses::TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLEGACY().

Here is the caller graph for this function:

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

Definition at line 63 of file PartialTranslOptColl.h.

References m_list.

const std::vector<TranslationOption*>& Moses::PartialTranslOptColl::GetList (  )  const [inline]

size_t Moses::PartialTranslOptColl::GetPrunedCount (  )  [inline]

return number of pruned partial hypotheses

Definition at line 89 of file PartialTranslOptColl.h.

References m_totalPruned.

Referenced by Moses::TranslationOptionCollection::CreateTranslationOptionsForRange(), and Moses::TranslationOptionCollectionConfusionNet::CreateTranslationOptionsForRangeLEGACY().

Here is the caller graph for this function:

void Moses::PartialTranslOptColl::Prune (  ) 

pruning, remove partial translation options, if list too big

Definition at line 75 of file PartialTranslOptColl.cpp.

References Moses::ComparePartialTranslationOption(), m_list, m_maxSize, m_totalPruned, m_worstScore, and NTH_ELEMENT4.

Referenced by Add().

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PartialTranslOptColl possibleTranslation 
) [friend]


Member Data Documentation

score of the best translation option

Definition at line 51 of file PartialTranslOptColl.h.

Referenced by AddNoPrune(), and PartialTranslOptColl().

maximum number of translation options allowed

Definition at line 53 of file PartialTranslOptColl.h.

Referenced by Add(), PartialTranslOptColl(), and Prune().

number of options pruned

Definition at line 54 of file PartialTranslOptColl.h.

Referenced by AddNoPrune(), GetPrunedCount(), PartialTranslOptColl(), and Prune().

score of the worse translation option

Definition at line 52 of file PartialTranslOptColl.h.

Referenced by AddNoPrune(), PartialTranslOptColl(), and Prune().


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

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