1 /******* BEGIN LICENSE BLOCK *******
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 * The contents of this file are subject to the Mozilla Public License Version
5 * 1.1 (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 * http://www.mozilla.org/MPL/
9 * Software distributed under the License is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 * for the specific language governing rights and limitations under the
14 * The Initial Developers of the Original Code are Kevin Hendricks (MySpell)
15 * and László Németh (Hunspell). Portions created by the Initial Developers
16 * are Copyright (C) 2002-2005 the Initial Developers. All Rights Reserved.
18 * Contributor(s): Kevin Hendricks (kevin.hendricks@sympatico.ca)
19 * David Einstein (deinst@world.std.com)
20 * László Németh (nemethl@gyorsposta.hu)
43 * Alternatively, the contents of this file may be used under the terms of
44 * either the GNU General Public License Version 2 or later (the "GPL"), or
45 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
46 * in which case the provisions of the GPL or the LGPL are applicable instead
47 * of those above. If you wish to allow use of your version of this file only
48 * under the terms of either the GPL or the LGPL, and not to allow others to
49 * use your version of this file under the terms of the MPL, indicate your
50 * decision by deleting the provisions above and replace them with the notice
51 * and other provisions required by the GPL or the LGPL. If you do not delete
52 * the provisions above, a recipient may use your version of this file under
53 * the terms of any one of the MPL, the GPL or the LGPL.
55 ******* END LICENSE BLOCK *******/
60 #ifndef MOZILLA_CLIENT
66 #include "filemgr.hxx"
69 enum flag
{ FLAG_CHAR
, FLAG_LONG
, FLAG_NUM
, FLAG_UNI
};
74 struct hentry
** tableptr
;
79 unsigned short forbiddenword
;
83 struct cs_info
* csconv
;
85 unsigned short * ignorechars_utf16
;
86 int ignorechars_utf16_len
;
87 int numaliasf
; // flag vector `compression' with aliases
88 unsigned short ** aliasf
;
89 unsigned short * aliasflen
;
90 int numaliasm
; // morphological desciption `compression' with aliases
95 HashMgr(const char * tpath
, const char * apath
, const char * key
= NULL
);
98 struct hentry
* lookup(const char *) const;
99 int hash(const char *) const;
100 struct hentry
* walk_hashtable(int & col
, struct hentry
* hp
) const;
102 int add(const char * word
);
103 int add_with_affix(const char * word
, const char * pattern
);
104 int remove(const char * word
);
105 int decode_flags(unsigned short ** result
, char * flags
, FileMgr
* af
);
106 unsigned short decode_flag(const char * flag
);
107 char * encode_flag(unsigned short flag
);
109 int get_aliasf(int index
, unsigned short ** fvec
, FileMgr
* af
);
111 char * get_aliasm(int index
);
114 int get_clen_and_captype(const char * word
, int wbl
, int * captype
);
115 int load_tables(const char * tpath
, const char * key
);
116 int add_word(const char * word
, int wbl
, int wcl
, unsigned short * ap
,
117 int al
, const char * desc
, bool onlyupcase
);
118 int load_config(const char * affpath
, const char * key
);
119 int parse_aliasf(char * line
, FileMgr
* af
);
120 int add_hidden_capitalized_word(char * word
, int wbl
, int wcl
,
121 unsigned short * flags
, int al
, char * dp
, int captype
);
122 int parse_aliasm(char * line
, FileMgr
* af
);
123 int remove_forbidden_flag(const char * word
);