项目作者: steliossid

项目描述 :
Command line Python scripts analyzing shakespeare.txt file
高级语言: Python
项目地址: git://github.com/steliossid/text-file-analysis.git
创建时间: 2020-02-23T19:05:58Z
项目社区:https://github.com/steliossid/text-file-analysis

开源协议:

下载


text-file-analysis

Command line Python scripts analyzing shakespeare.txt file

  • text_stats.py: Module that is responsible for analyzing and getting statistical results from shakespeare.txt file about letter frequency, total number of words, number of unique words and five most common words along with the words that most commonly follow them.

If user provides a second argument, all output is written to that file.

Example: python text_stats.py shakespeare.txt <output-file>

  • generate_text.py: Module that is responsible to generate text randomly based on the successor of a given word from shakespeare.txt.

User must provide the first word of the sentence and the number of words of the sentence as arguments.

Example: python generate_text.py shakespeare.txt king 500