java.lang.Object
org.xbib.interlibrary.catalog.matching.string.SoundexEncoder
Alle implementierten Schnittstellen:
StringEncoder

public class SoundexEncoder extends Object implements StringEncoder
Encodes a string into a soundex value. Soundex is an encoding used to relate similar names, but can also be used as a general purpose scheme to find word with similar phonemes.
  • Felddetails

    • US_ENGLISH

      public static final SoundexEncoder US_ENGLISH
      This static variable contains an instance of the Soundex using the US_ENGLISH mapping.
  • Konstruktordetails

    • SoundexEncoder

      public SoundexEncoder()
      Creates an instance of the Soundex object using the default US_ENGLISH mapping.
    • SoundexEncoder

      public SoundexEncoder(List<Character> mapping)
      Creates a soundex instance using a custom mapping. This constructor can be used to customize the mapping, and/or possibly provide an internationalized mapping for a non-Western character set.
      Parameter:
      mapping - Mapping array to use when finding the corresponding code for a given character
  • Methodendetails

    • encode

      public String encode(String str) throws EncoderException
      Retrieves the Soundex code for a given string.
      Angegeben von:
      encode in Schnittstelle StringEncoder
      Parameter:
      str - String to encode using the Soundex algorithm
      Gibt zurück:
      A soundex code for the String supplied
      Löst aus:
      EncoderException - if there is an error condition during the encoding process.
    • getMaxLength

      public int getMaxLength()
      Returns the maxLength. Standard Soundex
      Gibt zurück:
      int
    • setMaxLength

      public void setMaxLength(int maxLength)
      Sets the maxLength.
      Parameter:
      maxLength - The maxLength to set