|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.gla.dcs.renaissance.mg4j.Utils
public class Utils
Some utilities
Constructor Summary | |
---|---|
Utils()
|
Method Summary | |
---|---|
static Set<Integer> |
getDocumentTerms(it.unimi.dsi.mg4j.document.DocumentCollection collection,
int docID,
it.unimi.dsi.mg4j.index.TermProcessor processor,
IndexConfiguration index)
Get the set of terms of a document d |
static int |
getSumDF(IndexConfiguration indexConf)
This methods iterates over all terms of the given index and computes the sum of all terms' document frequencies (number of documents a term appears in) |
static int |
getWithinDocumentFrequencies(it.unimi.dsi.mg4j.document.DocumentCollection collection,
int docID,
it.unimi.dsi.mg4j.index.TermProcessor processor,
IndexConfiguration index,
it.unimi.dsi.fastutil.ints.AbstractInt2IntMap relFreq)
Get the within-document frequencies tf(t,d) of all terms t in a document d and the total number of tokens counted in d. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Utils()
Method Detail |
---|
public static int getWithinDocumentFrequencies(it.unimi.dsi.mg4j.document.DocumentCollection collection, int docID, it.unimi.dsi.mg4j.index.TermProcessor processor, IndexConfiguration index, it.unimi.dsi.fastutil.ints.AbstractInt2IntMap relFreq) throws IOException, bpiwowar.lang.RuntimeException
collection
- the document collectiondocID
- the document IDprocessor
- the term processor usedindex
- the index configurationrelFreq
- the Int2IntMap where the frequencies are returned, with the
term ID as key and its frequency within the document as value.
If the term does not appear in the document it won't appear
here as well. Note that relFreq will be cleared before
starting the calculation.
IOException
bpiwowar.lang.RuntimeException
public static int getSumDF(IndexConfiguration indexConf) throws IOException, UnsupportedOperationException
index
- the index under consideration
IOException
- if something went wrong while accessing the index
UnsupportedOperationException
public static Set<Integer> getDocumentTerms(it.unimi.dsi.mg4j.document.DocumentCollection collection, int docID, it.unimi.dsi.mg4j.index.TermProcessor processor, IndexConfiguration index) throws IOException, bpiwowar.lang.RuntimeException
collection
- the document collectiondocID
- the document IDprocessor
- the term processor usedindex
- the index configuration
IOException
bpiwowar.lang.RuntimeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |