RiTa
index
Name RiLexicon
Description A user-customizable lexicon equipped with implementations of a variety of matching algorithms (min-edit-distance, soundex, anagrams, alliteration, rhymes, looks-like, etc.) based on combinations of letters, syllables and phonemes. An example:
   RiLexicon lex = new RiLexicon(this);
    String[] similars = lex.similarBySound("cat");
    String[] rhymes  = lex.getSimpleRhymes("cat");
    // etc.

Note: If you wish to modify or customize the lexicon (e.g., add words, or change pronunciations) you can do so by editing the 'rita_addenda.txt' file, found in $SKETCH_DIR/libraries/rita and placing the modifed version in the 'data' folder of your sketch.

Constructors
RiLexicon(pApplet);
Methods
containingStringsByLetter()   Returns valid words (in lexicon) using both substring and superstring matching. This method CONTAINS(K) = UNION(SUB(K), SUPER(K)).

contains()   Returns true if the word exists in the lexicon

getAlliterations()   Finds alliterations by comparing the phonemes of the input string to those of each word in the lexicon

getPosEntries()   Return the list of possible parts-of-speech for the word , or null if not found.

getSimpleRhymes()   Finds rhymes by comparing the phonemes of the input string to those of each word in the lexicon

getWords()   Returns the set of words in the lexicon (including those from user-addenda) that match the supplied regular expressions

isContaining()   Returns true if orig is a sub or super-string of toCheck.

isSubstring()   Returns true if orig is a substring of toCheck.

isSuperstring()   Returns true if orig is a superstring of toCheck.

iterator()   Returns an iterator over the words in lexicon matching the supplied regular expression.

similarByLetter()   Compares the characters of the input string (using a version of the min-edit distance algorithm) to each word in the lexicon, returning the set of closest matches.

similarBySound()   Compares the phonemes of the input String to those of each word in the lexicon, returning the set of closest matches as a String[].

similarBySoundAndLetter()   First calls similarBySound(), then filters the result set by the algorithm used in similarByLetter(); (useful when similarBySound() returns too large a result set)

substringsByLetter()   Returns all valid substrings of the input word in the lexicon of length at least minLength

superstringsByLetter()   Returns all valid superstrings of the input word in the lexicon

Usage Web & Application