module documentation

Class for representing hierarchical language structures, such as syntax trees and morphological trees.

Class AbstractParentedTree An abstract base class for a Tree that automatically maintains pointers to parent nodes. These parent pointers are updated whenever any change is made to a tree's structure. Two subclasses are currently defined:...
Class ImmutableMultiParentedTree Undocumented
Class ImmutableParentedTree Undocumented
Class ImmutableProbabilisticTree Undocumented
Class ImmutableTree No class docstring; 0/2 instance variable, 1/15 method documented
Class MultiParentedTree A Tree that automatically maintains parent pointers for multi-parented trees. The following are methods for querying the structure of a multi-parented tree: parents(), parent_indices(), left_siblings()...
Class ParentedTree A Tree that automatically maintains parent pointers for single-parented trees. The following are methods for querying the structure of a parented tree: parent, parent_index, left_sibling, right_sibling...
Class ProbabilisticTree Undocumented
Class Tree A Tree represents a hierarchical grouping of leaves and subtrees. For example, each constituent in a syntax tree is represented by a single Tree.
Function bracket_parse Use Tree.read(s, remove_empty_top_bracketing=True) instead.
Function demo A demonstration showing how Trees and Trees can be used. This demonstration creates a Tree, and loads a Tree from the Treebank corpus, and shows the results of calling several of their methods.
Function sinica_parse Parse a Sinica Treebank string and return a tree. Trees are represented as nested brackettings, as shown in the following example (X represents a Chinese character): S(goal:NP(Head:Nep:XX)|theme:NP(Head:Nhaa:X)|quantity:Dab:X|Head:VL2:X)#0(PERIODCATEGORY)...
Function _child_names Undocumented
def bracket_parse(s): (source)

Use Tree.read(s, remove_empty_top_bracketing=True) instead.

def demo(): (source)

A demonstration showing how Trees and Trees can be used. This demonstration creates a Tree, and loads a Tree from the Treebank corpus, and shows the results of calling several of their methods.

def sinica_parse(s): (source)

Parse a Sinica Treebank string and return a tree. Trees are represented as nested brackettings, as shown in the following example (X represents a Chinese character): S(goal:NP(Head:Nep:XX)|theme:NP(Head:Nhaa:X)|quantity:Dab:X|Head:VL2:X)#0(PERIODCATEGORY)

Parameters
s:strThe string to be converted
Returns
TreeA tree corresponding to the string representation.
def _child_names(tree): (source)

Undocumented