mosesdecoder/phrase-extract/postprocess-egret-forests/PostprocessEgretForests.h
Phil Williams 9e88f794e6 Add phrase-extract/postprocess-egret-forests
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).
2015-03-10 13:51:30 +00:00

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