Package jazzparser :: Package formalisms :: Package base :: Module modalities :: Class ModalityTree
[hide private]
[frames] | no frames]

Class ModalityTree

source code

object --+
         |
        ModalityTree

The tree is a DAG which defines a hierarchy of categories. If a node Y is reachable from X, X generalizes Y. Modality Y can therefore be used anywhere where an X modality is required, since Y is a specialized type of X.

Instance Methods [hide private]
 
__init__(self, root_nodes=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
contains(self, modality) source code
 
__str__(self)
str(x)
source code
 
accepts(self, modality_general, modality_specific)
Returns true if, under the modality hierarchy represented by the tree, modality_specific can be accepted where a modality_general is required.
source code
 
find(self, modality)
Returns a list of all the nodes in this tree or subtrees with the given modality.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
 
from_dom(xml)
Builds a modality tree from its DOM XML representation.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, root_nodes=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

accepts(self, modality_general, modality_specific)

source code 

Returns true if, under the modality hierarchy represented by the tree, modality_specific can be accepted where a modality_general is required. Equivalently, checks whether modality_specific is a specialization of modality_general (including equality).