mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 00:47:31 +03:00
48 lines
880 B
C++
48 lines
880 B
C++
#pragma once
|
|
|
|
#include <boost/smart_ptr/shared_ptr.hpp>
|
|
#include "moses/ThreadPool.h"
|
|
#include "moses/TranslationOptionCollection.h"
|
|
#include "moses/IOWrapper.h"
|
|
|
|
namespace Moses
|
|
{
|
|
class InputType;
|
|
class OutputCollector;
|
|
|
|
|
|
class TrainingTask : public Moses::Task
|
|
{
|
|
|
|
public:
|
|
|
|
TrainingTask(Moses::InputType* source, Moses::IOWrapper &ioWrapper)
|
|
: m_source(source)
|
|
, m_ioWrapper(ioWrapper) {
|
|
}
|
|
|
|
~TrainingTask() {
|
|
}
|
|
|
|
void Run() {
|
|
StaticData::Instance().InitializeForInput(*m_source);
|
|
|
|
std::cerr << *m_source << std::endl;
|
|
|
|
TranslationOptionCollection *transOptColl = m_source->CreateTranslationOptionCollection();
|
|
transOptColl->CreateTranslationOptions();
|
|
delete transOptColl;
|
|
|
|
StaticData::Instance().CleanUpAfterSentenceProcessing(*m_source);
|
|
}
|
|
|
|
|
|
private:
|
|
Moses::InputType* m_source;
|
|
Moses::IOWrapper &m_ioWrapper;
|
|
|
|
};
|
|
|
|
|
|
} //namespace
|