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 Details

    • index

      private final Index<C> 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.IOException
      Constructor.
      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

      public PostingsList getPostings​(java.lang.String term) throws java.io.IOException
      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.IOException
      Description 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.IOException
      Description 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.IOException
      Description 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.