Bug 470455 - test_database_sync_embed_visits.js leaks, r=sdwilsh
[wine-gecko.git] / extensions / spellcheck / hunspell / src / affentry.hxx
blobd18d594ab19c44cb839821efd749e2019e14aa5c
1 /******* BEGIN LICENSE BLOCK *******
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3 *
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/
8 *
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
12 * License.
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)
21 * Davide Prina
22 * Giuseppe Modugno
23 * Gianluca Turconi
24 * Simon Brouwer
25 * Noll Janos
26 * Biro Arpad
27 * Goldman Eleonora
28 * Sarlos Tamas
29 * Bencsath Boldizsar
30 * Halacsy Peter
31 * Dvornik Laszlo
32 * Gefferth Andras
33 * Nagy Viktor
34 * Varga Daniel
35 * Chris Halls
36 * Rene Engelhard
37 * Bram Moolenaar
38 * Dafydd Jones
39 * Harri Pitkanen
40 * Andras Timar
41 * Tor Lillqvist
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 *******/
57 #ifndef _AFFIX_HXX_
58 #define _AFFIX_HXX_
60 #include "affixmgr.hxx"
61 #include "atypes.hxx"
62 #include "baseaffix.hxx"
64 /* A Prefix Entry */
66 class PfxEntry : public AffEntry
68 AffixMgr* pmyMgr;
70 PfxEntry * next;
71 PfxEntry * nexteq;
72 PfxEntry * nextne;
73 PfxEntry * flgnxt;
75 public:
77 PfxEntry(AffixMgr* pmgr, affentry* dp );
78 ~PfxEntry();
80 inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); }
81 struct hentry * checkword(const char * word, int len, char in_compound,
82 const FLAG needflag = FLAG_NULL);
84 struct hentry * check_twosfx(const char * word, int len, char in_compound, const FLAG needflag = NULL);
86 char * check_morph(const char * word, int len, char in_compound,
87 const FLAG needflag = FLAG_NULL);
89 char * check_twosfx_morph(const char * word, int len,
90 char in_compound, const FLAG needflag = FLAG_NULL);
92 inline FLAG getFlag() { return aflag; }
93 inline const char * getKey() { return appnd; }
94 char * add(const char * word, int len);
96 inline short getKeyLen() { return appndl; }
98 inline const char * getMorph() { return morphcode; }
100 inline const unsigned short * getCont() { return contclass; }
101 inline short getContLen() { return contclasslen; }
103 inline PfxEntry * getNext() { return next; }
104 inline PfxEntry * getNextNE() { return nextne; }
105 inline PfxEntry * getNextEQ() { return nexteq; }
106 inline PfxEntry * getFlgNxt() { return flgnxt; }
108 inline void setNext(PfxEntry * ptr) { next = ptr; }
109 inline void setNextNE(PfxEntry * ptr) { nextne = ptr; }
110 inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; }
111 inline void setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; }
113 inline char * nextchar(char * p);
114 inline int test_condition(const char * st);
120 /* A Suffix Entry */
122 class SfxEntry : public AffEntry
124 AffixMgr* pmyMgr;
125 char * rappnd;
127 SfxEntry * next;
128 SfxEntry * nexteq;
129 SfxEntry * nextne;
130 SfxEntry * flgnxt;
132 SfxEntry * l_morph;
133 SfxEntry * r_morph;
134 SfxEntry * eq_morph;
136 public:
138 SfxEntry(AffixMgr* pmgr, affentry* dp );
139 ~SfxEntry();
141 inline bool allowCross() { return ((opts & aeXPRODUCT) != 0); }
142 struct hentry * checkword(const char * word, int len, int optflags,
143 AffEntry* ppfx, char ** wlst, int maxSug, int * ns,
144 // const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, char in_compound=IN_CPD_NOT);
145 const FLAG cclass = FLAG_NULL, const FLAG needflag = FLAG_NULL, const FLAG badflag = 0);
147 struct hentry * check_twosfx(const char * word, int len, int optflags, AffEntry* ppfx, const FLAG needflag = NULL);
149 char * check_twosfx_morph(const char * word, int len, int optflags,
150 AffEntry* ppfx, const FLAG needflag = FLAG_NULL);
151 struct hentry * get_next_homonym(struct hentry * he);
152 struct hentry * get_next_homonym(struct hentry * word, int optflags, AffEntry* ppfx,
153 const FLAG cclass, const FLAG needflag);
156 inline FLAG getFlag() { return aflag; }
157 inline const char * getKey() { return rappnd; }
158 char * add(const char * word, int len);
161 inline const char * getMorph() { return morphcode; }
163 inline const unsigned short * getCont() { return contclass; }
164 inline short getContLen() { return contclasslen; }
165 inline const char * getAffix() { return appnd; }
167 inline short getKeyLen() { return appndl; }
169 inline SfxEntry * getNext() { return next; }
170 inline SfxEntry * getNextNE() { return nextne; }
171 inline SfxEntry * getNextEQ() { return nexteq; }
173 inline SfxEntry * getLM() { return l_morph; }
174 inline SfxEntry * getRM() { return r_morph; }
175 inline SfxEntry * getEQM() { return eq_morph; }
176 inline SfxEntry * getFlgNxt() { return flgnxt; }
178 inline void setNext(SfxEntry * ptr) { next = ptr; }
179 inline void setNextNE(SfxEntry * ptr) { nextne = ptr; }
180 inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; }
181 inline void setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; }
183 inline char * nextchar(char * p);
184 inline int test_condition(const char * st, const char * begin);
188 #endif