information at http://users.cs.dal.ca/~vlado/srcperl/Ngrams/Ngrams.html
-
download and save the source code.
-
$ make
-
$ ngrams --type=word --n=3 --in= sample.txt
or
$ ngrams --type=character -n=3 --in= sample.txt
or
Byte ngrams, e.g., getting ngrams from binary file.
$ ngrams --type=byte -n=3 --in= sample.txt
That's it.
If you found any bug or have any suggestion, please kindly send me email jerryy@gmail.com. Thanks.
Zheyuan Yu. Feb 18,2006