Package opennlp.tools.util.normalizer
Class GermanUmlautCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.GermanUmlautCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,opennlp.tools.util.normalizer.CharSequenceNormalizer,opennlp.tools.util.normalizer.OffsetAwareNormalizer
public class GermanUmlautCharSequenceNormalizer
extends Object
implements opennlp.tools.util.normalizer.OffsetAwareNormalizer
A
CharSequenceNormalizer that transliterates German umlauts and the eszett the way German
conventionally expands them (DIN 5007-2): a-umlaut to ae, o-umlaut to oe,
u-umlaut to ue, and eszett to ss, with the capital umlauts and the capital eszett
(U+1E9E) expanded likewise.
This is the correct diacritic fold for German, where the generic
AccentFoldCharSequenceNormalizer (which would yield a, o, u) is
wrong. It is an expanding, offset-changing transform, so like the other folds it belongs to the
derived matching form rather than to anything offset-preserving. A cursor pass with no regular
expression.
The fold matches the precomposed code points. A base letter followed by a combining diaeresis
(for example a + U+0308) is not a member and passes through unchanged, so apply NFC
composition first if the input may contain decomposed forms.
- 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
-