00001 #pragma once 00002 00003 namespace Moses 00004 { 00005 class ChartHypothesis; 00006 class InputType; 00007 class TargetPhrase; 00008 00012 class ChartBasedFeatureContext 00013 { 00014 //The context either has a hypothesis (during search) or a 00015 //TargetPhrase and source sentence (during pre-calculation) 00016 //TODO: should the context also include some info on where the TargetPhrase 00017 //is anchored (assuming it's lexicalised), which is available at pre-calc? 00018 const ChartHypothesis* m_hypothesis; 00019 const TargetPhrase& m_targetPhrase; 00020 const InputType& m_source; 00021 00022 public: 00023 ChartBasedFeatureContext(const ChartHypothesis* hypothesis); 00024 ChartBasedFeatureContext(const TargetPhrase& targetPhrase, 00025 const InputType& source); 00026 00027 const InputType& GetSource() const { 00028 return m_source; 00029 } 00030 00031 const TargetPhrase& GetTargetPhrase() const { 00032 return m_targetPhrase; 00033 } 00034 00035 }; 00036 00037 } // namespace 00038 00039