|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.shef.dcs.oak.jate.core.feature.AbstractFeature
uk.ac.shef.dcs.oak.jate.core.feature.FeatureCorpusTermFrequency
public class FeatureCorpusTermFrequency
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 |
---|
protected FeatureCorpusTermFrequency(GlobalIndex index)
Method Detail |
---|
public int getTotalCorpusTermFreq()
public void setTotalCorpusTermFreq(int i)
public void addToTermFreq(java.lang.String term, int i)
term
- i
- public void addToTermFreq(int t, int i)
t
- i
- public void setTermFreq(java.lang.String term, int freq)
term
- freq
- public void setTermFreq(int t, int freq)
t
- freq
- public int getTermFreq(java.lang.String term)
term
-
public int getTermFreq(int t)
t
- the id of the term
public double getNormalizedTermFreq(java.lang.String term)
term
-
public double getNormalizedTermFreq(int t)
t
- the id of the term
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |