diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-13 11:27:48 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2013-09-13 11:27:48 +0400 |
commit | 3b03d803d98194772e4b0ac6df7041c8c98c0119 (patch) | |
tree | eb2511059b3991addfe1482c44000465a6091a67 | |
parent | 9950279bc72c2acdf227ca30ef4bba2d900c241b (diff) |
make sure Evaluate(inputPath) is called for chart translation options
-rw-r--r-- | moses/ChartManager.cpp | 3 | ||||
-rw-r--r-- | moses/ChartParser.cpp | 5 | ||||
-rw-r--r-- | moses/ChartParser.h | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/moses/ChartManager.cpp b/moses/ChartManager.cpp index 8a25be1f2..aa47dc161 100644 --- a/moses/ChartManager.cpp +++ b/moses/ChartManager.cpp @@ -93,6 +93,9 @@ void ChartManager::ProcessSentence() m_parser.Create(range, m_translationOptionList); m_translationOptionList.ApplyThreshold(); + const InputPath &inputPath = m_parser.GetInputPath(range); + m_translationOptionList.Evaluate(m_source, inputPath); + // decode ChartCell &cell = m_hypoStackColl.Get(range); diff --git a/moses/ChartParser.cpp b/moses/ChartParser.cpp index 7170c4d92..bc5b86a3e 100644 --- a/moses/ChartParser.cpp +++ b/moses/ChartParser.cpp @@ -219,6 +219,11 @@ void ChartParser::CreateInputPaths(const InputType &input) } } +const InputPath &ChartParser::GetInputPath(WordsRange &range) const +{ + return GetInputPath(range.GetStartPos(), range.GetEndPos()); +} + const InputPath &ChartParser::GetInputPath(size_t startPos, size_t endPos) const { size_t offset = endPos - startPos; diff --git a/moses/ChartParser.h b/moses/ChartParser.h index d80296771..55a2c85fd 100644 --- a/moses/ChartParser.h +++ b/moses/ChartParser.h @@ -66,6 +66,7 @@ public: long GetTranslationId() const; size_t GetSize() const; const InputPath &GetInputPath(size_t startPos, size_t endPos) const; + const InputPath &GetInputPath(WordsRange &range) const; private: ChartParserUnknown m_unknown; |