Interface StringNormalizer

All Known Implementing Classes:
DefaultStringNormalizer

public interface StringNormalizer
Translates strings to a reduced char set.
  • Method Summary

    Modifier and Type
    Method
    Description
    The singleton.
    Normalizes a string (phonetically) for use as PDO.normText.
    unDiacrit(String str, boolean keepLength)
    Converts special unicode characters (so-called diacrits) to standard ascii.
    Supports also special german and northern european "umlauts".
  • Method Details

    • getInstance

      static StringNormalizer getInstance()
      The singleton.
      Returns:
      the singleton
    • normalize

      String normalize(String str)
      Normalizes a string (phonetically) for use as PDO.normText.
      Parameters:
      str - the string to be normalized
      Returns:
      the normalized string
    • unDiacrit

      String unDiacrit(String str, boolean keepLength)
      Converts special unicode characters (so-called diacrits) to standard ascii.
      Supports also special german and northern european "umlauts".
      Parameters:
      str - the string to be converted
      keepLength - true if the length should be kept, i.e. no Ä to AE, but to A
      Returns:
      the converted string