This program count the frequency of all words contained into a text . This program can print each word and its frequency of occurrence. This program can return the three most frequent words
- prog.py : program file
- test_prog.py : program of unit test
- test_text.txt : text sample for testing
- TheProjectGutenbergeBookofFrankenstein.txt : text use for the test
-
Clone the repositorie
https://github.com/horlas/test_python.git
-
This program run with python 3 , so you should check your python version:
python3 --version
- To install python3 last version:
sudo apt update
sudo apt install python3.9
-
In the dowload folder open a shell
-
Command line to run test
python3 test_prog.py
- Command line to run the program
python3 prog.py TheProjectGutenbergeBookofFrankenstein.txt
-
You can use the program with any text by pasting it into the program folder and passing the name of the text as an argument at the end of command line.
-
Depending on the size of the text the order can take more or less time, don't worry.