Terrier IR Platform
1.1.1

uk.ac.gla.terrier.structures
Class BlockDirectIndex

java.lang.Object
  extended by uk.ac.gla.terrier.structures.DirectIndex
      extended by uk.ac.gla.terrier.structures.BlockDirectIndex

public class BlockDirectIndex
extends DirectIndex

Extended direct index that saves both block and field information about the terms that appear in a document.

Version:
$Revision: 1.28 $
Author:
Douglas Johnson, Vassilis Plachouras

Constructor Summary
BlockDirectIndex(DocumentIndex docIndex)
          Constructs an instance of the class with the given document index.
BlockDirectIndex(DocumentIndex docIndex, java.lang.String filename)
          Constructs an instance of the class with the given document index.
BlockDirectIndex(DocumentIndex docIndex, java.lang.String path, java.lang.String prefix)
           
 
Method Summary
 int[][] getTerms(int docid)
          Returns a five dimensional array containing the term ids and the term frequencies for the given document.
 void print()
          Prints out the direct index file.
 
Methods inherited from class uk.ac.gla.terrier.structures.DirectIndex
close
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockDirectIndex

public BlockDirectIndex(DocumentIndex docIndex)
Constructs an instance of the class with the given document index.

Parameters:
docIndex - The document index to be used

BlockDirectIndex

public BlockDirectIndex(DocumentIndex docIndex,
                        java.lang.String filename)
Constructs an instance of the class with the given document index. The underlying direct file has the given non-default filename.

Parameters:
docIndex - The document index to be used
filename - the non-default filename used for the underlying direct file.

BlockDirectIndex

public BlockDirectIndex(DocumentIndex docIndex,
                        java.lang.String path,
                        java.lang.String prefix)
Method Detail

print

public void print()
Prints out the direct index file.

Overrides:
print in class DirectIndex

getTerms

public int[][] getTerms(int docid)
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.

Terrier IR Platform
1.1.1

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