Reference

Class

RiMarkov

Name

probability

Description Returns either the raw (unigram) probability for a single token in the model (0 if it does not exist)
 
OR
 
(for an array) the probability of obtaining a sequence of k tokens where k <= nFactor ,
e.g., if nFactor = 3, then valid lengths for the data array are 1, 2 & 3.
Example
rm = new RiMarkov(3); 
rm.text(theText);
rm.probability("the");
Parameters
String OR String[]the string (or sequence) to search for
Returns
float(when parameter is an array)
double(when parameter is a String object)
probability from 0-1
Syntax
probability(dataString);
probability(dataArray);
Platform Java / JavaScript