00001 #include "InputWeightFF.h" 00002 00003 #include <vector> 00004 00005 #include "moses/ScoreComponentCollection.h" 00006 #include "moses/Syntax/SHyperedge.h" 00007 #include "moses/TargetPhrase.h" 00008 00009 namespace Moses 00010 { 00011 namespace Syntax 00012 { 00013 00014 InputWeightFF::InputWeightFF(const std::string &line) 00015 : StatelessFeatureFunction(1, line) 00016 { 00017 ReadParameters(); 00018 } 00019 00020 void InputWeightFF::EvaluateWhenApplied(const Hypothesis& hypo, 00021 ScoreComponentCollection* accumulator) const 00022 { 00023 // TODO Throw exception. 00024 assert(false); 00025 } 00026 00027 void InputWeightFF::EvaluateWhenApplied(const ChartHypothesis &hypo, 00028 ScoreComponentCollection* accumulator) const 00029 { 00030 // TODO Throw exception. 00031 assert(false); 00032 } 00033 00034 void InputWeightFF::EvaluateWhenApplied( 00035 const Syntax::SHyperedge &hyperedge, 00036 ScoreComponentCollection* accumulator) const 00037 { 00038 accumulator->PlusEquals(this, hyperedge.label.inputWeight); 00039 } 00040 00041 void InputWeightFF::SetParameter(const std::string& key, 00042 const std::string& value) 00043 { 00044 StatelessFeatureFunction::SetParameter(key, value); 00045 } 00046 00047 } // Syntax 00048 } // Moses