org.openscience.nmrshiftdb.util
Class Soundex

java.lang.Object
  extended by org.openscience.nmrshiftdb.util.Soundex

public class Soundex
extends java.lang.Object

Find the Soundex of a string. This is an adapted version with it's own soundex rules. This code is taken from jakarta-taglibs who took if from generationjava.com who took it from the codesnippers at sourceforge. The license ? Pff...

Version:
0.4, 20010812
Author:
bayard@generationjava.com

Field Summary
private static char[] soundexMapping
           
private static char[] US_ENGLISH_MAPPING
           
 
Constructor Summary
Soundex()
           
 
Method Summary
static char getMappingCode(char c)
          Gives the soundex of a letter (figures are coded as themselves)
static java.lang.String soundex(java.lang.String str, java.lang.String whereIs, StringAndInt positionInteger)
          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

private static final char[] US_ENGLISH_MAPPING

soundexMapping

private static char[] soundexMapping
Constructor Detail

Soundex

public Soundex()
Method Detail

getMappingCode

public static char getMappingCode(char c)
Gives the soundex of a letter (figures are coded as themselves)

Parameters:
c - The letter
Returns:
The soundex

soundex

public static java.lang.String soundex(java.lang.String str,
                                       java.lang.String whereIs,
                                       StringAndInt positionInteger)
Get the SoundEx value of a string. This is not the canonical soundex implementation, but my own one (the first letter is coded as well, length is unlimited, figures are coded) The base of this implementation is taken from the code-snippers on http://www.sourceforge.net/

Parameters:
str - The String the soundex should be calculated from
whereIs - The soundex code the position of which should be established
positionInteger - The myInt field contains the position of whereIS
Returns:
The soundex