Class TextNormalizationHelper


  • public class TextNormalizationHelper
    extends java.lang.Object
    This helper class dynamically loads the "java.text.Normalizer" in JDK 6 or above using reflection. It provides the method normalize which transforms Unicode text into an equivalent composed or decomposed form. The normalize method supports the standard normalization forms described in Unicode Standard Annex #15 — Unicode Normalization Forms.
    • Field Detail

      • NORMALIZER_CLASS_NAME

        public static final java.lang.String NORMALIZER_CLASS_NAME
        See Also:
        Constant Field Values
      • NORMALIZER_FORM_CLASS_NAME

        public static final java.lang.String NORMALIZER_FORM_CLASS_NAME
        See Also:
        Constant Field Values
      • NORMALIZER_NORMALIZE_METHOD_NAME

        public static final java.lang.String NORMALIZER_NORMALIZE_METHOD_NAME
        See Also:
        Constant Field Values
      • NORMALIZER_IS_NORMALIZED_METHOD_NAME

        public static final java.lang.String NORMALIZER_IS_NORMALIZED_METHOD_NAME
        See Also:
        Constant Field Values
    • Constructor Detail

      • TextNormalizationHelper

        public TextNormalizationHelper()
    • Method Detail

      • isNormalizationCapable

        public static boolean isNormalizationCapable()
        Checks if is normalization capable.
        Returns:
        true, if is normalization capable
      • isNormalized

        public static boolean isNormalized​(java.lang.String text)
        Tests whether the text is normalized.
        Parameters:
        text - the text to be checked for normalization
        Returns:
        true if the text is normalized; false otherwise.
      • normalize

        public static java.lang.String normalize​(java.lang.String text)
        Normalizes the text.
        Parameters:
        text - the text to be normalized
        Returns:
        string the normalized text