ir.vsr
Class DocumentReference
java.lang.Object
|
+--ir.vsr.DocumentReference
- public class DocumentReference
- extends java.lang.Object
A simple data structure for storing a reference to a document file
that includes information on the length of its document vector.
The goal is to have a lightweight object to store in an inverted index
without having to store an entire Document object.
Field Summary |
java.io.File |
file
The file where the referenced document is stored. |
double |
length
The length of the corresponding Document vector. |
Method Summary |
Document |
getDocument(short docType,
boolean stem)
Get the full Document for this Document reference by recreating it
with the given docType and stemming |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
file
public java.io.File file
- The file where the referenced document is stored.
length
public double length
- The length of the corresponding Document vector.
DocumentReference
public DocumentReference(java.io.File file,
double length)
DocumentReference
public DocumentReference(FileDocument doc)
- Create a reference to this document, initializing its length to 0
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getDocument
public Document getDocument(short docType,
boolean stem)
- Get the full Document for this Document reference by recreating it
with the given docType and stemming