diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-10-02 21:42:56 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-10-02 21:42:56 +0400 |
commit | 6e32bd3e19db20bb7e8c3034fc0056c937b435b6 (patch) | |
tree | bf5fd5a134b3f8da47b873cb0d385998ca3dab70 /moses/TranslationOptionCollectionLattice.h | |
parent | 1b12b0c4a24ffd78a08dd0053739b6497b8ce990 (diff) |
correct creation of input paths for lattices
Diffstat (limited to 'moses/TranslationOptionCollectionLattice.h')
-rw-r--r-- | moses/TranslationOptionCollectionLattice.h | 55 |
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: + +}; + +} + |