00001 #pragma once 00002 00003 #include "ScoreComponentCollection.h" 00004 00005 namespace Moses 00006 { 00007 class TargetPhrase; 00008 class InputPath; 00009 class InputType; 00010 class StackVec; 00011 00012 class ChartTranslationOption 00013 { 00014 friend std::ostream& operator<<(std::ostream&, const ChartTranslationOption&); 00015 00016 protected: 00017 const TargetPhrase &m_targetPhrase; 00018 ScoreComponentCollection m_scoreBreakdown; 00019 const InputPath *m_inputPath; 00020 const std::vector<const Word*> *m_ruleSourceFromInputPath; // used by placeholders 00021 00022 public: 00023 ChartTranslationOption(const TargetPhrase &targetPhrase); 00024 00025 const TargetPhrase &GetPhrase() const { 00026 return m_targetPhrase; 00027 } 00028 00029 const InputPath *GetInputPath() const { 00030 return m_inputPath; 00031 } 00032 00033 void SetInputPath(const InputPath *inputPath) { 00034 m_inputPath = inputPath; 00035 } 00036 00037 const std::vector<const Word*> *GetSourceRuleFromInputPath() const { 00038 return m_ruleSourceFromInputPath; 00039 } 00040 void SetSourceRuleFromInputPath(const std::vector<const Word*> *obj) { 00041 m_ruleSourceFromInputPath = obj; 00042 } 00043 00044 const ScoreComponentCollection &GetScores() const { 00045 return m_scoreBreakdown; 00046 } 00047 00048 void EvaluateWithSourceContext(const InputType &input, 00049 const InputPath &inputPath, 00050 const StackVec &stackVec); 00051 }; 00052 00053 } 00054