A script to generate H for a research class
ruby gen_h.rb -g alphabet.txt, -f freqs.txt
Flag: -g, --alphabet
Expected format is a list of words, one per line, all unique, with sufficient range so as to be allow users to type all possible words (thereby requiring all english characters and the space character)
Example:
a
b
c
...
the
ation
st
Flag: -f, --frequencies
Expected format is a list of words, space separated from their frequency counts, one per line, in descending order.
Example:
THE 12345677
HELLO 134567
EXAMPLE 123342
Recommended file: http://norvig.com/google-books-common-words.txt
Flag: -o, --output
The file to write the result to
Flag: -n, --words-to-parse
The number of words to parse from the frequency file. Defaults to 10000