RiMarkov

Description

Performs text generation via Markov chains (aka n-grams) with options to process single characters, words, sentences, and arbitrary regular expressions.

Provides a variety of methods specifically designed for text-generation.

Examples
rm = new RiMarkov(3);

rm.loadText(theText);

sentences = rm.generateSentences(10);

for (int i = 0; i < sentences.length; i++) {
	println(sentences[i]);
}
Syntax
// Constructs a sentence-generating Markov-chain and set its n-factor.

RiMarkov(int nFactor)


// Also sets a flag determining whether the model will attempt to recognize
// and parse (English) sentences (default=true)

RiMarkov(int nFactor, boolean recognizeSentences)


// Also sets a flag to allow duplicates in the generated output (default=true)

RiMarkov(int nFactor, boolean recognizeSentences, boolean allowDuplicates)

Parameters
  int nFactor
  boolean recognizeSentences
  boolean allowDuplicates
Platform Java / Javascript