Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

BasicIndexWithCat Class Reference

A basic implementation of IndexWithCat based on two Index's. More...

#include <BasicIndexWithCat.hpp>

Inheritance diagram for BasicIndexWithCat:

IndexWithCat Index List of all members.

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 string &name)
 to be implemented later

Spelling and index conversion
virtual TERMID_T term (const string &word) const
 Convert a term spelling to a termID.

virtual const string term (TERMID_T termID) const
 Convert a termID to its spelling.

virtual DOCID_T document (const string &docIDStr) const
 Convert a spelling to docID.

virtual const string document (DOCID_T docID) const
 Convert a docID to its spelling.

virtual int category (const string &catIDStr) const
 Convert a spelling to catID.

virtual const string category (int catID) const
 Convert a catID to its spelling.

Summary counts
virtual COUNT_T docCount () const
 Total count (i.e., number) of documents in collection.

virtual COUNT_T termCountUnique () const
 Total count of unique terms in collection.

virtual COUNT_T termCount (TERMID_T termID) const
 Total counts of a term in collection.

virtual COUNT_T termCount () const
 Total counts of all terms in collection.

virtual float docLengthAvg () const
 Average document length.

virtual COUNT_T docCount (TERMID_T termID) const
 Total counts of doc with a given term.

virtual COUNT_T docLength (DOCID_T docID) const
 Total counts of terms in a document.

virtual int catCount () const
 Total counts of categories.

virtual int docCountInCat (int catID) const
 Total counts of documents in a category.

Base Index entry access (Term X Doc)
virtual DocInfoListdocInfoList (TERMID_T termID) const
 doc entries in a term index,
See also:
DocList


virtual TermInfoListtermInfoList (DOCID_T docID) const
 word entries in a document index,
See also:
TermList


Category Index entry access (Cat X Doc)
virtual void startCatIDIteration (int docID) const
virtual bool hasMoreCatID () const
virtual int nextCatID () const
 Iteration over all category ids that a doc belongs to.

virtual void startDocIDIteration (int catID) const
virtual bool hasMoreDocID () const
virtual int nextDocID () const
 Iteration over all doc ids that belong to a given category.


Detailed Description

A basic implementation of IndexWithCat based on two Index's.

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.


Constructor & Destructor Documentation

BasicIndexWithCat::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::~BasicIndexWithCat   [inline]
 


Member Function Documentation

int BasicIndexWithCat::catCount   [inline, virtual]
 

Total counts of categories.

Implements IndexWithCat.

const string BasicIndexWithCat::category int    catID const [inline, virtual]
 

Convert a catID to its spelling.

Implements IndexWithCat.

int BasicIndexWithCat::category const string &    catIDStr const [inline, virtual]
 

Convert a spelling to catID.

Implements IndexWithCat.

virtual COUNT_T BasicIndexWithCat::docCount TERMID_T    termID const [inline, virtual]
 

Total counts of doc with a given term.

Implements Index.

virtual COUNT_T BasicIndexWithCat::docCount   const [inline, virtual]
 

Total count (i.e., number) of documents in collection.

Implements Index.

int BasicIndexWithCat::docCountInCat int    catID const [inline, virtual]
 

Total counts of documents in a category.

Implements IndexWithCat.

virtual DocInfoList* BasicIndexWithCat::docInfoList TERMID_T    termID const [inline, virtual]
 

doc entries in a term index,

See also:
DocList

Implements Index.

virtual COUNT_T BasicIndexWithCat::docLength DOCID_T    docID const [inline, virtual]
 

Total counts of terms in a document.

Implements Index.

virtual float BasicIndexWithCat::docLengthAvg   const [inline, virtual]
 

Average document length.

Implements Index.

virtual const string BasicIndexWithCat::document DOCID_T    docID const [inline, virtual]
 

Convert a docID to its spelling.

Implements Index.

virtual DOCID_T BasicIndexWithCat::document const string &    docIDStr const [inline, virtual]
 

Convert a spelling to docID.

bool BasicIndexWithCat::hasMoreCatID   [virtual]
 

Implements IndexWithCat.

bool BasicIndexWithCat::hasMoreDocID   [virtual]
 

Implements IndexWithCat.

int BasicIndexWithCat::nextCatID   [virtual]
 

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.

int BasicIndexWithCat::nextDocID   [virtual]
 

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.

bool BasicIndexWithCat::open const string &    name [inline, virtual]
 

to be implemented later

Implements Index.

void BasicIndexWithCat::startCatIDIteration int    docID const [virtual]
 

Implements IndexWithCat.

void BasicIndexWithCat::startDocIDIteration int    catID const [virtual]
 

Implements IndexWithCat.

virtual const string BasicIndexWithCat::term TERMID_T    termID const [inline, virtual]
 

Convert a termID to its spelling.

Implements Index.

virtual TERMID_T BasicIndexWithCat::term const string &    word const [inline, virtual]
 

Convert a term spelling to a termID.

virtual COUNT_T BasicIndexWithCat::termCount   const [inline, virtual]
 

Total counts of all terms in collection.

Implements Index.

virtual COUNT_T BasicIndexWithCat::termCount TERMID_T    termID const [inline, virtual]
 

Total counts of a term in collection.

Implements Index.

virtual COUNT_T BasicIndexWithCat::termCountUnique   const [inline, virtual]
 

Total count of unique terms in collection.

Implements Index.

virtual TermInfoList* BasicIndexWithCat::termInfoList DOCID_T    docID const [inline, virtual]
 

word entries in a document index,

See also:
TermList

Implements Index.


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 12:59:24 2004 for Lemur Toolkit by doxygen1.2.18