Terrier IR Platform
1.1.1

uk.ac.gla.terrier.structures
Class BlockInvertedIndex

java.lang.Object
  extended by uk.ac.gla.terrier.structures.InvertedIndex
      extended by uk.ac.gla.terrier.structures.BlockInvertedIndex

public class BlockInvertedIndex
extends InvertedIndex

This class implements the block field inverted index for performing retrieval.

Version:
$Revision: 1.27 $
Author:
Douglas Johnson

Field Summary
 
Fields inherited from class uk.ac.gla.terrier.structures.InvertedIndex
FIELD_LOAD_FACTOR, NORMAL_LOAD_FACTOR
 
Constructor Summary
BlockInvertedIndex(Lexicon lexicon)
          Creates an instance of the BlockInvertedIndex class using the given lexicon.
BlockInvertedIndex(Lexicon lexicon, java.lang.String filename)
          Creates an instance of the BlockInvertedIndex class using the given lexicon.
BlockInvertedIndex(Lexicon lexicon, java.lang.String path, java.lang.String prefix)
           
 
Method Summary
 int[][] getDocuments(long startOffset, byte startBitOffset, long endOffset, byte endBitOffset)
          Returns a 2D array containing the document ids, the term frequencies, the field scores the block frequencies and the block ids for the given documents.
 int[][] getDocumentsWithoutBlocks(int termid)
           
 int[][] getDocumentsWithoutBlocks(int termid, int startDocid, int endDocid)
           
 void print()
          Prints out the block inverted index file.
 
Methods inherited from class uk.ac.gla.terrier.structures.InvertedIndex
close, getBitFile, getDocuments, getDocuments, getDocuments
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockInvertedIndex

public BlockInvertedIndex(Lexicon lexicon)
Creates an instance of the BlockInvertedIndex class using the given lexicon.

Parameters:
lexicon - The lexicon used for retrieval

BlockInvertedIndex

public BlockInvertedIndex(Lexicon lexicon,
                          java.lang.String path,
                          java.lang.String prefix)

BlockInvertedIndex

public BlockInvertedIndex(Lexicon lexicon,
                          java.lang.String filename)
Creates an instance of the BlockInvertedIndex class using the given lexicon.

Parameters:
lexicon - The lexicon used for retrieval
filename - the name of the inverted file
Method Detail

print

public void print()
Prints out the block inverted index file.

Overrides:
print in class InvertedIndex

getDocuments

public int[][] getDocuments(long startOffset,
                            byte startBitOffset,
                            long endOffset,
                            byte endBitOffset)
Returns a 2D array containing the document ids, the term frequencies, the field scores the block frequencies and the block ids for the given documents.

Overrides:
getDocuments in class InvertedIndex
Parameters:
startOffset - start byte of the postings in the inverted file
startBitOffset - start bit of the postings in the inverted file
endOffset - end byte of the postings in the inverted file
endBitOffset - end bit of the postings in the inverted file
Returns:
int[][] the five dimensional [5][] array containing the document ids, frequencies, field scores and block frequencies, while the last vector contains the block identifiers and it has a different length from the document identifiers.

getDocumentsWithoutBlocks

public int[][] getDocumentsWithoutBlocks(int termid,
                                         int startDocid,
                                         int endDocid)

getDocumentsWithoutBlocks

public int[][] getDocumentsWithoutBlocks(int termid)

Terrier IR Platform
1.1.1

Terrier Information Retrieval Platform 1.1.1. Copyright 2004-2007 University of Glasgow