Class WhitespaceCharSequenceNormalizer

java.lang.Object
opennlp.tools.util.normalizer.WhitespaceCharSequenceNormalizer
All Implemented Interfaces:
Serializable, CharSequenceNormalizer, OffsetAwareNormalizer

public class WhitespaceCharSequenceNormalizer extends Object implements OffsetAwareNormalizer
A CharSequenceNormalizer that collapses each run of Unicode whitespace to a single ASCII space and trims the edges, reusing the cursor based CharClass.whitespace() engine.

Unlike a \s regular expression, this recognizes the full Unicode White_Space set (no-break space, ideographic space, the typographic spaces, line and paragraph separators, and so on), so spacing copied from the web, PDFs, or non-Latin sources normalizes consistently. It is the Unicode-aware counterpart to ShrinkCharSequenceNormalizer.

See Also: