This commit is contained in:
Marcin Junczys-Dowmunt 2017-03-22 09:41:36 +01:00
parent f97cdfd77a
commit 62cad1d904
2 changed files with 13 additions and 7 deletions

View File

@ -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_;

View File

@ -23,7 +23,6 @@ void Printer(const God &god, const History& history, OStream& out) {
if (god.Get<bool>("return-alignment")) {
best += GetAlignmentString(GetAlignment(bestTranslation.second));
}
LOG(progress, "Best translation: {}", best);
if (god.Get<bool>("n-best")) {
std::vector<std::string> 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<bool>("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;
}
}