#include <TargetBigramFeature.h>
Public Member Functions | |
TargetBigramFeature (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 | |
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, ScoreComponentCollection *) const |
void | SetParameter (const std::string &key, const std::string &value) |
Definition at line 32 of file TargetBigramFeature.h.
Moses::TargetBigramFeature::TargetBigramFeature | ( | const std::string & | line | ) |
Definition at line 27 of file TargetBigramFeature.cpp.
References Moses::FactorCollection::AddFactor(), BOS_, Moses::FactorCollection::Instance(), Moses::Output, Moses::FeatureFunction::ReadParameters(), and Moses::Word::SetFactor().
const FFState * Moses::TargetBigramFeature::EmptyHypothesisState | ( | const InputType & | input | ) | const [virtual] |
return the state associated with the empty hypothesis for a given sentence
Implements Moses::StatefulFeatureFunction.
Definition at line 70 of file TargetBigramFeature.cpp.
virtual FFState* Moses::TargetBigramFeature::EvaluateWhenApplied | ( | const ChartHypothesis & | , | |
int | , | |||
ScoreComponentCollection * | ||||
) | const [inline, virtual] |
FFState * Moses::TargetBigramFeature::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 75 of file TargetBigramFeature.cpp.
References StringPiece::data(), EOS_, FindStringPiece(), Moses::Hypothesis::GetCurrTargetPhrase(), Moses::Word::GetFactor(), Moses::Phrase::GetSize(), Moses::Word::GetString(), Moses::Factor::GetString(), Moses::Phrase::GetWord(), Moses::TargetBigramState::GetWord(), Moses::Hypothesis::GetWordsBitmap(), Moses::Bitmap::IsComplete(), NULL, Moses::ScoreComponentCollection::PlusEquals(), and StringPiece::size().
bool Moses::TargetBigramFeature::IsUseable | ( | const FactorMask & | mask | ) | const [virtual] |
void Moses::TargetBigramFeature::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 51 of file TargetBigramFeature.cpp.
References BOS_, Moses::FeatureFunction::m_options, and UTIL_THROW_IF2.
void Moses::TargetBigramFeature::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |