Generated on Thu Mar 22 10:39:51 2012 for Gecode by doxygen 1.6.3

Dictionary Class Reference

A simple dictionary class. More...

#include <scowl.hpp>

List of all members.

Public Member Functions

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

Protected Attributes

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

Static Protected Attributes

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

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 [inline]

Print statistics summary.

Definition at line 13612 of file scowl.hpp.


Member Data Documentation

const unsigned int Dictionary::limit_len = 64 [static, protected]

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: