Package nltk :: Package parse :: Module featurechart :: Class FeatureTopDownPredictRule
[hide private]
[frames] | no frames]

type FeatureTopDownPredictRule

source code

         object --+                
                  |                
   chart.ChartRuleI --+            
                      |            
chart.AbstractChartRule --+        
                          |        
   chart.TopDownPredictRule --+    
                              |    
 chart.CachedTopDownPredictRule --+
                                  |
                                 FeatureTopDownPredictRule
Known Subclasses:

A specialized version of the (cached) top down predict rule that operates on nonterminals whose symbols are FeatStructNonterminals. Rather than simply comparing the nonterminals for equality, they are unified.

The top down expand rule states that:

licenses the edge:

for each grammar production B2 → γ, assuming that B1 and B2 can be unified.

Instance Methods [hide private]
iter of EdgeI
apply_iter(self, chart, grammar, edge)
Returns: A generator that will add edges licensed by this rule and the given edges to the chart, one at a time.
source code

Inherited from chart.CachedTopDownPredictRule: __init__

Inherited from chart.AbstractChartRule: __str__, apply, apply_everywhere, apply_everywhere_iter

Class Variables [hide private]

Inherited from chart.TopDownPredictRule: NUM_EDGES

Method Details [hide private]

apply_iter(self, chart, grammar, edge)

source code 
Parameters:
  • edges - A set of existing edges. The number of edges that should be passed to apply is specified by the NUM_EDGES class variable.
Returns: iter of EdgeI
A generator that will add edges licensed by this rule and the given edges to the chart, one at a time. Each time the generator is resumed, it will either add a new edge and yield that edge; or return.
Overrides: chart.ChartRuleI.apply_iter
(inherited documentation)