'For each word in WordNet that is not in Brill\'s lexicon,
test if the given tagger((word, "NN")) yields an improved (word, tag).
Returns the relative scores for nouns, verbs, adjectives and adverbs.'

def _test_morphological_rules(self, function=en.parser.morphology.apply):

    scores = []
    for (tag, lexicon) in (('NN', en.wordnet.NOUNS), ('VB', en.wordnet.VERBS), ('JJ', en.wordnet.ADJECTIVES), ('RB', en.wordnet.ADVERBS)):
        (i, n) = (0, 0)
        for word in lexicon:
            word = word.form
            if (word not in en.lexicon):
                if function([word, 'NN'])[1].startswith(tag):
                    i += 1
                n += 1
        scores.append((float(i) / n))
    return scores
