MosesTraining::SyntaxNodeCollection Class Reference

#include <SyntaxNodeCollection.h>

List of all members.

Public Member Functions

 SyntaxNodeCollection ()
 ~SyntaxNodeCollection ()
SyntaxNodeAddNode (int startPos, int endPos, const std::string &label)
 Construct and insert a new SyntaxNode.
bool HasNode (int startPos, int endPos) const
 Return true iff there are one or more SyntaxNodes with the given span.
const std::vector< SyntaxNode * > & GetNodes (int startPos, int endPos) const
 Lookup the SyntaxNodes for a given span.
bool HasNodeStartingAtPosition (int startPos) const
const std::vector< SyntaxNode * > & GetNodesByStartPosition (int startPos) const
bool HasNodeEndingAtPosition (int endPos) const
const std::vector< SyntaxNode * > & GetNodesByEndPosition (int endPos) const
const std::vector< SyntaxNode * > & GetAllNodes ()
 Get a vector of pointers to all SyntaxNodes (unordered).
std::size_t GetNumWords () const
 Get the number of words (defined as 1 + the max end pos of any node).
void Clear ()
 Clear the container (this deletes the SyntaxNodes).
std::auto_ptr< SyntaxTreeExtractTree ()
 Extract a SyntaxTree (assuming the collection's nodes constitute a tree).


Detailed Description

A collection of SyntaxNodes organized by start and end position.

Definition at line 37 of file SyntaxNodeCollection.h.


Constructor & Destructor Documentation

MosesTraining::SyntaxNodeCollection::SyntaxNodeCollection (  )  [inline]

Definition at line 40 of file SyntaxNodeCollection.h.

MosesTraining::SyntaxNodeCollection::~SyntaxNodeCollection (  ) 

Definition at line 29 of file SyntaxNodeCollection.cpp.

References Clear().

Here is the call graph for this function:


Member Function Documentation

SyntaxNode * MosesTraining::SyntaxNodeCollection::AddNode ( int  startPos,
int  endPos,
const std::string &  label 
)

Construct and insert a new SyntaxNode.

Definition at line 44 of file SyntaxNodeCollection.cpp.

Referenced by LeftBinarize(), MosesTraining::ProcessAndStripXMLTags(), RightBinarize(), and SAMT().

Here is the caller graph for this function:

void MosesTraining::SyntaxNodeCollection::Clear (  ) 

Clear the container (this deletes the SyntaxNodes).

Definition at line 34 of file SyntaxNodeCollection.cpp.

Referenced by MosesTraining::Syntax::XmlTreeParser::Parse(), and ~SyntaxNodeCollection().

Here is the caller graph for this function:

std::auto_ptr< SyntaxTree > MosesTraining::SyntaxNodeCollection::ExtractTree (  ) 

Extract a SyntaxTree (assuming the collection's nodes constitute a tree).

Definition at line 105 of file SyntaxNodeCollection.cpp.

References MosesTraining::Syntax::Tree< T >::children(), MosesTraining::SyntaxNode::end, MosesTraining::Syntax::Tree< T >::parent(), MosesTraining::SyntaxNode::start, and MosesTraining::Syntax::Tree< T >::value().

Referenced by MosesTraining::Syntax::XmlTreeParser::Parse().

Here is the call graph for this function:

Here is the caller graph for this function:

const std::vector< SyntaxNode* >& MosesTraining::SyntaxNodeCollection::GetAllNodes (  )  [inline]

Get a vector of pointers to all SyntaxNodes (unordered).

Definition at line 59 of file SyntaxNodeCollection.h.

Referenced by SAMT(), and store().

Here is the caller graph for this function:

const std::vector< SyntaxNode * > & MosesTraining::SyntaxNodeCollection::GetNodes ( int  startPos,
int  endPos 
) const

Lookup the SyntaxNodes for a given span.

Definition at line 61 of file SyntaxNodeCollection.cpp.

Referenced by collectWordLabelCounts(), HasNode(), LeftBinarize(), MosesTraining::ProcessAndStripXMLTags(), RightBinarize(), and SAMT().

Here is the caller graph for this function:

const std::vector< SyntaxNode * > & MosesTraining::SyntaxNodeCollection::GetNodesByEndPosition ( int  endPos  )  const

Definition at line 95 of file SyntaxNodeCollection.cpp.

Referenced by HasNodeEndingAtPosition().

Here is the caller graph for this function:

const std::vector< SyntaxNode * > & MosesTraining::SyntaxNodeCollection::GetNodesByStartPosition ( int  startPos  )  const

Definition at line 80 of file SyntaxNodeCollection.cpp.

Referenced by HasNodeStartingAtPosition().

Here is the caller graph for this function:

std::size_t MosesTraining::SyntaxNodeCollection::GetNumWords (  )  const [inline]

Get the number of words (defined as 1 + the max end pos of any node).

Definition at line 64 of file SyntaxNodeCollection.h.

Referenced by determineSplitPoints(), and SAMT().

Here is the caller graph for this function:

bool MosesTraining::SyntaxNodeCollection::HasNode ( int  startPos,
int  endPos 
) const

Return true iff there are one or more SyntaxNodes with the given span.

Definition at line 56 of file SyntaxNodeCollection.cpp.

References GetNodes().

Referenced by determineSplitPoints(), and SAMT().

Here is the call graph for this function:

Here is the caller graph for this function:

bool MosesTraining::SyntaxNodeCollection::HasNodeEndingAtPosition ( int  endPos  )  const

Definition at line 90 of file SyntaxNodeCollection.cpp.

References GetNodesByEndPosition().

Here is the call graph for this function:

bool MosesTraining::SyntaxNodeCollection::HasNodeStartingAtPosition ( int  startPos  )  const

Definition at line 75 of file SyntaxNodeCollection.cpp.

References GetNodesByStartPosition().

Here is the call graph for this function:


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

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