|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.util.Soundex
public class Soundex
Encodes words using the SOUNDEX algorithm.
Field Summary | |
---|---|
protected int[] |
m_soundexInts
Table |
static int |
NO_MAX
Length, |
Constructor Summary | |
---|---|
Soundex()
Creates the Soundex code table. |
Method Summary | |
---|---|
int |
getCode(char c)
Returns the Soundex code for the specified character. |
boolean |
getDropLastS()
If true, the final 's' or 'S' of the word being encoded is dropped. |
int |
getLength()
Returns the length of code strings to build, 4 by default. |
boolean |
getPad()
If true and a word is coded to a shorter length than getLength(), the code will be padded with zeros. |
static void |
main(java.lang.String[] strings)
Displays the codes for the parameters. |
protected java.lang.String |
reduce(java.lang.String string)
Removes adjacent sounds. |
void |
setCode(char c,
int i)
Allows you to modify the default code table |
void |
setDropLastS(boolean bool)
If true, the final 's' of the word being encoded is dropped. |
void |
setLength(int lengthInt)
Sets the length of code strings to build. |
void |
setPad(boolean bool)
If true, pads code to getLength() with zeros. |
java.lang.String |
soundex(java.lang.String string)
Returns the soundex code for the specified word. |
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 int[] m_soundexInts
Constructor Detail |
---|
public Soundex()
Method Detail |
---|
public int getCode(char c)
public boolean getDropLastS()
public int getLength()
NO_MAX
public boolean getPad()
public java.lang.String soundex(java.lang.String string)
string
- The word to code.public static void main(java.lang.String[] strings)
public void setCode(char c, int i)
c
- The character to specify the code for.i
- The code to represent c with, must -1, or 0 thru 9public void setDropLastS(boolean bool)
public void setLength(int lengthInt)
Length
- of code to produce, must be >= 1public void setPad(boolean bool)
protected java.lang.String reduce(java.lang.String string)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |