#include <AlignedSentenceSyntax.h>
Public Member Functions | |
AlignedSentenceSyntax (int lineNum, const std::string &source, const std::string &target, const std::string &alignment) | |
virtual | ~AlignedSentenceSyntax () |
void | Create (const Parameter ¶ms) |
Protected Member Functions | |
void | XMLParse (Phrase &output, SyntaxTree &tree, const std::string input, const Parameter ¶ms) |
void | XMLParse (Phrase &output, SyntaxTree &tree, const pugi::xml_node &parentNode, const Parameter ¶ms) |
void | CreateNonTerms () |
void | CreateNonTerms (ConsistentPhrase &cp, const SyntaxTree::Labels &sourceLabels, const SyntaxTree::Labels &targetLabels) |
void | Populate (bool isSyntax, int mixedSyntaxType, const Parameter ¶ms, std::string line, Phrase &phrase, SyntaxTree &tree) |
Protected Attributes | |
std::string | m_sourceStr |
std::string | m_targetStr |
std::string | m_alignmentStr |
SyntaxTree | m_sourceTree |
SyntaxTree | m_targetTree |
Definition at line 14 of file AlignedSentenceSyntax.h.
AlignedSentenceSyntax::AlignedSentenceSyntax | ( | int | lineNum, | |
const std::string & | source, | |||
const std::string & | target, | |||
const std::string & | alignment | |||
) |
Definition at line 15 of file AlignedSentenceSyntax.cpp.
AlignedSentenceSyntax::~AlignedSentenceSyntax | ( | ) | [virtual] |
Definition at line 26 of file AlignedSentenceSyntax.cpp.
void AlignedSentenceSyntax::Create | ( | const Parameter & | params | ) | [virtual] |
Reimplemented from AlignedSentence.
Definition at line 53 of file AlignedSentenceSyntax.cpp.
References AlignedSentence::CreateConsistentPhrases(), CreateNonTerms(), m_alignmentStr, AlignedSentence::m_source, m_sourceStr, m_sourceTree, AlignedSentence::m_target, m_targetStr, m_targetTree, Parameter::mixedSyntaxType, Populate(), AlignedSentence::PopulateAlignment(), Parameter::sourceSyntax, and Parameter::targetSyntax.
void AlignedSentenceSyntax::CreateNonTerms | ( | ConsistentPhrase & | cp, | |
const SyntaxTree::Labels & | sourceLabels, | |||
const SyntaxTree::Labels & | targetLabels | |||
) | [protected] |
Definition at line 166 of file AlignedSentenceSyntax.cpp.
References ConsistentPhrase::AddNonTerms().
void AlignedSentenceSyntax::CreateNonTerms | ( | ) | [protected] |
Definition at line 144 of file AlignedSentenceSyntax.cpp.
References ConsistentPhrase::corners, SyntaxTree::Find(), ConsistentPhrases::GetColl(), AlignedSentence::m_consistentPhrases, AlignedSentence::m_source, m_sourceTree, m_targetTree, and MosesTraining::sourceLabels.
Referenced by Create().
void AlignedSentenceSyntax::Populate | ( | bool | isSyntax, | |
int | mixedSyntaxType, | |||
const Parameter & | params, | |||
std::string | line, | |||
Phrase & | phrase, | |||
SyntaxTree & | tree | |||
) | [protected] |
void AlignedSentenceSyntax::XMLParse | ( | Phrase & | output, | |
SyntaxTree & | tree, | |||
const pugi::xml_node & | parentNode, | |||
const Parameter & | params | |||
) | [protected] |
Definition at line 80 of file AlignedSentenceSyntax.cpp.
References SyntaxTree::Add(), pugi::xml_attribute::as_string(), Escape(), pugi::xml_node::first_child(), Moses::Tokenize(), and XMLParse().
void AlignedSentenceSyntax::XMLParse | ( | Phrase & | output, | |
SyntaxTree & | tree, | |||
const std::string | input, | |||
const Parameter & | params | |||
) | [protected] |
Definition at line 131 of file AlignedSentenceSyntax.cpp.
References pugi::xml_node::child(), pugi::xml_document::load(), pugi::parse_comments, pugi::parse_default, and sapt::topNode().
Referenced by XMLParse().
std::string AlignedSentenceSyntax::m_alignmentStr [protected] |
std::string AlignedSentenceSyntax::m_sourceStr [protected] |
SyntaxTree AlignedSentenceSyntax::m_sourceTree [protected] |
Definition at line 28 of file AlignedSentenceSyntax.h.
Referenced by Create(), and CreateNonTerms().
std::string AlignedSentenceSyntax::m_targetStr [protected] |
SyntaxTree AlignedSentenceSyntax::m_targetTree [protected] |
Definition at line 28 of file AlignedSentenceSyntax.h.
Referenced by Create(), and CreateNonTerms().