Package nltk :: Package parse :: Module chart :: Class CachedTopDownExpandRule
[hide private]
[frames] | no frames]

Class CachedTopDownExpandRule

source code

       object --+        
                |        
AbstractChartRule --+    
                    |    
    TopDownExpandRule --+
                        |
                       CachedTopDownExpandRule
Known Subclasses:

A cached version of TopDownExpandRule. After the first time this rule is applied to an edge with a given end and next, it will not generate any more edges for edges with that end and next.

If chart or grammar are changed, then the cache is flushed.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
apply_iter(self, chart, grammar, edge) source code
 
__str__(self)
str(x)
source code

Inherited from AbstractChartRule: apply, apply_everywhere, apply_everywhere_iter

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

Class Variables [hide private]

Inherited from TopDownExpandRule: NUM_EDGES

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

apply_iter(self, chart, grammar, edge)

source code 
Overrides: TopDownExpandRule.apply_iter

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: AbstractChartRule.__str__