00001 #include <vector>
00002 #include "SkeletonStatefulFF.h"
00003 #include "moses/ScoreComponentCollection.h"
00004 #include "moses/Hypothesis.h"
00005
00006 using namespace std;
00007
00008 namespace Moses
00009 {
00010
00012 SkeletonStatefulFF::SkeletonStatefulFF(const std::string &line)
00013 :StatefulFeatureFunction(3, line)
00014 {
00015 ReadParameters();
00016 }
00017
00018
00019
00020
00021
00022 void SkeletonStatefulFF::EvaluateInIsolation(const Phrase &source
00023 , const TargetPhrase &targetPhrase
00024 , ScoreComponentCollection &scoreBreakdown
00025 , ScoreComponentCollection &estimatedScores) const
00026 {}
00027
00028
00029
00030
00031 void SkeletonStatefulFF::EvaluateWithSourceContext(const InputType &input
00032 , const InputPath &inputPath
00033 , const TargetPhrase &targetPhrase
00034 , const StackVec *stackVec
00035 , ScoreComponentCollection &scoreBreakdown
00036 , ScoreComponentCollection *estimatedScores) const
00037 {}
00038
00039
00040
00041
00042 void SkeletonStatefulFF::EvaluateTranslationOptionListWithSourceContext
00043 (const InputType &input, const TranslationOptionList &translationOptionList) const
00044 {}
00045
00046 FFState* SkeletonStatefulFF::EvaluateWhenApplied(
00047 const Hypothesis& cur_hypo,
00048 const FFState* prev_state,
00049 ScoreComponentCollection* accumulator) const
00050 {
00051
00052 vector<float> newScores(m_numScoreComponents);
00053 newScores[0] = 1.5;
00054 newScores[1] = 0.3;
00055 newScores[2] = 0.4;
00056 accumulator->PlusEquals(this, newScores);
00057
00058
00059 accumulator->PlusEquals(this, "sparse-name", 2.4);
00060
00061
00062 return new SkeletonState(0);
00063 }
00064
00065 FFState* SkeletonStatefulFF::EvaluateWhenApplied(
00066 const ChartHypothesis& ,
00067 int ,
00068 ScoreComponentCollection* accumulator) const
00069 {
00070 return new SkeletonState(0);
00071 }
00072
00073 void SkeletonStatefulFF::SetParameter(const std::string& key, const std::string& value)
00074 {
00075 if (key == "arg") {
00076
00077 } else {
00078 StatefulFeatureFunction::SetParameter(key, value);
00079 }
00080 }
00081
00082 }
00083