nltk.ccg.CCGLeafEdge¶
- class nltk.ccg.CCGLeafEdge[source]¶
Bases:
EdgeI
Class representing leaf edges in a CCG derivation.
- lhs()[source]¶
Return this edge’s left-hand side, which specifies what kind of structure is hypothesized by this edge.
- See
TreeEdge
andLeafEdge
for a description of the left-hand side values for each edge type.
- span()[source]¶
Return a tuple
(s, e)
, wheretokens[s:e]
is the portion of the sentence that is consistent with this edge’s structure.- Return type
tuple(int, int)
- rhs()[source]¶
Return this edge’s right-hand side, which specifies the content of the structure hypothesized by this edge.
- See
TreeEdge
andLeafEdge
for a description of the right-hand side values for each edge type.
- dot()[source]¶
Return this edge’s dot position, which indicates how much of the hypothesized structure is consistent with the sentence. In particular,
self.rhs[:dot]
is consistent withtokens[self.start():self.end()]
.- Return type
int
- is_complete()[source]¶
Return True if this edge’s structure is fully consistent with the text.
- Return type
bool
- is_incomplete()[source]¶
Return True if this edge’s structure is partially consistent with the text.
- Return type
bool
- nextsym()[source]¶
Return the element of this edge’s right-hand side that immediately follows its dot.
- Return type
Nonterminal or terminal or None