Package nltk_lite :: Package parse :: Module pchart :: Class RandomParse
[hide private]
[frames] | no frames]

Class RandomParse

source code

object --+            
         |            
    ParseI --+        
             |        
 AbstractParse --+    
                 |    
BottomUpChartParse --+
                     |
                    RandomParse

A bottom-up parser for PCFGs that tries edges in random order. This sorting order results in a random search strategy.

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 BottomUpChartParse: __init__, get_parse_list, trace

Inherited from BottomUpChartParse (private): _prune, _setprob

Inherited from AbstractParse: get_parse, grammar, parse

Inherited from ParseI: get_parse_dict, get_parse_probs

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]

Inherited from BottomUpChartParse (private): _grammar, _trace

Properties [hide private]

Inherited from object: __class__

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.

Returns: None
Overrides: BottomUpChartParse.sort_queue
(inherited documentation)