Class NumberCharSequenceNormalizer

java.lang.Object
opennlp.tools.util.normalizer.NumberCharSequenceNormalizer
All Implemented Interfaces:
Serializable, opennlp.tools.util.normalizer.CharSequenceNormalizer

public class NumberCharSequenceNormalizer extends Object implements opennlp.tools.util.normalizer.CharSequenceNormalizer
A CharSequenceNormalizer implementation that normalizes text in terms of numbers: every maximal run of ASCII digits (0 to 9), that is the longest unbroken stretch of consecutive digits, is replaced by a single space. For example, "a1234b56" becomes "a b ". Non-ASCII digits, for example Arabic-Indic or fullwidth digits, are not treated as digits and are left unchanged.
See Also:
  • Constructor Details

    • NumberCharSequenceNormalizer

      public NumberCharSequenceNormalizer()
  • Method Details

    • getInstance

      public static NumberCharSequenceNormalizer getInstance()
      Returns the shared, stateless instance.
      Returns:
      the shared, stateless instance
    • normalize

      public CharSequence normalize(CharSequence text)
      Specified by:
      normalize in interface opennlp.tools.util.normalizer.CharSequenceNormalizer