diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2014-09-30 15:59:31 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2014-09-30 15:59:31 +0400 |
commit | c20af584e73873ce4d06b14a7ff793752fb07505 (patch) | |
tree | 5484d906f59066d235e508025dfd4eaf86e51073 /moses/TranslationTask.h | |
parent | ebd2e724942cf2f96050e470e4d14a217ea3da73 (diff) |
move TranslationTask into moses/
Diffstat (limited to 'moses/TranslationTask.h')
-rw-r--r-- | moses/TranslationTask.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/moses/TranslationTask.h b/moses/TranslationTask.h new file mode 100644 index 000000000..05b257a6a --- /dev/null +++ b/moses/TranslationTask.h @@ -0,0 +1,63 @@ +#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 +{ + +/** 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, Moses::OutputCollector* outputCollector, Moses::OutputCollector* nbestCollector, + 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; + Moses::OutputCollector* m_outputCollector; + Moses::OutputCollector* m_nbestCollector; + 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 |