diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-28 19:39:38 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-28 19:39:38 +0300 |
commit | f865e7e43c8f593cce75ee7157d77c4b94e95814 (patch) | |
tree | 4c420e412bc357e3400fbd7ff6a204830990e58c /moses/IOWrapper.cpp | |
parent | af0d0f02e199e618b06dcbfa083f06e831f44146 (diff) |
move OutputInput() to Hypothesis class
Diffstat (limited to 'moses/IOWrapper.cpp')
-rw-r--r-- | moses/IOWrapper.cpp | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/moses/IOWrapper.cpp b/moses/IOWrapper.cpp index f2926a86c..e7f1ba565 100644 --- a/moses/IOWrapper.cpp +++ b/moses/IOWrapper.cpp @@ -593,24 +593,6 @@ void IOWrapper::OutputBestHypo(const std::vector<Word>& mbrBestHypo, long /*tra out << endl; } - -void IOWrapper::OutputInput(std::vector<const Phrase*>& map, const Hypothesis* hypo) -{ - if (hypo->GetPrevHypo()) { - OutputInput(map, hypo->GetPrevHypo()); - map[hypo->GetCurrSourceWordsRange().GetStartPos()] = &hypo->GetTranslationOption().GetInputPath().GetPhrase(); - } -} - -void IOWrapper::OutputInput(std::ostream& os, const Hypothesis* hypo) -{ - size_t len = hypo->GetInput().GetSize(); - std::vector<const Phrase*> inp_phrases(len, 0); - OutputInput(inp_phrases, hypo); - for (size_t i=0; i<len; ++i) - if (inp_phrases[i]) os << *inp_phrases[i]; -} - void IOWrapper::OutputBestHypo(const Hypothesis *hypo, long /*translationId*/, char reportSegmentation, bool reportAllFactors) { if (hypo != NULL) { @@ -624,7 +606,7 @@ void IOWrapper::OutputBestHypo(const Hypothesis *hypo, long /*translationId*/, c } if (StaticData::Instance().IsPathRecoveryEnabled()) { - OutputInput(cout, hypo); + hypo->OutputInput(cout); cout << "||| "; } OutputBestSurface(cout, hypo, *m_outputFactorOrder, reportSegmentation, reportAllFactors); |