nltk.grammar.DependencyGrammar¶
- class nltk.grammar.DependencyGrammar[source]¶
Bases:
object
A dependency grammar. A DependencyGrammar consists of a set of productions. Each production specifies a head/modifier relationship between a pair of words.
- __init__(productions)[source]¶
Create a new dependency grammar, from the set of
Productions
.- Parameters
productions (list(Production)) – The list of productions that defines the grammar