Class CollapseRepeatingTransformerConfig
java.lang.Object
com.norconex.importer.handler.BaseLabelableConfig
com.norconex.importer.handler.BaseDocHandlerConfig
com.norconex.importer.handler.transformer.impl.CollapseRepeatingTransformerConfig
- All Implemented Interfaces:
Labelable,ChunkedTextSupport
public class CollapseRepeatingTransformerConfig
extends BaseDocHandlerConfig
implements ChunkedTextSupport
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGets source field matcher for fields on which to perform repeating string collapsing.intinthashCode()booleanGets whether to ignore case sensitivity.setFieldMatcher(TextMatcher fieldMatcher) Sets source field matcher for fields on which to perform repeating string collapsing.setIgnoreCase(boolean ignoreCase) Sets whether to ignore case sensitivity.setMaxReadSize(int maxReadSize) setSourceCharset(Charset sourceCharset) setStrings(List<String> strings) toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Constructor Details
-
CollapseRepeatingTransformerConfig
public CollapseRepeatingTransformerConfig()
-
-
Method Details
-
getStrings
-
setStrings
-
isIgnoreCase
public boolean isIgnoreCase()Gets whether to ignore case sensitivity.- Returns:
trueif ignoring character case
-
setIgnoreCase
Sets whether to ignore case sensitivity.- Parameters:
ignoreCase-trueif ignoring character case- Returns:
- this instance
-
getFieldMatcher
Gets source field matcher for fields on which to perform repeating string collapsing.- Specified by:
getFieldMatcherin interfaceChunkedTextSupport- Returns:
- field matcher
-
setFieldMatcher
Sets source field matcher for fields on which to perform repeating string collapsing.- Parameters:
fieldMatcher- field matcher- Returns:
- this instance
-
getMaxReadSize
public int getMaxReadSize()- Specified by:
getMaxReadSizein interfaceChunkedTextSupport
-
getSourceCharset
- Specified by:
getSourceCharsetin interfaceChunkedTextSupport
-
setMaxReadSize
- Returns:
this.
-
setSourceCharset
- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-