public class WordAnalyser
extends java.lang.Object
Constructor and Description |
---|
WordAnalyser(java.util.List<WeightedWordInterface> weightedWords)
Creates a new WordAnalyzer with the supplied list of WeightedWords.
|
Modifier and Type | Method and Description |
---|---|
java.util.TreeSet<java.lang.Integer> |
getColorValueSortedTreeSet()
This method returns a TreeSet of the index numbers of the weightedWords
list where the indexes are sorted by the colorValue of the weighted word.
|
float |
getColorWeight(int value)
Figures out the weight from 0 to 1 based on the supplied color value
|
int |
getMaxColorValue()
Returns the highest value of the color value
|
int |
getMaxSizeValue()
Returns the highest value of the size values
|
int |
getMinColorValue()
Returns the lowest value of the color value
|
int |
getMinSizeValue()
Returns the lowest value of the size values
|
java.util.TreeSet<java.lang.Integer> |
getSizeValueSortedTreeSet()
This method returns a TreeSet of the index numbers of the weightedWords
list where the indexes are sorted by the sizeValue of the weighted word.
|
float |
getSizeWeight(int value)
Returns the weight from 0 to 1 for a given size value
|
java.util.List<WeightedWordInterface> |
getTopWordsColorWeighted(int limit)
Returns an alphabetical List of the the first n words as per the
ColorValue order
|
java.util.List<WeightedWordInterface> |
getTopWordsSizeWeighted(int limit)
Returns an alphabetical List of the the first n words as per the
SizeValue order
|
java.util.List<WeightedWordInterface> |
getWeightedWords()
Returns the list of WeightedWords
|
WeightedWordInterface |
getWord(int i)
Returns the word for the index
|
public WordAnalyser(java.util.List<WeightedWordInterface> weightedWords)
weightedWords
- The list of weightedWordspublic WeightedWordInterface getWord(int i)
i
- the word index, 0 to size() - 1public java.util.List<WeightedWordInterface> getWeightedWords()
public java.util.TreeSet<java.lang.Integer> getSizeValueSortedTreeSet()
public int getMaxSizeValue()
public int getMinSizeValue()
public float getSizeWeight(int value)
value
- the value for which to figure out the weightpublic java.util.List<WeightedWordInterface> getTopWordsSizeWeighted(int limit)
limit
- The maximum words to returnpublic java.util.TreeSet<java.lang.Integer> getColorValueSortedTreeSet()
public int getMaxColorValue()
public int getMinColorValue()
public float getColorWeight(int value)
value
- the value for which to figure out the weightpublic java.util.List<WeightedWordInterface> getTopWordsColorWeighted(int limit)
limit
- The maximum words to return