A container for the nodes and labelled edges of a dependency
structure.
|
|
__init__(self,
tree_str=None)
We place a dummy 'top' node in the first position in the nodelist,
since the root node is often assigned '0' as its head. |
source code
|
|
|
|
|
|
|
redirect_arcs(self,
originals,
redirect)
Redirects arcs to any of the nodes in the originals list to the
redirect node address. |
source code
|
|
|
|
add_arc(self,
head_address,
mod_address)
Adds an arc from the node specified by head_address to the node
specified by the mod address. |
source code
|
|
|
|
|
|
|
get_by_address(self,
node_address)
Returns the node with the given address. |
source code
|
|
|
|
contains_address(self,
node_address)
Returns true if the graph contains a node with the given node
address, false otherwise. |
source code
|
|
|
|
|
|
|
|
|
|
left_children(self,
node_index)
Returns the number of left children under the node specified by the
given address. |
source code
|
|
|
|
right_children(self,
node_index)
Returns the number of right children under the node specified by the
given address. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
_tree(self,
i)
Recursive function for turning dependency graphs into NLTK trees. |
source code
|
|
|
|
tree(self)
Starting with the root node, build a dependency tree
using the NLTK Tree constructor. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
| get_cycle_path(self,
curr_node,
goal_node_index) |
source code
|
|
str
|
|