diff options
Diffstat (limited to 'phrase-extract/extract-ghkm/ExtractGHKM.h')
-rw-r--r-- | phrase-extract/extract-ghkm/ExtractGHKM.h | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/phrase-extract/extract-ghkm/ExtractGHKM.h b/phrase-extract/extract-ghkm/ExtractGHKM.h index 66c4c55f8..0d0fa8bf1 100644 --- a/phrase-extract/extract-ghkm/ExtractGHKM.h +++ b/phrase-extract/extract-ghkm/ExtractGHKM.h @@ -28,6 +28,8 @@ #include "OutputFileStream.h" #include "SyntaxTree.h" +#include "syntax-common/tool.h" + namespace MosesTraining { namespace GHKM @@ -35,22 +37,14 @@ namespace GHKM struct Options; -class ExtractGHKM +class ExtractGHKM : public Syntax::Tool { public: + ExtractGHKM() : Tool("extract-ghkm") {} - ExtractGHKM() : m_name("extract-ghkm") {} - const std::string &GetName() const { - return m_name; - } - int Main(int argc, char *argv[]); + virtual int Main(int argc, char *argv[]); private: - - void Error(const std::string &) const; - void OpenInputFileOrDie(const std::string &, std::ifstream &); - void OpenOutputFileOrDie(const std::string &, std::ofstream &); - void OpenOutputFileOrDie(const std::string &, Moses::OutputFileStream &); void RecordTreeLabels(const SyntaxTree &, std::set<std::string> &); void CollectWordLabelCounts(SyntaxTree &, const Options &, @@ -79,8 +73,6 @@ private: std::vector<std::string> ReadTokens(const SyntaxTree &root) const; void ProcessOptions(int, char *[], Options &) const; - - std::string m_name; }; } // namespace GHKM |