ctext
index
 
Name loadFile ( )
Examples
// Create a markov model with N = 3
PMarkov markov = new PMarkov(this, 3);  

// Load file <data-dir>/in1.txt into the model 
markov.loadFile("in1.txt");

// Load in2.txt tripling its probabilities 
markov.loadFile("in2.txt", 3);
Description Load a text file (of sentences) into the model -- if using Processing, the file should be in the sketch's data folder.
Syntax
loadFile(fileName, multiplier);
loadFile(fileName);
Parameters
fileName   - name of file to load
multiplier   - weighting for words in the file; a weight of 3 is equivalent to loading that file 3 times and gives each word 3x the probability of being chosen on a call to generate().
Returns None
Usage Web & Application
Related