00001 #pragma once 00002 00003 #include <vector> 00004 00005 #include "moses/Syntax/PVertex.h" 00006 00007 namespace Moses 00008 { 00009 namespace Syntax 00010 { 00011 namespace T2S 00012 { 00013 00014 struct InputTree { 00015 public: 00016 struct Node { 00017 Node(const PVertex &v, const std::vector<Node*> &c) 00018 : pvertex(v) 00019 , children(c) {} 00020 00021 Node(const PVertex &v) : pvertex(v) {} 00022 00023 PVertex pvertex; 00024 std::vector<Node*> children; 00025 }; 00026 00027 // All tree nodes in post-order. 00028 std::vector<Node> nodes; 00029 00030 // Tree nodes arranged by starting position (i.e. the vector nodes[i] 00031 // contains the subset of tree nodes with span [i,j] (for any j).) 00032 std::vector<std::vector<Node*> > nodesAtPos; 00033 }; 00034 00035 } // T2S 00036 } // Syntax 00037 } // Moses