com.aliasi.features
Class PrefixedFeatureExtractor<E>

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

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

A PrefixedFeatureExtractor applies a specified prefix to all of the feature names from a base feature extractor. This class is convenient when combining feature extractors in situations where there might be name-space conflicts.

Thread Safety

A prefixed feature extractor is thread safe if its underlying feature extractor is thread safe.

Serialization

A prefixed feature extractor may be serialized if its underlying feature extractor is serializable. Deserialization produces an instance of this class.

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

Constructor Summary
PrefixedFeatureExtractor(String prefix, FeatureExtractor<E> extractor)
          Construct a feature extractor that adds the specified prefix to feature names extracted by the specified extractor.
 
Method Summary
 Map<String,? extends Number> features(E in)
          Return the feature map derived by prefixing the specified prefix to the feature names extracted by the base feature extractor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixedFeatureExtractor

public PrefixedFeatureExtractor(String prefix,
                                FeatureExtractor<E> extractor)
Construct a feature extractor that adds the specified prefix to feature names extracted by the specified extractor.

Parameters:
prefix - Prefix for feature names.
extractor - Base feature extractor.
Method Detail

features

public Map<String,? extends Number> features(E in)
Return the feature map derived by prefixing the specified prefix to the feature names extracted by the base feature extractor.

Specified by:
features in interface FeatureExtractor<E>
Parameters:
in - Object whose features are extracted.
Returns:
Mapping from prefixed features to values.