public class WordStemming
extends java.lang.Object
Constructor and Description |
---|
WordStemming()
Create a new instance of WordStemming.
|
WordStemming(java.util.ArrayList<java.lang.String> wordsList)
Create a new instance of WordStemming.
|
WordStemming(java.util.HashMap<java.lang.String,java.lang.Integer> thisBagOfWords)
Create a new instance of WordStemming.
|
Modifier and Type | Method and Description |
---|---|
java.util.HashMap<java.lang.String,java.lang.Integer> |
createStemmedBagOfWords()
Create a new bag of words structure using stemmed words instead.
|
java.util.ArrayList<java.lang.String> |
createStemmedWordsListOnly()
Create a new list of words using stemmed words instead.
|
java.lang.String |
stemWord(java.lang.String wordToken)
Stem the single word token.
|
public WordStemming()
public WordStemming(java.util.HashMap<java.lang.String,java.lang.Integer> thisBagOfWords)
createStemmedBagOfWords
method.thisBagOfWords
- the current bag of words structure.public WordStemming(java.util.ArrayList<java.lang.String> wordsList)
createStemmedWordsListOnly
methodwordsList
- a list of words to be converted into a hash structure
with a count of 1 for each word.public java.util.HashMap<java.lang.String,java.lang.Integer> createStemmedBagOfWords() throws java.lang.Exception
java.lang.Exception
- any error.public java.util.ArrayList<java.lang.String> createStemmedWordsListOnly() throws java.lang.Exception
java.lang.Exception
- any error.public java.lang.String stemWord(java.lang.String wordToken) throws java.lang.Exception
wordToken
- the word to stem.java.lang.Exception
- any error.