mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-28 14:32:38 +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
930 B
C++
47 lines
930 B
C++
#pragma once
|
|
|
|
#include <istream>
|
|
#include <ostream>
|
|
#include <string>
|
|
|
|
namespace MosesTraining
|
|
{
|
|
namespace Syntax
|
|
{
|
|
namespace PostprocessEgretForests
|
|
{
|
|
|
|
struct Options;
|
|
class SplitPointFileParser;
|
|
|
|
class PostprocessEgretForests
|
|
{
|
|
public:
|
|
PostprocessEgretForests() : m_name("postprocess-egret-forests") {}
|
|
|
|
void Error(const std::string &) const;
|
|
|
|
const std::string &GetName() const {
|
|
return m_name;
|
|
}
|
|
|
|
int Main(int argc, char *argv[]);
|
|
|
|
private:
|
|
void OneBestTree(std::istream &, std::ostream &, SplitPointFileParser *,
|
|
const Options &);
|
|
|
|
void OpenInputFileOrDie(const std::string &, std::ifstream &);
|
|
|
|
void ProcessForest(std::istream &, std::ostream &, SplitPointFileParser *,
|
|
const Options &);
|
|
|
|
void ProcessOptions(int, char *[], Options &) const;
|
|
|
|
std::string m_name;
|
|
};
|
|
|
|
} // namespace PostprocessEgretForests
|
|
} // namespace Syntax
|
|
} // namespace MosesTraining
|