Package opennlp.tools.util.normalizer
Class NfcCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.NfcCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,CharSequenceNormalizer
A
CharSequenceNormalizer that applies Unicode Normalization Form C (canonical
composition, UAX #15).
NFC is the safe, lossless (under canonical equivalence) baseline for matching: precomposed
and decomposed spellings of the same text (for example U+00E9 versus e plus a
combining acute accent) become identical, so equal text compares equal regardless of how it was
encoded. It changes no characters' meaning and is the W3C-recommended interchange form.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final NfcCharSequenceNormalizerprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic NfcCharSequenceNormalizerReturns the shared, stateless instance.normalize(CharSequence text) Normalizes a sequence of characters.private ObjectReturns the shared instance, so deserialization keeps the singleton.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
INSTANCE
-
-
Constructor Details
-
NfcCharSequenceNormalizer
public NfcCharSequenceNormalizer()
-
-
Method Details
-
getInstance
Returns the shared, stateless instance.- Returns:
- the shared, stateless instance
-
normalize
Normalizes a sequence of characters.- Specified by:
normalizein interfaceCharSequenceNormalizer- Parameters:
text- TheCharSequenceto normalize. Must not benull.- Returns:
- The normalized
CharSequence.
-
readResolve
Returns the shared instance, so deserialization keeps the singleton.- Returns:
- the shared instance, so deserialization keeps the singleton
-