|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.udo.cs.wvtool.wordlist.WVTWord
class WVTWord
Class, which represents an individual word and its occurances (class and document frequencies). It is also used as counter to count word occurances in a currently processed document.
Field Summary | |
---|---|
private int[] |
classCount
counter for the class frequencies |
private int |
documentCount
counter for the document frequencies |
private int |
localCount
counter for the term frequencies in the currently processed document |
private java.lang.String |
word
the word |
Constructor Summary | |
---|---|
WVTWord(java.lang.String word)
Create a new instance of Word, not supporting class values. |
|
WVTWord(java.lang.String word,
int numClasses)
Create a new instance of Word. |
Method Summary | |
---|---|
void |
addOccurance()
Add an occurance of the word for the document currently processed. |
void |
closeDocument(boolean onlyReset)
Close the processing of the current document, no class value is provided for this document. |
void |
closeDocument(int classValue,
boolean onlyReset)
Close the processing of the current document, if a class value is provided. |
int |
getClassFrequency(int classValue)
Return the class frequency of this word for a given class. |
int |
getDocumentFrequency()
Return the document frequency for this word. |
int |
getLocalFrequency()
Return the frequency for the current document. |
java.lang.String |
getWord()
Returns the word. |
void |
setClassFrequency(int index,
int v)
Set the class frequency |
void |
setDocumentFrequency(int v)
Set the document frequency |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String word
private int[] classCount
private int documentCount
private int localCount
Constructor Detail |
---|
public WVTWord(java.lang.String word, int numClasses)
word
- the word as a StringnumClasses
- the number of possible class valuespublic WVTWord(java.lang.String word)
word
- the word as a StringMethod Detail |
---|
public void addOccurance()
public void closeDocument(boolean onlyReset)
onlyReset
- should only the local counter be reseted (without
changing the other frequencies)public void closeDocument(int classValue, boolean onlyReset)
classValue
- the class value for the document, which has been just
processedonlyReset
- should only the local counter be reseted (without
changing the other frequencies)public int getLocalFrequency()
public int getDocumentFrequency()
public void setDocumentFrequency(int v)
v
- the valuepublic void setClassFrequency(int index, int v)
index
- the index of the class valuev
- the value to setpublic int getClassFrequency(int classValue)
classValue
- the class value
public java.lang.String getWord()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |