Class UmlautUtil

java.lang.Object
ch.tocco.nice2.toolbox.api.text.UmlautUtil

public class UmlautUtil extends Object
Provides utility methods for dealing with (German) Umlauts.

See http://de.wikipedia.org/wiki/Umlaut

This is used for fulltext searching. Feel free to refactor n'stuff.

  • Method Details

    • containsUmlaut

      public static boolean containsUmlaut(String str)
      Tells if the string contains at least one german umlaut.
    • containsSharpS

      public static boolean containsSharpS(String str)

      Note that the new uppercase sharp s is not handled yet.

    • containsGermanExtra

      public static boolean containsGermanExtra(String str)
      Tells if the string contains at least one German umlaut or sharp s.

      Note that the new uppercase sharp s is not handled yet.

    • asciifyUmlauts

      public static String asciifyUmlauts(String str)
      Converts the german umlauts to germanized 2-char variants.

      Warning: if your term was ALL UPPER CASE then it will contain lowercase 'e' characters if there were substitutions made. This is because the conversion just appends a lowercase 'e'.

    • flattenUmlauts

      public static String flattenUmlauts(String str)
      Removes the dots on umlauts.
    • asciifySharpS

      public static String asciifySharpS(String str)
      Note that sharp-s is replaced with 2 lowercase ss. If your string is upper-case otherwise you might want to convert that.

      Note that the new uppercase sharp s is not handled yet.

    • asciifyGermanExtra

      public static String asciifyGermanExtra(String str)
    • flattenGermanExtra

      public static String flattenGermanExtra(String str)