|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectat.tuwien.ifs.somtoolbox.output.labeling.UnitWords
public class UnitWords
This class is used for saving the word frequencies of word cocurrences. It also calculates the words' relative frequency
Field Summary | |
---|---|
private double |
numberOfWords
|
private boolean |
recalcNecessary
|
private Hashtable<String,Double> |
wordFreq
|
private int |
x
|
private int |
y
|
private int |
z
|
Constructor Summary | |
---|---|
UnitWords(int x,
int y,
int z)
|
Method Summary | |
---|---|
void |
addWord(String word)
Adds a word with frequency=1 |
void |
addWord(String word,
double frequency)
Adds a word with its frequency. |
double |
getAbsoluteFrequency(String word)
Calculates the relative frequency of a word in a unit |
double |
getNumberOfWords()
|
double |
getRelativeFrequency(String word)
Calculates the relative frequency of a word in a unit |
Set<String> |
getWordSet()
Returns a Set which contains all words of this unit |
int |
getX()
|
int |
getY()
|
int |
getZ()
|
private void |
recalcNumberOfWords()
Calculates the total number of words |
void |
setNumberOfWords(double numberOfWords)
|
void |
setX(int x)
|
void |
setY(int y)
|
void |
setZ(int z)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int x
private int y
private int z
private double numberOfWords
private boolean recalcNecessary
private Hashtable<String,Double> wordFreq
Constructor Detail |
---|
public UnitWords(int x, int y, int z)
x
- Position of the unit on the x-axisy
- Position of the unit on the y-axisz
- Position of the unit on the z-axisMethod Detail |
---|
public void setX(int x)
x
- The x to set.public int getX()
public void setY(int y)
y
- The y to set.public int getY()
public void setZ(int z)
z
- The z to set.public int getZ()
public void setNumberOfWords(double numberOfWords)
numberOfWords
- The numberOfWords to set.public double getNumberOfWords()
public double getAbsoluteFrequency(String word)
public double getRelativeFrequency(String word)
public void addWord(String word)
word
- the word to addaddWord(String word, double frequency)
public void addWord(String word, double frequency)
word
- the word to addfrequency
- of the occurrence of the wordprivate void recalcNumberOfWords()
public Set<String> getWordSet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |