List of utility methods to do String Normalize
String | normalize(String name) normalize return normalize(name, -1);
|
String | normalize(String s) Replaces all the funky characters with normal ASCII return Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", ""); |
String | normalize(String s) java.text.Normalizer is only available for jdk 1.6. return s;
|
String | normalize(String s) Normalizes a string by removing features that should not be considered as differentiating between two strings (such as accents and case). s = Normalizer.normalize(s, Normalizer.Form.NFD); s = s.replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); s = s.toLowerCase(); s = s.replaceAll("[^a-z0-9]+", " "); s = s.replaceAll("([a-z])([0-9])", "$1 $2"); s = s.replaceAll("([0-9])([a-z])", "$1 $2"); return s; |
String | normalize(String s) normalize String d = Normalizer.normalize(s, Normalizer.Form.NFKD); d = diacriticalMarksPattern.matcher(d).replaceAll(""); return Normalizer.normalize(d, Normalizer.Form.NFKC); |
String | normalize(String string) normalize StringBuilder sb = new StringBuilder(string.length()); string = Normalizer.normalize(string, Normalizer.Form.NFD); for (char c : string.toCharArray()) { if (c <= '\u007F') sb.append(c); return sb.toString(); |
String | normalize(String string) normalize if (string != null) { string = Normalizer.normalize(string, NORMALIZATION_FORM); return string; |
String | normalize(String string) normalize if (string != null) { Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); String decomposed = Normalizer.normalize(string, Normalizer.Form.NFD); return pattern.matcher(decomposed).replaceAll(""); } else { return null; |
String | normalize(String text) normalize return text == null ? null : Normalizer.normalize(text, Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); |
String | normalize(String text) normalize String[] texts = normalize(new String[] { text }); return texts[0]; |