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

public class DoubleMetaphoneEncoder extends Object implements StringEncoder
DoubleMetaphone Java Implementation from the algorithm by Lawrence Philips.
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected char
    charAt(String value, int index)
    Gets the character at index index if available, otherwise it returns Character.MIN_VALUE so that there is some sort of a default.
    protected static boolean
    contains(String value, int start, int length, String[] criteria)
    Determines whether value contains any of the criteria starting at index start and matching up to length length.
    final String
    encode(String value)
    Encode a value with Double Metaphone.
    protected String
    encode(String valueStr, boolean alternate)
    Encode a value with Double Metaphone, optionally using the alternate encoding.
    int
    Returns the maxCodeLen.
    boolean
    Check if the Double Metaphone values of two String values are equal.
    boolean
    isDoubleMetaphoneEqual(String value1, String value2, boolean alternate)
    Check if the Double Metaphone values of two String values are equal, optionally using the alternate value.
    void
    setMaxCodeLen(int maxCodeLen)
    Sets the maxCodeLen.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • DoubleMetaphoneEncoder

      public DoubleMetaphoneEncoder()
  • Methodendetails

    • encode

      public final String encode(String value) throws EncoderException
      Encode a value with Double Metaphone.
      Angegeben von:
      encode in Schnittstelle StringEncoder
      Parameter:
      value - String to encode
      Gibt zurück:
      an encoded string
      Löst aus:
      EncoderException - if there is an error condition during the encoding process.
    • encode

      protected String encode(String valueStr, boolean alternate)
      Encode a value with Double Metaphone, optionally using the alternate encoding.
      Parameter:
      valueStr - String to encode
      alternate - use alternate encode
      Gibt zurück:
      an encoded string
    • isDoubleMetaphoneEqual

      public boolean isDoubleMetaphoneEqual(String value1, String value2)
      Check if the Double Metaphone values of two String values are equal.
      Parameter:
      value1 - value1
      value2 - value2
      Gibt zurück:
      true if equals
    • isDoubleMetaphoneEqual

      public boolean isDoubleMetaphoneEqual(String value1, String value2, boolean alternate)
      Check if the Double Metaphone values of two String values are equal, optionally using the alternate value.
      Parameter:
      value1 - value1
      value2 - value2
      alternate - alternate
      Gibt zurück:
      true if equal
    • getMaxCodeLen

      public int getMaxCodeLen()
      Returns the maxCodeLen.
      Gibt zurück:
      int
    • setMaxCodeLen

      public void setMaxCodeLen(int maxCodeLen)
      Sets the maxCodeLen.
      Parameter:
      maxCodeLen - The maxCodeLen to set
    • charAt

      protected char charAt(String value, int index)
      Gets the character at index index if available, otherwise it returns Character.MIN_VALUE so that there is some sort of a default.
      Parameter:
      value - value
      index - index
      Gibt zurück:
      char
    • contains

      protected static boolean contains(String value, int start, int length, String[] criteria)
      Determines whether value contains any of the criteria starting at index start and matching up to length length.
      Parameter:
      value - value
      start - start
      length - length
      criteria - criteria
      Gibt zurück:
      true