public class Soundex extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
m_soundexInts
Table
|
static int |
NO_MAX
Length,
|
| Constructor and Description |
|---|
Soundex()
Creates the Soundex code table.
|
| Modifier and Type | Method and Description |
|---|---|
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(String[] strings)
Displays the codes for the parameters.
|
protected String |
reduce(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.
|
String |
soundex(String string)
Returns the soundex code for the specified word.
|
public static final transient int NO_MAX
protected int[] m_soundexInts
public Soundex()
public int getCode(char c)
public boolean getDropLastS()
public int getLength()
NO_MAXpublic boolean getPad()
public String soundex(String string)
string - The word to code.public static void main(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)
Copyright © 2017 etc.to. All rights reserved.