This is an old project that is pretty much just a Markov chain generator. I spent a while on it before I knew anything about Big O, then came back to it and made it a few orders of magnitude faster once I understood efficiency.
Put your source text in a file in this directory, then run python WordCounter2.py
to generate the model. To generate some random text, run python SentanceGenerator.py <model name>
.