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