#include <CountNonTerms.h>
Public Member Functions | |
CountNonTerms (const std::string &line) | |
bool | IsUseable (const FactorMask &mask) const |
void | EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const |
void | EvaluateWithSourceContext (const InputType &input, const InputPath &inputPath, const TargetPhrase &targetPhrase, const StackVec *stackVec, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection *estimatedScores=NULL) const |
void | EvaluateTranslationOptionListWithSourceContext (const InputType &input, const TranslationOptionList &translationOptionList) const |
void | EvaluateWhenApplied (const Hypothesis &hypo, ScoreComponentCollection *accumulator) const |
void | EvaluateWhenApplied (const ChartHypothesis &hypo, ScoreComponentCollection *accumulator) const |
void | SetParameter (const std::string &key, const std::string &value) |
void | Load (AllOptions::ptr const &opts) |
override to load model files | |
Protected Attributes | |
bool | m_all |
bool | m_sourceSyntax |
bool | m_targetSyntax |
Definition at line 8 of file CountNonTerms.h.
Moses::CountNonTerms::CountNonTerms | ( | const std::string & | line | ) |
Definition at line 9 of file CountNonTerms.cpp.
References Moses::FeatureFunction::ReadParameters().
void Moses::CountNonTerms::EvaluateInIsolation | ( | const Phrase & | source, | |
const TargetPhrase & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedScores | |||
) | const [virtual] |
Implements Moses::FeatureFunction.
Definition at line 18 of file CountNonTerms.cpp.
References Moses::Phrase::GetSize(), Moses::Phrase::GetWord(), Moses::Word::IsNonTerminal(), m_all, Moses::FeatureFunction::m_numScoreComponents, Moses::FeatureFunction::m_options, m_sourceSyntax, m_targetSyntax, and Moses::ScoreComponentCollection::PlusEquals().
void Moses::CountNonTerms::EvaluateTranslationOptionListWithSourceContext | ( | const InputType & | input, | |
const TranslationOptionList & | translationOptionList | |||
) | const [inline, virtual] |
void Moses::CountNonTerms::EvaluateWhenApplied | ( | const ChartHypothesis & | hypo, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
Same for chart-based features.
Implements Moses::StatelessFeatureFunction.
Definition at line 37 of file CountNonTerms.h.
void Moses::CountNonTerms::EvaluateWhenApplied | ( | const Hypothesis & | hypo, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
This should be implemented for features that apply to phrase-based models.
Implements Moses::StatelessFeatureFunction.
Definition at line 33 of file CountNonTerms.h.
void Moses::CountNonTerms::EvaluateWithSourceContext | ( | const InputType & | input, | |
const InputPath & | inputPath, | |||
const TargetPhrase & | targetPhrase, | |||
const StackVec * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedScores = NULL | |||
) | const [inline, virtual] |
bool Moses::CountNonTerms::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::CountNonTerms::Load | ( | AllOptions::ptr const & | opts | ) | [virtual] |
override to load model files
Reimplemented from Moses::FeatureFunction.
Definition at line 74 of file CountNonTerms.cpp.
References Moses::FeatureFunction::m_options.
void Moses::CountNonTerms::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 59 of file CountNonTerms.cpp.
References m_all, m_sourceSyntax, m_targetSyntax, and Moses::Scan< bool >().
bool Moses::CountNonTerms::m_all [protected] |
Definition at line 46 of file CountNonTerms.h.
Referenced by EvaluateInIsolation(), and SetParameter().
bool Moses::CountNonTerms::m_sourceSyntax [protected] |
Definition at line 46 of file CountNonTerms.h.
Referenced by EvaluateInIsolation(), and SetParameter().
bool Moses::CountNonTerms::m_targetSyntax [protected] |
Definition at line 46 of file CountNonTerms.h.
Referenced by EvaluateInIsolation(), and SetParameter().