diff --git a/contrib/other-builds/moses2/PhraseBased/Manager.cpp b/contrib/other-builds/moses2/PhraseBased/Manager.cpp index 1e7c919c4..e96fafe07 100644 --- a/contrib/other-builds/moses2/PhraseBased/Manager.cpp +++ b/contrib/other-builds/moses2/PhraseBased/Manager.cpp @@ -228,7 +228,9 @@ std::string Manager::OutputNBest() bool ok = false; if (system.options.nbest.only_distinct) { - string tgtPhrase = path->ToString(); + string tgtPhrase = path->OutputTargetPhrase(system); + //cerr << "tgtPhrase=" << tgtPhrase << endl; + if (distinctHypos.insert(tgtPhrase).second) { ok = true; } diff --git a/contrib/other-builds/moses2/PhraseBased/TrellisPath.cpp b/contrib/other-builds/moses2/PhraseBased/TrellisPath.cpp index 17df59061..b9b70a31e 100644 --- a/contrib/other-builds/moses2/PhraseBased/TrellisPath.cpp +++ b/contrib/other-builds/moses2/PhraseBased/TrellisPath.cpp @@ -76,7 +76,7 @@ SCORE TrellisPath::GetFutureScore() const void TrellisPath::Debug(std::ostream &out, const System &system) const { - out << ToString(); + out << OutputTargetPhrase(system); out << "||| "; GetScores().Debug(out, system); @@ -85,7 +85,7 @@ void TrellisPath::Debug(std::ostream &out, const System &system) const out << GetScores().GetTotalScore(); } -std::string TrellisPath::ToString() const +std::string TrellisPath::OutputTargetPhrase(const System &system) const { //cerr << "path=" << this << " " << nodes.size() << endl; std::stringstream out; diff --git a/contrib/other-builds/moses2/PhraseBased/TrellisPath.h b/contrib/other-builds/moses2/PhraseBased/TrellisPath.h index b3f22ed2d..bfd06af91 100644 --- a/contrib/other-builds/moses2/PhraseBased/TrellisPath.h +++ b/contrib/other-builds/moses2/PhraseBased/TrellisPath.h @@ -65,7 +65,7 @@ public: SCORE GetFutureScore() const; void Debug(std::ostream &out, const System &system) const; - std::string ToString() const; + std::string OutputTargetPhrase(const System &system) const; //! create a set of next best paths by wiggling 1 of the node at a time. void CreateDeviantPaths(TrellisPaths &paths, const ArcLists &arcLists,