mosesdecoder/contrib/other-builds/moses2/TranslationTask.cpp
2015-11-10 12:46:26 +00:00

32 lines
529 B
C++

#include "TranslationTask.h"
#include "Search/Manager.h"
using namespace std;
TranslationTask::TranslationTask(System &system, const std::string &line)
{
m_mgr = new Manager(system, line);
}
TranslationTask::~TranslationTask()
{
delete m_mgr;
}
void TranslationTask::Run()
{
m_mgr->Decode();
const Hypothesis *bestHypo = m_mgr->GetBestHypothesis();
if (bestHypo) {
bestHypo->OutputToStream(cout);
cerr << "BEST TRANSLATION: " << *bestHypo;
}
else {
cerr << "NO TRANSLATION";
}
cout << endl;
cerr << endl;
}