Package opennlp.tools.util.normalizer
Class DashCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.DashCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,opennlp.tools.util.normalizer.CharSequenceNormalizer,opennlp.tools.util.normalizer.OffsetAwareNormalizer
public class DashCharSequenceNormalizer
extends Object
implements opennlp.tools.util.normalizer.OffsetAwareNormalizer
A
CharSequenceNormalizer that maps every Unicode dash to an ASCII hyphen-minus
(U+002D), reusing the cursor based CharClass.dashes() engine.
This folds the many dash code points (en dash, em dash, figure dash, non-breaking hyphen,
fullwidth hyphen, and so on) to a single form so that "state-of-the-art" matches
regardless of which dash the source used. The mathematical minus signs are left untouched by
default, and U+00AD SOFT HYPHEN (a format character) is not treated as a dash.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DashCharSequenceNormalizerReturns the shared, stateless instance.normalize(CharSequence text) opennlp.tools.util.normalizer.AlignedTextnormalizeAligned(CharSequence text)
-
Constructor Details
-
DashCharSequenceNormalizer
public DashCharSequenceNormalizer()
-
-
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
-