Markov3 digests Usenet articles and builds an internal data structure that models the articles as if they came from a random process, where each word is determined by the previous two. It then emits a series of articles on the standard output that have the same distribution of words, word pairs, and word triplets as do the input files. The name markov3 comes from the fact that this structure is called a Markov chain, and that the statistics for word triplets are modeled. Here, a "word" is a sequence of printable characters surrounded by whitespace. Paragraph breaks (blank lines) are also treated as a "word". Paragraphs of included text are treated as single "words" and printed as "> ...".
By default, the program expects to be fed Usenet articles; it strips off headers, included text, and signatures (or at least it tries). The -p (plain) option disables the header-stripping feature (otherwise everything is skipped until a blank line is encountered).
By default, 10 articles, separated by form feeds, are written on the standard output. The -n option lets you specify a different number.
The -x option does not seed the random number generator; this is useful for simulating people who repeat themselves.
The -d (dump) option dumps a representation of the internal data structure built by markov3 on the named file.
Finally, the -v (verbose) option prints some statistics on the standard error.
Posting articles generated by markov3 to the net may be hazardous to your health.
Not as smart as Mark V. Shaney.
If you don't have lex, you'll need to rewrite the lexical analyzer but most of the program is in C.