| |
| |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #ifndef moses_DecodeFeature |
| #define moses_DecodeFeature |
|
|
| #include <vector> |
|
|
| #include "moses/FF/StatelessFeatureFunction.h" |
| #include "moses/FactorTypeSet.h" |
| #include "moses/TypeDef.h" |
|
|
| namespace Moses |
| { |
| class DecodeStep; |
| class DecodeGraph; |
|
|
| |
| |
| |
| class DecodeFeature : public StatelessFeatureFunction |
| { |
|
|
| public: |
| 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; |
|
|
| |
| const FactorMask& GetInputFactorMask() const; |
|
|
| 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) { |
| m_container = container; |
| } |
|
|
| const DecodeGraph &GetDecodeGraph() const; |
|
|
| protected: |
| std::vector<FactorType> m_input; |
| std::vector<FactorType> m_output; |
| FactorMask m_inputFactors; |
| FactorMask m_outputFactors; |
| const DecodeStep *m_container; |
| }; |
|
|
| } |
|
|
| #endif |
|
|