#include <PhrasePenalty.h>
Public Member Functions | |
PhrasePenalty (const std::string &line) | |
bool | IsUseable (const FactorMask &mask) const |
virtual void | EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const |
void | EvaluateWhenApplied (const Hypothesis &hypo, ScoreComponentCollection *accumulator) const |
void | EvaluateWhenApplied (const ChartHypothesis &hypo, ScoreComponentCollection *accumulator) const |
void | EvaluateWhenApplied (const Syntax::SHyperedge &hyperedge, ScoreComponentCollection *accumulator) 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 | SetParameter (const std::string &key, const std::string &value) |
Protected Attributes | |
bool | m_perPhraseTable |
Definition at line 8 of file PhrasePenalty.h.
Moses::PhrasePenalty::PhrasePenalty | ( | const std::string & | line | ) |
Definition at line 11 of file PhrasePenalty.cpp.
References Moses::FeatureFunction::ReadParameters().
void Moses::PhrasePenalty::EvaluateInIsolation | ( | const Phrase & | source, | |
const TargetPhrase & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedScores | |||
) | const [virtual] |
Implements Moses::FeatureFunction.
Definition at line 18 of file PhrasePenalty.cpp.
References Moses::ScoreComponentCollection::Assign(), Moses::TargetPhrase::GetContainer(), Moses::PhraseDictionary::GetId(), Moses::FeatureFunction::m_numScoreComponents, m_perPhraseTable, and UTIL_THROW_IF2.
void Moses::PhrasePenalty::EvaluateTranslationOptionListWithSourceContext | ( | const InputType & | input, | |
const TranslationOptionList & | translationOptionList | |||
) | const [inline, virtual] |
void Moses::PhrasePenalty::EvaluateWhenApplied | ( | const Syntax::SHyperedge & | hyperedge, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
void Moses::PhrasePenalty::EvaluateWhenApplied | ( | const ChartHypothesis & | hypo, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
Same for chart-based features.
Implements Moses::StatelessFeatureFunction.
Definition at line 25 of file PhrasePenalty.h.
void Moses::PhrasePenalty::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 22 of file PhrasePenalty.h.
void Moses::PhrasePenalty::EvaluateWithSourceContext | ( | const InputType & | input, | |
const InputPath & | inputPath, | |||
const TargetPhrase & | targetPhrase, | |||
const StackVec * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedScores = NULL | |||
) | const [inline, virtual] |
bool Moses::PhrasePenalty::IsUseable | ( | const FactorMask & | mask | ) | const [inline, virtual] |
void Moses::PhrasePenalty::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Definition at line 40 of file PhrasePenalty.cpp.
References m_perPhraseTable, and Moses::Scan< bool >().
bool Moses::PhrasePenalty::m_perPhraseTable [protected] |
Definition at line 46 of file PhrasePenalty.h.
Referenced by EvaluateInIsolation(), and SetParameter().