2015-03-10 16:51:30 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "vector"
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
#include "Symbol.h"
|
|
|
|
|
|
|
|
namespace MosesTraining
|
|
|
|
{
|
|
|
|
namespace Syntax
|
|
|
|
{
|
|
|
|
namespace PostprocessEgretForests
|
|
|
|
{
|
|
|
|
|
|
|
|
class Forest
|
|
|
|
{
|
2015-05-02 13:45:24 +03:00
|
|
|
public:
|
2015-03-10 16:51:30 +03:00
|
|
|
struct Vertex;
|
|
|
|
|
|
|
|
struct Hyperedge {
|
|
|
|
double weight;
|
|
|
|
Vertex *head;
|
|
|
|
std::vector<Vertex *> tail;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Vertex {
|
|
|
|
Symbol symbol;
|
|
|
|
int start;
|
|
|
|
int end;
|
|
|
|
std::vector<boost::shared_ptr<Hyperedge> > incoming;
|
|
|
|
};
|
|
|
|
|
|
|
|
Forest() {}
|
|
|
|
|
|
|
|
std::vector<boost::shared_ptr<Vertex> > vertices;
|
|
|
|
|
2015-05-02 13:45:24 +03:00
|
|
|
private:
|
2015-03-10 16:51:30 +03:00
|
|
|
// Copying is not allowed.
|
|
|
|
Forest(const Forest &);
|
|
|
|
Forest &operator=(const Forest &);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace PostprocessEgretForests
|
|
|
|
} // namespace Syntax
|
|
|
|
} // namespace MosesTraining
|