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 <hieu@hoang.co.uk>2013-10-02 21:42:56 +0400
committerHieu Hoang <hieu@hoang.co.uk>2013-10-02 21:42:56 +0400
commit6e32bd3e19db20bb7e8c3034fc0056c937b435b6 (patch)
treebf5fd5a134b3f8da47b873cb0d385998ca3dab70 /moses/TranslationOptionCollectionLattice.h
parent1b12b0c4a24ffd78a08dd0053739b6497b8ce990 (diff)
correct creation of input paths for lattices
Diffstat (limited to 'moses/TranslationOptionCollectionLattice.h')
-rw-r--r--moses/TranslationOptionCollectionLattice.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/moses/TranslationOptionCollectionLattice.h b/moses/TranslationOptionCollectionLattice.h
new file mode 100644
index 000000000..d54cf9aa9
--- /dev/null
+++ b/moses/TranslationOptionCollectionLattice.h
@@ -0,0 +1,55 @@
+// $Id$
+#pragma once
+
+#include "TranslationOptionCollection.h"
+#include "InputPath.h"
+
+namespace Moses
+{
+
+class ConfusionNet;
+
+/** Holds all translation options, for all spans, of a particular confusion network input
+ * Inherited from TranslationOptionCollection.
+ */
+class TranslationOptionCollectionLattice : public TranslationOptionCollection
+{
+public:
+ typedef std::vector< std::vector<InputPathList> > InputPathMatrix;
+
+protected:
+ bool m_useLegacy;
+
+ InputPathMatrix m_inputPathMatrix; /*< contains translation options */
+
+ InputPathList &GetInputPathList(size_t startPos, size_t endPos);
+ void CreateTranslationOptionsForRangeNew(const DecodeGraph &decodeStepList
+ , size_t startPosition
+ , size_t endPosition
+ , bool adhereTableLimit
+ , size_t graphInd);
+
+ void CheckLEGACY();
+ void CreateTranslationOptionsForRangeLEGACY(const DecodeGraph &decodeStepList
+ , size_t startPosition
+ , size_t endPosition
+ , bool adhereTableLimit
+ , size_t graphInd);
+
+public:
+ TranslationOptionCollectionLattice(const ConfusionNet &source, size_t maxNoTransOptPerCoverage, float translationOptionThreshold);
+
+ void ProcessUnknownWord(size_t sourcePos);
+ void CreateTranslationOptions();
+ void CreateTranslationOptionsForRange(const DecodeGraph &decodeStepList
+ , size_t startPosition
+ , size_t endPosition
+ , bool adhereTableLimit
+ , size_t graphInd);
+
+protected:
+
+};
+
+}
+