class documentation
class BinaryCombinatorRule(AbstractChartRule): (source)
Constructor: BinaryCombinatorRule(combinator)
Class implementing application of a binary combinator to a chart. Takes the directed combinator to apply.
Method | __init__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | apply |
Return 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. |
Constant | NUMEDGES |
Undocumented |
Instance Variable | _combinator |
Undocumented |
Inherited from AbstractChartRule
:
Method | apply |
Return a generator that will add all edges licensed by this rule, given the edges that are currently in 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. |
Inherited from ChartRuleI
(via AbstractChartRule
):
Class Variable | NUM |
The number of existing edges that this rule uses to license new edges. Typically, this number ranges from zero to two. |
overrides
nltk.parse.chart.AbstractChartRule.apply
Return 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.
Parameters | |
chart | Undocumented |
grammar | Undocumented |
left | Undocumented |
right | Undocumented |
*edges:list(EdgeI) | 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(EdgeI) | Undocumented |