Class CollapseRepeatingTransformer

java.lang.Object
com.norconex.importer.handler.transformer.impl.CollapseRepeatingTransformer
All Implemented Interfaces:
Configurable<CollapseRepeatingTransformerConfig>, ConfigurableDocHandler<CollapseRepeatingTransformerConfig>, DocHandler

public class CollapseRepeatingTransformer extends Object implements ConfigurableDocHandler<CollapseRepeatingTransformerConfig>

Reduces specified consecutive characters or strings to only one instance (document content only). If reducing duplicate words, you usually have to add a space at the Beginning or end of the word.

This class can be used as a pre-parsing (text content-types only) or post-parsing handlers.

For more advanced replacement needs, consider using ReplaceTransformer instead.

In addition to regular characters, you can specify these special characters in your XML:

  • \r (carriage returns)
  • \n (line feed)
  • \t (tab)
  • \s (space)
See Also: