Reference

Class

RiMarkov

Name

generateSentences

Description Generates some # (one or more) of sentences from the model.
 
Note: multiple sentences generated by this method WILL follow the model across sentence boundaries; thus the following two calls are NOT equivalent:
 
results = markov.generateSentences(10);
// and
for (int i = 0; i < 10; i++)
results[i] = markov.generateSentence(1);
The latter will create 10 sentences with no explicit relationship between one and the next; while the former will follow probabilities from one sentence (across a boundary) to the next.
Syntax
generateSentences(num);
Parameters
intthe number of sentences
Returns
String[]the result
Example
rm = new RiMarkov(3);
rm.loadText(theText);
sentences = rm.generateSentences(10);
Platform Java / Javascript