Terrier IR Platform
2.2.1

uk.ac.gla.terrier.structures
Class BlockLexiconInputStream

java.lang.Object
  extended by uk.ac.gla.terrier.structures.LexiconInputStream
      extended by uk.ac.gla.terrier.structures.BlockLexiconInputStream
All Implemented Interfaces:
java.lang.Iterable<java.lang.String>, Closeable
Direct Known Subclasses:
UTFBlockLexiconInputStream

public class BlockLexiconInputStream
extends LexiconInputStream

An input stream for accessing sequentially the entries of a block lexicon.

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

Constructor Summary
BlockLexiconInputStream()
          A default constructor.
BlockLexiconInputStream(java.io.DataInput in)
          Read a lexicon from the specified input stream
BlockLexiconInputStream(java.io.File file)
          A constructor given the filename.
BlockLexiconInputStream(java.lang.String filename)
          A constructor given the filename.
BlockLexiconInputStream(java.lang.String path, java.lang.String prefix)
           
 
Method Summary
 int getBlockFrequency()
          Returns the block frequency for the currently processed term.
 int numberOfEntries()
          Returns the number of entries in the lexicon file.
 void print()
          Prints out the contents of the lexicon file to check.
 int readNextEntry()
          Read the next lexicon entry.
 
Methods inherited from class uk.ac.gla.terrier.structures.LexiconInputStream
close, getEndBitOffset, getEndOffset, getEntrySize, getNt, getNumberOfPointersRead, getNumberOfTermsRead, getNumberOfTokensRead, getStartBitOffset, getStartOffset, getTerm, getTermCharacters, getTermId, getTF, iterator, readNextEntryBytes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockLexiconInputStream

public BlockLexiconInputStream()
A default constructor.


BlockLexiconInputStream

public BlockLexiconInputStream(java.lang.String filename)
A constructor given the filename.

Parameters:
filename - java.lang.String the name of the lexicon file.

BlockLexiconInputStream

public BlockLexiconInputStream(java.lang.String path,
                               java.lang.String prefix)

BlockLexiconInputStream

public BlockLexiconInputStream(java.io.File file)
A constructor given the filename.

Parameters:
file - java.io.File the name of the lexicon file.

BlockLexiconInputStream

public BlockLexiconInputStream(java.io.DataInput in)
Read a lexicon from the specified input stream

Method Detail

readNextEntry

public int readNextEntry()
                  throws java.io.IOException
Read the next lexicon entry.

Overrides:
readNextEntry in class LexiconInputStream
Returns:
the number of bytes read if there is no error, otherwise returns -1 in case of EOF
Throws:
java.io.IOException - if an I/O error occurs

numberOfEntries

public int numberOfEntries()
Returns the number of entries in the lexicon file.

Overrides:
numberOfEntries in class LexiconInputStream

print

public void print()
Prints out the contents of the lexicon file to check.

Overrides:
print in class LexiconInputStream

getBlockFrequency

public int getBlockFrequency()
Returns the block frequency for the currently processed term.

Returns:
int The block frequency for the currently processed term

Terrier IR Platform
2.2.1

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