Package opennlp.tools.util.normalizer
Class QuoteCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.QuoteCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,opennlp.tools.util.normalizer.CharSequenceNormalizer,opennlp.tools.util.normalizer.OffsetAwareNormalizer
public class QuoteCharSequenceNormalizer
extends Object
implements opennlp.tools.util.normalizer.OffsetAwareNormalizer
A
CharSequenceNormalizer that folds typographic quotation marks to their ASCII forms:
the single quotes and apostrophes to ' and the double quotes to ".
This is high value for matching, since curly quotes, guillemets, and fullwidth quotes
otherwise prevent "don't" from matching "don" + U+2019 + "t". It is built from
two CharClass sets, so membership is O(1) and scanning is a single cursor pass with no
regular expression. ASCII quotes are left unchanged.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic QuoteCharSequenceNormalizerReturns the shared, stateless instance.normalize(CharSequence text) opennlp.tools.util.normalizer.AlignedTextnormalizeAligned(CharSequence text)
-
Constructor Details
-
QuoteCharSequenceNormalizer
public QuoteCharSequenceNormalizer()
-
-
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
-