pitt.search.semanticvectors
Class VectorStoreWriter

java.lang.Object
  extended by pitt.search.semanticvectors.VectorStoreWriter

public class VectorStoreWriter
extends java.lang.Object

This class provides methods for serializing a VectorStore to 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.

In the current implementation, VectorStoreWriter objects have no internal fields, since vecLength is now a global variable. The writing methods could therefore be made static and done without instantiation; we've left the current (slightly awkward looking) instance method approach for now to see if the current implementation of vecLength and writers holds up in practice.

See Also:
ObjectVector

Constructor Summary
VectorStoreWriter()
          Empty constructor method to give you a notional "instance" from which to call class methods.
 
Method Summary
 boolean WriteVectors(java.lang.String vectorFileName, VectorStore objectVectors)
           
 boolean WriteVectorsAsText(java.lang.String vectorTextFile, VectorStore objectVectors)
          Outputs a vector store as a plain text file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VectorStoreWriter

public VectorStoreWriter()
Empty constructor method to give you a notional "instance" from which to call class methods.

Method Detail

WriteVectors

public boolean WriteVectors(java.lang.String vectorFileName,
                            VectorStore objectVectors)
Parameters:
vectorFileName - The name of the file to write to
objectVectors - The vector store to be written to disk

WriteVectorsAsText

public boolean WriteVectorsAsText(java.lang.String vectorTextFile,
                                  VectorStore objectVectors)
Outputs a vector store as a plain text file.

Parameters:
vectorTextFile - The name of the file to write to
objectVectors - The vector store to be written to disk