Package opennlp.tools.util.normalizer

# Class TextNormalizer

java.lang.Object
opennlp.tools.util.normalizer.TextNormalizer

public final class TextNormalizer extends Object
Entry point for composing normalization steps into a single `CharSequenceNormalizer`.

Use `builder()` to assemble a chain, or `defaultChain()` for a conservative, ready-made chain. Steps run in the order they are added. Each step is a shared, stateless normalizer; the built result is an `AggregateCharSequenceNormalizer` that applies them in sequence.

     CharSequenceNormalizer n = TextNormalizer.builder()
         .nfc().caseFold().accentFold()
         .build();

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final class`
  `TextNormalizer.Builder`
  A fluent builder that appends normalization steps in order and composes them into one `CharSequenceNormalizer` via `TextNormalizer.Builder.build()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static TextNormalizer.Builder`
  `builder()`
  Returns a new, empty `TextNormalizer.Builder`.
  `static opennlp.tools.util.normalizer.CharSequenceNormalizer`
  `defaultChain()`
  Returns a conservative, ready-made normalization chain.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### builder

    public static TextNormalizer.Builder builder()
    Returns a new, empty `TextNormalizer.Builder`.
    Returns:
      a new, empty `TextNormalizer.Builder`

  - ### defaultChain

    public static opennlp.tools.util.normalizer.CharSequenceNormalizer defaultChain()
    Returns a conservative, ready-made normalization chain.

    The chain strips invisible controls, applies NFC, collapses whitespace, folds quotes and dashes, case folds, and finally applies script-gated diacritic folding.

    Returns:
      a conservative, ready-made normalization chain