Class WrapperIndividualContentIndex<C,U>
java.lang.Object
es.uam.eps.ir.relison.content.index.AbstractIndex<C>
es.uam.eps.ir.relison.content.index.individual.AbstractIndividualContentIndex<C,U>
es.uam.eps.ir.relison.content.index.individual.WrapperIndividualContentIndex<C,U>
- Type Parameters:
C
- type of the contents.U
- type of the users.
- All Implemented Interfaces:
DocumentMap<C>
,Index<C>
,IndividualContentIndex<C,U>
public class WrapperIndividualContentIndex<C,U> extends AbstractIndividualContentIndex<C,U>
Individual content index builder wrapping a simple one.
-
Field Summary
Fields inherited from class es.uam.eps.ir.relison.content.index.individual.AbstractIndividualContentIndex
contentsToUsers, usersToContents
-
Constructor Summary
Constructors Constructor Description WrapperIndividualContentIndex(Index<C> index, it.unimi.dsi.fastutil.ints.Int2ObjectMap<U> userMap)
Constructor.WrapperIndividualContentIndex(java.lang.String indexFolder, Index<C> index, org.ranksys.formats.parsing.Parser<U> uParser)
Constructor. -
Method Summary
Modifier and Type Method Description java.util.Collection<java.lang.String>
getAllTerms()
Obtains the set of all terms in the index dictionary.long
getDocFreq(java.lang.String term)
Obtains the number of documents containing the term.PostingsList
getPostings(java.lang.String term)
Obtains the posting list of a term.long
getTotalFreq(java.lang.String term)
Obtains the total frequency of a term in the collection.int
numDocs()
Obtains the number of contents.Methods inherited from class es.uam.eps.ir.relison.content.index.individual.AbstractIndividualContentIndex
getContents, getUser, loadUserContentMap
Methods inherited from class es.uam.eps.ir.relison.content.index.AbstractIndex
getContent, getContentId, loadContents
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface es.uam.eps.ir.relison.content.index.DocumentMap
getContent, getContentId
-
Field Details
-
index
The internal index.
-
-
Constructor Details
-
WrapperIndividualContentIndex
public WrapperIndividualContentIndex(java.lang.String indexFolder, Index<C> index, org.ranksys.formats.parsing.Parser<U> uParser) throws java.io.IOExceptionConstructor.- Parameters:
indexFolder
- route to the index.index
- the index.uParser
- a user parser.- Throws:
java.io.IOException
- if something fails while loading the content to user map.
-
WrapperIndividualContentIndex
public WrapperIndividualContentIndex(Index<C> index, it.unimi.dsi.fastutil.ints.Int2ObjectMap<U> userMap)Constructor.- Parameters:
index
- the index.userMap
- the content to user map.
-
-
Method Details
-
getPostings
Description copied from interface:Index
Obtains the posting list of a term.- Parameters:
term
- the term to look up.- Returns:
- the posting list of the term.
- Throws:
java.io.IOException
- if something fails while reading the posting list.
-
getAllTerms
public java.util.Collection<java.lang.String> getAllTerms() throws java.io.IOExceptionDescription copied from interface:Index
Obtains the set of all terms in the index dictionary.- Returns:
- the collection of terms.
- Throws:
java.io.IOException
- if something fails while reading the list of terms.
-
getTotalFreq
public long getTotalFreq(java.lang.String term) throws java.io.IOExceptionDescription copied from interface:Index
Obtains the total frequency of a term in the collection.- Parameters:
term
- the term to look up.- Returns:
- the total frequency of the term in the collection.
- Throws:
java.io.IOException
- if something fails while reading the frequency.
-
getDocFreq
public long getDocFreq(java.lang.String term) throws java.io.IOExceptionDescription copied from interface:Index
Obtains the number of documents containing the term.- Parameters:
term
- the term to look up.- Returns:
- the number of documents containing the term.
- Throws:
java.io.IOException
- if something fails while reading the doc frequency.
-
numDocs
public int numDocs()Description copied from interface:DocumentMap
Obtains the number of contents.- Returns:
- the number of contents.
-