diff --git a/src/common/output_collector.cpp b/src/common/output_collector.cpp index c08423d1..037e3269 100644 --- a/src/common/output_collector.cpp +++ b/src/common/output_collector.cpp @@ -16,9 +16,9 @@ void OutputCollector::Write(long sourceId, const std::string& output) { boost::mutex::scoped_lock lock(mutex_); if (sourceId == nextId_) { - *outStrm_ << output << std::flush; LOG(progress, "Best translation {} : {}", sourceId, output); - + *outStrm_ << output << std::endl; + ++nextId_; Outputs::const_iterator iter, iterNext; @@ -29,8 +29,8 @@ void OutputCollector::Write(long sourceId, const std::string& output) if (currId == nextId_) { // 1st element in the map is the next const string &currOutput = iter->second; - *outStrm_ << currOutput << std::flush; LOG(progress, "Best translation {} : {}", currId, currOutput); + *outStrm_ << currOutput << std::endl; ++nextId_; diff --git a/src/common/printer.h b/src/common/printer.h index 4b153b99..8eb7d1a9 100755 --- a/src/common/printer.h +++ b/src/common/printer.h @@ -23,7 +23,6 @@ void Printer(const God &god, const History& history, OStream& out) { if (god.Get("return-alignment")) { best += GetAlignmentString(GetAlignment(bestTranslation.second)); } - LOG(progress, "Best translation: {}", best); if (god.Get("n-best")) { std::vector scorerNames = god.GetScorerNames(); @@ -48,15 +47,22 @@ void Printer(const God &god, const History& history, OStream& out) { for(size_t j = 0; j < hypo->GetCostBreakdown().size(); ++j) { out << " " << scorerNames[j] << "= " << hypo->GetCostBreakdown()[j]; } + if(god.Get("normalize")) { - out << " ||| " << hypo->GetCost() / words.size() << std::endl; + out << " ||| " << hypo->GetCost() / words.size(); } else { - out << " ||| " << hypo->GetCost() << std::endl; + out << " ||| " << hypo->GetCost(); } + + if(i < nbl.size() - 1) + out << std::endl; + else + out << std::flush; + } } else { - out << best << std::endl; + out << best << std::flush; } }