public class GenericTransformator extends java.lang.Object implements Transformator
Each transformation rule represent a line in the phonetic file. One line contains two groups of characters separated by white space(s). The first group is the match expression. The match expression describes letters to associate with a syllable. The second group is the replacement expression giving the phonetic equivalent of the match expression.
| Constructor and Description |
|---|
GenericTransformator(java.io.File phonetic)
Construct a transformation table from the phonetic file
|
GenericTransformator(java.io.File phonetic,
java.lang.String encoding)
Construct a transformation table from the phonetic file
|
GenericTransformator(java.io.Reader phonetic)
Construct a transformation table from the phonetic file
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
java.lang.String |
transform(java.lang.String word)
Builds the phonetic code of the word.
|
public GenericTransformator(java.io.File phonetic)
throws java.io.IOException
phonetic - the phonetic file as specified in aspelljava.io.IOException - indicates a problem while reading the
phonetic filepublic GenericTransformator(java.io.File phonetic,
java.lang.String encoding)
throws java.io.IOException
phonetic - the phonetic file as specified in aspellencoding - the character set requiredjava.io.IOException - indicates a problem while reading the
phonetic filepublic GenericTransformator(java.io.Reader phonetic)
throws java.io.IOException
phonetic - the phonetic file as specified in aspell. The file is
supplied as a reader.java.io.IOException - indicates a problem while reading the
phonetic informationpublic char[] getCodeReplaceList()
public final char[] getReplaceList()
getReplaceList in interface Transformatorpublic java.lang.String transform(java.lang.String word)
transform in interface Transformatorword - the word to transform