Package nltk :: Package parse :: Module pchart :: Class UnsortedChartParser
[hide private]
[frames] | no frames]

type UnsortedChartParser

source code

                  object --+        
                           |        
                 api.ParserI --+    
                               |    
BottomUpProbabilisticChartParser --+
                                   |
                                  UnsortedChartParser

A bottom-up parser for PCFGs that tries edges in whatever order.

Instance Methods [hide private]
None
sort_queue(self, queue, chart)
Sort the given queue of Edges, placing the edge that should be tried first at the beginning of the queue.
source code

Inherited from BottomUpProbabilisticChartParser: __init__, grammar, nbest_parse, trace

Inherited from BottomUpProbabilisticChartParser (private): _prune, _setprob

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

    Deprecated

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

Instance Variables [hide private]

Inherited from BottomUpProbabilisticChartParser (private): _grammar, _trace

Method Details [hide private]

sort_queue(self, queue, chart)

source code 

Sort the given queue of Edges, placing the edge that should be tried first at the beginning of the queue. This method will be called after each Edge is added to the queue.

Parameters:
  • queue - The queue of Edges to sort. Each edge in this queue is an edge that could be added to the chart by the fundamental rule; but that has not yet been added.
  • chart - The chart being used to parse the text. This chart can be used to provide extra information for sorting the queue.
Returns: None
Overrides: BottomUpProbabilisticChartParser.sort_queue
(inherited documentation)