nltk.ccg.CCGChartParser

class nltk.ccg.CCGChartParser[source]

Bases: ParserI

Chart parser for CCGs. Based largely on the ChartParser class from NLTK.

__init__(lexicon, rules, trace=0)[source]
lexicon()[source]
parse(tokens)[source]
Returns

An iterator that generates parse trees for the sentence. When possible this list is sorted from most likely to least likely.

Parameters

sent (list(str)) – The sentence to be parsed

Return type

iter(Tree)

grammar()[source]
Returns

The grammar used by this parser.

parse_all(sent, *args, **kwargs)[source]
Return type

list(Tree)

parse_one(sent, *args, **kwargs)[source]
Return type

Tree or None

parse_sents(sents, *args, **kwargs)[source]

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