org.apache.commons.codec.language
Class RefinedSoundex

java.lang.Object
  extended by org.apache.commons.codec.language.RefinedSoundex
All Implemented Interfaces:
Encoder, StringEncoder

public class RefinedSoundex
extends Object
implements StringEncoder

Encodes a string into a soundex value. Sounde is an encoding used to relate similar names, but can also be used as a general purpose scheme to find word with similar phonemes. More information may be found at: http://www.bluepoof.com/Soundex/info2.html

Version:
$Revision: 3.0 $ $Date: 2004/07/24 13:22:05 $
Author:
tobrien@transolutions.net, ggregory@seagullsw.com

Field Summary
static RefinedSoundex US_ENGLISH
           
static char[] US_ENGLISH_MAPPING
           
 
Constructor Summary
RefinedSoundex()
           
RefinedSoundex(char[] mapping)
           
 
Method Summary
 Object encode(Object pObject)
          All encoders allow a library-user to pass an Object and get an Object in return.
 String encode(String pString)
          Encode a String and produce a String.
 String soundex(String str)
          Get the SoundEx value of a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

US_ENGLISH_MAPPING

public static final char[] US_ENGLISH_MAPPING

US_ENGLISH

public static final RefinedSoundex US_ENGLISH
Constructor Detail

RefinedSoundex

public RefinedSoundex()

RefinedSoundex

public RefinedSoundex(char[] mapping)
Method Detail

soundex

public String soundex(String str)
Get the SoundEx value of a string. This implementation is taken from the code-snippers on http://www.sourceforge.net/


encode

public String encode(String pString)
              throws EncoderException
Description copied from interface: StringEncoder
Encode a String and produce a String.

Specified by:
encode in interface StringEncoder
Parameters:
pString - a String to encode
Returns:
the encoded String
Throws:
EncoderException - thrown if there is an error conidition during the Encoding process.

encode

public Object encode(Object pObject)
              throws EncoderException
Description copied from interface: Encoder
All encoders allow a library-user to pass an Object and get an Object in return. This function encodes an "Object" - returning the encoded content as an Object. The Objects here may just be byte[] or Strings depending on the implementation used.

Specified by:
encode in interface Encoder
Parameters:
pObject - An object ot encode
Returns:
An "encoded" Object
Throws:
EncoderException - an encoder exception is thrown if the encoder experiences a failure condition during the encoding process.


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.