Package opennlp.tools.util.normalizer
Class EmojiToEmoticonCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.EmojiToEmoticonCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,opennlp.tools.util.normalizer.CharSequenceNormalizer,opennlp.tools.util.normalizer.OffsetAwareNormalizer
public final class EmojiToEmoticonCharSequenceNormalizer
extends Object
implements opennlp.tools.util.normalizer.OffsetAwareNormalizer
A
CharSequenceNormalizer that folds emoji to ASCII emoticons, using the bundled
emoji-emoticons.txt mapping (for example U+1F642 SLIGHTLY SMILING FACE to :)).
A mapped pictograph inside a larger ZWJ sequence or followed by U+FE0E VARIATION SELECTOR-15
is left untouched; a trailing U+FE0F VARIATION SELECTOR-16 after any mapped pictograph is
absorbed into the fold, so no dangling variation selector is left behind. This is an expanding,
offset-changing transform: normalizeAligned(CharSequence) reports the Alignment
from the folded text back to the input. The reverse direction is
EmoticonToEmojiCharSequenceNormalizer.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the shared, stateless instance.normalize(CharSequence text) opennlp.tools.util.normalizer.AlignedTextnormalizeAligned(CharSequence text)
-
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
-