Public Types | Public Attributes | List of all members
moot::wasteLexicon Class Reference

simple hash_set<>-based lexicon class

Public Types

typedef __gnu_cxx::hash_set< std::string > Lexicon
 

Public Member Functions

Constructors etc.
 wasteLexicon ()
 
 ~wasteLexicon ()
 
void clear ()
 
Access and Manipulation
bool lookup (const std::string &word) const
 
void insert (const std::string &word)
 
I/O
bool load (moot::TokenReader *reader)
 
bool load (mootio::mistream *mis)
 
bool load (const char *filename)
 

Public Attributes

Lexicon lex
 

Member Typedef Documentation

◆ Lexicon

typedef __gnu_cxx::hash_set<std::string> moot::wasteLexicon::Lexicon

typedef for underlying lexicon data

Constructor & Destructor Documentation

◆ wasteLexicon()

moot::wasteLexicon::wasteLexicon ( )
inline

Default constructor

◆ ~wasteLexicon()

moot::wasteLexicon::~wasteLexicon ( )
inline

destructor

Member Function Documentation

◆ clear()

void moot::wasteLexicon::clear ( void  )
inline

clear all entries

◆ lookup()

bool moot::wasteLexicon::lookup ( const std::string &  word) const
inline
Returns
true iff word is present in the lexicon

◆ insert()

void moot::wasteLexicon::insert ( const std::string &  word)
inline

insert word into the lexicon

References load().

◆ load() [1/3]

bool moot::wasteLexicon::load ( moot::TokenReader reader)

load lexicon from a moot::TokenReader: adds only mootToken::text() of moot::TokTypeVanilla tokens

Returns
true on success, false otherwise

Referenced by insert().

◆ load() [2/3]

bool moot::wasteLexicon::load ( mootio::mistream mis)

load lexicon from a mootio::mistream; wraps load(moot::TokenReader*) using a temporary TokenReaderNative

Returns
true on success, false otherwise

◆ load() [3/3]

bool moot::wasteLexicon::load ( const char *  filename)

load lexicon from a named file; wraps load(mootoi::mistream*) method

Returns
true on success, false otherwise

Member Data Documentation

◆ lex

Lexicon moot::wasteLexicon::lex

underlying lexicon data


The documentation for this class was generated from the following file: