java.io.Serializable
public class PolarityLexiconEvaluator extends LexiconEvaluator
Constructor | Description |
---|---|
PolarityLexiconEvaluator(java.lang.String file,
java.lang.String name) |
initializes the Object
|
Modifier and Type | Method | Description |
---|---|---|
java.util.Map<java.lang.String,java.lang.Double> |
evaluateTweet(java.util.List<java.lang.String> tokens) |
Calculates lexicon-based feature values from a list of tokens
|
java.util.Map<java.lang.String,java.lang.String> |
getDict() |
Gets the dictionary mapping the words to their sentiment
|
void |
processDict() |
initializes the dictionary
|
java.lang.String |
retrieveValue(java.lang.String word) |
returns the sentiment associated with a word
|
getFeatureNames
public PolarityLexiconEvaluator(java.lang.String file, java.lang.String name)
file
- the file with the lexiconname
- the prefix for all the attributes calculated from this lexiconpublic void processDict() throws java.io.IOException
LexiconEvaluator
processDict
in class LexiconEvaluator
java.io.IOException
- in case of wrong filepublic java.lang.String retrieveValue(java.lang.String word)
word
- the input wordpublic java.util.Map<java.lang.String,java.lang.Double> evaluateTweet(java.util.List<java.lang.String> tokens)
LexiconEvaluator
evaluateTweet
in class LexiconEvaluator
tokens
- a tokenized tweetpublic java.util.Map<java.lang.String,java.lang.String> getDict()