2 * Copyright © 2006 Carl Worth
4 * This program is free software; you can redistribute it and\/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2, or (at your option)
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA."
34 typedef struct _string {
41 string_init (string_t *string);
44 string_fini (string_t *string);
47 string_append_char (string_t *string, char c);
50 string_chop (string_t *string);
55 #define TRIE_FLAGS_IS_WORD (1<<0)
57 typedef struct _trie {
59 struct _trie *next[26];
63 (*trie_predicate_t) (trie_t *trie);
65 #define TRIE_CHAR_TO_INDEX(c) (tolower (c) - 'a')
66 #define TRIE_INDEX_TO_CHAR(i) (i + 'a')
72 trie_add (trie_t *trie,
73 const char *word_chunk);
76 trie_find (trie_t *trie,
77 const char *word_chunk);
79 #endif /* _DICT_IMPL_H_ */