Package opennlp.tools.util.normalizer
Class DigitCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.DigitCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,opennlp.tools.util.normalizer.CharSequenceNormalizer,opennlp.tools.util.normalizer.OffsetAwareNormalizer
public class DigitCharSequenceNormalizer
extends Object
implements opennlp.tools.util.normalizer.OffsetAwareNormalizer
A
CharSequenceNormalizer that maps Unicode decimal digits to their ASCII equivalents,
so for example Arabic-Indic, Devanagari, or fullwidth digits all become 0-9.
It maps a code point when Character.digit(int, int) reports a value of 0-
9 in radix ten, that is, when the code point is a Unicode decimal digit. Other numeric
forms (Roman numerals, superscripts, circled numbers, fractions) are not decimal digits and are
left unchanged. Scanning is a single O(1)-per-code-point cursor pass with no regular
expression.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DigitCharSequenceNormalizerReturns the shared, stateless instance.normalize(CharSequence text) opennlp.tools.util.normalizer.AlignedTextnormalizeAligned(CharSequence text)
-
Constructor Details
-
DigitCharSequenceNormalizer
public DigitCharSequenceNormalizer()
-
-
Method Details
-
getInstance
Returns the shared, stateless instance.- Returns:
- the shared, stateless instance
-
normalize
- Specified by:
normalizein interfaceopennlp.tools.util.normalizer.CharSequenceNormalizer
-
normalizeAligned
- Specified by:
normalizeAlignedin interfaceopennlp.tools.util.normalizer.OffsetAwareNormalizer
-