Reference

Class

RiTa

Name

soundsLike

Description Compares the phonemes 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.soundsLike("happy");
RiTa.soundsLike("happy", { matchSpelling: true });
RiTa.soundsLike("happy", { limit: 10, minDistance: 2 });
RiTa.soundsLike("happy", { numSyllables: 2, minDistance: 2 });
RiTa.soundsLike("happy", { minWordLength:10, numSyllables:2 });
Parameters
Stringthe word to match
Object
(or Map in Java)
options (optional)

{bool} options.matchSpelling:
if true will also attempt to match spelling
by returning an intersection with RiTa.spellsLike (default=false)

{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

{String} options.pos:
the target part-of-speech for word in the result
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)

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