Package parser_course :: Package small_parsers :: Module very_simple_cky_parser :: Class cnf_grammar
[hide private]
[frames] | no frames]

Class cnf_grammar

source code

           object --+    
                    |    
small_grammar.Grammar --+
                        |
                       cnf_grammar

Initialized with an arbitrary context-free grammar, this turns the grammar into a cnf grammar and computes a bottum up grammar suitable for efficient use with a CKY parser.

Instance Methods [hide private]
 
__init__(self, base_grammar)
base grammar is a non cnf grammar instance that will be used to create the cnf grammar.
source code
 
compute_bottum_up_grammar(self) source code
 
find_BURules(self, cat) source code

Inherited from small_grammar.Grammar: compute_nonterminals, compute_preterminals, display, get_parts_of_speech

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, base_grammar)
(Constructor)

source code 

base grammar is a non cnf grammar instance that will be used to create the cnf grammar.

Overrides: object.__init__