Generated on Thu Jan 16 2025 00:00:00 for Gecode by doxygen 1.14.0

A simple dictionary class. More...

#include <scowl.hpp>

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

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 int limit_len = 64
 Maximal word length support.

Detailed Description

A simple dictionary class.

Definition at line 49 of file scowl.hpp.

Constructor & Destructor Documentation

◆ Dictionary()

Dictionary::Dictionary ( void )
inline

Initialize as empty dictionary.

Definition at line 13474 of file scowl.hpp.

◆ ~Dictionary()

Dictionary::~Dictionary ( void )
inline

Destructor.

Definition at line 13630 of file scowl.hpp.

Member Function Documentation

◆ init()

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 13482 of file scowl.hpp.

◆ len()

int Dictionary::len ( void ) const
inline

Return maximal length of a word.

Definition at line 13599 of file scowl.hpp.

◆ words() [1/2]

int Dictionary::words ( void ) const
inline

Return total number of words.

Definition at line 13603 of file scowl.hpp.

◆ words() [2/2]

int Dictionary::words ( int l) const
inline

Return number of words with length l.

Definition at line 13607 of file scowl.hpp.

◆ word()

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

Return word number i with length l.

Definition at line 13611 of file scowl.hpp.

◆ print()

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 13616 of file scowl.hpp.

Member Data Documentation

◆ limit_len

const int Dictionary::limit_len = 64
staticprotected

Maximal word length support.

Definition at line 52 of file scowl.hpp.

◆ max_len

int Dictionary::max_len
protected

Actual maximal length in dictionary.

Definition at line 54 of file scowl.hpp.

◆ n_all_words

int Dictionary::n_all_words
protected

Total number of words.

Definition at line 56 of file scowl.hpp.

◆ n_words

int Dictionary::n_words[limit_len]
protected

Number of words of some length.

Definition at line 58 of file scowl.hpp.

◆ s_words

char* Dictionary::s_words[limit_len]
protected

Beginning of words of some length.

Definition at line 60 of file scowl.hpp.

◆ chunk

char* Dictionary::chunk
protected

One big memory chunk for storing words.

Definition at line 62 of file scowl.hpp.


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