|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpitt.search.semanticvectors.VectorStoreReaderText
public class VectorStoreReaderText
This class provides methods for reading a VectorStore from a textfile.
The textfile should start with an optional header line,
"-dimensions|N".
All subsequent lines should be of the form
String|Num1|Num2|...|NumN
The serialization currently presumes that the object (in the ObjectVectors) should be serialized as a String.
This class is mainly for interoperability with plain text file formats: normal (fast) implementations should use the internal VectorStoreReader class that uses Lucene's I/O functions.
VectorStoreReaderLucene,
ObjectVector| Nested Class Summary | |
|---|---|
class |
VectorStoreReaderText.VectorEnumerationText
Implements the hasMoreElements() and nextElement() methods to give Enumeration interface from store in VectorTextFile. |
| Constructor Summary | |
|---|---|
VectorStoreReaderText(java.lang.String vectorFileText)
|
|
| Method Summary | |
|---|---|
void |
close()
Release all filesystem or other resources that aren't automatically garbage collected. |
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 |
static ObjectVector |
parseVectorLine(java.lang.String line)
Returns an object vector from a text line. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VectorStoreReaderText(java.lang.String vectorFileText)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void close()
CloseableVectorStore
close in interface CloseableVectorStorepublic java.util.Enumeration getAllVectors()
getAllVectors in interface VectorStore
public static ObjectVector parseVectorLine(java.lang.String line)
throws java.io.IOException
java.io.IOExceptionpublic float[] getVector(java.lang.Object desiredObject)
getVector in interface VectorStoredesiredObject - - the string identifying the object being searched for.
public int getNumVectors()
getNumVectors in interface VectorStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||