class documentation

A processing class for deriving trees that represent possible structures for a sequence of tokens. These tree structures are known as "parses". Typically, parsers are used to derive syntax trees for sentences. But parsers can also be used to derive other kinds of tree structure, such as morphological trees and discourse structures.

Subclasses must define:
  • at least one of: parse(), parse_sents().
Subclasses may define:
  • grammar()
Method grammar No summary
Method parse When possible this list is sorted from most likely to least likely.
Method parse_all No summary
Method parse_one No summary
Method parse_sents Apply self.parse() to each element of sents. :rtype: iter(iter(Tree))
def parse(self, sent, *args, **kwargs): (source)

When possible this list is sorted from most likely to least likely.

Parameters
sent:list(str)The sentence to be parsed
*argsUndocumented
**kwargsUndocumented
Returns
iter(Tree)An iterator that generates parse trees for the sentence.
def parse_all(self, sent, *args, **kwargs): (source)
Returns
list(Tree)Undocumented
def parse_one(self, sent, *args, **kwargs): (source)
Returns
Tree or NoneUndocumented
def parse_sents(self, sents, *args, **kwargs): (source)

Apply self.parse() to each element of sents. :rtype: iter(iter(Tree))