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.
Note: you must call addFeatureType(WordNetFeatureClass) in order
to specify which types of WordNet features you would like. If you do not add any feature types,
no features will be returned. See WordNetFeatureExtractor.WordNetFeatureClass to learn about WordNet feature
types.
| Modifier and Type | Class and Description |
|---|---|
static class |
WordNetFeatureExtractor.WordNetFeatureClass
Feature types as used in
addFeatureType(WordNetFeatureClass). |
| Modifier and Type | Field and Description |
|---|---|
static WordNetManager |
wnManager |
| Constructor and Description |
|---|
WordNetFeatureExtractor()
Creates a new WordNetFeatureExtractor.
|
WordNetFeatureExtractor(boolean useLastWord)
Creates a new WordNetFeatureExtractor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFeatureType(WordNetFeatureExtractor.WordNetFeatureClass name)
Specify which types of features you would like this feature extractor to extract.
|
String |
getName() |
Set<Feature> |
getWordFeatures(TextAnnotation ta,
int tokenPosition) |
convertToWordFeatureExtractor, getFeaturespublic static WordNetManager wnManager
public WordNetFeatureExtractor(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.
FileNotFoundExceptionnet.didion.jwnl.JWNLExceptionpublic WordNetFeatureExtractor()
throws FileNotFoundException,
net.didion.jwnl.JWNLException
new WordNetFeatureExtractor(false).net.didion.jwnl.JWNLExceptionFileNotFoundExceptionWordNetFeatureExtractor(boolean)public void addFeatureType(WordNetFeatureExtractor.WordNetFeatureClass name)
name - feature typepublic Set<Feature> getWordFeatures(TextAnnotation ta, int tokenPosition) throws EdisonException
getWordFeatures in class WordFeatureExtractorEdisonExceptionpublic String getName()
getName in interface FeatureExtractorgetName in class WordFeatureExtractorCopyright © 2017. All rights reserved.