org.terrier.structures
Class TermPayloadInvertedIndex<PAYLOAD>

java.lang.Object
  extended by org.terrier.structures.BitPostingIndex
      extended by org.terrier.structures.InvertedIndex
          extended by org.terrier.structures.TermPayloadInvertedIndex<PAYLOAD>
Type Parameters:
PAYLOAD - the payload type
All Implemented Interfaces:
Closeable, org.terrier.structures.IndexConfigurable, org.terrier.structures.PostingIndex<org.terrier.structures.BitIndexPointer>
Direct Known Subclasses:
NNInvertedIndex, PositionInvertedIndex

public class TermPayloadInvertedIndex<PAYLOAD>
extends org.terrier.structures.InvertedIndex
implements org.terrier.structures.IndexConfigurable

This class implements the inverted index for performing retrieval. The inverted index contains payload data for each term occurrence.

Author:
Jonathon Hare

Field Summary
protected  int DocumentBlockCountDelta
           
protected  TermPayloadCoordinator<PAYLOAD> payloadConf
           
 
Fields inherited from class org.terrier.structures.InvertedIndex
doi, FIELD_LOAD_FACTOR, logger, NORMAL_LOAD_FACTOR
 
Fields inherited from class org.terrier.structures.BitPostingIndex
fieldCount, file, index, postingImplementation
 
Constructor Summary
TermPayloadInvertedIndex(org.terrier.structures.Index index, String structureName, org.terrier.structures.DocumentIndex _doi, Class<? extends org.terrier.structures.postings.IterablePosting> postingClass)
          Construct the inverted index.
 
Method Summary
 int[][] getDocuments(org.terrier.structures.BitIndexPointer pointer)
          
 TermPayloadCoordinator<PAYLOAD> getPayloadConfig()
          Get the payload coordinator
 gnu.trove.TIntObjectHashMap<PAYLOAD[]> getPayloads(org.terrier.structures.BitIndexPointer pointer)
          For a given postings list return a map of docid -> payloads_of_each_term_instance
 TermPayloadIterablePosting<PAYLOAD> getPostings(org.terrier.structures.BitIndexPointer pointer)
           
 void print()
           
 void setIndex(org.terrier.structures.Index i)
          let it know which index to use
 
Methods inherited from class org.terrier.structures.InvertedIndex
getBitFiles, getDocuments
 
Methods inherited from class org.terrier.structures.BitPostingIndex
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DocumentBlockCountDelta

protected int DocumentBlockCountDelta

payloadConf

protected TermPayloadCoordinator<PAYLOAD> payloadConf
Constructor Detail

TermPayloadInvertedIndex

public TermPayloadInvertedIndex(org.terrier.structures.Index index,
                                String structureName,
                                org.terrier.structures.DocumentIndex _doi,
                                Class<? extends org.terrier.structures.postings.IterablePosting> postingClass)
                         throws IOException
Construct the inverted index.

Parameters:
index - the index to which this inverted index belongs
structureName - the name of the inverted index structure
_doi - the document index
postingClass - the class to use for iterating postings
Throws:
IOException
Method Detail

setIndex

public void setIndex(org.terrier.structures.Index i)
let it know which index to use

Specified by:
setIndex in interface org.terrier.structures.IndexConfigurable

getDocuments

public int[][] getDocuments(org.terrier.structures.BitIndexPointer pointer)

Overrides:
getDocuments in class org.terrier.structures.InvertedIndex

getPayloads

public gnu.trove.TIntObjectHashMap<PAYLOAD[]> getPayloads(org.terrier.structures.BitIndexPointer pointer)
For a given postings list return a map of docid -> payloads_of_each_term_instance

Parameters:
pointer - postings list
Returns:
document->payloads mapping

getPayloadConfig

public TermPayloadCoordinator<PAYLOAD> getPayloadConfig()
Get the payload coordinator

Returns:
the payload coordinator

getPostings

public TermPayloadIterablePosting<PAYLOAD> getPostings(org.terrier.structures.BitIndexPointer pointer)
                                                throws IOException
Specified by:
getPostings in interface org.terrier.structures.PostingIndex<org.terrier.structures.BitIndexPointer>
Overrides:
getPostings in class org.terrier.structures.InvertedIndex
Throws:
IOException

print

public void print()
Overrides:
print in class org.terrier.structures.InvertedIndex


Copyright © 2011 The University of Southampton. All Rights Reserved.