__init__(self,
span,
lhs,
rhs,
dot=0,
bindings=None)
(Constructor)
| source code
|
Construct a new edge. If the edge is incomplete (i.e., if
dot<len(rhs) ), then store the bindings as-is. If the
edge is complete (i.e., if dot==len(rhs) ), then apply the
bindings to all nonterminals in lhs and rhs ,
and then clear the bindings. See TreeEdge for
a description of the other arguments.
- Parameters:
span - A tuple (s,e) , where subtokens[s:e] is
the portion of the sentence that is consistent with the new
edge's structure.
lhs - The new edge's left-hand side, specifying the hypothesized tree's
node value.
rhs - The new edge's right-hand side, specifying the hypothesized
tree's children.
dot - The position of the new edge's dot. This position specifies what
prefix of the production's right hand side is consistent with the
text. In particular, if sentence is the list of
subtokens in the sentence, then
subtokens[span[0]:span[1]] can be spanned by the
children specified by rhs[:dot] .
- Overrides:
chart.TreeEdge.__init__
|