Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures.indexing
Class BlockDirectIndexBuilder

java.lang.Object
  extended by uk.ac.gla.terrier.structures.indexing.DirectIndexBuilder
      extended by uk.ac.gla.terrier.structures.indexing.BlockDirectIndexBuilder

public class BlockDirectIndexBuilder
extends DirectIndexBuilder

Builds a direct index using block and possibly field information.

Version:
$Revision: 1.24 $
Author:
Douglas Johnson & Vassilis Plachouras & Craig Macdonald

Constructor Summary
BlockDirectIndexBuilder(DocumentIndex docIndex)
          Deprecated. DocumentIndex is no longer required to use a DirectIndexBuilder
BlockDirectIndexBuilder(Index i)
           
BlockDirectIndexBuilder(java.lang.String filename)
          Constructs an instance of the class with the direct file being written to filename.
BlockDirectIndexBuilder(java.lang.String path, java.lang.String prefix)
          Constructs an instance of the class with the direct file being written in the index space defined
 
Method Summary
 FilePosition addDocument(int[][] terms)
          Adds a document to the direct index and returns the offset in the direct index after adding the document.
 void finishedCollections()
          When the indexing has reached the end of all collections, this method writes the buffers on disk and closes the corresponding files.
 
Methods inherited from class uk.ac.gla.terrier.structures.indexing.DirectIndexBuilder
close, flushBuffer, getLastEndOffset, resetBuffer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockDirectIndexBuilder

public BlockDirectIndexBuilder(DocumentIndex docIndex)
Deprecated. DocumentIndex is no longer required to use a DirectIndexBuilder

Constructs an instance of the class with the given document index.

Parameters:
docIndex - The document index to be used

BlockDirectIndexBuilder

public BlockDirectIndexBuilder(java.lang.String filename)
Constructs an instance of the class with the direct file being written to filename.

Parameters:
filename - the non-default filename used for the underlying direct file.

BlockDirectIndexBuilder

public BlockDirectIndexBuilder(java.lang.String path,
                               java.lang.String prefix)
Constructs an instance of the class with the direct file being written in the index space defined


BlockDirectIndexBuilder

public BlockDirectIndexBuilder(Index i)
Method Detail

addDocument

public FilePosition addDocument(int[][] terms)
                         throws java.io.IOException
Adds a document to the direct index and returns the offset in the direct index after adding the document. The document is passed as an array of termids and frequencies.

Overrides:
addDocument in class DirectIndexBuilder
Parameters:
terms - int[][] the array of the document's terms and tfs, blocks, etc.
Returns:
FilePosition the offset of the direct file after adding the document.
Throws:
java.io.IOException
Since:
1.1.0

finishedCollections

public void finishedCollections()
When the indexing has reached the end of all collections, this method writes the buffers on disk and closes the corresponding files.

Overrides:
finishedCollections in class DirectIndexBuilder

Terrier IR Platform
2.2.1

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