java.io.Serializable
public class NRCEmotionLexiconEvaluator extends LexiconEvaluator
Constructor | Description |
---|---|
NRCEmotionLexiconEvaluator(java.lang.String path,
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> words) |
Calculates lexicon-based feature values from a list of tokens
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
getDict() |
Gets the dictionary mapping the words to their emotion associations
|
java.util.Map<java.lang.String,java.lang.Integer> |
getWord(java.lang.String word) |
Gets the emotions for a word
|
void |
processDict() |
initializes the dictionary
|
getFeatureNames
public NRCEmotionLexiconEvaluator(java.lang.String path, java.lang.String name)
path
- the file with the lexiconname
- the prefix for all the attributes calculated from this lexiconpublic java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> getDict()
public java.util.Map<java.lang.String,java.lang.Integer> getWord(java.lang.String word)
word
- the emotion key namepublic void processDict() throws java.io.IOException
LexiconEvaluator
processDict
in class LexiconEvaluator
java.io.IOException
- in case of wrong filepublic java.util.Map<java.lang.String,java.lang.Double> evaluateTweet(java.util.List<java.lang.String> words)
LexiconEvaluator
evaluateTweet
in class LexiconEvaluator
words
- a tokenized tweet