Package nltk :: Module tree :: Class ProbabilisticTree
[hide private]
[frames] | no frames]

Class ProbabilisticTree

source code

                object --+        
                         |        
                      list --+    
                             |    
                          Tree --+
                                 |
                    object --+   |
                             |   |
probability.ProbabilisticMixIn --+
                                 |
                                ProbabilisticTree

Instance Methods [hide private]
 
__init__(self, node_or_str, children=None, **prob_kwargs)
Construct a new tree.
source code
 
_frozen_class(self) source code
 
__repr__(self) source code
 
__str__(self) source code
 
__cmp__(self, other) source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
copy(self, deep=False) source code

Inherited from Tree: __add__, __delitem__, __ge__, __getitem__, __gt__, __le__, __lt__, __mul__, __radd__, __rmul__, __setitem__, chomsky_normal_form, collapse_unary, draw, flatten, freeze, height, leaf_treeposition, leaves, pos, pprint, pprint_latex_qtree, productions, subtrees, treeposition_spanning_leaves, treepositions, un_chomsky_normal_form

Inherited from Tree (private): _pprint_flat

Inherited from list: __contains__, __delslice__, __getattribute__, __getslice__, __hash__, __iadd__, __imul__, __iter__, __len__, __reversed__, __setslice__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from probability.ProbabilisticMixIn: logprob, prob, set_logprob, set_prob

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__

Class Methods [hide private]
 
convert(cls, val)
Convert a tree between different subtypes of Tree.
source code

Inherited from Tree: parse

Inherited from Tree (private): _parse_error

Static Methods [hide private]
 
__new__(cls, node_or_str, children=None, **prob_kwargs) source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(cls, node_or_str, children=None, **prob_kwargs)
Static Method

source code 
Overrides: Tree.__new__

__init__(self, node_or_str, children=None, **prob_kwargs)
(Constructor)

source code 

Construct a new tree. This constructor can be called in one of two ways:

  • Tree(node, children) constructs a new tree with the specified node value and list of children.
  • Tree(s) constructs a new tree by parsing the string s. It is equivalent to calling the class method Tree.parse(s).
Overrides: Tree.__init__
(inherited documentation)

_frozen_class(self)

source code 
Overrides: Tree._frozen_class

__repr__(self)
(Representation operator)

source code 
Overrides: Tree.__repr__

__str__(self)
(Informal representation operator)

source code 
Overrides: Tree.__str__

__eq__(self, other)
(Equality operator)

source code 
Overrides: Tree.__eq__

__ne__(self, other)

source code 
Overrides: Tree.__ne__

copy(self, deep=False)

source code 
Overrides: Tree.copy

convert(cls, val)
Class Method

source code 

Convert a tree between different subtypes of Tree. cls determines which class will be used to encode the new tree.

Parameters:
  • val - The tree that should be converted.
Returns:
The new Tree.
Overrides: Tree.convert
(inherited documentation)