uk.ac.shef.dcs.oak.jate.core.feature
Class FeatureRefCorpusTermFrequency
java.lang.Object
uk.ac.shef.dcs.oak.jate.core.feature.AbstractFeature
uk.ac.shef.dcs.oak.jate.core.feature.FeatureRefCorpusTermFrequency
public class FeatureRefCorpusTermFrequency
- extends AbstractFeature
A feature store that contains information of term distributions over a reference corpus. It contains following
information:
- total number of occurrences of all terms found in the reference corpus, which is the sum of occurrences of each term
- number of occurrences of each term found in the reference corpus
Method Summary |
void |
addToTermFreq(java.lang.String t,
int i)
increment the number of occurrences of term t by i |
double |
getNormalizedTermFreq(java.lang.String w)
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(java.lang.String t)
Get the number of occurrences of a term in the corpus |
int |
getTotalRefCorpusTermFreq()
|
void |
setTotalRefCorpusTermFreq(int i)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FeatureRefCorpusTermFrequency
protected FeatureRefCorpusTermFrequency()
getTotalRefCorpusTermFreq
public int getTotalRefCorpusTermFreq()
setTotalRefCorpusTermFreq
public void setTotalRefCorpusTermFreq(int i)
addToTermFreq
public void addToTermFreq(java.lang.String t,
int i)
- increment the number of occurrences of term t by i
- Parameters:
t
- i
-
getTermFreq
public int getTermFreq(java.lang.String t)
- Get the number of occurrences of a term in the corpus
- Parameters:
t
-
- Returns:
getNormalizedTermFreq
public double getNormalizedTermFreq(java.lang.String w)
- 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:
w
- the id of the term
- Returns: