diff options
author | Hieu Hoang <fishandfrolick@gmail.com> | 2013-05-28 04:25:27 +0400 |
---|---|---|
committer | Hieu Hoang <fishandfrolick@gmail.com> | 2013-05-28 04:25:27 +0400 |
commit | 805eef6c18eeee511a5f03fd4e4cd8ae96f47eb5 (patch) | |
tree | da1d55846d37ec9c0587ec5bbedad89aef0b6433 /moses/TreeInput.cpp | |
parent | ae82d02a05a199b8876972640dc831285005f09f (diff) |
delete sourcePhrase variable in TargetPhrase class
Diffstat (limited to 'moses/TreeInput.cpp')
-rw-r--r-- | moses/TreeInput.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/moses/TreeInput.cpp b/moses/TreeInput.cpp index ba4195ca8..acae0bdb1 100644 --- a/moses/TreeInput.cpp +++ b/moses/TreeInput.cpp @@ -186,6 +186,9 @@ bool TreeInput::ProcessAndStripXMLTags(string &line, std::vector<XMLParseOutput> CHECK(targetLHS->GetFactor(0) != NULL); targetPhrase.SetTargetLHS(targetLHS); + // not tested + Phrase sourcePhrase = this->GetSubString(WordsRange(startPos,endPos-1)); + // get probability float probValue = 1; if (altProbs.size() > i && altProbs[i].size() > 0) { @@ -194,7 +197,7 @@ bool TreeInput::ProcessAndStripXMLTags(string &line, std::vector<XMLParseOutput> // convert from prob to log-prob float scoreValue = FloorScore(TransformScore(probValue)); targetPhrase.SetXMLScore(scoreValue); - targetPhrase.Evaluate(); + targetPhrase.Evaluate(sourcePhrase); // set span and create XmlOption WordsRange range(startPos+1,endPos); |