Description |
If only one array parameter is provided, this function returns all possible next words, ordered by probability, for the given array. If two arrays are provided, it returns an unordered list of possible words w that complete the n-gram consisting of: pre[0]...pre[k], w, post[k+1]...post[n].
result = rm.completions([ "the" ], [ "red", "ball" ]); will return all the single words that occur between 'the' and 'red ball' in the current model (assuming n > 3),e.g., [ 'round', 'big', 'bouncy']).
Note: For this operation to be valid, (pre.length + post.length) must be less than the model's n-factor, otherwise an error will be thrown. |