| containsChar() |
|
Returns true if the model contains the token
in any position, else false.
|
| getCompletion() |
|
Chooses a single completion (if there are more than 1)
based upon probabilistic random choices.
|
| getEndOfSequenceChar() |
|
Returns the character marking the end of an input sequence;
|
| getNFactor() |
|
Returns the current n-value for the model
|
| getProbabilities() |
|
Returns the full set of possible next tokens
(as a HashMap: String -> Float (probability))
given an array of tokens representing the path
down the tree (with length less than n).
If the input array length is not less than n,
or the path cannot be found, or the endnode
has no children, null is returned.
As the returned Map represents the full set of
possible next tokens, the sum of its probabilities
will alwyas equal 1.
|
| getProbability() |
|
Returns the probability of obtaining
a sequence of k character tokens were k <= nFactor,
e.g., if nFactor = 3, then valid lengths
for the String tokens are 1, 2 & 3.
|
| isSmoothing() |
|
Returns whether (add-1) smoothing is enabled for the model
|
| loadCharData() |
|
Load a String into the model, treating each character as separate entity
|
| loadFile() |
|
Load a text file into the model -- if using Processing, the file
should be in the sketch's data folder.
|
| printTree() |
|
Outputs a String representing the models probability tree using
the supplied print stream (or System.out).
NOTE: this method will block for potentially long periods of time
on large models.
|
| setEndOfSequenceChar() |
|
Sets the character to mark the end of an input sequence.
To parse each word token separately, for example, set this
to {@link Character} a space - default is Character.EOF.
|
| setUseSmoothing() |
|
Toggles whether (add-1) smoothing is enabled for the model
|