org.imageterrier.structures
Class PositionInvertedIndex
java.lang.Object
org.terrier.structures.BitPostingIndex
org.terrier.structures.InvertedIndex
org.terrier.structures.TermPayloadInvertedIndex<int[]>
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
| 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. |
| 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 |
DocumentBlockCountDelta
protected int DocumentBlockCountDelta
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 belongsstructureName - the name of the inverted index structure_doi - the document indexpostingClass - the class to use for iterating postings
- Throws:
IOException
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 pointerdocposmap - 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.