00001 #include <vector> 00002 #include "SyntaxRHS.h" 00003 #include "moses/ScoreComponentCollection.h" 00004 #include "moses/TargetPhrase.h" 00005 #include "moses/StackVec.h" 00006 00007 using namespace std; 00008 00009 namespace Moses 00010 { 00011 SyntaxRHS::SyntaxRHS(const std::string &line) 00012 :StatelessFeatureFunction(1, line) 00013 { 00014 ReadParameters(); 00015 } 00016 00017 void SyntaxRHS::EvaluateInIsolation(const Phrase &source 00018 , const TargetPhrase &targetPhrase 00019 , ScoreComponentCollection &scoreBreakdown 00020 , ScoreComponentCollection &estimatedScores) const 00021 { 00022 } 00023 00024 void SyntaxRHS::EvaluateWithSourceContext(const InputType &input 00025 , const InputPath &inputPath 00026 , const TargetPhrase &targetPhrase 00027 , const StackVec *stackVec 00028 , ScoreComponentCollection &scoreBreakdown 00029 , ScoreComponentCollection *estimatedScores) const 00030 { 00031 assert(stackVec); 00032 00033 if (targetPhrase.GetNumNonTerminals()) { 00034 vector<float> newScores(m_numScoreComponents); 00035 newScores[0] = - std::numeric_limits<float>::infinity(); 00036 scoreBreakdown.PlusEquals(this, newScores); 00037 } 00038 00039 } 00040 00041 } 00042