make sure Evaluate(inputPath) is called for chart translation options

This commit is contained in:
Hieu Hoang 2013-09-13 09:27:48 +02:00
parent 9950279bc7
commit 3b03d803d9
3 changed files with 9 additions and 0 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;