00001 
00002 
00003 
00004 
00005 
00006 
00007 
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 
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