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

WordSet.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 #include "TextHandler.hpp"
00013 
00014 #include <set>
00015 
00016 
00017 #ifndef _LT_STR
00018 #define _LT_STR
00019 
00020 #include "common_headers.hpp"
00021 
00022 /* for the set */
00023 struct lt_str
00024 {
00025   bool operator()(const char* s1, const char* s2) const
00026   {
00027     return strcmp(s1, s2) < 0;
00028   }
00029 };
00030 #endif
00031 
00032 #ifndef _WORDSET_HPP
00033 #define _WORDSET_HPP
00034 
00036 
00043 class WordSet {
00044 
00045 public:
00046   WordSet();
00048   WordSet(char * filename);
00049   ~WordSet();
00050 
00052   void load(char * filename);
00054   void add(char * word);
00056   bool contains(char * word);
00057 
00059   void clear();
00060 
00061 
00062 protected:
00063   
00065   set<char *, lt_str> words;
00066 
00067 
00068 };
00069 
00070 #endif

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