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

TextHandler.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.cs.cmu.edu/~lemur/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 #ifndef NULL
00013 #define NULL 0
00014 #endif
00015 
00016 #ifndef _TEXTHANDLER_HPP
00017 #define _TEXTHANDLER_HPP
00018 
00019 
00036 
00037 
00038 //  Might make more sense as TextSource and TextDestination with
00039 //  functions in the middle of the chain inheriting from both.
00040 
00041 
00042 class TextHandler {
00043 
00044 public:
00045   TextHandler() {
00046     textHandler = NULL;
00047   }
00048 
00050   virtual void foundDoc(char * docno) {
00051     docno = handleDoc(docno);
00052     if (textHandler != NULL) 
00053       textHandler->foundDoc(docno);
00054   }
00056   virtual void foundWord(char * word) {
00057     word = handleWord(word);
00058     if (textHandler != NULL)
00059       textHandler->foundWord(word);
00060   }
00062   virtual void setTextHandler(TextHandler * th) {
00063     textHandler = th;
00064   }
00065 
00067   virtual char * handleDoc(char * docno) { return docno; }
00069   virtual char * handleWord(char * word) { return word; }
00070 
00071 protected:
00073   TextHandler * textHandler;
00074 };
00075 
00076 #endif
00077 

Generated at Fri Jul 26 18:22:27 2002 for LEMUR by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000