#pragma once #include #include #include #include #include "moses/Syntax/F2S/PVertexToStackMap.h" #include "moses/Syntax/KBestExtractor.h" #include "moses/Syntax/Manager.h" #include "moses/Syntax/SVertexStack.h" #include "moses/TreeInput.h" #include "moses/Word.h" #include "InputTree.h" #include "RuleTrie.h" namespace Moses { namespace Syntax { struct SHyperedge; namespace T2S { template class Manager : public Syntax::Manager { public: Manager(ttasksptr const& ttask); void Decode(); // Get the SHyperedge for the 1-best derivation. const SHyperedge *GetBestSHyperedge() const; void ExtractKBest( std::size_t k, std::vector > &kBestList, bool onlyDistinct=false) const; void OutputDetailedTranslationReport(OutputCollector *collector) const; private: void InitializeRuleMatchers(); void InitializeStacks(); void RecombineAndSort(const std::vector &, SVertexStack &); InputTree m_inputTree; F2S::PVertexToStackMap m_stackMap; boost::shared_ptr m_glueRuleTrie; std::vector > m_ruleMatchers; RuleMatcher *m_glueRuleMatcher; }; } // T2S } // Syntax } // Moses // Implementation #include "Manager-inl.h"