Terrier IR Platform
2.2.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
All Implemented Interfaces:
Closeable, IndexConfigurable

public class BlockDirectIndex
extends DirectIndex
implements IndexConfigurable

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

Version:
$Revision: 1.33 $
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.
 void setIndex(Index i)
          let it know which index to use
 
Methods inherited from class uk.ac.gla.terrier.structures.DirectIndex
close, reOpenLegacyBitFile
 
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

setIndex

public void setIndex(Index i)
let it know which index to use

Specified by:
setIndex in interface IndexConfigurable
Parameters:
i - Index object to use

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
2.2.1

Terrier Information Retrieval Platform 2.2.1. Copyright 2004-2008 University of Glasgow