type FeatureFundamentalRule
source code
object --+
|
chart.ChartRuleI --+
|
chart.AbstractChartRule --+
|
chart.FundamentalRule --+
|
FeatureFundamentalRule
A specialized version of the fundamental rule that operates on
nonterminals whose symbols are FeatStructNonterminals.
Rather tha simply comparing the nonterminals for equality, they are
unified. Variable bindings from these unifications are collected and
stored in the chart using a FeatureTreeEdge. When a complete edge is generated,
these bindings are applied to all nonterminals in the edge.
The fundamental rule states that:
-
[A → α * B1 β][i:j]
-
[B2 → γ *][j:k]
licenses the edge:
assuming that B1 and B2 can be unified to generate B3.
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:
chart.ChartRuleI.apply_iter
- (inherited documentation)
|