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

type BottomUpPredictCombineRule

source code

   object --+            
            |            
   ChartRuleI --+        
                |        
AbstractChartRule --+    
                    |    
  BottomUpPredictRule --+
                        |
                       BottomUpPredictCombineRule
Known Subclasses:

A rule licensing any edge corresponding to a production whose right-hand side begins with a complete edge's left-hand side. In particular, this rule specifies that:

licenses the edge:

for each grammar production B → A β.


Note: This is like BottomUpPredictRule, but it also applies the FundamentalRule to the resulting edge.

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 AbstractChartRule: __str__, apply, apply_everywhere, apply_everywhere_iter

Class Variables [hide private]
int NUM_EDGES = 1
The number of existing edges that this rule uses to license new 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: ChartRuleI.apply_iter
(inherited documentation)