mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-04 01:45:52 +03:00
48 lines
1003 B
C++
48 lines
1003 B
C++
#pragma once
|
|
|
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
|
#include "moses/ThreadPool.h"
|
|
#include "moses/Manager.h"
|
|
#include "moses/HypergraphOutput.h"
|
|
|
|
namespace Moses
|
|
{
|
|
class InputType;
|
|
class OutputCollector;
|
|
|
|
class IOWrapper;
|
|
|
|
/** Translates a sentence.
|
|
* - calls the search (Manager)
|
|
* - applies the decision rule
|
|
* - outputs best translation and additional reporting
|
|
**/
|
|
class TranslationTask : public Moses::Task
|
|
{
|
|
|
|
public:
|
|
|
|
TranslationTask(Moses::InputType* source, Moses::IOWrapper &ioWrapper,
|
|
bool outputSearchGraphSLF,
|
|
boost::shared_ptr<Moses::HypergraphOutput<Moses::Manager> > hypergraphOutput);
|
|
|
|
~TranslationTask();
|
|
|
|
/** Translate one sentence
|
|
* gets called by main function implemented at end of this source file */
|
|
void Run();
|
|
|
|
|
|
private:
|
|
Moses::InputType* m_source;
|
|
Moses::IOWrapper &m_ioWrapper;
|
|
|
|
bool m_outputSearchGraphSLF;
|
|
boost::shared_ptr<Moses::HypergraphOutput<Moses::Manager> > m_hypergraphOutput;
|
|
|
|
|
|
};
|
|
|
|
|
|
} //namespace
|