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

lemur::utility::WordSet Class Reference

A generic class that provides a neat and easy to use wrapper to a hash_set<char *>. More...

#include <WordSet.hpp>

Inheritance diagram for lemur::utility::WordSet:

lemur::api::Stopper List of all members.

Public Member Functions

 WordSet ()
 WordSet (const string &filename)
 Create object, and load set from file.

 ~WordSet ()
void load (const string &filename)
 Load a set from file. Does not clear the set first.

void add (const char *word)
 Add a word (char *) to the set.

bool contains (const char *word) const
 Check for the existence of a word in the set.

void clear ()
 Empty the set and free memory.


Protected Attributes

set< char *, lt_strwords
string lastfile

Detailed Description

A generic class that provides a neat and easy to use wrapper to a hash_set<char *>.

A generic class that provides a neat and easy to use wrapper to a hash_set<char *>. It can load items in the set from a file (one item per line). It also handles its own memory conveniently.


Constructor & Destructor Documentation

lemur::utility::WordSet::WordSet  ) 
 

lemur::utility::WordSet::WordSet const string &  filename  ) 
 

Create object, and load set from file.

lemur::utility::WordSet::~WordSet  ) 
 


Member Function Documentation

void lemur::utility::WordSet::add const char *  word  ) 
 

Add a word (char *) to the set.

void lemur::utility::WordSet::clear  ) 
 

Empty the set and free memory.

bool lemur::utility::WordSet::contains const char *  word  )  const
 

Check for the existence of a word in the set.

void lemur::utility::WordSet::load const string &  filename  ) 
 

Load a set from file. Does not clear the set first.


Member Data Documentation

string lemur::utility::WordSet::lastfile [protected]
 

set<char *, lt_str> lemur::utility::WordSet::words [protected]
 

The set used to store words. once a word is stored, we do not change it


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:07 2010 for Lemur by doxygen 1.3.4