java.io.Serializable
, OptionHandler
public class ArffLexiconWordLabeller extends java.lang.Object implements java.io.Serializable, OptionHandler
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
LEXICON_FOLDER_NAME |
Default path to where lexicons are stored.
|
static java.lang.String |
METALEX_FILE_NAME |
The path of the MetaLexLexicon default lexicon.
|
Constructor | Description |
---|---|
ArffLexiconWordLabeller() |
Modifier and Type | Method | Description |
---|---|---|
java.util.Map<Attribute,java.lang.Double> |
evaluateWord(java.lang.String word) |
Retrieves word-affective associations from a lexicon for a particular word
|
java.util.List<Attribute> |
getAttributes() |
Gets the feature names
|
java.io.File |
getLexiconFile() |
|
java.lang.String |
getLexiconName() |
|
java.lang.String |
getLexiconWordIndex() |
|
java.lang.String[] |
getOptions() |
|
Stemmer |
getStemmer() |
|
java.lang.String |
globalInfo() |
Returns a string describing this filter.
|
java.util.Enumeration<Option> |
listOptions() |
|
void |
processDict() |
Processes all the dictionary files.
|
void |
setLexiconFile(java.io.File lexiconFile) |
|
void |
setLexiconName(java.lang.String lexiconName) |
|
void |
setLexiconWordIndex(java.lang.String lexiconWordIndex) |
|
void |
setOptions(java.lang.String[] options) |
|
void |
setStemmer(Stemmer m_stemmer) |
public static java.lang.String LEXICON_FOLDER_NAME
public static java.lang.String METALEX_FILE_NAME
public void processDict() throws java.io.IOException
java.io.IOException
- an IOException will be raised if an invalid file is suppliedpublic java.util.Map<Attribute,java.lang.Double> evaluateWord(java.lang.String word)
word
- the target wordpublic java.util.List<Attribute> getAttributes()
public java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
java.lang.Exception
@OptionMetadata(displayName="lexicon file", description="The arff file with the input lexicon.", commandLineParamName="lexiconFile", commandLineParamSynopsis="-lexiconFile <string>", displayOrder=1) public java.io.File getLexiconFile()
public void setLexiconFile(java.io.File lexiconFile)
@OptionMetadata(displayName="lexiconName", description="The lexicon name to be prefixed in all features calculated from this lexicon.", commandLineParamName="B", commandLineParamSynopsis="-B", displayOrder=2) public java.lang.String getLexiconName()
public void setLexiconName(java.lang.String lexiconName)
@OptionMetadata(displayName="lexiconWordIndex", description="The index of the word attribute in the given arff lexicon (starting from 1). First and last are valid values.", commandLineParamName="A", commandLineParamSynopsis="-A <col>", displayOrder=3) public java.lang.String getLexiconWordIndex()
public void setLexiconWordIndex(java.lang.String lexiconWordIndex)
@OptionMetadata(displayName="stemmer", description="The stemming algorithm to use on the words from the lexicon. It is recommended to use the same stemmer used with the main filter. Default: no stemming.", commandLineParamName="lex-stemmer", commandLineParamSynopsis="-lex-stemmer <string>", displayOrder=4) public Stemmer getStemmer()
public void setStemmer(Stemmer m_stemmer)