Package nltk :: Package ccg :: Module chart :: Class BinaryCombinatorRule
[hide private]
[frames] | no frames]

type BinaryCombinatorRule

source code

               object --+        
                        |        
   parse.chart.ChartRuleI --+    
                            |    
parse.chart.AbstractChartRule --+
                                |
                               BinaryCombinatorRule

Class implementing application of a binary combinator to a chart. Takes the directed combinator to apply.

Instance Methods [hide private]
 
__init__(self, combinator) source code
iter of EdgeI
apply_iter(self, chart, grammar, left_edge, right_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
 
__str__(self) source code

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

Class Variables [hide private]
  NUMEDGES = 2

Inherited from parse.chart.ChartRuleI: NUM_EDGES

Method Details [hide private]

__init__(self, combinator)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

apply_iter(self, chart, grammar, left_edge, right_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: parse.chart.ChartRuleI.apply_iter
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
Overrides: parse.chart.AbstractChartRule.__str__