Vokram is:

a toy Markov chain library that is most likely implemented incorrectly and extremely inefficiently.

It can be used as library:

>>> import vokram
>>> corpus = open('the_art_of_war.txt')
>>> model = vokram.build_word_model(corpus, 2)
>>> vokram.markov_words(model, 25))
'Hence it is not supreme excellence; supreme excellence consists in breaking the enemy's few.'

Or via command-line:

$ cat the_art_of_war.txt | vokram
Spies cannot be obtained inductively from experience, nor by any danger.
$ vokram -h
usage: vokram [-h] [-w NUM_WORDS] [-n NGRAM_SIZE]

Generates plausible new sentences from a corpus provided on STDIN.

optional arguments:
  -h, --help            show this help message and exit
  -w NUM_WORDS, --num-words NUM_WORDS
                        Maximum number of words in the resulting sentence.
  -n NGRAM_SIZE, --ngram-size NGRAM_SIZE

Here is an example using some That’s What She Said jokes I found on GitHub:

$ </tmp/Positive_Prompts_TS.txt bin/vokram

Warning

The following exampe outputs are kind of 18+, this Markov chain somehow seems to make it very racy. You have been warned.

Okay you just slide it in my mouth. its not usually that quick. I’m not wearing protection!! Oh look it finally came up!

A few more, so this wouldn’t end so quick (that’s what she said):

Lean forward slightly and touch back down. Kaitlyn, what hole should I spit this? I can’t get it back up. wow! its amazing how fast it exploded! It’s so big!

just put it in the back, so you don’t have anywhere else to put that in all the way in, it feels really good so it still won’t penetrate!

omg I’m so hungry, I’d put anything in there it’s too big, I could blow better than him.

So thick, and so juicy. There is one more time I’m gonna ride it out. Harder, faster, keep going! I don’t like the short fat ones!

well don’t put it in the right one. I love it when it hits me in already! I could do 15, but I’d prefer 17- It’ll make everything faster.

Vokram is written by Will McCutchen under the MIT License, currently version 1.0.0 (2014-05-04), for Python 2 only.