anl.aida.sv
Class DocumentVectorStoreReader

java.lang.Object
  extended by anl.aida.sv.DocumentVectorStoreReader

public class DocumentVectorStoreReader
extends java.lang.Object

Reads Semantic Vector vectors that have been written using a DocumentVectorStoreWriter.


Nested Class Summary
 class DocumentVectorStoreReader.VectorIterable
          Implements the hasMoreElements() and nextElement() methods to give Enumeration interface from store on disk.
 
Field Summary
private  boolean hasHeader
           
private  org.apache.lucene.store.IndexInput indexInput
           
 
Constructor Summary
DocumentVectorStoreReader(java.lang.String vectorFile)
           
 
Method Summary
 java.lang.Iterable<pitt.search.semanticvectors.ObjectVector> getAllVectors()
           
 int getNumVectors()
          Trivial (costly) implementation of getNumVectors that iterates and counts vectors.
 float[] getVector(DocumentIDMatcher matcher)
          Given an object, get its corresponding vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

indexInput

private org.apache.lucene.store.IndexInput indexInput

hasHeader

private boolean hasHeader
Constructor Detail

DocumentVectorStoreReader

public DocumentVectorStoreReader(java.lang.String vectorFile)
                          throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getAllVectors

public java.lang.Iterable<pitt.search.semanticvectors.ObjectVector> getAllVectors()

getVector

public float[] getVector(DocumentIDMatcher matcher)
                  throws java.io.IOException
Given an object, get its corresponding vector.

Parameters:
matcher - the DocumentIDMatcher that will match the desired vector
Returns:
vector from the VectorStore, or null if not found.
Throws:
java.io.IOException - if there is an error reading the vectors

getNumVectors

public int getNumVectors()
Trivial (costly) implementation of getNumVectors that iterates and counts vectors.

Returns:
the numbe of stored vectors