00001 #ifndef moses_SearchCubePruning_h 00002 #define moses_SearchCubePruning_h 00003 00004 #include <vector> 00005 #include "Search.h" 00006 #include "HypothesisStackCubePruning.h" 00007 #include "SentenceStats.h" 00008 00009 namespace Moses 00010 { 00011 00012 class InputType; 00013 class TranslationOptionCollection; 00014 00018 class SearchCubePruning: public Search 00019 { 00020 protected: 00021 std::vector < HypothesisStack* > m_hypoStackColl; 00022 // no of elements = no of words in source + 1 00023 const TranslationOptionCollection &m_transOptColl; 00025 00026 void CreateForwardTodos(HypothesisStackCubePruning &stack); 00028 void CreateForwardTodos(const Bitmap &bitmap, const Range &range, BitmapContainer &bitmapContainer); 00029 bool CheckDistortion(const Bitmap &bitmap, const Range &range) const; 00030 00031 void PrintBitmapContainerGraph(); 00032 00033 public: 00034 SearchCubePruning(Manager& manager, const TranslationOptionCollection &transOptColl); 00035 ~SearchCubePruning(); 00036 00037 void Decode(); 00038 00039 void OutputHypoStackSize(); 00040 void OutputHypoStack(int stack); 00041 00042 virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const; 00043 virtual const Hypothesis *GetBestHypothesis() const; 00044 }; 00045 00046 00047 } 00048 #endif