This is software written in C++ that can
Download
The software is free, no warranty applies. Use at your own risk. Yada-yada...
It is no doubt quite buggy and poorly documented. Check back later or email the author for more information. The paper: Bi-grams Generated from Phoenix Grammars and Sparse Data for the Universal Speech Interface (the program now works for any n although it might take a millennia to finish) and a Powerpoint presentation will provide some background.