org.terrier.structures
Class BlockDirectIndex
java.lang.Object
org.terrier.structures.BitPostingIndex
org.terrier.structures.DirectIndex
org.terrier.structures.BlockDirectIndex
- All Implemented Interfaces:
- java.io.Closeable, PostingIndex<BitIndexPointer>
public class BlockDirectIndex
- extends DirectIndex
Extended direct index that saves both block
and field information about the terms that
appear in a document.
- Author:
- Douglas Johnson, Vassilis Plachouras
Constructor Summary |
BlockDirectIndex(Index index,
java.lang.String structureName)
Constructs an instance of the class with
the given index, using the specified structure name. |
BlockDirectIndex(Index index,
java.lang.String structureName,
java.lang.Class<? extends IterablePosting> postingClass)
Constructs an instance of the class with |
Method Summary |
int[][] |
getTerms(BitIndexPointer pointer)
Get the terms for the document at the specified bit index pointer. |
int[][] |
getTerms(int docid)
Returns a five dimensional array containing the
term ids and the term frequencies for the given document. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentBlockCountDelta
protected int DocumentBlockCountDelta
BlockDirectIndex
public BlockDirectIndex(Index index,
java.lang.String structureName)
throws java.io.IOException
- Constructs an instance of the class with
the given index, using the specified structure name.
- Parameters:
index
- The index to be usedstructureName
- the name of this direct index
- Throws:
java.io.IOException
BlockDirectIndex
public BlockDirectIndex(Index index,
java.lang.String structureName,
java.lang.Class<? extends IterablePosting> postingClass)
throws java.io.IOException
- Constructs an instance of the class with
- Parameters:
index
- structureName
- postingClass
-
- Throws:
java.io.IOException
getTerms
public int[][] getTerms(int docid)
throws java.io.IOException
- Returns a five dimensional array containing the
term ids and the term frequencies for the given document.
- Overrides:
getTerms
in class DirectIndex
- Parameters:
docid
- the id of the document whose terms we are looking for.
- Returns:
- int[][] a five dimensional array containing
the term ids, frequencies, field scores,
block frequencies and the containing the block ids.
- Throws:
java.io.IOException
getTerms
public int[][] getTerms(BitIndexPointer pointer)
throws java.io.IOException
- Get the terms for the document at the specified bit index pointer.
See getTerms(int docid) for the return specification.
- Overrides:
getTerms
in class DirectIndex
- Throws:
java.io.IOException
Terrier 3.5. Copyright © 2004-2011 University of Glasgow