com.aliasi.features
Class AddFeatureExtractor<E>

java.lang.Object
  extended by com.aliasi.features.AddFeatureExtractor<E>
Type Parameters:
E - Type of objects whose features are extracted
All Implemented Interfaces:
FeatureExtractor<E>, Serializable

public class AddFeatureExtractor<E>
extends Object
implements FeatureExtractor<E>, Serializable

An AddFeatureExtractor returns feature vectors that result from summing the feature vectors returned by a collection of contained feature extractors.

Since:
Lingpipe3.8
Version:
3.9.2
Author:
Bob Carpenter
See Also:
Serialized Form

Constructor Summary
AddFeatureExtractor(Collection<? extends FeatureExtractor<? super E>> extractors)
          Construct an additive feature extractor from the specified collection of extractors.
AddFeatureExtractor(FeatureExtractor<? super E>... extractors)
          Construct an additive feature extractor from the specified extractors.
AddFeatureExtractor(FeatureExtractor<? super E> extractor1, FeatureExtractor<? super E> extractor2)
          Construct an additive feature extractor from the specified pair of extractors.
 
Method Summary
 List<FeatureExtractor<? super E>> baseFeatureExtractors()
          Returns an unmodifiable view of the list of base feature extractors for this additive feature extractor.
 Map<String,? extends Number> features(E in)
          Return the feature vector for the specified input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddFeatureExtractor

public AddFeatureExtractor(Collection<? extends FeatureExtractor<? super E>> extractors)
Construct an additive feature extractor from the specified collection of extractors. Each extractor in the collection must be capable of parsing objects of type E.

The collection will be copied locally, so that subsequent changes to the extractor collection supplied to the constructor will not affect the returned feature extractor.

Parameters:
extractors - Collection of feature extractors.

AddFeatureExtractor

public AddFeatureExtractor(FeatureExtractor<? super E> extractor1,
                           FeatureExtractor<? super E> extractor2)
Construct an additive feature extractor from the specified pair of extractors.

Parameters:
extractor1 - First feature extractor.
extractor2 - Second feature extractor.

AddFeatureExtractor

public AddFeatureExtractor(FeatureExtractor<? super E>... extractors)
Construct an additive feature extractor from the specified extractors.

Parameters:
extractors - Variable length list (or a single array) of extractors.
Method Detail

features

public Map<String,? extends Number> features(E in)
Description copied from interface: FeatureExtractor
Return the feature vector for the specified input.

Specified by:
features in interface FeatureExtractor<E>
Parameters:
in - Input object.
Returns:
The feature vector for the specified input.

baseFeatureExtractors

public List<FeatureExtractor<? super E>> baseFeatureExtractors()
Returns an unmodifiable view of the list of base feature extractors for this additive feature extractor.

Returns:
The base feature extractors.