00001 #pragma once
00002
00003 #include "StatelessFeatureFunction.h"
00004
00005 namespace Moses
00006 {
00007
00008 class PhrasePenalty : public StatelessFeatureFunction
00009 {
00010 public:
00011 PhrasePenalty(const std::string &line);
00012
00013 bool IsUseable(const FactorMask &mask) const {
00014 return true;
00015 }
00016
00017 virtual void EvaluateInIsolation(const Phrase &source
00018 , const TargetPhrase &targetPhrase
00019 , ScoreComponentCollection &scoreBreakdown
00020 , ScoreComponentCollection &estimatedScores) const;
00021
00022 void EvaluateWhenApplied(const Hypothesis& hypo,
00023 ScoreComponentCollection* accumulator) const {
00024 }
00025 void EvaluateWhenApplied(const ChartHypothesis &hypo,
00026 ScoreComponentCollection* accumulator) const {
00027 }
00028 void EvaluateWhenApplied(const Syntax::SHyperedge &hyperedge,
00029 ScoreComponentCollection* accumulator) const {
00030 }
00031
00032 void EvaluateWithSourceContext(const InputType &input
00033 , const InputPath &inputPath
00034 , const TargetPhrase &targetPhrase
00035 , const StackVec *stackVec
00036 , ScoreComponentCollection &scoreBreakdown
00037 , ScoreComponentCollection *estimatedScores = NULL) const {
00038 }
00039
00040 void EvaluateTranslationOptionListWithSourceContext(const InputType &input
00041 , const TranslationOptionList &translationOptionList) const {
00042 }
00043 void SetParameter(const std::string& key, const std::string& value);
00044
00045 protected:
00046 bool m_perPhraseTable;
00047 };
00048
00049 }
00050