Terrier IR Platform
1.1.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.19 $
Author:
Douglas Johnson & Vassilis Plachouras & Craig Macdonald

Constructor Summary
BlockDirectIndexBuilder(DocumentIndex docIndex)
          Deprecated. DocumentIndex is no longer required to use a DirectIndexBuilder
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(FieldDocumentTreeNode[] terms)
          Deprecated.  
 FilePosition addDocument(int[][] terms)
          Adds a document to the direct index and returns the offset in the direct index after adding the document.
 
Methods inherited from class uk.ac.gla.terrier.structures.indexing.DirectIndexBuilder
close, finishedCollections, 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

Method Detail

addDocument

public FilePosition addDocument(FieldDocumentTreeNode[] terms)
                         throws java.io.IOException
Deprecated. 

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 FieldDocumentTreeNode.

Overrides:
addDocument in class DirectIndexBuilder
Parameters:
terms - FieldDocumentTreeNode[] the array of the document's terms.
Returns:
FilePosition the offset of the direct file after adding the document.
Throws:
java.io.IOException

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 FieldDocumentTreeNode.

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

Terrier IR Platform
1.1.1

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