Class TextStatisticsTransformerConfig
java.lang.Object
com.norconex.importer.handler.BaseLabelableConfig
com.norconex.importer.handler.BaseDocHandlerConfig
com.norconex.importer.handler.transformer.impl.TextStatisticsTransformerConfig
- All Implemented Interfaces:
Labelable
Analyzes the content of the supplied document and adds statistical information about its content or field as metadata fields. Default behavior provide the statistics about the content. Refer to the following for the new metadata fields to be created along with their description.
| Field name | Description |
|---|---|
| document.stat.characterCount | Total number of characters (excluding carriage returns/line feed). |
| document.stat.wordCount | Total number of words. |
| document.stat.sentenceCount | Total number of sentences. |
| document.stat.paragraphCount | Total number of paragraph. |
| document.stat.averageWordCharacterCount | Average number of character in every words. |
| document.stat.averageSentenceCharacterCount | Average number of character in sentences (including non-word characters, such as spaces, or slashes). |
| document.stat.averageSentenceWordCount | Average number of words per sentences. |
| document.stat.averageParagraphCharacterCount | Average number of characters in paragraphs (including non-word characters, such as spaces, or slashes). |
| document.stat.averageParagraphSentenceCount | Average number of sentences per paragraphs. |
| document.stat.averageParagraphWordCount | Average number of words per paragraphs. |
You can specify a field matcher to obtain statistics about matching
fields instead.
When you do so, the field name will be inserted in the above
names, right after "document.stat.". E.g.:
document.stat.myfield.characterCount
Can be used both as a pre-parse (text-only) or post-parse handler.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGets field matcher for fields to split.inthashCode()setFieldMatcher(TextMatcher fieldMatcher) Sets the field matcher for fields to split.setSourceCharset(Charset sourceCharset) toString()Methods inherited from class com.norconex.importer.handler.BaseLabelableConfig
getLabel, setLabel
-
Constructor Details
-
TextStatisticsTransformerConfig
public TextStatisticsTransformerConfig()
-
-
Method Details
-
getFieldMatcher
Gets field matcher for fields to split.- Returns:
- field matcher
-
setFieldMatcher
Sets the field matcher for fields to split.- Parameters:
fieldMatcher- field matcher
-
getSourceCharset
-
setSourceCharset
- Returns:
this.
-
equals
- Overrides:
equalsin classBaseLabelableConfig
-
canEqual
- Overrides:
canEqualin classBaseLabelableConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseLabelableConfig
-
toString
- Overrides:
toStringin classBaseLabelableConfig
-