org.apache.commons.codec.language
Class SoundexUtils

java.lang.Object
  extended byorg.apache.commons.codec.language.SoundexUtils

final class SoundexUtils
extends Object

Utility methods for Soundex and RefinedSoundex classes.

Since:
1.3
Version:
$Id: SoundexUtils.java,v 1.5 2004/03/17 18:31:35 ggregory Exp $
Author:
Apache Software Foundation

Constructor Summary
(package private) SoundexUtils()
           
 
Method Summary
(package private) static String clean(String str)
          Cleans up the input string before Soundex processing by only returning upper case letters.
(package private) static int difference(StringEncoder encoder, String s1, String s2)
          Encodes the Strings and returns the number of characters in the two encoded Strings that are the same.
(package private) static int differenceEncoded(String es1, String es2)
          Returns the number of characters in the two Soundex encoded Strings that are the same.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SoundexUtils

SoundexUtils()
Method Detail

clean

static String clean(String str)
Cleans up the input string before Soundex processing by only returning upper case letters.

Parameters:
str - The String to clean.
Returns:
A clean String.

difference

static int difference(StringEncoder encoder,
                      String s1,
                      String s2)
               throws EncoderException
Encodes the Strings and returns the number of characters in the two encoded Strings that are the same.

Parameters:
encoder - The encoder to use to encode the Strings.
s1 - A String that will be encoded and compared.
s2 - A String that will be encoded and compared.
Returns:
The number of characters in the two Soundex encoded Strings that are the same.
Throws:
EncoderException - if an error occurs encoding one of the strings
See Also:
differenceEncoded(String,String), MS T-SQL DIFFERENCE

differenceEncoded

static int differenceEncoded(String es1,
                             String es2)
Returns the number of characters in the two Soundex encoded Strings that are the same.

Parameters:
es1 - An encoded String.
es2 - An encoded String.
Returns:
The number of characters in the two Soundex encoded Strings that are the same.
See Also:
MS T-SQL DIFFERENCE


commons-codec version 1.3 - Copyright © 2002-2004 - Apache Software Foundation