mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-06 03:33:37 +03:00
9e88f794e6
This performs some minor transformations to Egret forests: escaping of Moses special characters; removal of "^g" suffixes from constituent labels; and marking of slash/hyphen split points (using @ characters).
47 lines
702 B
C++
47 lines
702 B
C++
#pragma once
|
|
|
|
#include "vector"
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include "Symbol.h"
|
|
|
|
namespace MosesTraining
|
|
{
|
|
namespace Syntax
|
|
{
|
|
namespace PostprocessEgretForests
|
|
{
|
|
|
|
class Forest
|
|
{
|
|
public:
|
|
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;
|
|
|
|
private:
|
|
// Copying is not allowed.
|
|
Forest(const Forest &);
|
|
Forest &operator=(const Forest &);
|
|
};
|
|
|
|
} // namespace PostprocessEgretForests
|
|
} // namespace Syntax
|
|
} // namespace MosesTraining
|