com.swabunga.spell.engine
Interface Transformator

All Known Implementing Classes:
DoubleMeta, GenericTransformator

public interface Transformator

An interface for all Transformators - which take a dictionary word and converts into its phonetic hash. These phonetic hashes are useful for determining what other words are similar to it, and then list those words as suggestions.

Author:
Robert Gustavsson (robert@lindesign.se)

Method Summary
 char[] getReplaceList()
          gets the list of characters that should be swapped in to the misspelled word in order to try to find more suggestions.
 java.lang.String transform(java.lang.String word)
          Take the given word, and return the best phonetic hash for it.
 

Method Detail

transform

java.lang.String transform(java.lang.String word)
Take the given word, and return the best phonetic hash for it.

Parameters:
word - the word to transform
Returns:
the phonetic transformation of the word

getReplaceList

char[] getReplaceList()
gets the list of characters that should be swapped in to the misspelled word in order to try to find more suggestions. In general, this list represents all of the unique phonetic characters for this Transformator.

The replace list is used in the getSuggestions method. All of the letters in the misspelled word are replaced with the characters from this list to try and generate more suggestions, which implies l*n tries, if l is the size of the string, and n is the size of this list.

In addition to that, each of these letters is added to the misspelled word.

Returns:
char[] misspelled words should try replacing with these characters to get more suggestions