#include <DecodeFeature.h>
Public Member Functions | |
DecodeFeature (const std::string &line, bool registerNow) | |
DecodeFeature (size_t numScoreComponents, const std::string &line) | |
DecodeFeature (size_t numScoreComponents, const std::vector< FactorType > &input, const std::vector< FactorType > &output, const std::string &line) | |
const FactorMask & | GetOutputFactorMask () const |
returns output factor types as specified by the ini file | |
const FactorMask & | GetInputFactorMask () const |
returns input factor types as specified by the ini file | |
const std::vector< FactorType > & | GetInput () const |
const std::vector< FactorType > & | GetOutput () const |
bool | IsUseable (const FactorMask &mask) const |
void | SetParameter (const std::string &key, const std::string &value) |
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 | EvaluateInIsolation (const Phrase &source, const TargetPhrase &targetPhrase, ScoreComponentCollection &scoreBreakdown, ScoreComponentCollection &estimatedScores) const |
void | SetContainer (const DecodeStep *container) |
const DecodeGraph & | GetDecodeGraph () const |
Protected Attributes | |
std::vector< FactorType > | m_input |
std::vector< FactorType > | m_output |
FactorMask | m_inputFactors |
FactorMask | m_outputFactors |
const DecodeStep * | m_container |
Definition at line 39 of file DecodeFeature.h.
Moses::DecodeFeature::DecodeFeature | ( | const std::string & | line, | |
bool | registerNow | |||
) |
Moses::DecodeFeature::DecodeFeature | ( | size_t | numScoreComponents, | |
const std::string & | line | |||
) |
Moses::DecodeFeature::DecodeFeature | ( | size_t | numScoreComponents, | |
const std::vector< FactorType > & | input, | |||
const std::vector< FactorType > & | output, | |||
const std::string & | line | |||
) |
Definition at line 49 of file DecodeFeature.cpp.
References m_inputFactors, m_outputFactors, and VERBOSE.
void Moses::DecodeFeature::EvaluateInIsolation | ( | const Phrase & | source, | |
const TargetPhrase & | targetPhrase, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection & | estimatedScores | |||
) | const [inline, virtual] |
void Moses::DecodeFeature::EvaluateTranslationOptionListWithSourceContext | ( | const InputType & | input, | |
const TranslationOptionList & | translationOptionList | |||
) | const [inline, virtual] |
void Moses::DecodeFeature::EvaluateWhenApplied | ( | const Syntax::SHyperedge & | hyperedge, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
void Moses::DecodeFeature::EvaluateWhenApplied | ( | const ChartHypothesis & | hypo, | |
ScoreComponentCollection * | accumulator | |||
) | const [inline, virtual] |
Same for chart-based features.
Implements Moses::StatelessFeatureFunction.
Definition at line 68 of file DecodeFeature.h.
void Moses::DecodeFeature::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 65 of file DecodeFeature.h.
void Moses::DecodeFeature::EvaluateWithSourceContext | ( | const InputType & | input, | |
const InputPath & | inputPath, | |||
const TargetPhrase & | targetPhrase, | |||
const StackVec * | stackVec, | |||
ScoreComponentCollection & | scoreBreakdown, | |||
ScoreComponentCollection * | estimatedScores = NULL | |||
) | const [inline, virtual] |
const DecodeGraph & Moses::DecodeFeature::GetDecodeGraph | ( | ) | const |
Definition at line 108 of file DecodeFeature.cpp.
References Moses::DecodeStep::GetContainer(), and m_container.
Referenced by Moses::PhraseDictionary::SatisfyBackoff().
const std::vector< FactorType > & Moses::DecodeFeature::GetInput | ( | ) | const |
Definition at line 87 of file DecodeFeature.cpp.
References m_input.
Referenced by Moses::GenerationDictionary::FindWord(), and Moses::GenerationDictionary::Load().
const FactorMask & Moses::DecodeFeature::GetInputFactorMask | ( | ) | const |
returns input factor types as specified by the ini file
Definition at line 82 of file DecodeFeature.cpp.
References m_inputFactors.
const std::vector< FactorType > & Moses::DecodeFeature::GetOutput | ( | ) | const |
Definition at line 92 of file DecodeFeature.cpp.
References m_output.
Referenced by Moses::GenerationDictionary::Load().
const FactorMask & Moses::DecodeFeature::GetOutputFactorMask | ( | ) | const |
returns output factor types as specified by the ini file
Definition at line 76 of file DecodeFeature.cpp.
References m_outputFactors.
Referenced by Moses::DecodeStep::DecodeStep().
bool Moses::DecodeFeature::IsUseable | ( | const FactorMask & | mask | ) | const [virtual] |
Implements Moses::FeatureFunction.
Definition at line 97 of file DecodeFeature.cpp.
References m_output.
void Moses::DecodeFeature::SetContainer | ( | const DecodeStep * | container | ) | [inline] |
Definition at line 91 of file DecodeFeature.h.
References m_container.
Referenced by Moses::DecodeStep::DecodeStep().
void Moses::DecodeFeature::SetParameter | ( | const std::string & | key, | |
const std::string & | value | |||
) | [virtual] |
Reimplemented from Moses::FeatureFunction.
Reimplemented in Moses::GenerationDictionary, Moses::PhraseDictionary, Moses::PhraseDictionaryDynamicCacheBased, Moses::PhraseDictionaryGroup, Moses::PhraseDictionaryMemoryPerSentenceOnDemand, Moses::PhraseDictionaryMultiModel, Moses::PhraseDictionaryMultiModelCounts, Moses::PhraseDictionaryTransliteration, Moses::ProbingPT, Moses::PhraseDictionaryFuzzyMatch, and Moses::PhraseDictionaryOnDisk.
Definition at line 62 of file DecodeFeature.cpp.
References m_input, m_inputFactors, m_output, and m_outputFactors.
const DecodeStep* Moses::DecodeFeature::m_container [protected] |
Definition at line 102 of file DecodeFeature.h.
Referenced by GetDecodeGraph(), Moses::PhraseDictionary::SatisfyBackoff(), and SetContainer().
std::vector<FactorType> Moses::DecodeFeature::m_input [protected] |
Definition at line 98 of file DecodeFeature.h.
Referenced by Moses::PhraseDictionaryOnDisk::CreateRuleLookupManager(), GetInput(), Moses::ProbingPT::GetSourceProbingId(), Moses::PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(), Moses::PhraseDictionaryOnDisk::GetTargetPhraseCollectionNonCache(), Moses::PhraseDictionaryOnDisk::InitializeForInput(), Moses::PhraseDictionaryFuzzyMatch::InitializeForInput(), Moses::PhraseDictionaryALSuffixArray::InitializeForInput(), Moses::PhraseDictionaryTreeAdaptor::InitializeForInput(), Moses::PhraseDictionaryMemoryPerSentenceOnDemand::InitializeForInput(), Moses::PhraseDictionaryMemoryPerSentence::InitializeForInput(), Moses::RuleTableTrie::Load(), Moses::PhraseDictionaryCompact::Load(), Moses::Syntax::RuleTableFF::Load(), Moses::ProbingPT::ProbingPT(), and SetParameter().
FactorMask Moses::DecodeFeature::m_inputFactors [protected] |
Definition at line 100 of file DecodeFeature.h.
Referenced by DecodeFeature(), GetInputFactorMask(), Moses::PhraseDictionaryOnDisk::GetTargetPhraseCollectionBatch(), Moses::PhraseDictionaryMemory::GetTargetPhraseCollectionBatch(), Moses::PhraseDictionaryMemory::GetTargetPhraseCollectionLEGACY(), and SetParameter().
std::vector<FactorType> Moses::DecodeFeature::m_output [protected] |
Definition at line 99 of file DecodeFeature.h.
Referenced by Moses::PhraseDictionaryOnDisk::CreateRuleLookupManager(), Moses::ProbingPT::CreateTargetPhrase(), Moses::ExamplePT::CreateTargetPhrase(), GetOutput(), Moses::PhraseDictionaryOnDisk::GetTargetPhraseCollectionNonCache(), Moses::PhraseDictionaryOnDisk::InitializeForInput(), Moses::PhraseDictionaryFuzzyMatch::InitializeForInput(), Moses::PhraseDictionaryALSuffixArray::InitializeForInput(), Moses::PhraseDictionaryTreeAdaptor::InitializeForInput(), Moses::PhraseDictionaryMemoryPerSentenceOnDemand::InitializeForInput(), Moses::PhraseDictionaryMemoryPerSentence::InitializeForInput(), IsUseable(), Moses::RuleTableTrie::Load(), Moses::PhraseDictionaryCompact::Load(), Moses::Syntax::RuleTableFF::Load(), Moses::ProbingPT::ProbingPT(), and SetParameter().
FactorMask Moses::DecodeFeature::m_outputFactors [protected] |
Definition at line 101 of file DecodeFeature.h.
Referenced by DecodeFeature(), GetOutputFactorMask(), Moses::PhraseDictionary::SetFeaturesToApply(), and SetParameter().