Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TrainingTask.h « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 885e8fd163f0f92011832d2043a9a7cde9ea5cfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#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