Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2012-11-12 23:56:18 +0400
committerHieu Hoang <hieuhoang@gmail.com>2012-11-12 23:56:18 +0400
commit5e3ef23cef6101d2c098eb3445f562e8f595655b (patch)
treeb8c332b6fa82bae84ea4910967a10ba1b08a7107 /moses/SearchCubePruning.h
parent8c785cff2b1be3cccd76ea9026f71b649762dfc3 (diff)
move moses/src/* to moses/
Diffstat (limited to 'moses/SearchCubePruning.h')
-rw-r--r--moses/SearchCubePruning.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/moses/SearchCubePruning.h b/moses/SearchCubePruning.h
new file mode 100644
index 000000000..56565a81f
--- /dev/null
+++ b/moses/SearchCubePruning.h
@@ -0,0 +1,50 @@
+#ifndef moses_SearchCubePruning_h
+#define moses_SearchCubePruning_h
+
+#include <vector>
+#include "Search.h"
+#include "HypothesisStackCubePruning.h"
+
+namespace Moses
+{
+
+class InputType;
+class TranslationOptionCollection;
+
+/** Functions and variables you need to decoder an input using the phrase-based decoder with cube-pruning
+ * Instantiated by the Manager class
+ */
+class SearchCubePruning: public Search
+{
+protected:
+ const InputType &m_source;
+ std::vector < HypothesisStack* > m_hypoStackColl; /**< stacks to store hypotheses (partial translations) */
+ // no of elements = no of words in source + 1
+ TargetPhrase m_initialTargetPhrase; /**< used to seed 1st hypo */
+ clock_t m_start; /**< used to track time spend on translation */
+ const TranslationOptionCollection &m_transOptColl; /**< pre-computed list of translation options for the phrases in this sentence */
+
+ //! go thru all bitmaps in 1 stack & create backpointers to bitmaps in the stack
+ void CreateForwardTodos(HypothesisStackCubePruning &stack);
+ //! create a back pointer to this bitmap, with edge that has this words range translation
+ void CreateForwardTodos(const WordsBitmap &bitmap, const WordsRange &range, BitmapContainer &bitmapContainer);
+ bool CheckDistortion(const WordsBitmap &bitmap, const WordsRange &range) const;
+
+ void PrintBitmapContainerGraph();
+
+public:
+ SearchCubePruning(Manager& manager, const InputType &source, const TranslationOptionCollection &transOptColl);
+ ~SearchCubePruning();
+
+ void ProcessSentence();
+
+ void OutputHypoStackSize();
+ void OutputHypoStack(int stack);
+
+ virtual const std::vector < HypothesisStack* >& GetHypothesisStacks() const;
+ virtual const Hypothesis *GetBestHypothesis() const;
+};
+
+
+}
+#endif