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

Term.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.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 
00013 #ifndef _TERM_HPP
00014 #define _TERM_HPP
00015 #include "Exception.hpp"
00016 
00018 
00022 class Term {
00023 public:
00024   Term() { term=NULL; termptr=NULL;}
00025   virtual ~Term() { free(term); }
00027   virtual const char* spelling() const { if (term) return term; return termptr; }
00030   virtual void spelling(const char* str) { free(term); termptr = str; }
00033   virtual void spelling(const string& str) { free(term); termptr = str.c_str(); }
00035   virtual void copyspelling(const char* str) { reset(); term=strdup(str); }
00037   virtual void freespelling() { free(term); }
00039   virtual void reset() { free(term); termptr=NULL; }
00040 protected:
00041   char* term;
00042   const char* termptr;                  
00043 };
00044 
00045 
00046 #endif
00047 
00048 
00049 
00050   
00051 
00052 

Generated on Wed Nov 3 12:59:05 2004 for Lemur Toolkit by doxygen1.2.18