uk.ac.shef.dcs.oak.jate.core.feature
Class FeatureDocumentTermFrequency
java.lang.Object
uk.ac.shef.dcs.oak.jate.core.feature.AbstractFeature
uk.ac.shef.dcs.oak.jate.core.feature.FeatureDocumentTermFrequency
public class FeatureDocumentTermFrequency
- extends AbstractFeature
A feature store that contains information of term distributions in each document. 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 in each document
- existence of terms in documents
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
FeatureDocumentTermFrequency
protected FeatureDocumentTermFrequency(GlobalIndex index)
setTotalCorpusTermFreq
public void setTotalCorpusTermFreq(int i)
- Set total number of occurrences of all terms in the corpus
- Parameters:
i
-
getTotalCorpusTermFreq
public int getTotalCorpusTermFreq()
addToTermFreqInDoc
public void addToTermFreqInDoc(java.lang.String t,
Document d,
int freq)
- Increment term t's number of occurrences in d by freq
- Parameters:
t
- d
- freq
-
addToTermFreqInDoc
public void addToTermFreqInDoc(int t,
int d,
int freq)
- Increment term t (id) number of occurrences in d by freq
- Parameters:
t
- d
- freq
-
getTermFreqInDoc
public int getTermFreqInDoc(java.lang.String term,
Document d)
- Parameters:
term
- d
-
- Returns:
- number of occurrences of a term t in a document d
getTermFreqInDoc
public int getTermFreqInDoc(int t,
int d)
- Parameters:
t
- d
-
- Returns:
- number of occurrences of a term identified by id t in a document identified by id d
getTermFreqInDoc
public int getTermFreqInDoc(java.lang.String t,
int d)
- Parameters:
t
- d
-
- Returns:
- number of occurrences of a term t in a document identified by id d
getTermAppear
public int[] getTermAppear(java.lang.String t)
- Parameters:
t
-
- Returns:
- the id's of documents in which term t are found
getSumTermFreqInDocs
public int getSumTermFreqInDocs(java.lang.String term)
- Parameters:
term
-
- Returns:
- number of occurrences of a term in all documents
getSumTermFreqInDocs
public int getSumTermFreqInDocs(int term)
- Parameters:
term
-
- Returns:
- number of occurrences of a term in all documents