|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcds.util.Soundex
Encodes words using the soundex phonetic algorithm. The primary method to call is Soundex.encode(String).
The main method encodes arguments to System.out.
Field Summary | |
protected boolean |
DropFinalSBoolean
|
protected int |
LengthInt
|
private static java.lang.String |
LowerS
|
static int |
NO_MAX
|
protected boolean |
PadBoolean
|
protected int[] |
SoundexInts
|
private static java.lang.String |
UpperS
|
Constructor Summary | |
Soundex()
|
Method Summary | |
protected static int[] |
createArray()
Creates the Soundex code table. |
java.lang.String |
encode(java.lang.String word)
Returns the soundex code for the specified word. |
int |
getCode(char ch)
Returns the Soundex code for the specified character. |
boolean |
getDropFinalS()
If true, a final char of 's' or 'S' of the word being encoded will be dropped. |
int |
getLength()
The length of code strings to build, 4 by default. |
boolean |
getPad()
If true, appends zeros to a soundex code if the code is less than Soundex.getLength(). |
static void |
main(java.lang.String[] strings)
Displays the codes for the parameters. |
protected java.lang.String |
reduce(java.lang.String word)
Removes adjacent sounds. |
void |
setCode(char ch,
int code)
Allows you to modify the default code table |
void |
setDropFinalS(boolean bool)
If true, a final char of 's' or 'S' of the word being encoded will be dropped. |
void |
setLength(int length)
Sets the length of code strings to build. 4 by default. |
void |
setPad(boolean bool)
If true, appends zeros to a soundex code if the code is less than Soundex.getLength(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final transient int NO_MAX
protected boolean DropFinalSBoolean
protected int LengthInt
protected boolean PadBoolean
protected int[] SoundexInts
private static final java.lang.String LowerS
private static final java.lang.String UpperS
Constructor Detail |
public Soundex()
Method Detail |
public java.lang.String encode(java.lang.String word)
word
- The word to encode.public int getCode(char ch)
ch
- Should be between A-Z or a-z
public boolean getDropFinalS()
public int getLength()
NO_MAX
public boolean getPad()
public void setCode(char ch, int code)
ch
- The character to specify the code for.code
- The code to represent ch with, must be -1, or 1 thru 9public void setDropFinalS(boolean bool)
public void setLength(int length)
public void setPad(boolean bool)
protected static int[] createArray()
protected java.lang.String reduce(java.lang.String word)
public static void main(java.lang.String[] strings)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |