diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-04 19:46:14 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-12-04 19:46:14 +0300 |
commit | 3a2f58eb2c97d03b486508db1438fb8b877f85d7 (patch) | |
tree | 0296ef272d458466f724ff8cff623804dc8d266e | |
parent | c5fdb170fbe82213dc123b7b892ded7d32695d2c (diff) |
move OutputDetailedTranslationReport() to Manager
-rw-r--r-- | moses/Manager.cpp | 7 | ||||
-rw-r--r-- | moses/TranslationTask.cpp | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/moses/Manager.cpp b/moses/Manager.cpp index f201b2bde..d5f17c51c 100644 --- a/moses/Manager.cpp +++ b/moses/Manager.cpp @@ -43,6 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "moses/FF/DistortionScoreProducer.h" #include "moses/LM/Base.h" #include "moses/TranslationModel/PhraseDictionary.h" +#include "moses/TranslationAnalysis.h" #ifdef HAVE_PROTOBUF #include "hypergraph.pb.h" @@ -1720,6 +1721,12 @@ void Manager::OutputAlignment(ostream &out, const vector<const Hypothesis *> &ed void Manager::OutputDetailedTranslationReport(OutputCollector *collector) const { + if (collector) { + ostringstream out; + FixPrecision(out,PRECISION); + TranslationAnalysis::PrintTranslationAnalysis(out, GetBestHypothesis()); + collector->Write(m_source.GetTranslationId(),out.str()); + } } diff --git a/moses/TranslationTask.cpp b/moses/TranslationTask.cpp index 2f4b57e8f..c08aab706 100644 --- a/moses/TranslationTask.cpp +++ b/moses/TranslationTask.cpp @@ -282,12 +282,7 @@ void TranslationTask::RunPb() manager.OutputLatticeSamples(m_ioWrapper.GetLatticeSamplesCollector()); // detailed translation reporting - if (m_ioWrapper.GetDetailedTranslationCollector()) { - ostringstream out; - FixPrecision(out,PRECISION); - TranslationAnalysis::PrintTranslationAnalysis(out, manager.GetBestHypothesis()); - m_ioWrapper.GetDetailedTranslationCollector()->Write(m_source->GetTranslationId(),out.str()); - } + manager.OutputDetailedTranslationReport(m_ioWrapper.GetDetailedTranslationCollector()); //list of unknown words manager.OutputUnknowns(m_ioWrapper.GetUnknownsCollector()); |