- class nltk.parse.api.ParserI¶
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:
- Subclasses may define:
The grammar used by this parser.
- parse(sent, *args, **kwargs)¶
An iterator that generates parse trees for the sentence. When possible this list is sorted from most likely to least likely.
sent (list(str)) – The sentence to be parsed
- Return type
- parse_sents(sents, *args, **kwargs)¶
self.parse()to each element of
sents. :rtype: iter(iter(Tree))