com.swabunga.spell.engine
public class GenericTransformator extends Object implements Transformator
See Also: SpellDictionaryASpell for information on getting
phonetic files for aspell.
Field Summary | |
---|---|
static char | ALPHABET_END
The alphabet end marker. |
static char | ALPHABET_START
The alphabet start marker. |
static String | DIGITCODE
During phonetic transformation of a word each numeric character is
replaced by this DIGITCODE. |
static char | ENDMULTI
End a group of characters which can be appended to the match expression
of the phonetic file. |
static String[] | IGNORED_KEYWORDS
Phonetic file lines starting with the keywords are skipped.
|
static String | KEYWORD_ALPHBET
Phonetic file keyword indicating that a different alphabet is used
for this language. |
static String | REPLACEVOID
Phonetic file character code indicating that the replace expression
is empty. |
static char | STARTMULTI
Start a group of characters which can be appended to the match expression
of the phonetic file. |
Constructor Summary | |
---|---|
GenericTransformator(File phonetic)
Construct a transformation table from the phonetic file | |
GenericTransformator(File phonetic, String encoding)
Construct a transformation table from the phonetic file | |
GenericTransformator(Reader phonetic)
Construct a transformation table from the phonetic file |
Method Summary | |
---|---|
char[] | getCodeReplaceList()
Takes out all single character replacements and put them in a char array.
|
char[] | getReplaceList()
Builds up an char array with the chars in the alphabet of the language as it was read from the
alphabet tag in the phonetic file. |
String | transform(String word)
Builds the phonetic code of the word. |
See Also: KEYWORD_ALPHBET
See Also: KEYWORD_ALPHBET
ALPHABET_START
marker,
a list of characters defining the alphabet and a
ALPHABET_END
marker.Parameters: phonetic the phonetic file as specified in aspell
Throws: java.io.IOException indicates a problem while reading the phonetic file
Parameters: phonetic the phonetic file as specified in aspell encoding the character set required
Throws: java.io.IOException indicates a problem while reading the phonetic file
Parameters: phonetic the phonetic file as specified in aspell. The file is supplied as a reader.
Throws: java.io.IOException indicates a problem while reading the phonetic information
Returns: char[] An array of chars with replacements characters
Returns: char[] An array of chars representing the alphabet or null if no alphabet was available.
Parameters: word the word to transform
Returns: the phonetic transformation of the word