Package jazzparser :: Package data :: Class DerivationTrace
[hide private]
[frames] | no frames]

Class DerivationTrace

source code

object --+
         |
        DerivationTrace

Stores a trace of the derivation of a particular CCGCategory node and is associated with that category. For parse results, these structures will often be so large that there's no hope of being able to print the thing (even recursing to count the size can be prohibitively slow!).

Instance Methods [hide private]
 
__init__(self, result, rule=None, args=[], word=None)
rule and args may be specified to give the derivation node an initial pointer to a rule that was applied and a list of the arguments for that rule.
source code
 
add_rule(self, rule, args=[])
Add a rule application to the derivation node (that resulted in the same category as other rule applications stored here).
source code
 
add_rules_from_trace(self, other_trace) source code
 
__str__(self)
str(x)
source code
 
str_indent(self, indent='', signfmt=<type 'str'>) source code
 
get_size(self) source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, result, rule=None, args=[], word=None)
(Constructor)

source code 

rule and args may be specified to give the derivation node an initial pointer to a rule that was applied and a list of the arguments for that rule. Add more rules using add_rule().

All rule applications stored should have resulted in result.

Overrides: object.__init__

add_rule(self, rule, args=[])

source code 

Add a rule application to the derivation node (that resulted in the same category as other rule applications stored here). The rule is a pointer to the rule object that was applied. The args is a list of the arguments to which the rule was applied.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)