#include <RuleScope.h>
Public Member Functions | |
RuleScope (const std::string &line) | |
virtual bool | IsUseable (const FactorMask &mask) const |
virtual void | EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const |
virtual 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 |
virtual void | EvaluateWhenApplied (const Hypothesis &hypo, ScoreComponentCollection *accumulator) const |
virtual void | EvaluateWhenApplied (const ChartHypothesis &hypo, ScoreComponentCollection *accumulator) const |
void | SetParameter (const std::string &key, const std::string &value) |
Protected Member Functions | |
bool | IsGlueRule (const Phrase &source) const |
Protected Attributes | |
bool | m_sourceSyntax |
bool | m_perScope |
bool | m_futureCostOnly |
Definition at line 9 of file RuleScope.h.
Moses::RuleScope::RuleScope | ( | const std::string & | line | ) |
Definition at line 9 of file RuleScope.cpp.
void Moses::RuleScope::EvaluateInIsolation | ( | const Phrase & | source, | |
const TargetPhrase & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedScores | |||
) | const [virtual] |
Implements Moses::FeatureFunction.
Definition at line 23 of file RuleScope.cpp.
References Moses::Phrase::Back(), Moses::Phrase::Front(), Moses::Phrase::GetSize(), IsGlueRule(), Moses::Word::IsNonTerminal(), m_futureCostOnly, Moses::FeatureFunction::m_numScoreComponents, m_perScope, Moses::ScoreComponentCollection::PlusEquals(), and UTIL_THROW_IF2.
void Moses::RuleScope::EvaluateTranslationOptionListWithSourceContext | ( | const InputType & | input, | |
const TranslationOptionList & | translationOptionList | |||
) | const [inline, virtual] |
virtual void Moses::RuleScope::EvaluateWhenApplied | ( | const ChartHypothesis & | hypo, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
Same for chart-based features.
Implements Moses::StatelessFeatureFunction.
Definition at line 40 of file RuleScope.h.
virtual void Moses::RuleScope::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 36 of file RuleScope.h.
virtual void Moses::RuleScope::EvaluateWithSourceContext | ( | const InputType & | input, | |
const InputPath & | inputPath, | |||
const TargetPhrase & | targetPhrase, | |||
const StackVec * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedScores = NULL | |||
) | const [inline, virtual] |
bool Moses::RuleScope::IsGlueRule | ( | const Phrase & | source | ) | const [protected] |
Definition at line 94 of file RuleScope.cpp.
Referenced by EvaluateInIsolation().
virtual bool Moses::RuleScope::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::RuleScope::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 81 of file RuleScope.cpp.
References m_futureCostOnly, m_perScope, m_sourceSyntax, and Moses::Scan< bool >().
bool Moses::RuleScope::m_futureCostOnly [protected] |
bool Moses::RuleScope::m_perScope [protected] |
bool Moses::RuleScope::m_sourceSyntax [protected] |