diff options
author | phikoehn <pkoehn@inf.ed.ac.uk> | 2013-08-15 16:36:56 +0400 |
---|---|---|
committer | phikoehn <pkoehn@inf.ed.ac.uk> | 2013-08-15 16:36:56 +0400 |
commit | c002a81c9609cb0299d906f5d16a3a7c9ab76a83 (patch) | |
tree | 2851c6f54521ba73a13dc8451081b778c46aa943 /moses/Sentence.cpp | |
parent | b368085609b1d638de571e963295117003defc91 (diff) |
fixed logic errors
Diffstat (limited to 'moses/Sentence.cpp')
-rw-r--r-- | moses/Sentence.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/moses/Sentence.cpp b/moses/Sentence.cpp index ca8838b48..51aa18341 100644 --- a/moses/Sentence.cpp +++ b/moses/Sentence.cpp @@ -250,6 +250,18 @@ bool Sentence::XmlOverlap(size_t startPos, size_t endPos) const return false; } +void Sentence::GetXmlTranslationOptions(std::vector <TranslationOption*> &list) const +{ + for (std::vector<XmlOption*>::const_iterator iterXMLOpts = m_xmlOptions.begin(); + iterXMLOpts != m_xmlOptions.end(); ++iterXMLOpts) { + const XmlOption &xmlOption = **iterXMLOpts; + const WordsRange &range = xmlOption.range; + const TargetPhrase &targetPhrase = xmlOption.targetPhrase; + TranslationOption *transOpt = new TranslationOption(range, targetPhrase); + list.push_back(transOpt); + } +} + void Sentence::GetXmlTranslationOptions(std::vector <TranslationOption*> &list, size_t startPos, size_t endPos) const { //iterate over XmlOptions list, find exact source/target matches |