00001
00002
00003
00004
00005
00006
00007
00008 #pragma once
00009
00010 #include "AlignedSentence.h"
00011 #include "SyntaxTree.h"
00012 #include "pugixml.hpp"
00013
00014 class AlignedSentenceSyntax : public AlignedSentence
00015 {
00016 public:
00017 AlignedSentenceSyntax(int lineNum,
00018 const std::string &source,
00019 const std::string &target,
00020 const std::string &alignment);
00021 virtual ~AlignedSentenceSyntax();
00022
00023 void Create(const Parameter ¶ms);
00024
00025
00026 protected:
00027 std::string m_sourceStr, m_targetStr, m_alignmentStr;
00028 SyntaxTree m_sourceTree, m_targetTree;
00029
00030 void XMLParse(Phrase &output,
00031 SyntaxTree &tree,
00032 const std::string input,
00033 const Parameter ¶ms);
00034 void XMLParse(Phrase &output,
00035 SyntaxTree &tree,
00036 const pugi::xml_node &parentNode,
00037 const Parameter ¶ms);
00038 void CreateNonTerms();
00039 void CreateNonTerms(ConsistentPhrase &cp,
00040 const SyntaxTree::Labels &sourceLabels,
00041 const SyntaxTree::Labels &targetLabels);
00042 void Populate(bool isSyntax, int mixedSyntaxType, const Parameter ¶ms,
00043 std::string line, Phrase &phrase, SyntaxTree &tree);
00044
00045 };
00046