Class |
RiTa
|
Name |
search
|
Description |
Searches for words in the lexicon that match the given criteria, either by length, syllable-count, phoneme, stress, part-of-speech, etc. If no regex or options are supplied, the full set of words is returned. |
Example |
RiTa.search(); RiTa.search("tting") RiTa.search('f-ah-n-t', { type: 'phones', pos: 'n', numSyllables: 2 })
|
Parameters |
String or Regex (JS), String or Pattern (Java) | regex pattern to match (optional) |
---|
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.type: use "stresses" to indicate that the regex is for matching stress patterns use "phones" to indicate that the regex is for matching phonemes
{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]
{boolean} options.shuffle: if true, iterate over lexicon in random order
|
---|
|
Returns |
String[] | array of words matching the search criteria in the lexicon (or all words if no criteria is provided) |
---|
|
Related |
RiTa.alliterations(),RiTa.rhymes(),RiTa.soundsLike(),RiTa.spellsLike() |
Note |
tmp_note |
Syntax |
RiTa.search() RiTa.search(regex); RiTa.search(regex, opts);
|
Constants |
RiTa.alliterations(),RiTa.rhymes(),RiTa.soundsLike(),RiTa.spellsLike()Constants
|
Platform |
Java / JavaScript |
|
|