Package ch.tocco.nice2.toolbox.api.text
Class UmlautUtil
java.lang.Object
ch.tocco.nice2.toolbox.api.text.UmlautUtil
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 Summary
Modifier and TypeMethodDescriptionstatic String
asciifyGermanExtra
(String str) static String
asciifySharpS
(String str) Note that sharp-s is replaced with 2 lowercase ss.static String
asciifyUmlauts
(String str) Converts the german umlauts to germanized 2-char variants.static boolean
Tells if the string contains at least one German umlaut or sharp s.static boolean
containsSharpS
(String str) Note that the new uppercase sharp s is not handled yet.static boolean
containsUmlaut
(String str) Tells if the string contains at least one german umlaut.static String
flattenGermanExtra
(String str) static String
flattenUmlauts
(String str) Removes the dots on umlauts.
-
Method Details
-
containsUmlaut
Tells if the string contains at least one german umlaut. -
containsSharpS
Note that the new uppercase sharp s is not handled yet.
-
containsGermanExtra
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
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
Removes the dots on umlauts. -
asciifySharpS
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
-
flattenGermanExtra
-