Class NgramProcessor
java.lang.Object
org.tribuo.data.text.impl.NgramProcessor
- All Implemented Interfaces:
- com.oracle.labs.mlrg.olcut.config.Configurable,- com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>,- TextProcessor
A text processor that will generate token ngrams of a particular size.
- 
Constructor SummaryConstructorsConstructorDescriptionNgramProcessor(Tokenizer tokenizer, int n, double value) Creates a processor that will generate token ngrams of sizen.
- 
Method SummaryModifier and TypeMethodDescriptioncom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenancevoidUsed by the OLCUT configuration system, and should not be called by external code.Extracts features from the supplied text.Extracts features from the supplied text.
- 
Constructor Details- 
NgramProcessorCreates a processor that will generate token ngrams of sizen.- Parameters:
- tokenizer- The tokenizer to use to process text.
- n- the size of the ngram to generate
- value- the value we will put in the new features.
 
 
- 
- 
Method Details- 
postConfigpublic void postConfig()Used by the OLCUT configuration system, and should not be called by external code.- Specified by:
- postConfigin interface- com.oracle.labs.mlrg.olcut.config.Configurable
 
- 
processDescription copied from interface:TextProcessorExtracts features from the supplied text.- Specified by:
- processin interface- TextProcessor
- Parameters:
- text- The text to extract.
- Returns:
- The extracted features.
- Throws:
- TextProcessingException- If an error occurred during extraction (usually from tokenization).
 
- 
processDescription copied from interface:TextProcessorExtracts features from the supplied text.- Specified by:
- processin interface- TextProcessor
- Parameters:
- tag- The feature name tag.
- text- The text to extract.
- Returns:
- The extracted features.
- Throws:
- TextProcessingException- If an error occurred during extraction (usually from tokenization).
 
- 
getProvenancepublic com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
- getProvenancein interface- com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
 
 
-