Module constituency_data :: Class Ctree
[hide private]
[frames] | no frames]

Class Ctree

source code

This class encapsulates a tree object

Instance Methods [hide private]
 
__get_edge_nodes(self) source code
 
__get_nt_nodes(self) source code
 
__get_t_nodes(self) source code
 
__init__(self, node=None)
Constructor of the object
source code
 
__str__(self) source code
 
append_element(self, this_element)
Appends a node to the tree, could be a terminal or non terminal or edge
source code
Cedge
get_edges(self)
Iterator that returns all the edge objects
source code
Cedge
get_edges_as_list(self)
Iterator that returns all the edge objects
source code
xml Element
get_node(self)
Returns the node of the element
source code
Cnonterminal
get_non_terminals(self)
Iterator that returns all the non terminal objects
source code
Cterminal
get_terminals(self)
Iterator that returns all the terminal objects
source code
Cterminal
get_terminals_as_list(self)
Iterator that returns all the terminal objects
source code
Method Details [hide private]

__init__(self, node=None)
(Constructor)

source code 

Constructor of the object

Parameters:
  • node (xml Element or None (to create and empty one)) - this is the node of the element. If it is None it will create a new object

append_element(self, this_element)

source code 

Appends a node to the tree, could be a terminal or non terminal or edge

Parameters:
  • this_element (object) - the element to be appended

get_edges(self)

source code 

Iterator that returns all the edge objects

Returns: Cedge
terminal objects (iterator)

get_edges_as_list(self)

source code 

Iterator that returns all the edge objects

Returns: Cedge
terminal objects (iterator)

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_non_terminals(self)

source code 

Iterator that returns all the non terminal objects

Returns: Cnonterminal
non terminal objects (iterator)

get_terminals(self)

source code 

Iterator that returns all the terminal objects

Returns: Cterminal
terminal objects (iterator)

get_terminals_as_list(self)

source code 

Iterator that returns all the terminal objects

Returns: Cterminal
terminal objects as list