|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iglu.ir.InvertedIndex
Computes and stores an inverted index, which can be used by a search engine.
Field Summary | |
private boolean |
dataChanged
|
private java.util.HashMap |
forwardVectors
|
private java.util.HashMap |
invertedVectors
|
private java.io.File |
storedIn
|
Constructor Summary | |
InvertedIndex(java.io.File storedIn)
Creates a new index, or opens an existing index. |
Method Summary | |
void |
close()
Closes the index. |
boolean |
containsKey(java.io.Serializable docId)
Indicates whether a document is contained in the index. |
void |
flush()
Forces the index to be written to file. |
ValueSortedMap |
getDocuments(java.lang.String term)
Returns all documents containing term . |
TermVector |
getVector(java.lang.Object docId)
Returns the term vector assocated with a document ID. |
private void |
initializeFromFile()
Initializes the index from a saved file. |
java.util.Set |
keySet()
Returns a set of all document ID's contained in the index. |
static void |
main(java.lang.String[] args)
Runs some tests on this class. |
void |
put(java.io.Serializable docId,
TermVector docVector)
Adds a document to the index. |
int |
size()
Returns the number of documents in this index. |
static void |
test()
Runs some tests on this class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.HashMap invertedVectors
private java.util.HashMap forwardVectors
private java.io.File storedIn
private boolean dataChanged
Constructor Detail |
public InvertedIndex(java.io.File storedIn)
storedIn
. If
storedIn
is a directory, the index will be stored in
a file named "invertedIndex.dat" in this directory.
Method Detail |
private void initializeFromFile()
public void put(java.io.Serializable docId, TermVector docVector)
public TermVector getVector(java.lang.Object docId)
public ValueSortedMap getDocuments(java.lang.String term)
term
.
public boolean containsKey(java.io.Serializable docId)
public java.util.Set keySet()
public int size()
public void flush()
public void close()
public static void test()
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |