class documentation

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

Method sort_queue Sort the given queue of Edge objects, 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.

Inherited from BottomUpProbabilisticChartParser:

Method __init__ Create a new BottomUpProbabilisticChartParser, that uses grammar to parse texts.
Method grammar No summary
Method parse When possible this list is sorted from most likely to least likely.
Method trace Set the level of tracing output that should be generated when parsing a text.
Instance Variable beam_size Undocumented
Method _prune Discard items in the queue if the queue is longer than the beam.
Method _setprob Undocumented
Instance Variable _grammar The grammar used to parse sentences.
Instance Variable _trace The level of tracing output that should be generated when parsing a text.

Inherited from ParserI (via BottomUpProbabilisticChartParser):

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 sort_queue(self, queue, chart): (source) ΒΆ

Sort the given queue of Edge objects, 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:list(Edge)The queue of Edge objects 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:ChartThe chart being used to parse the text. This chart can be used to provide extra information for sorting the queue.
Returns
NoneUndocumented