nltk.grammar.DependencyProduction¶
- class nltk.grammar.DependencyProduction[source]¶
Bases:
Production
A dependency grammar production. Each production maps a single head word to an unordered list of one or more modifier words.
- __init__(lhs, rhs)[source]¶
Construct a new
Production
.- Parameters
lhs (Nonterminal) – The left-hand side of the new
Production
.rhs (sequence(Nonterminal and terminal)) – The right-hand side of the new
Production
.
- is_lexical()[source]¶
Return True if the right-hand contain at least one terminal token.
- Return type
bool
- is_nonlexical()[source]¶
Return True if the right-hand side only contains
Nonterminals
- Return type
bool