MosesTraining::Syntax::XmlTreeParser Class Reference

#include <xml_tree_parser.h>

Collaboration diagram for MosesTraining::Syntax::XmlTreeParser:

Collaboration graph
[legend]

List of all members.

Public Member Functions

std::auto_ptr< SyntaxTreeParse (const std::string &, bool unescape=false)
 Parse a single sentence and return a SyntaxTree (with words attached).
const std::string & sentence () const
 Get the sentence string (as returned by ProcessAndStripXMLTags).
const std::vector< std::string > & words () const
 Get the sentence as a vector of words.
const SyntaxNodeCollectionnode_collection () const
 Get the node collection (as returned by ProcessAndStripXMLTags).
const std::set< std::string > & label_set () const
 Get the label set (as returned by ProcessAndStripXMLTags).
const std::map< std::string,
int > & 
top_label_set () const
 Get the top label set (as returned by ProcessAndStripXMLTags).


Detailed Description

Parses string representations of parse trees in Moses' XML format and converts them to SyntaxTree objects.

This is a thin wrapper around the ProcessAndStripXMLTags function. After calling Parse(), the output from the ProcessAndStripXMLTags call (the sentence, node collection, label set, and top label set) are available via accessors.

Definition at line 23 of file xml_tree_parser.h.


Member Function Documentation

const std::set<std::string>& MosesTraining::Syntax::XmlTreeParser::label_set (  )  const [inline]

Get the label set (as returned by ProcessAndStripXMLTags).

Definition at line 40 of file xml_tree_parser.h.

Referenced by MosesTraining::Syntax::GHKM::ExtractGHKM::Main().

Here is the caller graph for this function:

const SyntaxNodeCollection& MosesTraining::Syntax::XmlTreeParser::node_collection (  )  const [inline]

Get the node collection (as returned by ProcessAndStripXMLTags).

Definition at line 35 of file xml_tree_parser.h.

Referenced by MosesTraining::Syntax::GHKM::ExtractGHKM::Main().

Here is the caller graph for this function:

std::auto_ptr< SyntaxTree > MosesTraining::Syntax::XmlTreeParser::Parse ( const std::string &  line,
bool  unescape = false 
)

const std::string& MosesTraining::Syntax::XmlTreeParser::sentence (  )  const [inline]

Get the sentence string (as returned by ProcessAndStripXMLTags).

Definition at line 29 of file xml_tree_parser.h.

const std::map<std::string, int>& MosesTraining::Syntax::XmlTreeParser::top_label_set (  )  const [inline]

Get the top label set (as returned by ProcessAndStripXMLTags).

Definition at line 43 of file xml_tree_parser.h.

Referenced by MosesTraining::Syntax::GHKM::ExtractGHKM::Main().

Here is the caller graph for this function:

const std::vector<std::string>& MosesTraining::Syntax::XmlTreeParser::words (  )  const [inline]

Get the sentence as a vector of words.

Definition at line 32 of file xml_tree_parser.h.

Referenced by MosesTraining::Syntax::GHKM::ExtractGHKM::Main().

Here is the caller graph for this function:


The documentation for this class was generated from the following files:

Generated on Thu Jul 6 00:34:09 2017 for Moses by  doxygen 1.5.9