it.unimi.di.mg4j.index.cluster
Class LexicalClusterIndexReader

java.lang.Object
  extended by it.unimi.di.mg4j.index.AbstractIndexReader
      extended by it.unimi.di.mg4j.index.cluster.AbstractIndexClusterIndexReader
          extended by it.unimi.di.mg4j.index.cluster.LexicalClusterIndexReader
All Implemented Interfaces:
IndexReader, SafelyCloseable, Closeable

public class LexicalClusterIndexReader
extends AbstractIndexClusterIndexReader

An index reader for a lexical cluster. It diverts a call for the documents of a given term or prefix to the suitable local index (or set of indices).

Author:
Alessandro Arrabito, Sebastiano Vigna

Field Summary
 
Fields inherited from class it.unimi.di.mg4j.index.cluster.AbstractIndexClusterIndexReader
indexReader
 
Fields inherited from class it.unimi.di.mg4j.index.AbstractIndexReader
closed
 
Constructor Summary
LexicalClusterIndexReader(LexicalCluster index, int bufferSize)
           
 
Method Summary
 IndexIterator documents(CharSequence term)
          Returns an index iterator over the documents containing a term; the term is given explicitly.
 IndexIterator documents(int term)
          Returns a document iterator over the documents containing a term.
 
Methods inherited from class it.unimi.di.mg4j.index.cluster.AbstractIndexClusterIndexReader
close
 
Methods inherited from class it.unimi.di.mg4j.index.AbstractIndexReader
finalize, nextIterator
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LexicalClusterIndexReader

public LexicalClusterIndexReader(LexicalCluster index,
                                 int bufferSize)
                          throws IOException
Throws:
IOException
Method Detail

documents

public IndexIterator documents(int term)
                        throws IOException
Description copied from interface: IndexReader
Returns a document iterator over the documents containing a term.

Note that the index iterator returned by this method will return null on a call to term().

Note that it is always possible to call this method with argument 0, even if the underlying index does not provide random access.

Parameters:
term - the number of a term.
Throws:
IOException

documents

public IndexIterator documents(CharSequence term)
                        throws IOException
Description copied from interface: IndexReader
Returns an index iterator over the documents containing a term; the term is given explicitly.

Unless the term processor of the associated index is null, words coming from a query will have to be processed before being used with this method.

Note that the index iterator returned by this method will return term on a call to term().

Parameters:
term - a term (the term will be downcased if the index is case insensitive).
Throws:
IOException