#include <TreeStructureFeature.h>
Public Member Functions | |
TreeStructureFeature (const std::string &line) | |
~TreeStructureFeature () | |
virtual const FFState * | EmptyHypothesisState (const InputType &input) const |
return the state associated with the empty hypothesis for a given sentence | |
bool | IsUseable (const FactorMask &mask) const |
void | SetParameter (const std::string &key, const std::string &value) |
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 | Load (AllOptions::ptr const &opts) |
override to load model files |
Definition at line 34 of file TreeStructureFeature.h.
Moses::TreeStructureFeature::TreeStructureFeature | ( | const std::string & | line | ) | [inline] |
Definition at line 43 of file TreeStructureFeature.h.
References Moses::Word::CreateFromString(), Moses::Output, and Moses::FeatureFunction::ReadParameters().
Moses::TreeStructureFeature::~TreeStructureFeature | ( | ) | [inline] |
Definition at line 52 of file TreeStructureFeature.h.
virtual const FFState* Moses::TreeStructureFeature::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 56 of file TreeStructureFeature.h.
FFState * Moses::TreeStructureFeature::EvaluateWhenApplied | ( | const ChartHypothesis & | cur_hypo, | |
int | featureID, | |||
ScoreComponentCollection * | accumulator | |||
) | const [virtual] |
Implements Moses::StatefulFeatureFunction.
Definition at line 23 of file TreeStructureFeature.cpp.
References Moses::TargetPhrase::GetAlignNonTerm(), Moses::ChartHypothesis::GetCurrTargetPhrase(), Moses::ChartHypothesis::GetFFState(), Moses::AlignmentInfo::GetNonTermIndexMap(), Moses::ChartHypothesis::GetPrevHypo(), Moses::TargetPhrase::GetProperty(), Moses::Phrase::GetSize(), Moses::TreeState::GetTree(), Moses::Phrase::GetWord(), Moses::Word::IsNonTerminal(), Moses::SyntaxConstraints::SyntacticRules(), and UTIL_THROW2.
FFState* Moses::TreeStructureFeature::EvaluateWhenApplied | ( | const Hypothesis & | cur_hypo, | |
const FFState * | prev_state, | |||
ScoreComponentCollection * | accumulator | |||
) | const [inline, 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 66 of file TreeStructureFeature.h.
References UTIL_THROW.
bool Moses::TreeStructureFeature::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::TreeStructureFeature::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 11 of file TreeStructureFeature.cpp.
References Moses::StaticData::InstanceNonConst(), Moses::FeatureFunction::m_options, NULL, and Moses::StaticData::SetTreeStructure().
void Moses::TreeStructureFeature::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 61 of file TreeStructureFeature.cpp.
References Moses::FeatureFunction::GetScoreProducerDescription(), Moses::FeatureFunction::m_tuneable, Moses::Scan< bool >(), and UTIL_THROW.