|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpitt.search.semanticvectors.VectorStoreReaderLucene
public class VectorStoreReaderLucene
This class provides methods for reading a VectorStore from disk.
The serialization currently presumes that the object (in the ObjectVectors) should be serialized as a String.
The implementation uses Lucene's I/O package, which proved much faster than the native java.io.DataOutputStream
ObjectVector
Nested Class Summary | |
---|---|
class |
VectorStoreReaderLucene.VectorEnumeration
Implements the hasMoreElements() and nextElement() methods to give Enumeration interface from store on disk. |
Constructor Summary | |
---|---|
VectorStoreReaderLucene(java.lang.String vectorFileName)
|
Method Summary | |
---|---|
void |
close()
Release all filesystem or other resources that aren't automatically garbage collected. |
org.apache.lucene.store.FSDirectory |
fsDirectory()
|
java.util.Enumeration |
getAllVectors()
|
int |
getNumVectors()
Trivial (costly) implementation of getNumVectors that iterates and counts vectors. |
float[] |
getVector(java.lang.Object desiredObject)
Given an object, get its corresponding vector This implementation only works for string objects so far |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VectorStoreReaderLucene(java.lang.String vectorFileName) throws java.io.IOException
java.io.IOException
Method Detail |
---|
public org.apache.lucene.store.FSDirectory fsDirectory()
public void close()
CloseableVectorStore
close
in interface CloseableVectorStore
public java.util.Enumeration getAllVectors()
getAllVectors
in interface VectorStore
public float[] getVector(java.lang.Object desiredObject)
getVector
in interface VectorStore
desiredObject
- - the string you're searching for
public int getNumVectors()
getNumVectors
in interface VectorStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |