blob: d9f03d62b2e66a370212a27dc7e70d6506d37351 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#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;
}
namespace MosesCmd
{
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(size_t lineNumber, Moses::InputType* source, MosesCmd::IOWrapper &ioWrapper,
Moses::OutputCollector* latticeSamplesCollector,
Moses::OutputCollector* wordGraphCollector, Moses::OutputCollector* searchGraphCollector,
Moses::OutputCollector* detailedTranslationCollector,
Moses::OutputCollector* alignmentInfoCollector,
Moses::OutputCollector* unknownsCollector,
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;
size_t m_lineNumber;
MosesCmd::IOWrapper &m_ioWrapper;
Moses::OutputCollector* m_latticeSamplesCollector;
Moses::OutputCollector* m_wordGraphCollector;
Moses::OutputCollector* m_searchGraphCollector;
Moses::OutputCollector* m_detailedTranslationCollector;
Moses::OutputCollector* m_alignmentInfoCollector;
Moses::OutputCollector* m_unknownsCollector;
bool m_outputSearchGraphSLF;
boost::shared_ptr<Moses::HypergraphOutput<Moses::Manager> > m_hypergraphOutput;
std::ofstream *m_alignmentStream;
};
} //namespace
|