Package opennlp.tools.util.normalizer
Class ConfusableSkeletonCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.ConfusableSkeletonCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,CharSequenceNormalizer
public class ConfusableSkeletonCharSequenceNormalizer
extends Object
implements CharSequenceNormalizer
A
CharSequenceNormalizer that reduces text to its Unicode confusable
skeleton (UTS #39).
This maps lookalike characters to a common prototype so that, for example, a word spelled with Cyrillic or Greek letters that imitate Latin ones reduces to the same form as its Latin spelling. The result is a matching key, not readable text: it is lossy and does not preserve offsets, so it is only meaningful as a derived layer of the original/normalized model.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ConfusableSkeletonCharSequenceNormalizerprivate static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns 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
-
ConfusableSkeletonCharSequenceNormalizer
private ConfusableSkeletonCharSequenceNormalizer()
-
-
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
-