Программа рассчитывает частоту повторения слов в тексте и выдает 10 самых часто повторяющихся слов.
Для работы скрипта требуется интерпретатор Python 3.5.
Пример запуска программы в Linux:
$ python3 lang_frequency.py <path to file>
Word 'и' repeated in the text 71 times
Word 'в' repeated in the text 65 times
Word 'я' repeated in the text 45 times
Word 'не' repeated in the text 45 times
Word 'он' repeated in the text 44 times
Word 'что' repeated in the text 38 times
Word 'на' repeated in the text 34 times
Word 'его' repeated in the text 30 times
Word 'красавчик' repeated in the text 28 times
Word 'а' repeated in the text 25 times
Запуск на Windows происходит аналогичным образом.
Код создан в учебных целях. В рамках учебного курса по веб-разработке - DEVMAN.org