Word frequency bar chart generator.
$ lua wfreq.lua --file hamlet.txt -m 20 -- --title "Words" --rotation 45 --label -x "Words" -y "Quantity"
$ lua wfreq.lua -f 1984.txt -m 15 -- --title 'Words' --rotation -45 --label -x "Words" -y "Quantity"
$ lua wfreq.lua --help
Usage: wfreq [-h] [--max NUM] --file FILE [--version] [<pygram>] ...
Linkage script beetween Lab_4.4 and Pygram.
Arguments:
pygram
Options:
-h, --help Show this help message and exit.
--max NUM, Max word count returned from Lab 4.4. Also the max bars
-m NUM to be shown in Pygram.
--file FILE, Input text file.
-f FILE
--version, -v Print version and exit.
Typical format:
$ wfreq <wfreq.lua options> [-- <pygram.py options>]
Where:
<wfreq.lua options> Are shown above.
<pygram.py options> You can check them with
$ python3 Pygram/pygram.py --help
Example usage:
$ lua wfreq.lua -f hamlet.txt -m 20 -- --title Words --rotation 90
--label -x "Words" -y "Quantity"
- Clone the repo with
git
$ git clone --recurse-submodules https://github.com/Dolfost/wfreq
- Build the lab4.4 with
build.sh
$ cd Lab_4.4 $ chmod +x build.sh $ ./build.sh $ cd ..
- Install
Lua v5.3
and higher$ brew install lua
- Install
luarocks
$ brew install luarocks
- Install Lua dependencies
$ luarocks install argparse
- Install
python v3.0
and higher$ brew install python3
- Install python dependencies
$ pip install -U matplotlib
- Ejoy!
Note that you might want to use different pakage manager than homebrew
.