anl.aida.sv
Class DocumentVectorStoreReader
java.lang.Object
anl.aida.sv.DocumentVectorStoreReader
public class DocumentVectorStoreReader
- extends java.lang.Object
Reads Semantic Vector vectors that have been written
using a DocumentVectorStoreWriter.
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 |
indexInput
private org.apache.lucene.store.IndexInput indexInput
hasHeader
private boolean hasHeader
DocumentVectorStoreReader
public DocumentVectorStoreReader(java.lang.String vectorFile)
throws java.io.IOException
- Throws:
java.io.IOException
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