diff options
Diffstat (limited to 'moses/Syntax/T2S/InputTree.h')
-rw-r--r-- | moses/Syntax/T2S/InputTree.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/moses/Syntax/T2S/InputTree.h b/moses/Syntax/T2S/InputTree.h new file mode 100644 index 000000000..93b7516e6 --- /dev/null +++ b/moses/Syntax/T2S/InputTree.h @@ -0,0 +1,38 @@ +#pragma once + +#include <vector> + +#include "moses/Syntax/PVertex.h" + +namespace Moses +{ +namespace Syntax +{ +namespace T2S +{ + +struct InputTree +{ + public: + struct Node { + Node(const PVertex &v, const std::vector<Node*> &c) + : pvertex(v) + , children(c) {} + + Node(const PVertex &v) : pvertex(v) {} + + PVertex pvertex; + std::vector<Node*> children; + }; + + // All tree nodes in post-order. + std::vector<Node> nodes; + + // Tree nodes arranged by starting position (i.e. the vector nodes[i] + // contains the subset of tree nodes with span [i,j] (for any j).) + std::vector<std::vector<Node*> > nodesAtPos; +}; + +} // T2S +} // Syntax +} // Moses |