00001 #pragma once 00002 00003 #include "vector" 00004 00005 #include <boost/shared_ptr.hpp> 00006 00007 #include "Symbol.h" 00008 00009 namespace MosesTraining 00010 { 00011 namespace Syntax 00012 { 00013 namespace PostprocessEgretForests 00014 { 00015 00016 class Forest 00017 { 00018 public: 00019 struct Vertex; 00020 00021 struct Hyperedge { 00022 double weight; 00023 Vertex *head; 00024 std::vector<Vertex *> tail; 00025 }; 00026 00027 struct Vertex { 00028 Symbol symbol; 00029 int start; 00030 int end; 00031 std::vector<boost::shared_ptr<Hyperedge> > incoming; 00032 }; 00033 00034 Forest() {} 00035 00036 std::vector<boost::shared_ptr<Vertex> > vertices; 00037 00038 private: 00039 // Copying is not allowed. 00040 Forest(const Forest &); 00041 Forest &operator=(const Forest &); 00042 }; 00043 00044 } // namespace PostprocessEgretForests 00045 } // namespace Syntax 00046 } // namespace MosesTraining