Package opennlp.tools.util.featuregen
Class AggregatedFeatureGenerator
- java.lang.Object
-
- opennlp.tools.util.featuregen.AggregatedFeatureGenerator
-
- All Implemented Interfaces:
AdaptiveFeatureGenerator
public class AggregatedFeatureGenerator extends Object implements AdaptiveFeatureGenerator
TheAggregatedFeatureGeneratoraggregates a set ofAdaptiveFeatureGenerators and calls them to generate the features.
-
-
Constructor Summary
Constructors Constructor Description AggregatedFeatureGenerator(Collection<AdaptiveFeatureGenerator> generators)AggregatedFeatureGenerator(AdaptiveFeatureGenerator... generators)Initializes the current instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAdaptiveData()Calls theAdaptiveFeatureGenerator.clearAdaptiveData()method on all aggregatedAdaptiveFeatureGenerators.voidcreateFeatures(List<String> features, String[] tokens, int index, String[] previousOutcomes)Calls theAdaptiveFeatureGenerator.createFeatures(List, String[], int, String[])method on all aggregatedAdaptiveFeatureGenerators.Collection<AdaptiveFeatureGenerator>getGenerators()Retrieves aCollectionsof all aggregatedAdaptiveFeatureGenerators.voidupdateAdaptiveData(String[] tokens, String[] outcomes)Calls theAdaptiveFeatureGenerator.updateAdaptiveData(String[], String[])method on all aggregatedAdaptiveFeatureGenerators.
-
-
-
Constructor Detail
-
AggregatedFeatureGenerator
public AggregatedFeatureGenerator(AdaptiveFeatureGenerator... generators)
Initializes the current instance.- Parameters:
generators- array of generators, null values are not permitted
-
AggregatedFeatureGenerator
public AggregatedFeatureGenerator(Collection<AdaptiveFeatureGenerator> generators)
-
-
Method Detail
-
clearAdaptiveData
public void clearAdaptiveData()
Calls theAdaptiveFeatureGenerator.clearAdaptiveData()method on all aggregatedAdaptiveFeatureGenerators.- Specified by:
clearAdaptiveDatain interfaceAdaptiveFeatureGenerator
-
createFeatures
public void createFeatures(List<String> features, String[] tokens, int index, String[] previousOutcomes)
Calls theAdaptiveFeatureGenerator.createFeatures(List, String[], int, String[])method on all aggregatedAdaptiveFeatureGenerators.- Specified by:
createFeaturesin 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(String[] tokens, String[] outcomes)
Calls theAdaptiveFeatureGenerator.updateAdaptiveData(String[], String[])method on all aggregatedAdaptiveFeatureGenerators.- Specified by:
updateAdaptiveDatain 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 Collection<AdaptiveFeatureGenerator> getGenerators()
Retrieves aCollectionsof all aggregatedAdaptiveFeatureGenerators.- Returns:
- all aggregated generators
-
-