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 Details

    • getInstance

      public static GermanUmlautCharSequenceNormalizer getInstance()
      Returns the shared, stateless instance.
      Returns:
      the shared, stateless instance
    • normalize

      public CharSequence normalize(CharSequence text)
      Specified by:
      normalize in interface opennlp.tools.util.normalizer.CharSequenceNormalizer
    • normalizeAligned

      public opennlp.tools.util.normalizer.AlignedText normalizeAligned(CharSequence text)
      Specified by:
      normalizeAligned in interface opennlp.tools.util.normalizer.OffsetAwareNormalizer