class documentation

Unit tests for CFG.

Method __init__ Undocumented
Method run grammatical (accept) and
Instance Variable cp Undocumented
Instance Variable suite Undocumented
Instance Variable test_grammar Undocumented
Instance Variable _accept Undocumented
Instance Variable _reject Undocumented
def __init__(self, grammar, suite, accept=None, reject=None): (source)

Undocumented

def run(self, show_trees=False): (source)

Sentences in the test suite are divided into two classes:
  • grammatical (accept) and
  • ungrammatical (reject).

If a sentence should parse accordng to the grammar, the value of trees will be a non-empty list. If a sentence should be rejected according to the grammar, then the value of trees will be None.

Undocumented

Undocumented

test_grammar = (source)

Undocumented

Undocumented

Undocumented