|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once |
|
|
|
#include <map> |
|
#include <set> |
|
#include <string> |
|
#include <vector> |
|
|
|
#include "RuleExtractionOptions.h" |
|
#include "SentenceAlignment.h" |
|
#include "SyntaxNodeCollection.h" |
|
|
|
namespace MosesTraining |
|
{ |
|
|
|
class SentenceAlignmentWithSyntax : public SentenceAlignment |
|
{ |
|
public: |
|
SyntaxNodeCollection targetTree; |
|
SyntaxNodeCollection sourceTree; |
|
std::set<std::string> & m_targetLabelCollection; |
|
std::set<std::string> & m_sourceLabelCollection; |
|
std::map<std::string, int> & m_targetTopLabelCollection; |
|
std::map<std::string, int> & m_sourceTopLabelCollection; |
|
const bool m_targetSyntax, m_sourceSyntax; |
|
|
|
SentenceAlignmentWithSyntax(std::set<std::string> & tgtLabelColl, |
|
std::set<std::string> & srcLabelColl, |
|
std::map<std::string,int> & tgtTopLabelColl, |
|
std::map<std::string,int> & srcTopLabelColl, |
|
bool targetSyntax, |
|
bool sourceSyntax) |
|
: m_targetLabelCollection(tgtLabelColl) |
|
, m_sourceLabelCollection(srcLabelColl) |
|
, m_targetTopLabelCollection(tgtTopLabelColl) |
|
, m_sourceTopLabelCollection(srcTopLabelColl) |
|
, m_targetSyntax(targetSyntax) |
|
, m_sourceSyntax(sourceSyntax) { |
|
} |
|
|
|
virtual ~SentenceAlignmentWithSyntax() {} |
|
|
|
bool |
|
processTargetSentence(const char *, int, bool boundaryRules); |
|
|
|
bool |
|
processSourceSentence(const char *, int, bool boundaryRules); |
|
}; |
|
|
|
} |
|
|
|
|