These programs will count words in a given text, plot a bar chart of the 10 most common words, and test Zipf's law on the two most common words.
- Simplified version of a full word-count example project.
- Inspired by and derived from https://hpc-carpentry.github.io/hpc-python/ which is distributed under Creative Commons Attribution license (CC-BY 4.0).
Four texts are provided in the data/ directory:
$ ls data/
LICENSE_TEXTS.md abyss.txt isles.txt last.txt sierra.txtTo calculate the word frequency distribution of a given text file:
$ python source/wordcount.py data/abyss.txt output.dat