Package opennlp.tools.util.normalizer
Class AlignedAggregateCharSequenceNormalizer
java.lang.Object
opennlp.tools.util.normalizer.AlignedAggregateCharSequenceNormalizer
- All Implemented Interfaces:
Serializable,CharSequenceNormalizer,OffsetAwareNormalizer
An
OffsetAwareNormalizer that applies a chain of offset-aware normalizers in order and composes
their per-stage Alignments with Alignment.andThen(Alignment), so the result maps a
span found in the fully normalized text back to the original input through every stage.
Produced by TextNormalizer.Builder.buildAligned(), which validates that every normalizer is
offset-aware before constructing this.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnormalize(CharSequence text) Normalizes a sequence of characters.normalizeAligned(CharSequence text) Normalizestextand returns the result together with theAlignmentback to the input.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
steps
-
-
Constructor Details
-
AlignedAggregateCharSequenceNormalizer
AlignedAggregateCharSequenceNormalizer(OffsetAwareNormalizer[] steps)
-
-
Method Details
-
normalize
Normalizes a sequence of characters.- Specified by:
normalizein interfaceCharSequenceNormalizer- Parameters:
text- TheCharSequenceto normalize. Must not benull.- Returns:
- The normalized
CharSequence.
-
normalizeAligned
Normalizestextand returns the result together with theAlignmentback to the input. The normalized text is identical toCharSequenceNormalizer.normalize(CharSequence): that is,normalizeAligned(text).normalized()equalsnormalize(text).toString().- Specified by:
normalizeAlignedin interfaceOffsetAwareNormalizer- Parameters:
text- TheCharSequenceto normalize.- Returns:
- The normalized text paired with its alignment to
text.
-