Main Page   Namespace List   Class Hierarchy   Alphabetical List   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.lemurproject.org/license.html
00008  *
00009  *==========================================================================
00010 */
00011 
00012 #include "Exception.hpp"
00013 #include <set>
00014 
00015 
00016 #ifndef _LT_STR
00017 #define _LT_STR
00018 
00019 #include "common_headers.hpp"
00020 
00021 /* for the set */
00022 struct lt_str
00023 {
00024   bool operator()(const char* s1, const char* s2) const
00025   {
00026     return strcmp(s1, s2) < 0;
00027   }
00028 };
00029 #endif
00030 
00031 #ifndef _WORDSET_HPP
00032 #define _WORDSET_HPP
00033 
00035 
00042 class WordSet {
00043 
00044 public:
00045   WordSet();
00047   WordSet(const string &filename);
00048   ~WordSet();
00049 
00051   void load(const string &filename);
00053   void add(const char * word);
00055   bool contains(const char * word) const;
00056 
00058   void clear();
00059 
00060 
00061 protected:
00062   
00065   set<char *, lt_str> words;
00066 
00067 
00068 };
00069 
00070 #endif

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