tc
Class TCTerm

java.lang.Object
  extended bytc.TCTerm
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable

public class TCTerm
extends java.lang.Object
implements java.lang.Comparable, java.lang.Cloneable

Class representing a single term in either a document, a category or the corpus


Field Summary
private  int documentFrequency
          the frewuency in either a category or the entire corpus
private  double inverseDocumentFrequency
          the inverse document frequency in the corpus
private  int termFrequency
          number of occurences in either a document, a category or the entire corpus
private  double weightValue
          the weight calculated by the weight functions
private  java.lang.String word
          the actual token (word).
 
Constructor Summary
(package private) TCTerm(java.lang.String term)
          Constructor of the Class TCTerm
 
Method Summary
 int addDocumentFrequency(int num)
           
 int addTermFrequency(int num)
           
 java.lang.Object clone()
          clones the term object
 int compareTo(java.lang.Object arg0)
          The terms will be compared using the weight variable
 boolean equals(java.lang.Object arg0)
          The string in the class is the unique "index"
 int getDocumentFrequency()
          returns the frequency of the term (in either a category or the entire corpus)
 double getInverseDocumentFrequency()
          returns the inverse document frequency of the term (in the corpus)
 int getTermFrequency()
          returns the number of occurences
 double getWeightValue()
          returns the weight-value for the term, calculated by one of the many wighting functions available in TCCorpus
 java.lang.String getWord()
          returns the word (index) of the string
 void setDocumentFrequency(int freq)
          sets the frequency of the term
 void setInverseDocumentFrequency(double ifreq)
           
 void setTermFrequency(int occ)
          sets the occurence of the term
 void setWeightValue(double wv)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

word

private java.lang.String word
the actual token (word). Is used as unique index!


termFrequency

private int termFrequency
number of occurences in either a document, a category or the entire corpus


documentFrequency

private int documentFrequency
the frewuency in either a category or the entire corpus


inverseDocumentFrequency

private double inverseDocumentFrequency
the inverse document frequency in the corpus


weightValue

private double weightValue
the weight calculated by the weight functions

Constructor Detail

TCTerm

TCTerm(java.lang.String term)
Constructor of the Class TCTerm

Parameters:
term - the term represented by this object
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clones the term object

Throws:
java.lang.CloneNotSupportedException

getWord

public java.lang.String getWord()
returns the word (index) of the string

Returns:

getTermFrequency

public int getTermFrequency()
returns the number of occurences

Returns:
number of occurences

getDocumentFrequency

public int getDocumentFrequency()
returns the frequency of the term (in either a category or the entire corpus)

Returns:

getInverseDocumentFrequency

public double getInverseDocumentFrequency()
returns the inverse document frequency of the term (in the corpus)

Returns:
the inverse document frequency of the term

getWeightValue

public double getWeightValue()
returns the weight-value for the term, calculated by one of the many wighting functions available in TCCorpus

Returns:
the weight-value of the term

setTermFrequency

public void setTermFrequency(int occ)
sets the occurence of the term

Parameters:
occ - the new value for the occurence field

setDocumentFrequency

public void setDocumentFrequency(int freq)
sets the frequency of the term

Parameters:
freq - the new document frequency of the term

setInverseDocumentFrequency

public void setInverseDocumentFrequency(double ifreq)

setWeightValue

public void setWeightValue(double wv)

addTermFrequency

public int addTermFrequency(int num)

addDocumentFrequency

public int addDocumentFrequency(int num)

equals

public boolean equals(java.lang.Object arg0)
The string in the class is the unique "index"


compareTo

public int compareTo(java.lang.Object arg0)
The terms will be compared using the weight variable

Specified by:
compareTo in interface java.lang.Comparable