#include <BasicIndex.hpp>
Inheritance diagram for BasicIndex:
Public Methods | |
BasicIndex () | |
constructor (used when opening an index) | |
BasicIndex (Compress *pc) | |
constructor (used when building an index) | |
virtual | ~BasicIndex () |
virtual bool | open (const string &indexName) |
Open previously created Index, return true if opened successfully. | |
void | build (DocStream *collectionStream, const string &file, const string &outputPrefix, int totalDocs=0x1000000, int maxMemory=0x4000000, int minimumCount=1, int maxVocSize=2000000) |
Spelling and index conversion | |
virtual int | term (const string &word) const |
Convert a term spelling to a termID. | |
virtual const string | term (int termID) const |
Convert a termID to its spelling. | |
virtual int | document (const string &docIDStr) const |
Convert a spelling to docID. | |
virtual const string | document (int docID) const |
Convert a docID to its spelling. | |
virtual const string | termLexiconID () const |
return the term lexicon ID | |
Summary counts | |
virtual int | docCount () const |
Total count (i.e., number) of documents in collection. | |
virtual int | termCountUnique () const |
Total count of unique terms in collection. | |
virtual int | termCount (int termID) const |
Total counts of a term in collection. | |
virtual int | termCount () const |
Total counts of all terms in collection. | |
virtual float | docLengthAvg () const |
Average document length. | |
virtual int | docCount (int termID) const |
Total counts of doc with a given term. | |
virtual int | docLength (int docID) const |
Total counts of terms in a document. | |
Index entry access | |
virtual DocInfoList * | docInfoList (int termID) const |
doc entries in a term index, caller should release the memory
| |
virtual TermInfoList * | termInfoList (int docID) const |
word entries in a document index, caller should release the memory
|
BasicIndex is a basic implementation of Index. It creates and manages two indices (term->doc and doc->term) as well as a term lexicon and document id lexicon. The application can pass in any compressor when calling the build function. @See Index for an example of use.
|
constructor (used when opening an index)
|
|
constructor (used when building an index)
|
|
|
|
|
|
Total counts of doc with a given term.
Implements Index. |
|
Total count (i.e., number) of documents in collection.
Implements Index. |
|
doc entries in a term index, caller should release the memory
Implements Index. |
|
Total counts of terms in a document.
Implements Index. |
|
Average document length.
Implements Index. |
|
Convert a docID to its spelling.
Implements Index. |
|
Convert a spelling to docID.
Implements Index. |
|
Open previously created Index, return true if opened successfully.
Implements Index. |
|
Convert a termID to its spelling.
Implements Index. |
|
Convert a term spelling to a termID.
Implements Index. |
|
Total counts of all terms in collection.
Implements Index. |
|
Total counts of a term in collection.
Implements Index. |
|
Total count of unique terms in collection.
Implements Index. |
|
word entries in a document index, caller should release the memory
Implements Index. |
|
return the term lexicon ID
Reimplemented from Index. |