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 #include "affixmgr.hxx"
62 #include "baseaffix.hxx"
66 class PfxEntry
: public AffEntry
77 PfxEntry(AffixMgr
* pmgr
, affentry
* dp
);
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
);
122 class SfxEntry
: public AffEntry
138 SfxEntry(AffixMgr
* pmgr
, affentry
* dp
);
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
);