Word Counter
Count the frequency of letters or words in a text file and show a graph.
Requirements
- Python 3.9 or higher
matplotlib
Usage
Download the source code and unzip the downloaded file. Run pip install -r requirements.txt
in the source code directory to install the required packages. Create a text file in the same directory as main.py
named input.txt
and fill it with text you want to analyze. Run the script in an IDE of your choice or with python main.py
.
Objective
Given a text file, count the frequency (number of occurrences) of either letters or words, and show a bar graph to visualize the results. Do not include whitespace or punctuation in the results, with the exception of apostrophes that are inside words.
Next Steps
- Add command line arguments for input file path and other options
- Add timers for significant steps to diagnose performance
- Optimize speed and memory usage
- Anything else you can think of to improve the script