class documentation

class DependencyGrammar(object): (source)

Constructor: DependencyGrammar(productions)

View In Hierarchy

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
@classmethod
def fromstring(cls, input): (source)

Undocumented

def __contains__(self, head, mod): (source)

Return True if this DependencyGrammar contains a DependencyProduction mapping 'head' to 'mod'.

Parameters
head:strA head word.
mod:strA mod word, to test as a modifier of 'head'.
Returns
boolUndocumented
def __init__(self, productions): (source)

Create a new dependency grammar, from the set of Productions.

Parameters
productions:list(Production)The list of productions that defines the grammar
def __repr__(self): (source)

Return a concise string representation of the DependencyGrammar

def __str__(self): (source)

Return a verbose string representation of the DependencyGrammar

Returns
strUndocumented
def contains(self, head, mod): (source)
Parameters
head:strA head word.
mod:strA mod word, to test as a modifier of 'head'.
Returns
booltrue if this DependencyGrammar contains a DependencyProduction mapping 'head' to 'mod'.
_productions = (source)

Undocumented