FreeLing  4.0
Public Member Functions | Static Public Member Functions | Private Attributes
freeling::parse_tree Class Reference

Class parse tree is used to store the results of parsing. More...

#include <language.h>

Inheritance diagram for freeling::parse_tree:
Inheritance graph
[legend]
Collaboration diagram for freeling::parse_tree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 parse_tree ()
 Class parse tree is used to store the results of parsing.
 parse_tree (parse_tree::const_iterator p)
 parse_tree (const node &)
void build_node_index (const std::wstring &)
 assign an id to each node and build index
void rebuild_node_index ()
 rebuild index maintaining node id's
parse_tree::const_iterator get_node_by_id (const std::wstring &) const
 access the node with given id
parse_tree::const_iterator get_node_by_pos (size_t) const
 access the node by word position
parse_tree::iterator get_node_by_id (const std::wstring &)
 access the node with given id
parse_tree::iterator get_node_by_pos (size_t)
 access the node by word position
parse_tree::const_iterator get_subsuming_node (size_t i, size_t j) const
 get lowest tree node subsuming whole word span i..j
parse_tree::iterator get_subsuming_node (size_t i, size_t j)
parse_tree::const_iterator get_left_subsuming_node (size_t i, size_t j) const
 get tree node subsuming longest span i..k such that k<=j
parse_tree::iterator get_left_subsuming_node (size_t i, size_t j)
parse_tree::const_iterator get_right_subsuming_node (size_t i, size_t j) const
 get tree node subsuming longest span k..j such that i<=k
parse_tree::iterator get_right_subsuming_node (size_t i, size_t j)

Static Public Member Functions

static const wordget_head_word (parse_tree::const_iterator)
 obtain a reference to head word of a parse_tree
static const std::wstring & get_head_label (parse_tree::const_iterator)
 obtain the head label of a parse_tree
static int get_head_position (parse_tree::const_iterator)
 obtain position of head word of a parse_tree (or -1 if no head)
static bool C_commands (parse_tree::const_iterator, parse_tree::const_iterator)
 C-commands 1 - pt1 does not dominate pt2 2 - pt2 does not dominate pt1 3 - The first branching node that dominates pt1 also dominates pt2.
static void PrintTree (parse_tree::const_iterator n, int k, int depth)
 print a parse tree (debugging purposes mainly)

Private Attributes

std::map< std::wstring,
parse_tree::iterator
node_index
std::vector< parse_tree::iteratorword_index

Detailed Description

Class parse tree is used to store the results of parsing.


Constructor & Destructor Documentation

Class parse tree is used to store the results of parsing.

Methods for parse_tree


Member Function Documentation

void freeling::parse_tree::build_node_index ( const std::wstring &  )

assign an id to each node and build index

assign id's to nodes and build index

References freeling::tree< node >::begin(), freeling::tree< node >::end(), int2wstring, and node_index.

C-commands 1 - pt1 does not dominate pt2 2 - pt2 does not dominate pt1 3 - The first branching node that dominates pt1 also dominates pt2.

References freeling::basic_tree_iterator< T, N >::get_parent(), freeling::basic_tree_iterator< T, N >::is_root(), freeling::basic_tree_iterator< T, N >::num_children(), and freeling::tree< node >::parent.

obtain position of head word of a parse_tree (or -1 if no head)

obtain the position in the sentence of the head word of a parse_tree

References freeling::basic_tree_iterator< T, N >::num_children(), freeling::basic_tree_iterator< T, N >::sibling_begin(), and freeling::basic_tree_iterator< T, N >::sibling_end().

get tree node subsuming longest span i..k such that k<=j

access the node with given id

access the node with given id

access the node by word position

get leaf node corresponding to word at given position in sentence, const iterator

References word_index.

access the node by word position

get leaf node corresponding to word at given position in sentence, normal iterator

References word_index.

get tree node subsuming longest span k..j such that i<=k

get lowest tree node subsuming whole word span i..j

void freeling::parse_tree::PrintTree ( parse_tree::const_iterator  n,
int  k,
int  depth 
) [static]

rebuild index maintaining node id's

References freeling::tree< node >::begin(), freeling::tree< node >::end(), node_index, and word_index.


Member Data Documentation

std::map<std::wstring,parse_tree::iterator> freeling::parse_tree::node_index [private]

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