Main Page   Namespace List   Class Hierarchy   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 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 DocInfoListdocInfoList (int termID)
 doc entries in a term index,
See also:
DocList.


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


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. More...

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


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.

Reimplemented from IndexWithCat.

const char * BasicIndexWithCat::category ( int catID ) [inline, virtual]
 

Convert a catID to its spelling.

Reimplemented from IndexWithCat.

int BasicIndexWithCat::category ( const char * catIDStr ) [inline, virtual]
 

Convert a spelling to catID.

Reimplemented from IndexWithCat.

int BasicIndexWithCat::docCount ( int termID ) [inline, virtual]
 

Total counts of doc with a given term.

Reimplemented from Index.

int BasicIndexWithCat::docCount ( ) [inline, virtual]
 

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

Reimplemented from Index.

int BasicIndexWithCat::docCountInCat ( int catID ) [inline, virtual]
 

Total counts of documents in a category.

Reimplemented from IndexWithCat.

DocInfoList * BasicIndexWithCat::docInfoList ( int termID ) [inline, virtual]
 

doc entries in a term index,

See also:
DocList.

Reimplemented from Index.

int BasicIndexWithCat::docLength ( int docID ) const [inline, virtual]
 

Total counts of terms in a document.

Reimplemented from Index.

float BasicIndexWithCat::docLengthAvg ( ) [inline, virtual]
 

Average document length.

Reimplemented from Index.

const char * BasicIndexWithCat::document ( int docID ) [inline, virtual]
 

Convert a docID to its spelling.

Reimplemented from Index.

int BasicIndexWithCat::document ( const char * docIDStr ) [inline, virtual]
 

Convert a spelling to docID.

Reimplemented from Index.

bool BasicIndexWithCat::hasMoreCatID ( ) [virtual]
 

Reimplemented from IndexWithCat.

bool BasicIndexWithCat::hasMoreDocID ( ) [virtual]
 

Reimplemented from 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

Reimplemented from 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

Reimplemented from IndexWithCat.

bool BasicIndexWithCat::open ( const char * fn ) [inline, virtual]
 

to be implemented later.

Reimplemented from Index.

void BasicIndexWithCat::startCatIDIteration ( int docID ) [virtual]
 

Reimplemented from IndexWithCat.

void BasicIndexWithCat::startDocIDIteration ( int catID ) [virtual]
 

Reimplemented from IndexWithCat.

const char * BasicIndexWithCat::term ( int termID ) [inline, virtual]
 

Convert a termID to its spelling.

Reimplemented from Index.

int BasicIndexWithCat::term ( const char * word ) [inline, virtual]
 

Convert a term spelling to a termID.

Reimplemented from Index.

int BasicIndexWithCat::termCount ( ) const [inline, virtual]
 

Total counts of all terms in collection.

Reimplemented from Index.

int BasicIndexWithCat::termCount ( int termID ) const [inline, virtual]
 

Total counts of a term in collection.

Reimplemented from Index.

int BasicIndexWithCat::termCountUnique ( ) [inline, virtual]
 

Total count of unique terms in collection.

Reimplemented from Index.

TermInfoList * BasicIndexWithCat::termInfoList ( int docID ) [inline, virtual]
 

word entries in a document index,

See also:
TermList.

Reimplemented from Index.


The documentation for this class was generated from the following files:
Generated at Fri Jul 26 18:22:43 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000