public class WordNetFeatureExtractor extends WordFeatureExtractor
The behavior for multiple word constituents is just like the
WordFeatureExtractor
:
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 FeatureException
.
Modifier and Type | Class and Description |
---|---|
static class |
WordNetFeatureExtractor.WordNetFeatureClass |
Modifier and Type | Field and Description |
---|---|
static WordNetManager |
wnManager |
Constructor and Description |
---|
WordNetFeatureExtractor(String jwnlConfigFile)
Creates a new WordNetFeatureExtractor.
|
WordNetFeatureExtractor(String jwnlConfigFile,
boolean useLastWord)
Creates a new WordNetFeatureExtractor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFeatureType(WordNetFeatureExtractor.WordNetFeatureClass name) |
String |
getName() |
Set<Feature> |
getWordFeatures(TextAnnotation ta,
int tokenPosition) |
convertToWordFeatureExtractor, getFeatures
public static WordNetManager wnManager
public WordNetFeatureExtractor(String jwnlConfigFile, boolean useLastWord) throws FileNotFoundException, net.didion.jwnl.JWNLException
It is probably safest to the parameter useLastWord
to true. This
will provide a check to ensure that the WordNetFeatureExtractor only sees
words.
jwnlConfigFile
- useLastWord
- net.didion.jwnl.JWNLException
FileNotFoundException
WordFeatureExtractor
public WordNetFeatureExtractor(String jwnlConfigFile) throws FileNotFoundException, net.didion.jwnl.JWNLException
new WordNetFeatureExtractor(jwnlConfigFile, false)
.net.didion.jwnl.JWNLException
FileNotFoundException
WordNetFeatureExtractor(String, boolean)
public void addFeatureType(WordNetFeatureExtractor.WordNetFeatureClass name)
public Set<Feature> getWordFeatures(TextAnnotation ta, int tokenPosition) throws EdisonException
getWordFeatures
in class WordFeatureExtractor
EdisonException
public String getName()
getName
in interface FeatureExtractor
getName
in class WordFeatureExtractor
Copyright © 2015. All rights reserved.