Package nltk :: Package ccg :: Module chart :: Class CCGChartParser
[hide private]
[frames] | no frames]

type CCGChartParser

source code

       object --+    
                |    
parse.api.ParserI --+
                    |
                   CCGChartParser

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

Instance Methods [hide private]
 
__init__(self, lexicon, rules, trace=0) source code
 
lexicon(self) source code
list of Tree
nbest_parse(self, tokens, n=None)
Returns: A list of parse trees that represent possible structures for the given sentence.
source code

Inherited from parse.api.ParserI: batch_iter_parse, batch_nbest_parse, batch_parse, batch_prob_parse, grammar, iter_parse, parse, prob_parse

    Deprecated

Inherited from parse.api.ParserI: batch_test, get_parse, get_parse_dict, get_parse_list, get_parse_prob

Method Details [hide private]

__init__(self, lexicon, rules, trace=0)
(Constructor)

source code 
Overrides: object.__init__
(inherited documentation)

nbest_parse(self, tokens, n=None)

source code 
Parameters:
  • sent - The sentence to be parsed
  • n - The maximum number of trees to return.
Returns: list of Tree
A list of parse trees that represent possible structures for the given sentence. When possible, this list is sorted from most likely to least likely. If n is specified, then the returned list will contain at most n parse trees.
Overrides: parse.api.ParserI.nbest_parse
(inherited documentation)