00001 #pragma once
00002
00003 #include <vector>
00004
00005 #include "moses/TreeInput.h"
00006 #include "moses/TypeDef.h"
00007
00008 #include "InputTree.h"
00009
00010 namespace Moses
00011 {
00012 namespace Syntax
00013 {
00014 namespace T2S
00015 {
00016
00017 class InputTreeBuilder
00018 {
00019 public:
00020 InputTreeBuilder(std::vector<FactorType> const& oFactors);
00021
00022
00023
00024 void Build(const TreeInput &, const std::string &, InputTree &);
00025
00026 private:
00027 static bool PostOrderComp(const std::pair<XMLParseOutput *, int> &,
00028 const std::pair<XMLParseOutput *, int> &);
00029
00030 void CreateNodes(const TreeInput &, const std::string &, InputTree &);
00031 void ConnectNodes(InputTree &);
00032 void SortXmlNodesIntoPostOrder(std::vector<XMLParseOutput> &);
00033
00034 const std::vector<FactorType> &m_outputFactorOrder;
00035 };
00036
00037 }
00038 }
00039 }