dic.h File Reference


Detailed Description

Dawg dictionary.

Author:
Antoine Fraboulet
Date:
2002

Definition in file dic.h.

Go to the source code of this file.

Defines

#define DIC_LETTERS   27
 different letters in the dictionary
#define DIC_WORD_MAX   16
 max length of words (including last )

Typedefs

typedef _DictionaryDictionary
typedef unsigned int dic_elt_t

Functions

int Dic_load (Dictionary *dic, const char *path)
 Dictionary creation and loading from a file.
int Dic_destroy (Dictionary dic)
 Destroy a dictionary.
char Dic_chr (Dictionary dic, dic_elt_t elt)
 Dic_chr returns the character associated with an element (in the range ['A'-'Z']), or the null character ('').
int Dic_last (Dictionary dic, dic_elt_t elt)
 Returns a boolean to show if there is another available character in the current depth (a neighbor in the tree).
int Dic_word (Dictionary dic, dic_elt_t elt)
 Returns a boolean to show if we are at the end of a word (see Dic_next).
dic_elt_t Dic_root (Dictionary dic)
 Returns the root of the dictionary.
dic_elt_t Dic_next (Dictionary dic, dic_elt_t elt)
 Returns the next available neighbor (see Dic_last).
dic_elt_t Dic_succ (Dictionary dic, dic_elt_t elt)
 Returns the first element available at the next depth in the dictionary dic : dictionary elt : current dictionary element.
unsigned int Dic_lookup (Dictionary dic, dic_elt_t root, char *pattern)
 Find the dictionary element matching the pattern starting from the given root node by walking the dictionary tree dic : valid dictionary root : starting dictionary node for the search pattern : string made of uppercase characters in the range ['A'-'Z'].


Define Documentation

#define DIC_LETTERS   27
 

different letters in the dictionary

Definition at line 37 of file dic.h.

Referenced by PPlus1::compute_enter(), Dic_search_7pl1(), init_letter_lists(), Plus1Frame::refresh(), and s_automaton_NFA_to_DFA().

#define DIC_WORD_MAX   16
 

max length of words (including last )

Definition at line 42 of file dic.h.

Referenced by PRegExp::compute_enter(), PPlus1::compute_enter(), PCross::compute_enter(), eliottxt_get_cross(), main(), RaccFrame::refresh(), BenjFrame::refresh(), and Plus1Frame::refresh().


Typedef Documentation

typedef unsigned int dic_elt_t
 

Definition at line 45 of file dic.h.

typedef struct _Dictionary* Dictionary
 

Definition at line 44 of file dic.h.


Function Documentation

char Dic_chr Dictionary  dic,
dic_elt_t  elt
 

Dic_chr returns the character associated with an element (in the range ['A'-'Z']), or the null character ('').

Returns:
ASCII code for the character

Definition at line 128 of file dic.c.

References _Dictionary::dawg.

Referenced by Board_checkout_tile(), Dic_lookup(), ExtendRight(), and LeftPart().

int Dic_destroy Dictionary  dic  ) 
 

Destroy a dictionary.

Definition at line 84 of file dic.c.

References _Dictionary::dawg.

Referenced by main(), print_dic_hex(), print_dic_list(), and MainFrame::~MainFrame().

int Dic_last Dictionary  dic,
dic_elt_t  elt
 

Returns a boolean to show if there is another available character in the current depth (a neighbor in the tree).

Returns:
0 or 1 (true)

Definition at line 139 of file dic.c.

References _Dictionary::dawg.

Referenced by Board_checkout_tile(), Dic_lookup(), and Dic_next().

int Dic_load Dictionary dic,
const char *  path
 

Dictionary creation and loading from a file.

Parameters:
dic : pointer to a dictionary
path : compressed dictionary path
Returns:
0 ok, 1 error

Definition at line 46 of file dic.c.

References check_header(), _Dict_header::edgesused, _Dict_header::nodesused, _Dict_header::nwords, _Dict_header::root, and _Dictionary::root.

Referenced by GameFactory::createFromCmdLine(), dic_load(), EVT_TEXT_ENTER(), and main().

unsigned int Dic_lookup Dictionary  dic,
dic_elt_t  root,
char *  pattern
 

Find the dictionary element matching the pattern starting from the given root node by walking the dictionary tree dic : valid dictionary root : starting dictionary node for the search pattern : string made of uppercase characters in the range ['A'-'Z'].

The pattern must be null ('') terminated

Returns:
0 if the string cannot be matched otherwise returns the element that results from walking the dictionary according to the pattern

Definition at line 153 of file dic.c.

References Dic_chr(), Dic_last(), Dic_next(), and Dic_succ().

Referenced by Board_checkout_tile().

dic_elt_t Dic_next Dictionary  dic,
dic_elt_t  elt
 

Returns the next available neighbor (see Dic_last).

Returns:
next dictionary element at the same depth

Definition at line 105 of file dic.c.

References Dic_last().

Referenced by Board_checkout_tile(), Dic_lookup(), ExtendRight(), and LeftPart().

dic_elt_t Dic_root Dictionary  dic  ) 
 

Returns the root of the dictionary.

Returns:
root element

Definition at line 121 of file dic.c.

References _Dictionary::root.

Referenced by Board_checkout_tile(), BoardSearchAux(), and Board::searchFirst().

dic_elt_t Dic_succ Dictionary  dic,
dic_elt_t  elt
 

Returns the first element available at the next depth in the dictionary dic : dictionary elt : current dictionary element.

Returns:
next element (successor)

Definition at line 114 of file dic.c.

References _Dictionary::dawg.

Referenced by Board_checkout_tile(), Dic_lookup(), ExtendRight(), and LeftPart().

int Dic_word Dictionary  dic,
dic_elt_t  elt
 

Returns a boolean to show if we are at the end of a word (see Dic_next).

Returns:
0 or 1 (true)

Definition at line 146 of file dic.c.

References _Dictionary::dawg.

Referenced by Board_checkout_tile(), and ExtendRight().


Generated on Thu Dec 29 02:01:15 2005 for Eliot by  doxygen 1.4.5