class SingleEdgeFundamentalRule(FundamentalRule): (source)
Known subclasses: nltk.app.chartparser_app.FundamentalEdgeRule, nltk.parse.chart.FilteredSingleEdgeFundamentalRule, nltk.parse.earleychart.CompleteFundamentalRule, nltk.parse.featurechart.FeatureSingleEdgeFundamentalRule
A rule that joins a given edge with adjacent edges in the chart, to form combined edges. In particular, this rule specifies that either of the edges:
- [A -> alpha \* B beta][i:j]
- [B -> gamma \*][j:k]
licenses the edge:
- [A -> alpha B * beta][i:j]
if the other edge is already in the chart.
| Note | |
| This is basically FundamentalRule, with one edge left unspecified. |
| 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 | NUM |
Undocumented |
| Method | _apply |
Undocumented |
| Method | _apply |
Undocumented |
Inherited from AbstractChartRule (via FundamentalRule):
| Method | __str__ |
Undocumented |
| 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. |
nltk.parse.chart.FundamentalRule.applynltk.parse.earleychart.CompleterRule, nltk.parse.earleychart.FilteredCompleteFundamentalRule, nltk.parse.earleychart.ScannerRuleReturn 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 |
| edge | 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 |
nltk.parse.chart.FilteredSingleEdgeFundamentalRule, nltk.parse.featurechart.FeatureSingleEdgeFundamentalRuleUndocumented