|
#pragma once |
|
|
|
#include "vector" |
|
|
|
#include "moses/Syntax/PVertex.h" |
|
|
|
namespace Moses |
|
{ |
|
namespace Syntax |
|
{ |
|
namespace F2S |
|
{ |
|
|
|
class Forest |
|
{ |
|
public: |
|
struct Vertex; |
|
|
|
struct Hyperedge { |
|
Vertex *head; |
|
std::vector<Vertex *> tail; |
|
float weight; |
|
}; |
|
|
|
struct Vertex { |
|
Vertex(const PVertex &v) : pvertex(v) {} |
|
~Vertex(); |
|
PVertex pvertex; |
|
std::vector<Hyperedge *> incoming; |
|
}; |
|
|
|
|
|
Forest() {} |
|
|
|
|
|
~Forest(); |
|
|
|
|
|
void Clear(); |
|
|
|
std::vector<Vertex *> vertices; |
|
|
|
private: |
|
|
|
Forest(const Forest &); |
|
Forest &operator=(const Forest &); |
|
}; |
|
|
|
} |
|
} |
|
} |
|
|