Moses::TranslationOption Class Reference

#include <TranslationOption.h>

Collaboration diagram for Moses::TranslationOption:

Collaboration graph
[legend]

List of all members.

Classes

struct  Better

Public Member Functions

 TranslationOption ()
 TranslationOption (const Range &range, const TargetPhrase &targetPhrase)
bool IsCompatible (const Phrase &phrase, const std::vector< FactorType > &featuresToCheck) const
const TargetPhraseGetTargetPhrase () const
const RangeGetSourceWordsRange () const
const InputPathGetInputPath () const
void SetInputPath (const InputPath &inputPath)
bool Overlap (const Hypothesis &hypothesis) const
size_t GetStartPos () const
size_t GetEndPos () const
size_t GetSize () const
float GetFutureScore () const
bool IsDeletionOption () const
const ScoreComponentCollectionGetScoreBreakdown () const
ScoreComponentCollectionGetScoreBreakdown ()
void EvaluateWithSourceContext (const InputType &input)
void UpdateScore (ScoreComponentCollection *futureScoreBreakdown=NULL)
const ScoresGetLexReorderingScores (const LexicalReordering *scoreProducer) const
void CacheLexReorderingScores (const LexicalReordering &scoreProducer, const Scores &score)
 TO_STRING ()
bool operator== (const TranslationOption &rhs) const

Protected Attributes

TargetPhrase m_targetPhrase
const InputPathm_inputPath
const Range m_sourceWordsRange
float m_futureScore

Friends

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


Detailed Description

Available phrase translation for a particular sentence pair. In a multi-factor model, this is expanded from the entries in the translation tables and generation tables (and pruned to the maximum number allowed). By pre-computing the allowable phrase translations, efficient beam search in Manager is possible when expanding instances of the class Hypothesis - the states in the search.

A translation option contains source and target phrase, aggregate and details scores (in m_scoreBreakdown), including an estimate how expensive this option will be in search (used to build the future cost matrix.)

m_targetPhrase points to a phrase-table entry. The source word range is zero-indexed, so it can't refer to an empty range. The target phrase may be empty.

Definition at line 62 of file TranslationOption.h.


Constructor & Destructor Documentation

Moses::TranslationOption::TranslationOption (  )  [explicit]

Definition at line 35 of file TranslationOption.cpp.

Moses::TranslationOption::TranslationOption ( const Range range,
const TargetPhrase targetPhrase 
)

constructor. Used by initial translation step

Definition at line 42 of file TranslationOption.cpp.


Member Function Documentation

void Moses::TranslationOption::CacheLexReorderingScores ( const LexicalReordering scoreProducer,
const Scores score 
)

Definition at line 71 of file TranslationOption.cpp.

References m_targetPhrase, and Moses::TargetPhrase::SetExtraScores().

Referenced by Moses::LexicalReordering::SetCache().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::TranslationOption::EvaluateWithSourceContext ( const InputType input  ) 

Definition at line 79 of file TranslationOption.cpp.

References Moses::TargetPhrase::EvaluateWithSourceContext(), GetInputPath(), and m_targetPhrase.

Referenced by Moses::TranslationOptionCollectionLattice::CreateTranslationOptions().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Moses::TranslationOption::GetEndPos (  )  const [inline]

return end index of source phrase

Definition at line 124 of file TranslationOption.h.

References Moses::Range::GetEndPos(), and m_sourceWordsRange.

Referenced by Moses::VW::EvaluateWhenApplied(), Moses::SearchNormal::ExpandHypothesis(), Moses::hash_value(), and Moses::VWState::VWState().

Here is the call graph for this function:

Here is the caller graph for this function:

float Moses::TranslationOption::GetFutureScore (  )  const [inline]

const InputPath & Moses::TranslationOption::GetInputPath (  )  const

const Scores * Moses::TranslationOption::GetLexReorderingScores ( const LexicalReordering scoreProducer  )  const

