mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
32 lines
529 B
C++
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;
|
|
|
|
}
|