class documentation
class DependencyGrammar(object): (source)
Constructor: DependencyGrammar(productions)
A dependency grammar. A DependencyGrammar consists of a set of productions. Each production specifies a head/modifier relationship between a pair of words.
Class Method | fromstring |
Undocumented |
Method | __contains__ |
Return True if this DependencyGrammar contains a DependencyProduction mapping 'head' to 'mod'. |
Method | __init__ |
Create a new dependency grammar, from the set of Productions. |
Method | __repr__ |
Return a concise string representation of the DependencyGrammar |
Method | __str__ |
Return a verbose string representation of the DependencyGrammar |
Method | contains |
No summary |
Instance Variable | _productions |
Undocumented |
Return True if this DependencyGrammar contains a DependencyProduction mapping 'head' to 'mod'.
Parameters | |
head:str | A head word. |
mod:str | A mod word, to test as a modifier of 'head'. |
Returns | |
bool | Undocumented |
Create a new dependency grammar, from the set of Productions.
Parameters | |
productions:list(Production) | The list of productions that defines the grammar |