00001 #ifndef moses_SearchNormal_h 00002 #define moses_SearchNormal_h 00003 00004 #include <vector> 00005 #include "Search.h" 00006 #include "HypothesisStackNormal.h" 00007 #include "TranslationOptionCollection.h" 00008 #include "Timer.h" 00009 00010 namespace Moses 00011 { 00012 00013 class Manager; 00014 class TranslationOptionCollection; 00015 00020 class SearchNormal: public Search 00021 { 00022 protected: 00024 // no of elements = no of words in source + 1 00025 std::vector < HypothesisStack* > m_hypoStackColl; 00026 00028 HypothesisStackNormal* actual_hypoStack; 00029 00031 const TranslationOptionCollection &m_transOptColl; 00032 00033 // functions for creating hypotheses 00034 00035 virtual bool 00036 ProcessOneStack(HypothesisStack* hstack); 00037 00038 virtual void 00039 ProcessOneHypothesis(const Hypothesis &hypothesis); 00040 00041 virtual void 00042 ExpandAllHypotheses(const Hypothesis &hypothesis, size_t startPos, size_t endPos); 00043 00044 virtual void 00045 ExpandHypothesis(const Hypothesis &hypothesis, 00046 const TranslationOption &transOpt, 00047 float expectedScore, 00048 float estimatedScore, 00049 const Bitmap &bitmap); 00050 00051 public: 00052 SearchNormal(Manager& manager, const TranslationOptionCollection &transOptColl); 00053 ~SearchNormal(); 00054 00055 void Decode(); 00056 00057 void OutputHypoStackSize(); 00058 void OutputHypoStack(); 00059 00060 virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const; 00061 virtual const Hypothesis *GetBestHypothesis() const; 00062 }; 00063 00064 } 00065 00066 #endif