00001 #pragma once 00002 00003 namespace Moses 00004 { 00005 class Hypothesis; 00006 class TranslationOption; 00007 class InputType; 00008 class TargetPhrase; 00009 class WordsBitmap; 00010 00018 class PhraseBasedFeatureContext 00019 { 00020 // The context either has a hypothesis (during search), or a TranslationOption and 00021 // source sentence (during pre-calculation). 00022 const Hypothesis* m_hypothesis; 00023 const TranslationOption& m_translationOption; 00024 const InputType& m_source; 00025 00026 public: 00027 PhraseBasedFeatureContext(const Hypothesis* hypothesis); 00028 PhraseBasedFeatureContext(const TranslationOption& translationOption, 00029 const InputType& source); 00030 00031 const TranslationOption& GetTranslationOption() const { 00032 return m_translationOption; 00033 } 00034 const InputType& GetSource() const { 00035 return m_source; 00036 } 00037 const TargetPhrase& GetTargetPhrase() const; //convenience method 00038 const WordsBitmap& GetWordsBitmap() const; 00039 00040 }; 00041 00042 } // namespace 00043 00044