def demo():
    '''Demonstration of the module.'''
    # Some words with their real lemmas
    lemmas = {'kneel': ['kneel', 'knelt'],
              'range': ['range', 'ranged'],
              'ring': ['ring', 'rang', 'rung']
              }
    # Same words with stems from a stemming algorithm
    stems = {'kneel': ['kneel'],
             'knelt': ['knelt'],
             'rang': ['rang', 'range', 'ranged'],
             'ring': ['ring'],
             'rung': ['rung']
             }
    print('Words grouped by their lemmas:')
    for lemma in sorted(lemmas):
        print('%s => %s' % (lemma, ' '.join(lemmas[lemma])))
    print()
    print('Same words grouped by a stemming algorithm:')
    for stem in sorted(stems):
        print('%s => %s' % (stem, ' '.join(stems[stem])))
    print()
    p = Paice(lemmas, stems)
    print(p)
    print()
    # Let's "change" results from a stemming algorithm
    stems = {'kneel': ['kneel'],
             'knelt': ['knelt'],
             'rang': ['rang'],
             'range': ['range', 'ranged'],
             'ring': ['ring'],
             'rung': ['rung']
             }
    print('Counting stats after changing stemming results:')
    for stem in sorted(stems):
        print((stem, ' '.join(stems[stem])) % '%s => %s')
    print()
    p.stems = stems
    p.update()
    print(p)
dataset/ETHPy150Open nltk/nltk/nltk/metrics/paice.py/demo/swapped operands of `%`