diff options
author | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-08 20:10:56 +0400 |
---|---|---|
committer | Hieu Hoang <hieu@hoang.co.uk> | 2013-08-08 20:10:56 +0400 |
commit | b044f31012fcd5c7b840453b91b36d0718f0cb5d (patch) | |
tree | 48d394de3c70700e7aaddb6286c3a0e1fba9266b /moses/TranslationOptionCollectionText.cpp | |
parent | 4b28daeed2ede54196d570e342546d0884adb28c (diff) |
consistently set source phrase in translation options as soon as the trans opt is created
Diffstat (limited to 'moses/TranslationOptionCollectionText.cpp')
-rw-r--r-- | moses/TranslationOptionCollectionText.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/moses/TranslationOptionCollectionText.cpp b/moses/TranslationOptionCollectionText.cpp index e90ff5fe5..4f22182a5 100644 --- a/moses/TranslationOptionCollectionText.cpp +++ b/moses/TranslationOptionCollectionText.cpp @@ -82,17 +82,19 @@ bool TranslationOptionCollectionText::HasXmlOptionsOverlappingRange(size_t start /** * Create xml-based translation options for the specific input span */ -void TranslationOptionCollectionText::CreateXmlOptionsForRange(size_t startPosition, size_t endPosition) +void TranslationOptionCollectionText::CreateXmlOptionsForRange(size_t startPos, size_t endPos) { Sentence const& source=dynamic_cast<Sentence const&>(m_source); + InputPath &inputPath = GetInputPath(startPos,endPos); vector <TranslationOption*> xmlOptions; - - source.GetXmlTranslationOptions(xmlOptions,startPosition,endPosition); + source.GetXmlTranslationOptions(xmlOptions,startPos,endPos); //get vector of TranslationOptions from Sentence for(size_t i=0; i<xmlOptions.size(); i++) { - Add(xmlOptions[i]); + TranslationOption *transOpt = xmlOptions[i]; + transOpt->SetSourcePhrase(inputPath.GetPhrase()); + Add(transOpt); } }; |