Reference

Class

RiTa

Name

spellsLike

Description Compares the letters of the input word (using a version of the Levenstein min-edit distance algorithm) to each word in the lexicon, returning the set of closest matches.
Example
RiTa.spellsLike("happy");
RiTa.spellsLike("happy", { limit: 10 });
RiTa.spellsLike("happy", { limit: 10, minDistance: 2 });
RiTa.spellsLike("happy", { numSyllables: 2, minDistance: 2 });
RiTa.spellsLike("happy", { minWordLength:10, numSyllables:2 });
Parameters
Stringthe word to match
Object
(or Map in Java)
options (optional)

{int} options.minLength:
minimum number of characters in target word (default=3)

{int} options.maxLength:
maximum number of characters in target word

{int} options.numSyllables:
target # of syllables in the word

{int} options.limit:
maximum # of results to return (default=10)

{String} options.pos:
the target part-of-speech for the word
either from the Penn tag set or the simplified tag set [a, r, v, n]

{int} options.minDistance:
the minimum distance of words from the target word
(increase to get more results)

{boolean} options.shuffle:
if true, iterate over lexicon in random order

Returns
String[]the matching words
Syntax
RiTa.spellsLike(word)
RiTa.spellsLike(word, opts)
Platform Java / JavaScript