00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #pragma once
00021
00022 #include <map>
00023 #include <set>
00024 #include <string>
00025 #include <vector>
00026
00027 #include "RuleExtractionOptions.h"
00028 #include "SentenceAlignment.h"
00029 #include "SyntaxNodeCollection.h"
00030
00031 namespace MosesTraining
00032 {
00033
00034 class SentenceAlignmentWithSyntax : public SentenceAlignment
00035 {
00036 public:
00037 SyntaxNodeCollection targetTree;
00038 SyntaxNodeCollection sourceTree;
00039 std::set<std::string> & m_targetLabelCollection;
00040 std::set<std::string> & m_sourceLabelCollection;
00041 std::map<std::string, int> & m_targetTopLabelCollection;
00042 std::map<std::string, int> & m_sourceTopLabelCollection;
00043 const bool m_targetSyntax, m_sourceSyntax;
00044
00045 SentenceAlignmentWithSyntax(std::set<std::string> & tgtLabelColl,
00046 std::set<std::string> & srcLabelColl,
00047 std::map<std::string,int> & tgtTopLabelColl,
00048 std::map<std::string,int> & srcTopLabelColl,
00049 bool targetSyntax,
00050 bool sourceSyntax)
00051 : m_targetLabelCollection(tgtLabelColl)
00052 , m_sourceLabelCollection(srcLabelColl)
00053 , m_targetTopLabelCollection(tgtTopLabelColl)
00054 , m_sourceTopLabelCollection(srcTopLabelColl)
00055 , m_targetSyntax(targetSyntax)
00056 , m_sourceSyntax(sourceSyntax) {
00057 }
00058
00059 virtual ~SentenceAlignmentWithSyntax() {}
00060
00061 bool
00062 processTargetSentence(const char *, int, bool boundaryRules);
00063
00064 bool
00065 processSourceSentence(const char *, int, bool boundaryRules);
00066 };
00067
00068 }
00069