returns cached scores

Definition at line 115 of file TranslationOption.cpp.

References Moses::TargetPhrase::GetExtraScores(), and m_targetPhrase.

Referenced by Moses::LRState::ComparePrevScores(), Moses::LRState::CopyScores(), and Moses::LexicalReordering::SetCache().

Here is the call graph for this function:

Here is the caller graph for this function:

ScoreComponentCollection& Moses::TranslationOption::GetScoreBreakdown (  )  [inline]

Definition at line 148 of file TranslationOption.h.

References Moses::TargetPhrase::GetScoreBreakdown(), and m_targetPhrase.

Here is the call graph for this function:

const ScoreComponentCollection& Moses::TranslationOption::GetScoreBreakdown (  )  const [inline]

size_t Moses::TranslationOption::GetSize (  )  const [inline]

return length of source phrase

Definition at line 129 of file TranslationOption.h.

References Moses::Range::GetEndPos(), Moses::Range::GetStartPos(), and m_sourceWordsRange.

Referenced by Moses::SearchNormal::ExpandHypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

const Range& Moses::TranslationOption::GetSourceWordsRange (  )  const [inline]

size_t Moses::TranslationOption::GetStartPos (  )  const [inline]

return start index of source phrase

Definition at line 119 of file TranslationOption.h.

References Moses::Range::GetStartPos(), and m_sourceWordsRange.

Referenced by Moses::VW::EvaluateWhenApplied(), Moses::SearchNormal::ExpandHypothesis(), Moses::hash_value(), and Moses::VWState::VWState().

Here is the call graph for this function:

Here is the caller graph for this function:

const TargetPhrase& Moses::TranslationOption::GetTargetPhrase (  )  const [inline]

bool Moses::TranslationOption::IsCompatible ( const Phrase phrase,
const std::vector< FactorType > &  featuresToCheck 
) const

returns true if all feature types in featuresToCheck are compatible between the two phrases

Definition at line 51 of file TranslationOption.cpp.

References Moses::Phrase::IsCompatible(), and m_targetPhrase.

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

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::TranslationOption::IsDeletionOption (  )  const [inline]

return true if the source phrase translates into nothing

Definition at line 139 of file TranslationOption.h.

References Moses::Phrase::GetSize(), and m_targetPhrase.

Referenced by Moses::Hypothesis::Hypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::TranslationOption::operator== ( const TranslationOption rhs  )  const [inline]

Definition at line 171 of file TranslationOption.h.

References m_sourceWordsRange, and m_targetPhrase.

bool Moses::TranslationOption::Overlap ( const Hypothesis hypothesis  )  const

whether source span overlaps with those of a hypothesis

Definition at line 63 of file TranslationOption.cpp.

References GetSourceWordsRange(), Moses::Hypothesis::GetWordsBitmap(), and Moses::Bitmap::Overlap().

Here is the call graph for this function:

void Moses::TranslationOption::SetInputPath ( const InputPath inputPath  ) 

Moses::TranslationOption::TO_STRING (  ) 

void Moses::TranslationOption::UpdateScore ( ScoreComponentCollection futureScoreBreakdown = NULL  )  [inline]

Definition at line 154 of file TranslationOption.h.

References m_targetPhrase, and Moses::TargetPhrase::UpdateScore().

Referenced by Moses::VW::EvaluateTranslationOptionListWithSourceContext(), and Moses::ExampleTranslationOptionListFeature::EvaluateTranslationOptionListWithSourceContext().

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 TranslationOption possibleTranslation 
) [friend]


Member Data Documentation

Definition at line 71 of file TranslationOption.h.

Referenced by GetFutureScore().

Definition at line 69 of file TranslationOption.h.

Referenced by GetInputPath(), and SetInputPath().

Definition at line 70 of file TranslationOption.h.

Referenced by GetEndPos(), GetSize(), GetSourceWordsRange(), GetStartPos(), and operator==().


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

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