List of utility methods to do String Normalize
String | normalize(String text) normalize StringBuilder builder = new StringBuilder(); int index = 0; int quote = 0; text = text.trim(); while (index < text.length()) { char c = text.charAt(index); if (Character.isWhitespace(c) || Character.isSpaceChar(c)) c = ' '; ... |
String | normalize(String text) Removes diacritics from UTF-8 String result = text; try { while (result.length() > 1 && !Character.isAlphabetic(result.charAt(0))) { if (result.length() > 1) { result = result.substring(1, result.length()); result = Normalizer.normalize(result.toLowerCase(), Normalizer.Form.NFD); ... |
String | normalize(String uri) Normalize a uri containing ../ and ./ paths. if ("".equals(uri)) { return uri; int leadingSlashes; for (leadingSlashes = 0; leadingSlashes < uri.length() && uri.charAt(leadingSlashes) == '/'; ++leadingSlashes) { boolean isDir = (uri.charAt(uri.length() - 1) == '/'); ... |
String | normalize(String value) normalize String temp = Normalizer.normalize(value, Normalizer.Form.NFD); Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+"); return pattern.matcher(temp).replaceAll(""); |
String | normalize(String value, Locale locale) normalize if (value == null) { return null; final DecimalFormatSymbols symbols = getDecimalFormatSymbols(locale); final char groupingSep = symbols.getGroupingSeparator(); final char decimalSep = symbols.getDecimalSeparator(); final StringBuilder sb = new StringBuilder(20); for (int i = 0; i < value.length(); ++i) { ... |
String | normalizeCutter(String cutter, int numDigits) normalize the cutter string for shelf list sorting - make number into decimal of the number of digits indicated by param String result = null; if (cutter != null && cutter.length() > 0) { String cutLets = getLCstartLetters(cutter); String cutDigs = cutter.substring(cutLets.length()); String norm = null; if (cutDigs != null && cutDigs.length() > 0) { try { Integer.parseInt(cutDigs); ... |
String | normalizeDose(String dose) Normalize dose if (dose.trim().equals("")) return ""; dose = dose.replace("milligrams", "mg").replace("milligram", "mg"); dose = dose.replaceAll("[ ]*\\,[ ]*", ""); java.text.DecimalFormat df = new java.text.DecimalFormat("##.######"); Pattern p = Pattern.compile("\\d*\\.?\\d*mcg"); Matcher m = p.matcher(dose); if (m.find()) { ... |
String | normalizeEnglishIdentifier(String id) Remove anything that is not English letters or digits from the string and convert what wasn't removed to lower case. return Normalizer.normalize(id, Normalizer.Form.NFD).replaceAll("[^a-zA-Z0-9]", "") .toLowerCase(); |
String | normalizeFieldNameOrPath(final String nameOrPath) Normalize field name or path. assertNotNull(nameOrPath, "Name of path must not be null"); return nameOrPath.trim().toLowerCase(Locale.ENGLISH); |
String | normalizeIndex(String input, String[] indexList) normalize Index String normalizedStr = Normalizer.normalize(input, Form.NFKD).toUpperCase(); normalizedStr = normalizedStr.substring(0, 1); if (Arrays.asList(indexList).contains(normalizedStr)) { return normalizedStr; } else { return "Char"; |