org.imageterrier.structures
Class PositionInvertedIndex

java.lang.Object
  extended by org.terrier.structures.BitPostingIndex
      extended by org.terrier.structures.InvertedIndex
          extended by org.terrier.structures.TermPayloadInvertedIndex<int[]>
              extended by org.imageterrier.structures.PositionInvertedIndex
All Implemented Interfaces:
Closeable, org.terrier.structures.IndexConfigurable, org.terrier.structures.PostingIndex<org.terrier.structures.BitIndexPointer>

public class PositionInvertedIndex
extends TermPayloadInvertedIndex<int[]>
implements org.terrier.structures.IndexConfigurable

An ImageTerrier inverted index with payloads capable of storing information on the position (i.e. spatial position, scale, orientation, etc.) of each visual-term occurrence.

Author:
Jonathon Hare

Field Summary
protected  int DocumentBlockCountDelta
           
 
Fields inherited from class org.terrier.structures.TermPayloadInvertedIndex
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
PositionInvertedIndex(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
 gnu.trove.TIntObjectHashMap<int[][]> getPositions(org.terrier.structures.BitIndexPointer pointer)
          Syntatic sugar for TermPayloadInvertedIndex.getPayloads(BitIndexPointer).
 int[][][] getPositions(org.terrier.structures.BitIndexPointer pointer, gnu.trove.TIntIntHashMap docposmap, int... requestedindices)
          Get a subset of the position information for a given postings list.
 gnu.trove.TIntObjectHashMap<org.openimaj.feature.local.Location[]> getPositionsDecoded(org.terrier.structures.BitIndexPointer pointer)
          Get all the decoded location payloads from a given postings list.
 PositionSpec getPositionSpec()
          Get the PositionSpec used for this index.
 
Methods inherited from class org.terrier.structures.TermPayloadInvertedIndex
getDocuments, getPayloadConfig, getPayloads, getPostings, print, setIndex
 
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
 
Methods inherited from interface org.terrier.structures.IndexConfigurable
setIndex
 

Field Detail

DocumentBlockCountDelta

protected int DocumentBlockCountDelta
Constructor Detail

PositionInvertedIndex

public PositionInvertedIndex(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

getPositionSpec

public PositionSpec getPositionSpec()
Get the PositionSpec used for this index.

Returns:
the PositionSpec.

getPositions

public gnu.trove.TIntObjectHashMap<int[][]> getPositions(org.terrier.structures.BitIndexPointer pointer)
Syntatic sugar for TermPayloadInvertedIndex.getPayloads(BitIndexPointer).

Parameters:
pointer - postings list pointer
Returns:
the position information for each posting in the list
See Also:
TermPayloadInvertedIndex.getPayloads(BitIndexPointer)

getPositions

public int[][][] getPositions(org.terrier.structures.BitIndexPointer pointer,
                              gnu.trove.TIntIntHashMap docposmap,
                              int... requestedindices)
Get a subset of the position information for a given postings list. The input is a map of the required documents to their index in the output array, and a list of required position indices (i.e. you can just get the x, and y parts and ignore everything else). The output is a three dimensional integer array of documents -> list of payload info where the payload info is itself an array of (encoded) ints.

Parameters:
pointer - postings list pointer
docposmap - a mapping of document-id -> array index in the output array for all relevant documents.
requestedindices - the position indices required
Returns:
subset of the position information of the posting

getPositionsDecoded

public gnu.trove.TIntObjectHashMap<org.openimaj.feature.local.Location[]> getPositionsDecoded(org.terrier.structures.BitIndexPointer pointer)
Get all the decoded location payloads from a given postings list.

Parameters:
pointer - postings list pointer
Returns:
the position information for each posting in the list
See Also:
TermPayloadInvertedIndex.getPayloads(BitIndexPointer)


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