Package opennlp.tools.util.featuregen
Class AggregatedFeatureGenerator
- java.lang.Object
-
- opennlp.tools.util.featuregen.AggregatedFeatureGenerator
-
- All Implemented Interfaces:
AdaptiveFeatureGenerator
public class AggregatedFeatureGenerator extends java.lang.Object implements AdaptiveFeatureGenerator
TheAggregatedFeatureGenerator
aggregates a set ofAdaptiveFeatureGenerator
s and calls them to generate the features.
-
-
Constructor Summary
Constructors Constructor Description AggregatedFeatureGenerator(java.util.Collection<AdaptiveFeatureGenerator> generators)
AggregatedFeatureGenerator(AdaptiveFeatureGenerator... generators)
Initializes the current instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAdaptiveData()
Calls theAdaptiveFeatureGenerator.clearAdaptiveData()
method on all aggregatedAdaptiveFeatureGenerator
s.void
createFeatures(java.util.List<java.lang.String> features, java.lang.String[] tokens, int index, java.lang.String[] previousOutcomes)
Calls theAdaptiveFeatureGenerator.createFeatures(List, String[], int, String[])
method on all aggregatedAdaptiveFeatureGenerator
s.java.util.Collection<AdaptiveFeatureGenerator>
getGenerators()
Retrieves aCollections
of all aggregatedAdaptiveFeatureGenerator
s.void
updateAdaptiveData(java.lang.String[] tokens, java.lang.String[] outcomes)
Calls theAdaptiveFeatureGenerator.updateAdaptiveData(String[], String[])
method on all aggregatedAdaptiveFeatureGenerator
s.
-
-
-
Constructor Detail
-
AggregatedFeatureGenerator
public AggregatedFeatureGenerator(AdaptiveFeatureGenerator... generators)
Initializes the current instance.- Parameters:
generators
- array of generators, null values are not permitted
-
AggregatedFeatureGenerator
public AggregatedFeatureGenerator(java.util.Collection<AdaptiveFeatureGenerator> generators)
-
-
Method Detail
-
clearAdaptiveData
public void clearAdaptiveData()
Calls theAdaptiveFeatureGenerator.clearAdaptiveData()
method on all aggregatedAdaptiveFeatureGenerator
s.- Specified by:
clearAdaptiveData
in interfaceAdaptiveFeatureGenerator
-
createFeatures
public void createFeatures(java.util.List<java.lang.String> features, java.lang.String[] tokens, int index, java.lang.String[] previousOutcomes)
Calls theAdaptiveFeatureGenerator.createFeatures(List, String[], int, String[])
method on all aggregatedAdaptiveFeatureGenerator
s.- Specified by:
createFeatures
in interfaceAdaptiveFeatureGenerator
- Parameters:
features
- The list of features to be added to.tokens
- The tokens of the sentence or other text unit being processed.index
- The index of the token which is currently being processed.previousOutcomes
- The outcomes for the tokens prior to the specified index.
-
updateAdaptiveData
public void updateAdaptiveData(java.lang.String[] tokens, java.lang.String[] outcomes)
Calls theAdaptiveFeatureGenerator.updateAdaptiveData(String[], String[])
method on all aggregatedAdaptiveFeatureGenerator
s.- Specified by:
updateAdaptiveData
in interfaceAdaptiveFeatureGenerator
- Parameters:
tokens
- The tokens of the sentence or other text unit which has been processed.outcomes
- The outcomes associated with the specified tokens.
-
getGenerators
public java.util.Collection<AdaptiveFeatureGenerator> getGenerators()
Retrieves aCollections
of all aggregatedAdaptiveFeatureGenerator
s.- Returns:
- all aggregated generators
-
-