00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021 #ifndef EXTRACT_GHKM_XML_TREE_PARSER_H_
00022 #define EXTRACT_GHKM_XML_TREE_PARSER_H_
00023
00024 #include "Exception.h"
00025
00026 #include "SyntaxTree.h"
00027
00028 #include <map>
00029 #include <memory>
00030 #include <set>
00031 #include <string>
00032 #include <vector>
00033
00034 namespace Moses
00035 {
00036 namespace GHKM
00037 {
00038
00039 class ParseTree;
00040
00041
00042
00043 class XmlTreeParser
00044 {
00045 public:
00046 XmlTreeParser(std::set<std::string> &, std::map<std::string, int> &);
00047 std::auto_ptr<ParseTree> Parse(const std::string &);
00048 private:
00049 std::auto_ptr<ParseTree> ConvertTree(const MosesTraining::SyntaxNode &,
00050 const std::vector<std::string> &);
00051
00052 std::set<std::string> &m_labelSet;
00053 std::map<std::string, int> &m_topLabelSet;
00054 std::string m_line;
00055 MosesTraining::SyntaxTree m_tree;
00056 std::vector<std::string> m_words;
00057 };
00058
00059 }
00060 }
00061
00062 #endif