@Test public void testRemoveAccents() { logger.info("removeAccents"); String text = "'ά','ό','έ','ί','ϊ','ΐ','ή','ύ','ϋ','ΰ','ώ','à','á','â','ã','ä','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ù','ú','û','ü','ý','ÿ','Ά','Ό','Έ','Ί','Ϊ','Ή','Ύ','Ϋ','Ώ','À','Á','Â','Ã','Ä','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ñ','Ò','Ó','Ô','Õ','Ö','Ù','Ú','Û','Ü','Ý'"; String expResult = "'α','ο','ε','ι','ι','ι','η','υ','υ','υ','ω','a','a','a','a','a','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','u','u','u','u','y','y','Α','Ο','Ε','Ι','Ι','Η','Υ','Υ','Ω','A','A','A','A','A','C','E','E','E','E','I','I','I','I','N','O','O','O','O','O','U','U','U','U','Y'"; String result = StringCleaner.removeAccents(text); assertEquals(expResult, result); }
public static String removeAccents(String text) { text = Normalizer.normalize(text, Normalizer.Form.NFD); text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return text; }
StringCleaner { public static String removeAccents(String text) { text = Normalizer.normalize(text, Normalizer.Form.NFD); text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return text; } }
StringCleaner { public static String removeAccents(String text) { text = Normalizer.normalize(text, Normalizer.Form.NFD); text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return text; }  }
StringCleaner { public static String removeAccents(String text) { text = Normalizer.normalize(text, Normalizer.Form.NFD); text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return text; }  static String tokenizeURLs(String text); static String tokenizeSmileys(String text); static String removeExtraSpaces(String text); static String removeSymbols(String text); static String unifyTerminators(String text); static String removeAccents(String text); static String clear(String text); }
StringCleaner { public static String removeAccents(String text) { text = Normalizer.normalize(text, Normalizer.Form.NFD); text = text.replaceAll("[\\p{InCombiningDiacriticalMarks}]", ""); return text; }  static String tokenizeURLs(String text); static String tokenizeSmileys(String text); static String removeExtraSpaces(String text); static String removeSymbols(String text); static String unifyTerminators(String text); static String removeAccents(String text); static String clear(String text);  }