def display_top_words(wa, max_display):
    cp = 0
    counts = Counter(wa.words_list(wa.normalized_text))
    sorted_occurences = sorted(counts.items(), key=operator.itemgetter(1), reverse=True)
    print('Top 10 recurring words:\n')
    print('{0:<30}{1:<30}{2:<30}'.format('# Ref', 'Occurrence', 'Perc'))
    for occurence in sorted_occurences:
        cp += 1
        if (cp <= max_display):
            print('{0:<30}{1:<30}{2:.2f} %'.format(occurence[0], occurence[1], ((occurence[1] * 100) / len(wa.words_list(wa.normalized_text)))))
        else:
            break
def display_top_words(wa, max_display):
    cp = 0
    counts = Counter(wa.words_list(wa.normalized_text))
    sorted_occurences = sorted(counts.items(), key=operator.itemgetter(1), reverse=True)
    print('Top 10 recurring words:\n')
    print('{0:<30}{1:<30}{2:<30}'.format('# Ref', 'Occurrence', 'Perc'))
    for occurence in sorted_occurences:
        cp += 1
        if (cp <= max_display):
            print('{0:<30}{1:<30}{2:.2f} %'.format(occurence[0], occurence[1], ((occurence[1] * 100) / len(wa.words_list(wa.normalized_text)))))
        else:
            break