2
This file is part of RoboJournal.
3
Copyright (c) 2013 by Will Kraft <pwizard@gmail.com>.
6
RoboJournal is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
11
RoboJournal is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with RoboJournal. If not, see <http://www.gnu.org/licenses/>.
20
/* ***** BEGIN LICENSE BLOCK *****
21
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
23
* The contents of this file are subject to the Mozilla Public License Version
24
* 1.1 (the "License"); you may not use this file except in compliance with
25
* the License. You may obtain a copy of the License at
26
* http://www.mozilla.org/MPL/
28
* Software distributed under the License is distributed on an "AS IS" basis,
29
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
30
* for the specific language governing rights and limitations under the
33
* The Original Code is Hunspell, based on MySpell.
35
* The Initial Developers of the Original Code are
36
* Kevin Hendricks (MySpell) and Laszlo Nemeth (Hunspell).
37
* Portions created by the Initial Developers are Copyright (C) 2002-2005
38
* the Initial Developers. All Rights Reserved.
64
* Alternatively, the contents of this file may be used under the terms of
65
* either the GNU General Public License Version 2 or later (the "GPL"), or
66
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
67
* in which case the provisions of the GPL or the LGPL are applicable instead
68
* of those above. If you wish to allow use of your version of this file only
69
* under the terms of either the GPL or the LGPL, and not to allow others to
70
* use your version of this file under the terms of the MPL, indicate your
71
* decision by deleting the provisions above and replace them with the notice
72
* and other provisions required by the GPL or the LGPL. If you do not delete
73
* the provisions above, a recipient may use your version of this file under
74
* the terms of any one of the MPL, the GPL or the LGPL.
76
* ***** END LICENSE BLOCK ***** */
81
#ifndef MOZILLA_CLIENT
87
#include "ui/hunspell/htypes.hxx"
88
#include "ui/hunspell/filemgr.hxx"
90
enum flag { FLAG_CHAR, FLAG_LONG, FLAG_NUM, FLAG_UNI };
95
struct hentry ** tableptr;
100
unsigned short forbiddenword;
104
struct cs_info * csconv;
106
unsigned short * ignorechars_utf16;
107
int ignorechars_utf16_len;
108
int numaliasf; // flag vector `compression' with aliases
109
unsigned short ** aliasf;
110
unsigned short * aliasflen;
111
int numaliasm; // morphological desciption `compression' with aliases
116
HashMgr(const char * tpath, const char * apath, const char * key = NULL);
119
struct hentry * lookup(const char *) const;
120
int hash(const char *) const;
121
struct hentry * walk_hashtable(int & col, struct hentry * hp) const;
123
int add(const char * word, char * aff);
124
int add_with_affix(const char * word, const char * pattern);
125
int remove(const char * word);
126
int decode_flags(unsigned short ** result, char * flags);
127
unsigned short decode_flag(const char * flag);
128
char * encode_flag(unsigned short flag);
130
int get_aliasf(int index, unsigned short ** fvec);
132
char * get_aliasm(int index);
135
int get_clen_and_captype(const char * word, int wbl, int * captype);
136
int load_tables(const char * tpath, const char * key);
137
int add_word(const char * word, int wbl, int wcl, unsigned short * ap,
138
int al, const char * desc, bool onlyupcase);
139
int load_config(const char * affpath, const char * key);
140
int parse_aliasf(char * line, FileMgr * af);
141
int add_hidden_capitalized_word(char * word, int wbl, int wcl,
142
unsigned short * flags, int al, char * dp, int captype);
143
int parse_aliasm(char * line, FileMgr * af);
144
int remove_forbidden_flag(const char * word);