Package nltk_lite :: Package contrib :: Module tree :: Class _AbstractElement
[hide private]
[frames] | no frames]

Class _AbstractElement

source code

etree.ElementTree._ElementInterface --+
                                      |
                                     _AbstractElement
Known Subclasses:
_AbstractParentedElement

An abstract base class for Elements.

Instance Methods [hide private]
 
__repr__(self) source code
 
__getitem__(self, index) source code
 
__setitem__(self, index, value) source code
 
__delitem__(self, index) source code
list
leaves(self)
Returns: a list containing this tree's leaves.
source code
 
flatten(self) source code
int
height(self)
Returns: The height of this tree.
source code
 
treepositions(self, order='preorder') source code
 
productions(self) source code
 
subtrees(self, filter=None)
Generate all the subtrees of this tree, optionally restricted to trees matching the filter function.
source code
 
copy(self, deep=True) source code
 
freeze(self, leaf_freezer=None) source code

Inherited from etree.ElementTree._ElementInterface: __delslice__, __getslice__, __init__, __len__, __setslice__, append, clear, find, findall, findtext, get, getchildren, getiterator, insert, items, keys, makeelement, remove, set

Class Variables [hide private]

Inherited from etree.ElementTree._ElementInterface: attrib, tag, tail, text

Method Details [hide private]

__repr__(self)
(Representation operator)

source code 
Overrides: etree.ElementTree._ElementInterface.__repr__

__getitem__(self, index)
(Indexing operator)

source code 
Overrides: etree.ElementTree._ElementInterface.__getitem__

__setitem__(self, index, value)
(Index assignment operator)

source code 
Overrides: etree.ElementTree._ElementInterface.__setitem__

__delitem__(self, index)
(Index deletion operator)

source code 
Overrides: etree.ElementTree._ElementInterface.__delitem__

leaves(self)

source code 
Returns: list
a list containing this tree's leaves.

height(self)

source code 
Returns: int
The height of this tree. The height of a tree containing no children is 1; the height of a tree containing only leaves is 2; and the height of any other tree is one plus the maximum of its children's heights.