public abstract class WordFeatureExtractor extends Object implements FeatureExtractor
If the input constituent is not a word, then the feature extractor can do one of two things: If a
flag is set in the constructor, then it will generate features from the last word of the
constituent. If the flag is not set, then it will throw a EdisonException
.
Constructor and Description |
---|
WordFeatureExtractor()
Creates a new
WordFeatureExtractor . |
WordFeatureExtractor(boolean useLastWordOfMultiwordConstituents)
Creates a new WordFeatureExtractor.
|
Modifier and Type | Method and Description |
---|---|
static WordFeatureExtractor |
convertToWordFeatureExtractor(FeatureExtractor fex) |
Set<Feature> |
getFeatures(Constituent c) |
String |
getName() |
abstract Set<Feature> |
getWordFeatures(TextAnnotation ta,
int wordPosition) |
public WordFeatureExtractor(boolean useLastWordOfMultiwordConstituents)
useLastWordOfMultiwordConstituents
is true
, then the feature extractor will generate features from the last word of
multi-word constituents. If it is not true, then the feature extractor will throw an
exception on seeing a multi-word constituent.
It is probably safest to the parameter to true
. This will provide a check to ensure
that the WordFeatureExtractor only sees words.
public WordFeatureExtractor()
WordFeatureExtractor
. This
constructor is equivalent to calling new WordFeatureExtractor(true)
.WordFeatureExtractor(boolean)
public static WordFeatureExtractor convertToWordFeatureExtractor(FeatureExtractor fex)
public Set<Feature> getFeatures(Constituent c) throws EdisonException
getFeatures
in interface FeatureExtractor
EdisonException
public abstract Set<Feature> getWordFeatures(TextAnnotation ta, int wordPosition) throws EdisonException
EdisonException
public String getName()
getName
in interface FeatureExtractor
Copyright © 2017. All rights reserved.