Reference

Class

RiMarkov

Name

getProbability

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 arrau are 1, 2 & 3.
Syntax
getProbability(dataString);
getProbability(dataArray);
Parameters
String OR String[]the string (or sequence of strings) to search for
Returns
floatprobability from 0-1
Example
rm = new RiMarkov(3); 
rm.loadFrom("http://www.rednoise.org/rita/examples/data/wittgenstein.txt");
rm.getProbability("the");
Platform Java / Javascript