Generated on Sat Feb 7 2015 02:01:38 for Gecode by doxygen 1.8.9.1
Dictionary Class Reference

A simple dictionary class. More...

#include <scowl.hpp>

Public Member Functions

 Dictionary (void)
 Initialize as empty dictionary. More...
 
void init (const char *fn)
 Perform actual initialization. More...
 
int len (void) const
 Return maximal length of a word. More...
 
int words (void) const
 Return total number of words. More...
 
int words (int l) const
 Return number of words with length l. More...
 
const char * word (int l, int i) const
 Return word number i with length l. More...
 
template<class Char , class Traits >
std::basic_ostream< Char, Traits > & print (std::basic_ostream< Char, Traits > &os) const
 Print statistics summary. More...
 
 ~Dictionary (void)
 Destructor. More...
 

Protected Attributes

unsigned int max_len
 Actual maximal length in dictionary. More...
 
int n_all_words
 Total number of words. More...
 
int n_words [limit_len]
 Number of words of some length. More...
 
char * s_words [limit_len]
 Beginning of words of some length. More...
 
char * chunk
 One big memory chunk for storing words. More...
 

Static Protected Attributes

static const unsigned int limit_len = 64
 Maximal word length support. More...
 

Detailed Description

A simple dictionary class.

Definition at line 53 of file scowl.hpp.

Constructor & Destructor Documentation

Dictionary::Dictionary ( void  )
inline

Initialize as empty dictionary.

Definition at line 13478 of file scowl.hpp.

Dictionary::~Dictionary ( void  )
inline

Destructor.

Definition at line 13626 of file scowl.hpp.

Member Function Documentation

void Dictionary::init ( const char *  fn)
inline

Perform actual initialization.

Reads words from file with name fn. If fn is NULL, the predefined dictionary is used.

Definition at line 13486 of file scowl.hpp.

int Dictionary::len ( void  ) const
inline

Return maximal length of a word.

Definition at line 13595 of file scowl.hpp.

int Dictionary::words ( void  ) const
inline

Return total number of words.

Definition at line 13599 of file scowl.hpp.

int Dictionary::words ( int  l) const
inline

Return number of words with length l.

Definition at line 13603 of file scowl.hpp.

const char * Dictionary::word ( int  l,
int  i 
) const
inline

Return word number i with length l.

Definition at line 13607 of file scowl.hpp.

template<class Char , class Traits >
std::basic_ostream< Char, Traits > & Dictionary::print ( std::basic_ostream< Char, Traits > &  os) const

Print statistics summary.

Definition at line 13612 of file scowl.hpp.

Member Data Documentation

const unsigned int Dictionary::limit_len = 64
staticprotected

Maximal word length support.

Definition at line 56 of file scowl.hpp.

unsigned int Dictionary::max_len
protected

Actual maximal length in dictionary.

Definition at line 58 of file scowl.hpp.

int Dictionary::n_all_words
protected

Total number of words.

Definition at line 60 of file scowl.hpp.

int Dictionary::n_words[limit_len]
protected

Number of words of some length.

Definition at line 62 of file scowl.hpp.

char* Dictionary::s_words[limit_len]
protected

Beginning of words of some length.

Definition at line 64 of file scowl.hpp.

char* Dictionary::chunk
protected

One big memory chunk for storing words.

Definition at line 66 of file scowl.hpp.


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