Fix moses mt compile error

git-svn-id: https://mosesdecoder.svn.sourceforge.net/svnroot/mosesdecoder/trunk@2886 1f5c12ca-751b-0410-a591-d2e778427230
This commit is contained in:
bhaddow 2010-02-11 10:44:11 +00:00
parent 20216dbfec
commit 2396f6d9e9

View File

@ -119,6 +119,18 @@ class TranslationTask : public Task {
const Hypothesis* bestHypo = NULL;
if (!staticData.UseMBR()) {
bestHypo = manager.GetBestHypothesis();
if (bestHypo) {
OutputSurface(
out,
bestHypo,
staticData.GetOutputFactorOrder(),
staticData.GetReportSegmentation(),
staticData.GetReportAllFactors());
IFVERBOSE(1) {
debug << "BEST TRANSLATION: " << *bestHypo << endl;
}
}
out << endl;
} else {
//MBR decoding
size_t nBestSize = staticData.GetMBRSize();
@ -130,23 +142,16 @@ class TranslationTask : public Task {
manager.CalcNBest(nBestSize, nBestList,true);
VERBOSE(2,"size of n-best: " << nBestList.GetSize() << " (" << nBestSize << ")" << endl);
IFVERBOSE(2) { PrintUserTime("calculated n-best list for MBR decoding"); }
bestHypo = doMBR(nBestList)->GetEdges().at(0);
std::vector<const Factor*> mbrBestHypo = doMBR(nBestList);
for (size_t i = 0 ; i < mbrBestHypo.size() ; i++) {
const Factor *factor = mbrBestHypo[i];
if (i>0) out << " ";
out << factor->GetString();
}
out << endl;
IFVERBOSE(2) { PrintUserTime("finished MBR decoding"); }
}
}
if (bestHypo) {
OutputSurface(
out,
bestHypo,
staticData.GetOutputFactorOrder(),
staticData.GetReportSegmentation(),
staticData.GetReportAllFactors());
IFVERBOSE(1) {
debug << "BEST TRANSLATION: " << *bestHypo << endl;
}
}
out << endl;
m_outputCollector->Write(m_lineNumber,out.str(),debug.str());
}
if (m_nbestCollector) {