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

TextHandler Class Reference

This class serves as an interface for classes working with the parsers. The setTextHandler function allows chaining of TextHandlers, so that information is passed from one TextHandler to the next. This is useful for chaining things like stopword lists and stemmers. A source in the chain of TextHandlers does not need to do anything in the foundDoc and foundWord functions. An example of a source is a parser. A destination in the chain of TextHandlers does not need to forward calls or store a when the setTextHandler function is called. An example of a destination would be a class that pushes the words and documents into an InvFPPushIndex (InvFPTextHandler) or writes to file (WriterTextHandler). Classes in the middle of a chain, like Stopper or Stemmer, need to provide full functionality for all functions. When their foundDoc or foundWord is called, they will possibly manipulate the data, then forward the info via calling the foundDoc/foundWord function of their TextHandler. More...

#include <TextHandler.hpp>

Inheritance diagram for TextHandler:

InvFPTextHandler Parser QueryTextHandler Stemmer Stopper WriterTextHandler ReutersParser TrecParser WebParser PorterStemmer List of all members.

Public Methods

 TextHandler ()
virtual void foundDoc (char *docno)
 Found a document with document number.

virtual void foundWord (char *word)
 Found a word.

virtual void setTextHandler (TextHandler *th)
 Set the TextHandler that this TextHandler will pass information on to.

virtual char* handleDoc (char *docno)
 Handle a doc.

virtual char* handleWord (char *word)
 Handle a word, possibly transforming it.


Protected Attributes

TextHandler* textHandler
 The next textHandler in the chain.


Detailed Description

This class serves as an interface for classes working with the parsers. The setTextHandler function allows chaining of TextHandlers, so that information is passed from one TextHandler to the next. This is useful for chaining things like stopword lists and stemmers. A source in the chain of TextHandlers does not need to do anything in the foundDoc and foundWord functions. An example of a source is a parser. A destination in the chain of TextHandlers does not need to forward calls or store a when the setTextHandler function is called. An example of a destination would be a class that pushes the words and documents into an InvFPPushIndex (InvFPTextHandler) or writes to file (WriterTextHandler). Classes in the middle of a chain, like Stopper or Stemmer, need to provide full functionality for all functions. When their foundDoc or foundWord is called, they will possibly manipulate the data, then forward the info via calling the foundDoc/foundWord function of their TextHandler.


Constructor & Destructor Documentation

TextHandler::TextHandler ( ) [inline]
 


Member Function Documentation

void TextHandler::foundDoc ( char * docno ) [inline, virtual]
 

Found a document with document number.

void TextHandler::foundWord ( char * word ) [inline, virtual]
 

Found a word.

char * TextHandler::handleDoc ( char * docno ) [inline, virtual]
 

Handle a doc.

Reimplemented in InvFPTextHandler, and WriterTextHandler.

char * TextHandler::handleWord ( char * word ) [inline, virtual]
 

Handle a word, possibly transforming it.

Reimplemented in InvFPTextHandler, QueryTextHandler, Stemmer, Stopper, and WriterTextHandler.

void TextHandler::setTextHandler ( TextHandler * th ) [inline, virtual]
 

Set the TextHandler that this TextHandler will pass information on to.


Member Data Documentation

TextHandler * TextHandler::textHandler [protected]
 

The next textHandler in the chain.


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