
This is a simple Markov babbler written by David Wu. Given a piece of text as input, it pseudorandomly outputs a piece of text, generated by probabilistically choosing words based on frequency and patterns with which they occur in the input.

Simply run Markov.jar, and choose the desired text file. You will be asked to specify the order of the Markov chain and the length of the output. The output should appear in the same directory, with the name "xxx.out.txt", where "xxx.txt" is the name of the input file chosen.

The Markov order is the number of words that the program considers at each step in order to randomly generate the next word. This is usually best set between 1-4. Setting the order lower will produce more random and uncorrelated output, while setting it higher will cause the output to be more orderly and coherent. At particularly high values, depending on the length of the input, it is likely that the output may simply be the input text, repeated verbatim.

The length of the output is the number of words the program should output before stopping. 

Typically, the longer the input text, the more interesting the results. Things such as the US Declaration of Independence, or pseudoscientific essays, or political rants work quite well and can give quite amusing results.

Enjoy!