The directory markovchain contains an order-2 Markov chain algorithm to produce blocks of pseudotext given a sizable input. I tested it using Pride and Prejudice by Jane Austen.
The directory markovcluster contains the Markov clustering algorithm, sample input matrix, and expected output.