#include <LexicalReordering.h>
Public Member Functions | |
LexicalReordering (const std::string &line) | |
virtual | ~LexicalReordering () |
void | Load (AllOptions::ptr const &opts) |
override to load model files | |
virtual bool | IsUseable (const FactorMask &mask) const |
virtual FFState const * | EmptyHypothesisState (const InputType &input) const |
return the state associated with the empty hypothesis for a given sentence | |
void | InitializeForInput (ttasksptr const &ttask) |
Called before search and collecting of translation options. | |
Scores | GetProb (const Phrase &f, const Phrase &e) const |
virtual FFState * | EvaluateWhenApplied (const Hypothesis &cur_hypo, const FFState *prev_state, ScoreComponentCollection *accumulator) const |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble. | |
virtual FFState * | EvaluateWhenApplied (const ChartHypothesis &, int featureID, ScoreComponentCollection *) const |
bool | GetHaveDefaultScores () |
float | GetDefaultScore (size_t i) |
virtual void | SetCache (TranslationOption &to) const |
virtual void | SetCache (TranslationOptionList &tol) const |
LRModel const & | GetModel () const |
Definition at line 31 of file LexicalReordering.h.
Moses::LexicalReordering::LexicalReordering | ( | const std::string & | line | ) |
Definition at line 19 of file LexicalReordering.cpp.
References Moses::LRModel::E, Moses::LRModel::F, Moses::LRModel::FE, Moses::FeatureFunction::m_args, Moses::FeatureFunction::m_numScoreComponents, Moses::FeatureFunction::m_numTuneableComponents, starts_with(), Moses::Tokenize(), Moses::TransformScore(), UTIL_THROW2, UTIL_THROW_IF2, and VERBOSE.
Moses::LexicalReordering::~LexicalReordering | ( | ) | [virtual] |
Definition at line 82 of file LexicalReordering.cpp.
FFState const * Moses::LexicalReordering::EmptyHypothesisState | ( | const InputType & | input | ) | const [virtual] |
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
Definition at line 119 of file LexicalReordering.cpp.
virtual FFState* Moses::LexicalReordering::EvaluateWhenApplied | ( | const ChartHypothesis & | , | |
int | featureID, | |||
ScoreComponentCollection * | ||||
) | const [inline, virtual] |
Implements Moses::StatefulFeatureFunction.
Definition at line 62 of file LexicalReordering.h.
References UTIL_THROW2.
FFState * Moses::LexicalReordering::EvaluateWhenApplied | ( | const Hypothesis & | cur_hypo, | |
const FFState * | prev_state, | |||
ScoreComponentCollection * | accumulator | |||
) | const [virtual] |
This interface should be implemented. Notes: When evaluating the value of this feature function, you should avoid calling hypo.GetPrevHypo(). If you need something from the "previous" hypothesis, you should store it in an FFState object which will be passed in as prev_state. If you don't do this, you will get in trouble.
Implements Moses::StatefulFeatureFunction.
Definition at line 105 of file LexicalReordering.cpp.
References Moses::LRState::Expand(), Moses::Hypothesis::GetInput(), Moses::Hypothesis::GetTranslationOption(), and VERBOSE.
float Moses::LexicalReordering::GetDefaultScore | ( | size_t | i | ) | [inline] |
Definition at line 73 of file LexicalReordering.h.
Referenced by Moses::LRState::CopyScores().
bool Moses::LexicalReordering::GetHaveDefaultScores | ( | ) | [inline] |
Definition at line 68 of file LexicalReordering.h.
Referenced by Moses::LRState::CopyScores().
LRModel const & Moses::LexicalReordering::GetModel | ( | ) | const |
Definition at line 154 of file LexicalReordering.cpp.
Referenced by Moses::Mmsapt::GetTargetPhraseCollectionLEGACY().
Definition at line 98 of file LexicalReordering.cpp.
References Moses::ARRAY_SIZE_INCR.
Referenced by SetCache().
void Moses::LexicalReordering::InitializeForInput | ( | ttasksptr const & | ttask | ) | [inline, virtual] |
Called before search and collecting of translation options.
Reimplemented from Moses::FeatureFunction.
Definition at line 47 of file LexicalReordering.h.
bool Moses::LexicalReordering::IsUseable | ( | const FactorMask & | mask | ) | const [virtual] |
void Moses::LexicalReordering::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 87 of file LexicalReordering.cpp.
References Moses::FeatureFunction::m_options.
void Moses::LexicalReordering::SetCache | ( | TranslationOptionList & | tol | ) | const [virtual] |
Definition at line 162 of file LexicalReordering.cpp.
References SetCache().
void Moses::LexicalReordering::SetCache | ( | TranslationOption & | to | ) | const [virtual] |
Definition at line 137 of file LexicalReordering.cpp.
References Moses::TranslationOption::CacheLexReorderingScores(), Moses::TranslationOption::GetInputPath(), Moses::TranslationOption::GetLexReorderingScores(), Moses::InputPath::GetPhrase(), GetProb(), and Moses::TranslationOption::GetTargetPhrase().
Referenced by Moses::TranslationOptionCollection::CacheLexReordering(), and SetCache().