nltk.TestGrammar.run

TestGrammar.run(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.