A simple dictionary class.
More...
#include <scowl.hpp>
|
| | 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...
|
| |
A simple dictionary class.
Definition at line 49 of file scowl.hpp.
◆ Dictionary()
| Dictionary::Dictionary |
( |
void |
| ) |
|
|
inline |
Initialize as empty dictionary.
Definition at line 13474 of file scowl.hpp.
◆ ~Dictionary()
| Dictionary::~Dictionary |
( |
void |
| ) |
|
|
inline |
◆ 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 |
◆ limit_len
| const int Dictionary::limit_len = 64 |
|
staticprotected |
Maximal word length support.
Definition at line 52 of file scowl.hpp.
◆ max_len
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
Number of words of some length.
Definition at line 58 of file scowl.hpp.
◆ s_words
Beginning of words of some length.
Definition at line 60 of file scowl.hpp.
◆ chunk
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: