#include <CoveredReferenceFeature.h>
Public Member Functions | |
CoveredReferenceFeature (const std::string &line) | |
void | Load (AllOptions::ptr const &opts) |
override to load model files | |
bool | IsUseable (const FactorMask &mask) const |
virtual const FFState * | EmptyHypothesisState (const InputType &input) const |
return the state associated with the empty hypothesis for a given sentence | |
void | EvaluateWithSourceContext (const InputType &input, const InputPath &inputPath, const TargetPhrase &targetPhrase, const StackVec *stackVec, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection *estimatedScores=NULL) const |
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. | |
FFState * | EvaluateWhenApplied (const ChartHypothesis &, int, ScoreComponentCollection *accumulator) const |
void | SetParameter (const std::string &key, const std::string &value) |
Definition at line 27 of file CoveredReferenceFeature.h.
Moses::CoveredReferenceFeature::CoveredReferenceFeature | ( | const std::string & | line | ) | [inline] |
Definition at line 41 of file CoveredReferenceFeature.h.
References Moses::FeatureFunction::m_tuneable, and Moses::FeatureFunction::ReadParameters().
virtual const FFState* Moses::CoveredReferenceFeature::EmptyHypothesisState | ( | const InputType & | input | ) | const [inline, virtual] |
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
Definition at line 52 of file CoveredReferenceFeature.h.
FFState * Moses::CoveredReferenceFeature::EvaluateWhenApplied | ( | const ChartHypothesis & | , | |
int | , | |||
ScoreComponentCollection * | accumulator | |||
) | const [virtual] |
Implements Moses::StatefulFeatureFunction.
Definition at line 121 of file CoveredReferenceFeature.cpp.
References UTIL_THROW.
FFState * Moses::CoveredReferenceFeature::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 80 of file CoveredReferenceFeature.cpp.
References Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Hypothesis::GetManager(), Moses::TargetPhrase::GetScoreBreakdown(), Moses::ScoreComponentCollection::GetScoresForProducer(), Moses::Manager::GetSource(), Moses::InputType::GetTranslationId(), Moses::CoveredReferenceState::m_coveredRef, Moses::ScoreComponentCollection::PlusEquals(), and UTIL_THROW.
void Moses::CoveredReferenceFeature::EvaluateWithSourceContext | ( | const InputType & | input, | |
const InputPath & | inputPath, | |||
const TargetPhrase & | targetPhrase, | |||
const StackVec * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedScores = NULL | |||
) | const [virtual] |
Reimplemented from Moses::StatefulFeatureFunction.
Definition at line 34 of file CoveredReferenceFeature.cpp.
References Moses::ScoreComponentCollection::Assign(), and Moses::InputType::GetTranslationId().
bool Moses::CoveredReferenceFeature::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::CoveredReferenceFeature::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 55 of file CoveredReferenceFeature.cpp.
References Moses::StaticData::Instance(), Moses::FeatureFunction::m_options, and Moses::Tokenize().
void Moses::CoveredReferenceFeature::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 71 of file CoveredReferenceFeature.cpp.