OSDN Git Service

BrowseRefsDlg: Show log context menu item added
[tortoisegit/TortoiseGitJp.git] / ext / hunspell / hashmgr.hxx
1 #ifndef _HASHMGR_HXX_
2 #define _HASHMGR_HXX_
3
4 #include <cstdio>
5 #include "htypes.hxx"
6
7 enum flag { FLAG_CHAR, FLAG_LONG, FLAG_NUM, FLAG_UNI };
8
9 class HashMgr
10 {
11   int             tablesize;
12   struct hentry * tableptr;
13   int             userword;
14   flag            flag_mode;
15   int             complexprefixes;
16   int             utf8;
17   char *          ignorechars;
18   unsigned short * ignorechars_utf16;
19   int             ignorechars_utf16_len;
20   int                 numaliasf; // flag vector `compression' with aliases
21   unsigned short **   aliasf;
22   unsigned short *    aliasflen;
23   int                 numaliasm; // morphological desciption `compression' with aliases
24   char **             aliasm;
25
26
27 public:
28   HashMgr(const char * tpath, const char * apath);
29   ~HashMgr();
30
31   struct hentry * lookup(const char *) const;
32   int hash(const char *) const;
33   struct hentry * walk_hashtable(int & col, struct hentry * hp) const;
34
35   int put_word(const char * word, int wl, char * ap);
36   int put_word_pattern(const char * word, int wl, const char * pattern);
37   int decode_flags(unsigned short ** result, char * flags);
38   unsigned short        decode_flag(const char * flag);
39   char *                encode_flag(unsigned short flag);
40   int is_aliasf();
41   int get_aliasf(int index, unsigned short ** fvec);
42 #ifdef HUNSPELL_EXPERIMENTAL
43   int is_aliasm();
44   char * get_aliasm(int index);
45 #endif
46
47   
48 private:
49   int load_tables(const char * tpath);
50   int add_word(const char * word, int wl, unsigned short * ap, int al, const char * desc);
51   int load_config(const char * affpath);
52   int parse_aliasf(char * line, FILE * af);
53 #ifdef HUNSPELL_EXPERIMENTAL
54   int parse_aliasm(char * line, FILE * af);
55 #endif
56
57 };
58
59 #endif