#include <BasicIndexWithCat.hpp>
Inheritance diagram for BasicIndexWithCat:
Public Methods | |
BasicIndexWithCat (Index &wordIndex, Index &categoryIndex, bool catIsTerm=true) | |
opens the indices. catIsTerm indicates whether a category is actually indexed as a "term" or a "document" in categoryIndex. | |
~BasicIndexWithCat () | |
bool | open (const char *) |
to be implemented later | |
Spelling and index conversion | |
virtual int | term (const char *word) |
Convert a term spelling to a termID. | |
virtual const char * | term (int termID) |
Convert a termID to its spelling. | |
virtual int | document (const char *docIDStr) |
Convert a spelling to docID. | |
virtual const char * | document (int docID) |
Convert a docID to its spelling. | |
virtual int | category (const char *catIDStr) |
Convert a spelling to catID. | |
virtual const char * | category (int catID) |
Convert a catID to its spelling. | |
Summary counts | |
virtual int | docCount () |
Total count (i.e., number) of documents in collection. | |
virtual int | termCountUnique () |
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 () |
Average document length. | |
virtual int | docCount (int termID) |
Total counts of doc with a given term. | |
virtual int | docLength (int docID) const |
Total counts of terms in a document. | |
virtual int | catCount () |
Total counts of categories. | |
virtual int | docCountInCat (int catID) |
Total counts of documents in a category. | |
Base Index entry access (Term X Doc) | |
virtual DocInfoList * | docInfoList (int termID) |
doc entries in a term index,
| |
virtual TermInfoList * | termInfoList (int docID) |
word entries in a document index,
| |
Category Index entry access (Cat X Doc) | |
virtual void | startCatIDIteration (int docID) |
virtual bool | hasMoreCatID () |
virtual int | nextCatID () |
Iteration over all category ids that a doc belongs to. | |
virtual void | startDocIDIteration (int catID) |
virtual bool | hasMoreDocID () |
virtual int | nextDocID () |
Iteration over all doc ids that belong to a given category. | |
Private Attributes | |
Index * | baseIndex |
base index (word X doc) | |
Index * | catIndex |
label/category index (cat X doc) | |
bool | catAsTerm |
TermInfoList * | tmInfoBuffer |
buffers for iteration support | |
DocInfoList * | docInfoBuffer |
TermInfo * | tmInfo |
DocInfo * | docInfo |
int * | base2cat |
synchronized doc id lexicons | |
int * | cat2base |
Static Private Attributes | |
const char | OOVSTRING [] = "[OOV]" |
BasicIndexWithCat is a wrapper that manages two separate Index's: one for word X doc index and one for category X doc index. It synchronizes the document index in both indices.
|
opens the indices. catIsTerm indicates whether a category is actually indexed as a "term" or a "document" in categoryIndex.
|
|
|
|
Total counts of categories.
Implements IndexWithCat. |
|
Convert a catID to its spelling.
Implements IndexWithCat. |
|
Convert a spelling to catID.
Implements IndexWithCat. |
|
Total counts of doc with a given term.
Implements Index. |
|
Total count (i.e., number) of documents in collection.
Implements Index. |
|
Total counts of documents in a category.
Implements IndexWithCat. |
|
doc entries in a term index,
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. |
|
Implements IndexWithCat. |
|
Implements IndexWithCat. |
|
Iteration over all category ids that a doc belongs to. startCatIDIteration, hasMoreCatID, and nextCatID go together to support iteration over category ids that a document has Implements IndexWithCat. |
|
Iteration over all doc ids that belong to a given category. startDocIDIteration, hasMoreDocID, and nextDocID go together to support iteration over all doc ids in a given category Implements IndexWithCat. |
|
to be implemented later
Implements Index. |
|
Implements IndexWithCat. |
|
Implements IndexWithCat. |
|
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,
Implements Index. |
|
synchronized doc id lexicons
|
|
base index (word X doc)
|
|
|
|
|
|
label/category index (cat X doc)
|
|
|
|
|
|
|
|
|
|
buffers for iteration support
|