uk.ac.shef.dcs.oak.jate.core.feature
Class FeatureCorpusTermFrequency

java.lang.Object
  extended by uk.ac.shef.dcs.oak.jate.core.feature.AbstractFeature
      extended by uk.ac.shef.dcs.oak.jate.core.feature.FeatureCorpusTermFrequency

public class FeatureCorpusTermFrequency
extends AbstractFeature

A feature store that contains information of term distributions over a corpus. It contains following information:
- total number of occurrences of all terms found in the corpus, which is the sum of occurrences of each term
- number of occurrences of each term found in the corpus


Field Summary
 
Fields inherited from class uk.ac.shef.dcs.oak.jate.core.feature.AbstractFeature
_index
 
Constructor Summary
protected FeatureCorpusTermFrequency(GlobalIndex index)
           
 
Method Summary
 void addToTermFreq(int t, int i)
          increment the number of occurrences of term with id t by i
 void addToTermFreq(java.lang.String term, int i)
          increment the number of occurrences of term by i
 double getNormalizedTermFreq(int t)
          Get the normalised frequency of a term in the corpus, which is the number of occurrences of that term as a fraction of the total number of occurrences of all terms in the corpus.
 double getNormalizedTermFreq(java.lang.String term)
          Get the normalised frequency of a term in the corpus, which is the number of occurrences of that term as a fraction of the total number of occurrences of all terms in the corpus.
 int getTermFreq(int t)
          Get the number of occurrences of a term in the corpus
 int getTermFreq(java.lang.String term)
          Get the number of occurrences of a term in the corpus
 int getTotalCorpusTermFreq()
           
 void setTermFreq(int t, int freq)
          Set the number of occurrences of a term with id t
 void setTermFreq(java.lang.String term, int freq)
          Set the number of occurrences of a term
 void setTotalCorpusTermFreq(int i)
           
 
Methods inherited from class uk.ac.shef.dcs.oak.jate.core.feature.AbstractFeature
getGlobalIndex, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FeatureCorpusTermFrequency

protected FeatureCorpusTermFrequency(GlobalIndex index)
Method Detail

getTotalCorpusTermFreq

public int getTotalCorpusTermFreq()

setTotalCorpusTermFreq

public void setTotalCorpusTermFreq(int i)

addToTermFreq

public void addToTermFreq(java.lang.String term,
                          int i)
increment the number of occurrences of term by i

Parameters:
term -
i -

addToTermFreq

public void addToTermFreq(int t,
                          int i)
increment the number of occurrences of term with id t by i

Parameters:
t -
i -

setTermFreq

public void setTermFreq(java.lang.String term,
                        int freq)
Set the number of occurrences of a term

Parameters:
term -
freq -

setTermFreq

public void setTermFreq(int t,
                        int freq)
Set the number of occurrences of a term with id t

Parameters:
t -
freq -

getTermFreq

public int getTermFreq(java.lang.String term)
Get the number of occurrences of a term in the corpus

Parameters:
term -
Returns:

getTermFreq

public int getTermFreq(int t)
Get the number of occurrences of a term in the corpus

Parameters:
t - the id of the term
Returns:

getNormalizedTermFreq

public double getNormalizedTermFreq(java.lang.String term)
Get the normalised frequency of a term in the corpus, which is the number of occurrences of that term as a fraction of the total number of occurrences of all terms in the corpus.

Parameters:
term -
Returns:

getNormalizedTermFreq

public double getNormalizedTermFreq(int t)
Get the normalised frequency of a term in the corpus, which is the number of occurrences of that term as a fraction of the total number of occurrences of all terms in the corpus.

Parameters:
t - the id of the term
Returns: