'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.'

def run(self, show_trees=False):

    for test in self.suite:
        print((test['doc'] + ':'), end='    ')
        for key in ['accept', 'reject']:
            for sent in test[key]:
                tokens = sent.split()
                trees = list(self.cp.parse(tokens))
                if (show_trees and trees):
                    print()
                    print(sent)
                    for tree in trees:
                        print(tree)
                if (key == 'accept'):
                    if (trees == []):
                        raise ValueError(("Sentence    '%s'    failed    to    parse'" % sent))
                    else:
                        accepted = True
                elif trees:
                    raise ValueError(("Sentence    '%s'    received    a    parse'" % sent))
                else:
                    rejected = True
        if (accepted and rejected):
            print('All    tests    passed!')
