Merge lp:~ddecator/songbird/fix-songbird-daily-build-20100416 into lp:songbird
- fix-songbird-daily-build-20100416
- Merge into songbird.head
Status: | Needs review |
---|---|
Proposed branch: | lp:~ddecator/songbird/fix-songbird-daily-build-20100416 |
Merge into: | lp:songbird |
Diff against target: |
11192 lines (+3860/-2686) 13 files modified
debian/changelog (+2/-2) debian/control (+13/-1) debian/copyright (+174/-3) debian/patches/bz429747_att317495+move_hunspell_1.2.patch (+3546/-2605) debian/patches/bz473629_lp319480_leak_setenv_apprunner.patch (+5/-15) debian/patches/fix_build_glitch.patch (+21/-0) debian/patches/fix_python.patch (+13/-0) debian/patches/fix_ssltunnel_with_system_nss.patch (+8/-16) debian/patches/install_systray.patch (+7/-11) debian/patches/series (+5/-1) debian/patches/sqlite_use_ar_cr.patch (+13/-0) debian/patches/taglib_directory_fix.patch (+13/-0) debian/rules (+40/-32) |
To merge this branch: | bzr merge lp:~ddecator/songbird/fix-songbird-daily-build-20100416 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mozilla Team | Pending | ||
Review via email: mp+23525@code.launchpad.net |
Commit message
Description of the change
- 109. By Draycen DeCator
-
* New upstream snapshot 2.0.0 a SVN 20100618r18971
- 110. By Draycen DeCator
-
* Fix failure in build due to unrecognized line-end-escapes in Makefile
- add debian/patches/ fix_build_ glitch. patch - 111. By Draycen DeCator
-
* Fix Makefile to find taglib in the proper directory
- add debian/patches/ taglib_ directory_ fix.patch - 112. By Draycen DeCator
-
* Rebase patch
- update debian/patches/ install_ systray. patch - 113. By Draycen DeCator
-
* Add additional copyright information
- update debian/copyright - 114. By Draycen DeCator
-
* Check for dependencies of Xulrunner 1.9.2
- update debian/control - 115. By Draycen DeCator
-
* Pull and build Xulrunner 1.9.2; Pull and build SQlite; Use bash to address pushd
- update debian/rules - 116. By Draycen DeCator
-
* Use 'ar cr' when building SQlite
- add debian/patches/ sqlite_ use_ar_ cr.patch - 117. By Draycen DeCator
-
* Rebase patches
- update debian/patches/ bz429747_ att317495+ move_hunspell_ 1.2.patch
- update debian/patches/ bz473629_ lp319480_ leak_setenv_ apprunner. patch
- update debian/patches/ fix_build_ glitch. patch
- update debian/patches/ fix_ssltunnel_ with_systen_ nss.patch - 118. By Draycen DeCator
-
* New upstream snapshot 2.0.0 a SVN 20100624r19027
- 119. By Draycen DeCator
-
* Look for python2.6 instead of python2.5 when building Xulrunner-1.9.2
- add debian/patches/ fix_python. patch - 120. By Draycen DeCator
-
* Ignore potentially obsolete patch bz429747_
att317495+ move_hunspell_ 1.2.patch
- update debian/patches/ series - 121. By Draycen DeCator
-
From: Mook <email address hidden>
Description: Make debian/rules compliant with songbird.mk no longer checking
environment variables.* Adjust rules file to accomodate changes upstream
- update debian/rules - 122. By Draycen DeCator
-
* New upstream snapshot 1.9.0 a SVN 20100708r19138
- 123. By Draycen DeCator
-
* Pull mozbrowser from new location and pull mozexthelper
- update debian/rules
Unmerged revisions
- 123. By Draycen DeCator
-
* Pull mozbrowser from new location and pull mozexthelper
- update debian/rules - 122. By Draycen DeCator
-
* New upstream snapshot 1.9.0 a SVN 20100708r19138
- 121. By Draycen DeCator
-
From: Mook <email address hidden>
Description: Make debian/rules compliant with songbird.mk no longer checking
environment variables.* Adjust rules file to accomodate changes upstream
- update debian/rules - 120. By Draycen DeCator
-
* Ignore potentially obsolete patch bz429747_
att317495+ move_hunspell_ 1.2.patch
- update debian/patches/ series - 119. By Draycen DeCator
-
* Look for python2.6 instead of python2.5 when building Xulrunner-1.9.2
- add debian/patches/ fix_python. patch - 118. By Draycen DeCator
-
* New upstream snapshot 2.0.0 a SVN 20100624r19027
- 117. By Draycen DeCator
-
* Rebase patches
- update debian/patches/ bz429747_ att317495+ move_hunspell_ 1.2.patch
- update debian/patches/ bz473629_ lp319480_ leak_setenv_ apprunner. patch
- update debian/patches/ fix_build_ glitch. patch
- update debian/patches/ fix_ssltunnel_ with_systen_ nss.patch - 116. By Draycen DeCator
-
* Use 'ar cr' when building SQlite
- add debian/patches/ sqlite_ use_ar_ cr.patch - 115. By Draycen DeCator
-
* Pull and build Xulrunner 1.9.2; Pull and build SQlite; Use bash to address pushd
- update debian/rules - 114. By Draycen DeCator
-
* Check for dependencies of Xulrunner 1.9.2
- update debian/control
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2009-08-20 12:58:04 +0000 |
3 | +++ debian/changelog 2010-07-09 07:34:41 +0000 |
4 | @@ -1,5 +1,5 @@ |
5 | -songbird (1.4.0~a~svn20090819r14581-0ubuntu1) UNRELEASED; urgency=low |
6 | +songbird (1.9.0~a~svn20100708r19138-0ubuntu1) UNRELEASED; urgency=low |
7 | |
8 | * Initial release. (Closes: LP #94494) |
9 | |
10 | - -- Fabien Tassin <fta@ubuntu.com> Wed, 19 Aug 2009 17:42:00 +0200 |
11 | + -- Draycen DeCator <ddecator@gmail.com> Thu, 08 Jul 2010 22:09:41 -0400 |
12 | |
13 | === modified file 'debian/control' |
14 | --- debian/control 2009-06-18 22:08:30 +0000 |
15 | +++ debian/control 2010-07-09 07:34:41 +0000 |
16 | @@ -35,7 +35,19 @@ |
17 | libgstreamer0.10-dev (>= 0.10.1), |
18 | libgstreamer-plugins-base0.10-dev (>= 0.10.7), |
19 | libnspr4-dev, |
20 | - libnss3-dev |
21 | + libnss3-dev, |
22 | + libpixman-1-dev, |
23 | + libpng12-dev (>= 1.2.0), |
24 | + libjpeg62-dev (>= 6b), |
25 | + libbz2-dev, |
26 | + libkrb5-dev, |
27 | + libasound2-dev, |
28 | + python-dev, python-support (>= 0.3), |
29 | + binutils (>= 2.17-1) [mips mipsel], |
30 | + hardening-wrapper, |
31 | + libnotify-dev, |
32 | + libiw-dev, |
33 | + mozilla-devscripts (>= 0.08~) |
34 | Standards-Version: 3.8.0 |
35 | |
36 | Package: songbird |
37 | |
38 | === modified file 'debian/copyright' |
39 | --- debian/copyright 2008-05-08 14:04:27 +0000 |
40 | +++ debian/copyright 2010-07-09 07:34:41 +0000 |
41 | @@ -11,6 +11,177 @@ |
42 | License: GPL-2+ |
43 | The Debian packaging information is under the GPL, version 2 or later |
44 | |
45 | -Files: * |
46 | -Copyright: TODO |
47 | -License: TODO |
48 | +Files: songbird/dependencies/vendor/sqlite/* |
49 | +Copyright: None |
50 | +License: Public Domain |
51 | + |
52 | +Files: songbird/dependencies/vendor/xulrunner/* |
53 | +Copyright: Mozilla |
54 | +License: LGPL-2.1 |
55 | + Overall, the xulrunner project is licensed under the terms of the Mozilla |
56 | + Public License version 1.1 or, at your option, under the terms of the GNU |
57 | + General Public License version 2 or subsequent, or the terms of the GNU |
58 | + Lesser General Public License version 2.1 or subsequent. |
59 | + |
60 | + On Debian systems, the complete text of the GNU General Public |
61 | + License can be found in the file `/usr/share/common-licenses/GPL' ; |
62 | + the complete text of the GNU Lesser General Public License can be |
63 | + found in the file `/usr/share/common-licenses/LGPL'. |
64 | + |
65 | + The complete text of the Mozilla Public License can be found in the MPL file |
66 | + in the same directory as this file. |
67 | + |
68 | + Some of the files are also licensed (single, dual or tri) under the terms of |
69 | + the Netscape Public License (NPL) which can be found as amendments to the |
70 | + MPL at the end of the file. Please refer to http://www.mozilla.org/MPL/relicensing-faq.html |
71 | + |
72 | + While the Mozilla Project is undergoing a global relicensing so that the |
73 | + aim is to have a full tree with these tri-license terms, there are at the |
74 | + moment quite some exceptions as following: |
75 | + |
76 | + (Note that I sometimes assumed files not explicitely licensed to be licensed |
77 | + under the same terms as the files around them and that a lot of the |
78 | + information has been extracted automatically, thus maybe leaving some doubt. |
79 | + Again, if you find "bugs", please contact me by email or via the BTS.) |
80 | + |
81 | + The following files are not tri-licenced MPL/GPL/LGPL: |
82 | + |
83 | + - GPL only: |
84 | + dom/tests/mochitest/ajax/jquery/dist/jquery.js |
85 | + dom/tests/mochitest/ajax/jquery/src/jquery/jquery.js |
86 | + |
87 | + - MPL and GPL: |
88 | + embedding/browser/activex/src/install/README.txt |
89 | + |
90 | + - MPL and LGPL: |
91 | + gfx/cairo/cairo/* |
92 | + |
93 | + - GPL and LGP: |
94 | + extensions/pref/system-pref/src/gconf/nsSystemPrefService.cpp |
95 | + extensions/pref/system-pref/src/gconf/nsSystemPrefService.h |
96 | + extensions/pref/system-pref/src/nsSystemPref.cpp |
97 | + extensions/pref/system-pref/src/nsSystemPref.h |
98 | + extensions/pref/system-pref/src/nsSystemPrefFactory.cpp |
99 | + extensions/pref/system-pref/src/nsSystemPrefLog.h |
100 | + netwerk/base/public/nsIIOService2.idl |
101 | + netwerk/base/public/nsINetworkLinkService.idl |
102 | + netwerk/streamconv/converters/mozTXTToHTMLConv.cpp |
103 | + netwerk/streamconv/converters/mozTXTToHTMLConv.h |
104 | + netwerk/streamconv/public/mozITXTToHTMLConv.idl |
105 | + toolkit/system/dbus/nsDBusModule.cpp |
106 | + toolkit/system/dbus/nsDBusService.cpp |
107 | + toolkit/system/dbus/nsDBusService.h |
108 | + toolkit/system/dbus/nsNetworkManagerListener.cpp |
109 | + toolkit/system/dbus/nsNetworkManagerListener.h |
110 | + |
111 | + - NPL only (thus MPL): (EDIT: to investigate) |
112 | + intl/uconv/ucvibm/864i.uf |
113 | + intl/uconv/ucvibm/cp850.uf |
114 | + intl/uconv/ucvibm/cp852.uf |
115 | + intl/uconv/ucvibm/cp855.uf |
116 | + intl/uconv/ucvibm/cp857.uf |
117 | + intl/uconv/ucvibm/cp862.uf |
118 | + intl/uconv/ucvibm/cp864.uf |
119 | + intl/uconv/ucvmath/mathematica1.uf |
120 | + intl/uconv/ucvmath/mathematica2.uf |
121 | + intl/uconv/ucvmath/mathematica3.uf |
122 | + intl/uconv/ucvmath/mathematica4.uf |
123 | + intl/uconv/ucvmath/mathematica5.uf |
124 | + intl/uconv/ucvmath/mtextra.uf |
125 | + intl/uconv/ucvmath/texcmex-t1.uf |
126 | + intl/uconv/ucvmath/texcmex-ttf.uf |
127 | + intl/uconv/ucvmath/texcmmi-t1.uf |
128 | + intl/uconv/ucvmath/texcmmi-ttf.uf |
129 | + intl/uconv/ucvmath/texcmr-ttf.uf |
130 | + intl/uconv/ucvmath/texcmsy-t1.uf |
131 | + |
132 | + - Public Domain: |
133 | + aclocal.m4 |
134 | + build/autoconf/freetype2.m4 |
135 | + build/autoconf/gtk.m4 |
136 | + build/autoconf/nspr.m4 |
137 | + db/mork/src/morkDeque.cpp |
138 | + db/mork/src/morkDeque.h |
139 | + |
140 | + The file db/mork/src/morkQuickSort.cpp is licensed under the following terms: |
141 | + |
142 | + Copyright (c) 1992, 1993 |
143 | + The Regents of the University of California. All rights reserved. |
144 | + |
145 | + Redistribution and use in source and binary forms, with or without |
146 | + modification, are permitted provided that the following conditions |
147 | + are met: |
148 | + 1. Redistributions of source code must retain the above copyright |
149 | + notice, this list of conditions and the following disclaimer. |
150 | + 2. Redistributions in binary form must reproduce the above copyright |
151 | + notice, this list of conditions and the following disclaimer in the |
152 | + documentation and/or other materials provided with the distribution. |
153 | + 3. Neither the name of the University nor the names of its contributors |
154 | + may be used to endorse or promote products derived from this software |
155 | + without specific prior written permission. |
156 | + |
157 | + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
158 | + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
159 | + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
160 | + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
161 | + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
162 | + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
163 | + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
164 | + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
165 | + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
166 | + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
167 | + SUCH DAMAGE. |
168 | + |
169 | + The following files come from X11R5, without any clear licensing terms: |
170 | + |
171 | + build/autoconf/install-sh |
172 | + directory/c-sdk/config/autoconf/install-sh |
173 | + nsprpub/build/autoconf/install-sh |
174 | + |
175 | + The embedding/qa/mozembed/public/nsIQABrowserUIGlue.idl file and the files |
176 | + under the embedding/tests directory are licensed under the following terms: |
177 | + |
178 | + Copyright (c) 2002 Netscape Communications Corporation and |
179 | + other contributors |
180 | + |
181 | + Permission is hereby granted, free of charge, to any person obtaining a |
182 | + copy of this Mozilla sample software and associated documentation files |
183 | + (the "Software"), to deal in the Software without restriction, including |
184 | + without limitation the rights to use, copy, modify, merge, publish, |
185 | + distribute, sublicense, and/or sell copies of the Software, and to permit |
186 | + persons to whom the Software is furnished to do so, subject to the |
187 | + following conditions: |
188 | + |
189 | + The above copyright notice and this permission notice shall be included |
190 | + in all copies or substantial portions of the Software. |
191 | + |
192 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
193 | + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
194 | + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
195 | + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
196 | + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
197 | + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
198 | + DEALINGS IN THE SOFTWARE. |
199 | + |
200 | +Files: songbird/dependencies/vendor/taglib/* |
201 | +Copyright: © 2002 Scott Wheeler <wheeler@kde.org> |
202 | +License: LGPL-2.0, MPL |
203 | + On Debian systems, the full text of the GNU Lesser General Public License |
204 | + version 2 can be found in the file `/usr/share/common-licenses/LGPL-2' |
205 | + |
206 | +Files: songbird/dependencies/vendor/mozbrowser/* |
207 | +Copyright: Mozilla |
208 | +License: MPL, GPL, LGPL |
209 | + On Debian systems, the full text of the GNU General Public License |
210 | + version 2 can be found in the file `/usr/share/common-licenses/GPL-2' |
211 | + |
212 | + On Debian systems, the full text of the GNU Lesser General Public License |
213 | + version 2 can be found in the file `/usr/share/common-licenses/LGPL-2' |
214 | + |
215 | + Please see the file ../toolkit/content/license.html for the copyright |
216 | + licensing conditions attached to this codebase, including copies of the |
217 | + licenses concerned. |
218 | + |
219 | + You are not granted rights or licenses to the trademarks of the |
220 | + Mozilla Foundation or any party, including without limitation the |
221 | + Firefox name or logo. |
222 | |
223 | === modified file 'debian/patches/bz429747_att317495+move_hunspell_1.2.patch' |
224 | --- debian/patches/bz429747_att317495+move_hunspell_1.2.patch 2009-03-12 12:28:02 +0000 |
225 | +++ debian/patches/bz429747_att317495+move_hunspell_1.2.patch 2010-07-09 07:34:41 +0000 |
226 | @@ -1,60 +1,55 @@ |
227 | --- |
228 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/Makefile.in | 8 |
229 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/Makefile.in | 66 |
230 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/README.hunspell | 59 |
231 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.cpp | 924 + |
232 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.hxx | 187 |
233 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.cpp | 4155 +++++++ |
234 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.hxx | 272 |
235 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/atypes.hxx | 154 |
236 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/baseaffix.hxx | 87 |
237 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.cpp | 5400 ++++++++++ |
238 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.hxx | 233 |
239 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.cpp | 941 + |
240 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.hxx | 129 |
241 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/htypes.hxx | 85 |
242 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.cpp | 1807 +++ |
243 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.h | 89 |
244 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.hxx | 195 |
245 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/langnum.hxx | 94 |
246 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.cpp | 310 |
247 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.hxx | 66 |
248 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.cpp | 2036 +++ |
249 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.hxx | 160 |
250 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/Makefile.in | 13 |
251 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/README.hunspell | 59 |
252 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affentry.cpp | 924 - |
253 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affentry.hxx | 187 |
254 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affixmgr.cpp | 4155 ------- |
255 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affixmgr.hxx | 272 |
256 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/atypes.hxx | 154 |
257 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/baseaffix.hxx | 87 |
258 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/csutil.cpp | 5400 ---------- |
259 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/csutil.hxx | 233 |
260 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/hashmgr.cpp | 941 - |
261 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/hashmgr.hxx | 129 |
262 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/htypes.hxx | 85 |
263 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/hunspell.cpp | 1807 --- |
264 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/hunspell.h | 89 |
265 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/hunspell.hxx | 195 |
266 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/langnum.hxx | 94 |
267 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/phonet.cpp | 310 |
268 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/phonet.hxx | 66 |
269 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/suggestmgr.cpp | 2036 --- |
270 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/suggestmgr.hxx | 160 |
271 | - build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/src/Makefile.in | 6 |
272 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/Makefile.in | 8 |
273 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/Makefile.in | 66 |
274 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/README.hunspell | 59 |
275 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.cpp | 924 + |
276 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.hxx | 187 |
277 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.cpp | 4155 +++++++ |
278 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.hxx | 272 |
279 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/atypes.hxx | 154 |
280 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/baseaffix.hxx | 87 |
281 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.cpp | 5400 ++++++++++ |
282 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.hxx | 233 |
283 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.cpp | 941 + |
284 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.hxx | 129 |
285 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/htypes.hxx | 85 |
286 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.cpp | 1807 +++ |
287 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.h | 89 |
288 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.hxx | 195 |
289 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/langnum.hxx | 94 |
290 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.cpp | 310 |
291 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.hxx | 66 |
292 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.cpp | 2036 +++ |
293 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.hxx | 160 |
294 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/Makefile.in | 13 |
295 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/README.hunspell | 59 |
296 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affentry.cpp | 924 - |
297 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affentry.hxx | 187 |
298 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affixmgr.cpp | 4155 ------- |
299 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affixmgr.hxx | 272 |
300 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/atypes.hxx | 154 |
301 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/baseaffix.hxx | 87 |
302 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/csutil.cpp | 5400 ---------- |
303 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/csutil.hxx | 233 |
304 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hashmgr.cpp | 941 - |
305 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hashmgr.hxx | 129 |
306 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/htypes.hxx | 85 |
307 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hunspell.cpp | 1807 --- |
308 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hunspell.h | 89 |
309 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/hunspell.hxx | 195 |
310 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/langnum.hxx | 94 |
311 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/phonet.cpp | 310 |
312 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/phonet.hxx | 66 |
313 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/suggestmgr.cpp | 2036 --- |
314 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/suggestmgr.hxx | 160 |
315 | + build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/src/Makefile.in | 6 |
316 | 44 files changed, 17464 insertions(+), 17395 deletions(-) |
317 | |
318 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/Makefile.in |
319 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/Makefile.in |
320 | =================================================================== |
321 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/Makefile.in |
322 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/Makefile.in |
323 | -@@ -36,12 +36,18 @@ |
324 | - DEPTH = ../../.. |
325 | - topsrcdir = @top_srcdir@ |
326 | - srcdir = @srcdir@ |
327 | - VPATH = @srcdir@ |
328 | - |
329 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/Makefile.in 2010-06-20 03:48:07.113137794 -0400 |
330 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/Makefile.in 2010-06-20 03:48:12.443136094 -0400 |
331 | +@@ -41,7 +41,13 @@ |
332 | include $(DEPTH)/config/autoconf.mk |
333 | |
334 | MODULE = hunspell |
335 | @@ -69,10 +64,10 @@ |
336 | |
337 | include $(topsrcdir)/config/rules.mk |
338 | |
339 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/Makefile.in |
340 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/Makefile.in |
341 | =================================================================== |
342 | ---- /dev/null |
343 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/Makefile.in |
344 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
345 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/Makefile.in 2010-06-20 03:48:12.443136094 -0400 |
346 | @@ -0,0 +1,66 @@ |
347 | +# ****** BEGIN LICENSE BLOCK ****** |
348 | +# Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
349 | @@ -140,10 +135,10 @@ |
350 | + |
351 | +include $(topsrcdir)/config/rules.mk |
352 | + |
353 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/README.hunspell |
354 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/README.hunspell |
355 | =================================================================== |
356 | ---- /dev/null |
357 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/README.hunspell |
358 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
359 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/README.hunspell 2010-06-20 03:48:12.443136094 -0400 |
360 | @@ -0,0 +1,59 @@ |
361 | +******* BEGIN LICENSE BLOCK ******* |
362 | +* Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
363 | @@ -204,10 +199,10 @@ |
364 | +in MySpell and fixed numerous problems with the encoding case conversion tables |
365 | +along with rewriting MySpell as Hunspell and ensuring compatibility with the |
366 | +Mozilla codebase. |
367 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.cpp |
368 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.cpp |
369 | =================================================================== |
370 | ---- /dev/null |
371 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.cpp |
372 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
373 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.cpp 2010-06-20 03:48:12.453135898 -0400 |
374 | @@ -0,0 +1,924 @@ |
375 | +/******* BEGIN LICENSE BLOCK ******* |
376 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
377 | @@ -1133,10 +1128,10 @@ |
378 | + |
379 | +#endif |
380 | + |
381 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.hxx |
382 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.hxx |
383 | =================================================================== |
384 | ---- /dev/null |
385 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.hxx |
386 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
387 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affentry.hxx 2010-06-20 03:48:12.453135898 -0400 |
388 | @@ -0,0 +1,187 @@ |
389 | +/******* BEGIN LICENSE BLOCK ******* |
390 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
391 | @@ -1325,10 +1320,10 @@ |
392 | +#endif |
393 | + |
394 | + |
395 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.cpp |
396 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.cpp |
397 | =================================================================== |
398 | ---- /dev/null |
399 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.cpp |
400 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
401 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.cpp 2010-06-20 03:48:12.453135898 -0400 |
402 | @@ -0,0 +1,4155 @@ |
403 | +/******* BEGIN LICENSE BLOCK ******* |
404 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
405 | @@ -5485,10 +5480,10 @@ |
406 | + } |
407 | + return 0; |
408 | +} |
409 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.hxx |
410 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.hxx |
411 | =================================================================== |
412 | ---- /dev/null |
413 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.hxx |
414 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
415 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/affixmgr.hxx 2010-06-20 03:48:12.453135898 -0400 |
416 | @@ -0,0 +1,272 @@ |
417 | +/******* BEGIN LICENSE BLOCK ******* |
418 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
419 | @@ -5762,10 +5757,10 @@ |
420 | + |
421 | +#endif |
422 | + |
423 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/atypes.hxx |
424 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/atypes.hxx |
425 | =================================================================== |
426 | ---- /dev/null |
427 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/atypes.hxx |
428 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
429 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/atypes.hxx 2010-06-20 03:48:12.453135898 -0400 |
430 | @@ -0,0 +1,154 @@ |
431 | +/******* BEGIN LICENSE BLOCK ******* |
432 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
433 | @@ -5921,10 +5916,10 @@ |
434 | + |
435 | + |
436 | + |
437 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/baseaffix.hxx |
438 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/baseaffix.hxx |
439 | =================================================================== |
440 | ---- /dev/null |
441 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/baseaffix.hxx |
442 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
443 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/baseaffix.hxx 2010-06-20 03:48:12.453135898 -0400 |
444 | @@ -0,0 +1,87 @@ |
445 | +/******* BEGIN LICENSE BLOCK ******* |
446 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
447 | @@ -6013,10 +6008,10 @@ |
448 | +}; |
449 | + |
450 | +#endif |
451 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.cpp |
452 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.cpp |
453 | =================================================================== |
454 | ---- /dev/null |
455 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.cpp |
456 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
457 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.cpp 2010-06-20 03:48:12.463136609 -0400 |
458 | @@ -0,0 +1,5400 @@ |
459 | +/******* BEGIN LICENSE BLOCK ******* |
460 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
461 | @@ -11418,10 +11413,10 @@ |
462 | + } |
463 | + return 0; |
464 | +} |
465 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.hxx |
466 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.hxx |
467 | =================================================================== |
468 | ---- /dev/null |
469 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.hxx |
470 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
471 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/csutil.hxx 2010-06-20 03:48:12.463136609 -0400 |
472 | @@ -0,0 +1,233 @@ |
473 | +/******* BEGIN LICENSE BLOCK ******* |
474 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
475 | @@ -11656,10 +11651,10 @@ |
476 | + unsigned short ** out_utf16, int * out_utf16_len, const char * name, int utf8); |
477 | + |
478 | +#endif |
479 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.cpp |
480 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.cpp |
481 | =================================================================== |
482 | ---- /dev/null |
483 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.cpp |
484 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
485 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.cpp 2010-06-20 03:48:12.463136609 -0400 |
486 | @@ -0,0 +1,941 @@ |
487 | +/******* BEGIN LICENSE BLOCK ******* |
488 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
489 | @@ -12602,10 +12597,10 @@ |
490 | + return NULL; |
491 | +} |
492 | +#endif |
493 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.hxx |
494 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.hxx |
495 | =================================================================== |
496 | ---- /dev/null |
497 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.hxx |
498 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
499 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hashmgr.hxx 2010-06-20 03:48:12.463136609 -0400 |
500 | @@ -0,0 +1,129 @@ |
501 | +/******* BEGIN LICENSE BLOCK ******* |
502 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
503 | @@ -12736,10 +12731,10 @@ |
504 | +}; |
505 | + |
506 | +#endif |
507 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/htypes.hxx |
508 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/htypes.hxx |
509 | =================================================================== |
510 | ---- /dev/null |
511 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/htypes.hxx |
512 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
513 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/htypes.hxx 2010-06-20 03:48:12.463136609 -0400 |
514 | @@ -0,0 +1,85 @@ |
515 | +/******* BEGIN LICENSE BLOCK ******* |
516 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
517 | @@ -12826,10 +12821,10 @@ |
518 | +}; |
519 | + |
520 | +#endif |
521 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.cpp |
522 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.cpp |
523 | =================================================================== |
524 | ---- /dev/null |
525 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.cpp |
526 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
527 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.cpp 2010-06-20 03:48:12.473135925 -0400 |
528 | @@ -0,0 +1,1807 @@ |
529 | +/******* BEGIN LICENSE BLOCK ******* |
530 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
531 | @@ -14638,10 +14633,10 @@ |
532 | +{ |
533 | + return ((Hunspell*)pHunspell)->suggest(slst, word); |
534 | +} |
535 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.h |
536 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.h |
537 | =================================================================== |
538 | ---- /dev/null |
539 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.h |
540 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
541 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.h 2010-06-20 03:48:12.473135925 -0400 |
542 | @@ -0,0 +1,89 @@ |
543 | +/******* BEGIN LICENSE BLOCK ******* |
544 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
545 | @@ -14732,10 +14727,10 @@ |
546 | +#endif |
547 | + |
548 | +#endif |
549 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.hxx |
550 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.hxx |
551 | =================================================================== |
552 | ---- /dev/null |
553 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.hxx |
554 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
555 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/hunspell.hxx 2010-06-20 03:48:12.473135925 -0400 |
556 | @@ -0,0 +1,195 @@ |
557 | +/******* BEGIN LICENSE BLOCK ******* |
558 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
559 | @@ -14932,10 +14927,10 @@ |
560 | +}; |
561 | + |
562 | +#endif |
563 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/langnum.hxx |
564 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/langnum.hxx |
565 | =================================================================== |
566 | ---- /dev/null |
567 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/langnum.hxx |
568 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
569 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/langnum.hxx 2010-06-20 03:48:12.473135925 -0400 |
570 | @@ -0,0 +1,94 @@ |
571 | +/******* BEGIN LICENSE BLOCK ******* |
572 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
573 | @@ -15031,10 +15026,10 @@ |
574 | +}; |
575 | + |
576 | +#endif |
577 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.cpp |
578 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.cpp |
579 | =================================================================== |
580 | ---- /dev/null |
581 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.cpp |
582 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
583 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.cpp 2010-06-20 03:48:12.473135925 -0400 |
584 | @@ -0,0 +1,310 @@ |
585 | +/******* BEGIN LICENSE BLOCK ******* |
586 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
587 | @@ -15346,10 +15341,10 @@ |
588 | + return (j); |
589 | + |
590 | + } /** end of function "phonet" **/ |
591 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.hxx |
592 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.hxx |
593 | =================================================================== |
594 | ---- /dev/null |
595 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.hxx |
596 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
597 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/phonet.hxx 2010-06-20 03:48:12.473135925 -0400 |
598 | @@ -0,0 +1,66 @@ |
599 | +/******* BEGIN LICENSE BLOCK ******* |
600 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
601 | @@ -15417,10 +15412,10 @@ |
602 | + int len, phonetable & phone); |
603 | + |
604 | +#endif |
605 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.cpp |
606 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.cpp |
607 | =================================================================== |
608 | ---- /dev/null |
609 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.cpp |
610 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
611 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.cpp 2010-06-20 03:48:12.473135925 -0400 |
612 | @@ -0,0 +1,2036 @@ |
613 | +/******* BEGIN LICENSE BLOCK ******* |
614 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
615 | @@ -17458,10 +17453,10 @@ |
616 | + free(result); |
617 | + return len; |
618 | +} |
619 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.hxx |
620 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.hxx |
621 | =================================================================== |
622 | ---- /dev/null |
623 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.hxx |
624 | +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 |
625 | ++++ songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/hunspell/suggestmgr.hxx 2010-06-20 03:48:12.473135925 -0400 |
626 | @@ -0,0 +1,160 @@ |
627 | +/******* BEGIN LICENSE BLOCK ******* |
628 | + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
629 | @@ -17623,53 +17618,102 @@ |
630 | +}; |
631 | + |
632 | +#endif |
633 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/Makefile.in |
634 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/Makefile.in |
635 | =================================================================== |
636 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/Makefile.in |
637 | -+++ songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/Makefile.in |
638 | -@@ -51,36 +51,27 @@ |
639 | - unicharutil \ |
640 | - spellchecker \ |
641 | - xulapp \ |
642 | - $(NULL) |
643 | - |
644 | - CPPSRCS = mozHunspell.cpp \ |
645 | - $(NULL) |
646 | - |
647 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/Makefile.in 2010-06-20 03:48:07.073138017 -0400 |
648 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
649 | +@@ -1,87 +0,0 @@ |
650 | +-# ****** BEGIN LICENSE BLOCK ****** |
651 | +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
652 | +-# |
653 | +-# The contents of this file are subject to the Mozilla Public License Version |
654 | +-# 1.1 (the "License"); you may not use this file except in compliance with |
655 | +-# the License. You may obtain a copy of the License at |
656 | +-# http://www.mozilla.org/MPL/ |
657 | +-# |
658 | +-# Software distributed under the License is distributed on an "AS IS" basis, |
659 | +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
660 | +-# for the specific language governing rights and limitations under the |
661 | +-# License. |
662 | +-# |
663 | +-# The Initial Developers of the Original Code are Kevin Hendricks (MySpell) |
664 | +-# and László Németh (Hunspell). Portions created by the Initial Developers |
665 | +-# are Copyright (C) 2002-2005 the Initial Developers. All Rights Reserved. |
666 | +-# |
667 | +-# Contributor(s): David Einstein (deinst@world.std.com) |
668 | +-# László Németh (nemethl@gyorsposta.hu) |
669 | +-# Ryan VanderMeulen (ryanvm@gmail.com) |
670 | +-# |
671 | +-# Alternatively, the contents of this file may be used under the terms of |
672 | +-# either the GNU General Public License Version 2 or later (the "GPL"), or |
673 | +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), |
674 | +-# in which case the provisions of the GPL or the LGPL are applicable instead |
675 | +-# of those above. If you wish to allow use of your version of this file only |
676 | +-# under the terms of either the GPL or the LGPL, and not to allow others to |
677 | +-# use your version of this file under the terms of the MPL, indicate your |
678 | +-# decision by deleting the provisions above and replace them with the notice |
679 | +-# and other provisions required by the GPL or the LGPL. If you do not delete |
680 | +-# the provisions above, a recipient may use your version of this file under |
681 | +-# the terms of any one of the MPL, the GPL or the LGPL. |
682 | +-# |
683 | +-# ****** END LICENSE BLOCK ****** |
684 | +- |
685 | +-DEPTH = ../../../.. |
686 | +-topsrcdir = @top_srcdir@ |
687 | +-srcdir = @srcdir@ |
688 | +-VPATH = @srcdir@ |
689 | +- |
690 | +-include $(DEPTH)/config/autoconf.mk |
691 | +- |
692 | +-MODULE = hunspell |
693 | +-LIBRARY_NAME = hunspell_s |
694 | +-FORCE_STATIC_LIB = 1 |
695 | +-LIBXUL_LIBRARY = 1 |
696 | +- |
697 | +-REQUIRES = xpcom \ |
698 | +- string \ |
699 | +- uconv \ |
700 | +- unicharutil \ |
701 | +- spellchecker \ |
702 | +- xulapp \ |
703 | +- $(NULL) |
704 | +- |
705 | +-CPPSRCS = mozHunspell.cpp \ |
706 | +- mozHunspellDirProvider.cpp \ |
707 | +- $(NULL) |
708 | +- |
709 | -ifndef MOZ_NATIVE_HUNSPELL |
710 | -CPPSRCS += affentry.cpp \ |
711 | - affixmgr.cpp \ |
712 | - csutil.cpp \ |
713 | +- dictmgr.cpp \ |
714 | +- filemgr.cpp \ |
715 | - hashmgr.cpp \ |
716 | - hunspell.cpp \ |
717 | +- hunzip.cpp \ |
718 | - phonet.cpp \ |
719 | +- replist.cpp \ |
720 | - suggestmgr.cpp \ |
721 | - $(NULL) |
722 | -endif |
723 | - |
724 | - ifdef MOZ_XUL_APP |
725 | - CPPSRCS += mozHunspellDirProvider.cpp |
726 | - endif |
727 | - |
728 | - EXTRA_DSO_LDOPTS = \ |
729 | - $(LIBS_DIR) \ |
730 | - $(XPCOM_LIBS) \ |
731 | - $(NSPR_LIBS) \ |
732 | - $(MOZ_UNICHARUTIL_LIBS) \ |
733 | - $(MOZ_HUNSPELL_LIBS) \ |
734 | - $(NULL) |
735 | - |
736 | - include $(topsrcdir)/config/rules.mk |
737 | - |
738 | - ifdef MOZ_NATIVE_HUNSPELL |
739 | - CXXFLAGS += $(MOZ_HUNSPELL_CFLAGS) |
740 | -+else |
741 | -+CXXFLAGS += -I$(srcdir)/../hunspell |
742 | - endif |
743 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/README.hunspell |
744 | +-EXTRA_DSO_LDOPTS = \ |
745 | +- $(LIBS_DIR) \ |
746 | +- $(XPCOM_LIBS) \ |
747 | +- $(NSPR_LIBS) \ |
748 | +- $(MOZ_UNICHARUTIL_LIBS) \ |
749 | +- $(MOZ_HUNSPELL_LIBS) \ |
750 | +- $(NULL) |
751 | +- |
752 | +-include $(topsrcdir)/config/rules.mk |
753 | +- |
754 | +-ifdef MOZ_NATIVE_HUNSPELL |
755 | +-CXXFLAGS += $(MOZ_HUNSPELL_CFLAGS) |
756 | +-endif |
757 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/README.hunspell |
758 | =================================================================== |
759 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/README.hunspell |
760 | -+++ /dev/null |
761 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/README.hunspell 2010-06-20 03:48:06.883136291 -0400 |
762 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
763 | @@ -1,59 +0,0 @@ |
764 | -******* BEGIN LICENSE BLOCK ******* |
765 | -* Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
766 | @@ -17707,7 +17751,7 @@ |
767 | -* |
768 | -******* END LICENSE BLOCK ******* |
769 | - |
770 | --Hunspell Version: 1.1.12 |
771 | +-Hunspell Version: 1.2.8 |
772 | - |
773 | -Hunspell Author: László Németh |
774 | -MySpell Author: Kevin Hendricks & David Einstein |
775 | @@ -17730,11 +17774,11 @@ |
776 | -in MySpell and fixed numerous problems with the encoding case conversion tables |
777 | -along with rewriting MySpell as Hunspell and ensuring compatibility with the |
778 | -Mozilla codebase. |
779 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affentry.cpp |
780 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affentry.cpp |
781 | =================================================================== |
782 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affentry.cpp |
783 | -+++ /dev/null |
784 | -@@ -1,924 +0,0 @@ |
785 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affentry.cpp 2010-06-20 03:48:06.943136303 -0400 |
786 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
787 | +@@ -1,1028 +0,0 @@ |
788 | -/******* BEGIN LICENSE BLOCK ******* |
789 | - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
790 | - * |
791 | @@ -17797,9 +17841,9 @@ |
792 | -#include <cctype> |
793 | -#include <cstdio> |
794 | -#else |
795 | --#include <stdlib.h> |
796 | +-#include <stdlib.h> |
797 | -#include <string.h> |
798 | --#include <stdio.h> |
799 | +-#include <stdio.h> |
800 | -#include <ctype.h> |
801 | -#endif |
802 | - |
803 | @@ -17819,22 +17863,23 @@ |
804 | - pmyMgr = pmgr; |
805 | - |
806 | - // set up its intial values |
807 | -- |
808 | -- aflag = dp->aflag; // flag |
809 | +- |
810 | +- aflag = dp->aflag; // flag |
811 | - strip = dp->strip; // string to strip |
812 | - appnd = dp->appnd; // string to append |
813 | - stripl = dp->stripl; // length of strip string |
814 | - appndl = dp->appndl; // length of append string |
815 | -- numconds = dp->numconds; // number of conditions to match |
816 | -- opts = dp->opts; // cross product flag |
817 | +- numconds = dp->numconds; // length of the condition |
818 | +- opts = dp->opts; // cross product flag |
819 | - // then copy over all of the conditions |
820 | -- memcpy(&conds.base[0],&dp->conds.base[0],SETSIZE*sizeof(conds.base[0])); |
821 | +- if (opts & aeLONGCOND) { |
822 | +- memcpy(c.conds, dp->c.l.conds1, MAXCONDLEN_1); |
823 | +- c.l.conds2 = dp->c.l.conds2; |
824 | +- } else memcpy(c.conds, dp->c.conds, MAXCONDLEN); |
825 | - next = NULL; |
826 | - nextne = NULL; |
827 | - nexteq = NULL; |
828 | --#ifdef HUNSPELL_EXPERIMENTAL |
829 | - morphcode = dp->morphcode; |
830 | --#endif |
831 | - contclass = dp->contclass; |
832 | - contclasslen = dp->contclasslen; |
833 | -} |
834 | @@ -17848,14 +17893,8 @@ |
835 | - pmyMgr = NULL; |
836 | - appnd = NULL; |
837 | - strip = NULL; |
838 | -- if (opts & aeUTF8) { |
839 | -- for (int i = 0; i < numconds; i++) { |
840 | -- if (conds.utf8.wchars[i]) free(conds.utf8.wchars[i]); |
841 | -- } |
842 | -- } |
843 | --#ifdef HUNSPELL_EXPERIMENTAL |
844 | +- if (opts & aeLONGCOND) free(c.l.conds2); |
845 | - if (morphcode && !(opts & aeALIASM)) free(morphcode); |
846 | --#endif |
847 | - if (contclass && !(opts & aeALIASF)) free(contclass); |
848 | -} |
849 | - |
850 | @@ -17864,8 +17903,9 @@ |
851 | -{ |
852 | - char tword[MAXWORDUTF8LEN + 4]; |
853 | - |
854 | -- if ((len > stripl) && (len >= numconds) && test_condition(word) && |
855 | -- (!stripl || (strncmp(word, strip, stripl) == 0)) && |
856 | +- if ((len > stripl || (len == 0 && pmyMgr->get_fullstrip())) && |
857 | +- (len >= numconds) && test_condition(word) && |
858 | +- (!stripl || (strncmp(word, strip, stripl) == 0)) && |
859 | - ((MAXWORDUTF8LEN + 4) > (len + appndl - stripl))) { |
860 | - /* we have a match so add prefix */ |
861 | - char * pp = tword; |
862 | @@ -17876,51 +17916,87 @@ |
863 | - strcpy(pp, (word + stripl)); |
864 | - return mystrdup(tword); |
865 | - } |
866 | -- return NULL; |
867 | +- return NULL; |
868 | -} |
869 | - |
870 | +-inline char * PfxEntry::nextchar(char * p) { |
871 | +- if (p) { |
872 | +- p++; |
873 | +- if (opts & aeLONGCOND) { |
874 | +- // jump to the 2nd part of the condition |
875 | +- if (p == c.conds + MAXCONDLEN_1) return c.l.conds2; |
876 | +- // end of the MAXCONDLEN length condition |
877 | +- } else if (p == c.conds + MAXCONDLEN) return NULL; |
878 | +- return *p ? p : NULL; |
879 | +- } |
880 | +- return NULL; |
881 | +-} |
882 | - |
883 | -inline int PfxEntry::test_condition(const char * st) |
884 | -{ |
885 | -- int cond; |
886 | -- unsigned char * cp = (unsigned char *)st; |
887 | -- if (!(opts & aeUTF8)) { // 256-character codepage |
888 | -- for (cond = 0; cond < numconds; cond++) { |
889 | -- if ((conds.base[*cp++] & (1 << cond)) == 0) return 0; |
890 | -- } |
891 | -- } else { // UTF-8 encoding |
892 | -- unsigned short wc; |
893 | -- for (cond = 0; cond < numconds; cond++) { |
894 | -- // a simple 7-bit ASCII character in UTF-8 |
895 | -- if ((*cp >> 7) == 0) { |
896 | -- // also check limit (end of word) |
897 | -- if ((!*cp) || ((conds.utf8.ascii[*cp++] & (1 << cond)) == 0)) return 0; |
898 | -- // UTF-8 multibyte character |
899 | -- } else { |
900 | -- // not dot wildcard in rule |
901 | -- if (!conds.utf8.all[cond]) { |
902 | -- if (conds.utf8.neg[cond]) { |
903 | -- u8_u16((w_char *) &wc, 1, (char *) cp); |
904 | -- if (conds.utf8.wchars[cond] && |
905 | -- flag_bsearch((unsigned short *)conds.utf8.wchars[cond], |
906 | -- wc, (short) conds.utf8.wlen[cond])) return 0; |
907 | -- } else { |
908 | -- if (!conds.utf8.wchars[cond]) return 0; |
909 | -- u8_u16((w_char *) &wc, 1, (char *) cp); |
910 | -- if (!flag_bsearch((unsigned short *)conds.utf8.wchars[cond], |
911 | -- wc, (short)conds.utf8.wlen[cond])) return 0; |
912 | -- } |
913 | -- } |
914 | -- // jump to next UTF-8 character |
915 | -- for(cp++; (*cp & 0xc0) == 0x80; cp++); |
916 | -- } |
917 | +- const char * pos = NULL; // group with pos input position |
918 | +- bool neg = false; // complementer |
919 | +- bool ingroup = false; // character in the group |
920 | +- if (numconds == 0) return 1; |
921 | +- char * p = c.conds; |
922 | +- while (1) { |
923 | +- switch (*p) { |
924 | +- case '\0': return 1; |
925 | +- case '[': { |
926 | +- neg = false; |
927 | +- ingroup = false; |
928 | +- p = nextchar(p); |
929 | +- pos = st; break; |
930 | +- } |
931 | +- case '^': { p = nextchar(p); neg = true; break; } |
932 | +- case ']': { |
933 | +- if ((neg && ingroup) || (!neg && !ingroup)) return 0; |
934 | +- pos = NULL; |
935 | +- p = nextchar(p); |
936 | +- // skip the next character |
937 | +- if (!ingroup) for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++); |
938 | +- if (*st == '\0' && p) return 0; // word <= condition |
939 | +- break; |
940 | +- } |
941 | +- case '.': if (!pos) { // dots are not metacharacters in groups: [.] |
942 | +- p = nextchar(p); |
943 | +- // skip the next character |
944 | +- for (st++; (opts & aeUTF8) && (*st & 0xc0) == 0x80; st++); |
945 | +- if (*st == '\0' && p) return 0; // word <= condition |
946 | +- break; |
947 | +- } |
948 | +- default: { |
949 | +- if (*st == *p) { |
950 | +- st++; |
951 | +- p = nextchar(p); |
952 | +- if ((opts & aeUTF8) && (*(st - 1) & 0x80)) { // multibyte |
953 | +- while (p && (*p & 0xc0) == 0x80) { // character |
954 | +- if (*p != *st) { |
955 | +- if (!pos) return 0; |
956 | +- st = pos; |
957 | +- break; |
958 | +- } |
959 | +- p = nextchar(p); |
960 | +- st++; |
961 | +- } |
962 | +- if (pos && st != pos) { |
963 | +- ingroup = true; |
964 | +- while (p && *p != ']' && (p = nextchar(p))); |
965 | +- } |
966 | +- } else if (pos) { |
967 | +- ingroup = true; |
968 | +- while (p && *p != ']' && (p = nextchar(p))); |
969 | +- } |
970 | +- } else if (pos) { // group |
971 | +- p = nextchar(p); |
972 | +- } else return 0; |
973 | +- } |
974 | - } |
975 | +- if (!p) return 1; |
976 | - } |
977 | -- return 1; |
978 | -} |
979 | - |
980 | -- |
981 | --// check if this prefix entry matches |
982 | +-// check if this prefix entry matches |
983 | -struct hentry * PfxEntry::checkword(const char * word, int len, char in_compound, const FLAG needflag) |
984 | -{ |
985 | - int tmpl; // length of tmpword |
986 | @@ -17934,7 +18010,7 @@ |
987 | - |
988 | - tmpl = len - appndl; |
989 | - |
990 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
991 | +- if (tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) { |
992 | - |
993 | - // generate new root word by removing prefix and adding |
994 | - // back any characters that would have been stripped |
995 | @@ -17955,8 +18031,8 @@ |
996 | - if ((he = pmyMgr->lookup(tmpword)) != NULL) { |
997 | - do { |
998 | - if (TESTAFF(he->astr, aflag, he->alen) && |
999 | -- // forbid single prefixes with pseudoroot flag |
1000 | -- ! TESTAFF(contclass, pmyMgr->get_pseudoroot(), contclasslen) && |
1001 | +- // forbid single prefixes with needaffix flag |
1002 | +- ! TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) && |
1003 | - // needflag |
1004 | - ((!needflag) || TESTAFF(he->astr, needflag, he->alen) || |
1005 | - (contclass && TESTAFF(contclass, needflag, contclasslen)))) |
1006 | @@ -17964,14 +18040,14 @@ |
1007 | - he = he->next_homonym; // check homonyms |
1008 | - } while (he); |
1009 | - } |
1010 | -- |
1011 | -- // prefix matched but no root word was found |
1012 | -- // if aeXPRODUCT is allowed, try again but now |
1013 | +- |
1014 | +- // prefix matched but no root word was found |
1015 | +- // if aeXPRODUCT is allowed, try again but now |
1016 | - // ross checked combined with a suffix |
1017 | - |
1018 | - //if ((opts & aeXPRODUCT) && in_compound) { |
1019 | - if ((opts & aeXPRODUCT)) { |
1020 | -- he = pmyMgr->suffix_check(tmpword, tmpl, aeXPRODUCT, (AffEntry *)this, NULL, |
1021 | +- he = pmyMgr->suffix_check(tmpword, tmpl, aeXPRODUCT, (AffEntry *)this, NULL, |
1022 | - 0, NULL, FLAG_NULL, needflag, in_compound); |
1023 | - if (he) return he; |
1024 | - } |
1025 | @@ -17980,7 +18056,7 @@ |
1026 | - return NULL; |
1027 | -} |
1028 | - |
1029 | --// check if this prefix entry matches |
1030 | +-// check if this prefix entry matches |
1031 | -struct hentry * PfxEntry::check_twosfx(const char * word, int len, |
1032 | - char in_compound, const FLAG needflag) |
1033 | -{ |
1034 | @@ -17995,7 +18071,8 @@ |
1035 | - |
1036 | - tmpl = len - appndl; |
1037 | - |
1038 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
1039 | +- if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && |
1040 | +- (tmpl + stripl >= numconds)) { |
1041 | - |
1042 | - // generate new root word by removing prefix and adding |
1043 | - // back any characters that would have been stripped |
1044 | @@ -18014,8 +18091,8 @@ |
1045 | - if (test_condition(tmpword)) { |
1046 | - tmpl += stripl; |
1047 | - |
1048 | -- // prefix matched but no root word was found |
1049 | -- // if aeXPRODUCT is allowed, try again but now |
1050 | +- // prefix matched but no root word was found |
1051 | +- // if aeXPRODUCT is allowed, try again but now |
1052 | - // cross checked combined with a suffix |
1053 | - |
1054 | - if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { |
1055 | @@ -18027,8 +18104,7 @@ |
1056 | - return NULL; |
1057 | -} |
1058 | - |
1059 | --#ifdef HUNSPELL_EXPERIMENTAL |
1060 | --// check if this prefix entry matches |
1061 | +-// check if this prefix entry matches |
1062 | -char * PfxEntry::check_twosfx_morph(const char * word, int len, |
1063 | - char in_compound, const FLAG needflag) |
1064 | -{ |
1065 | @@ -18042,7 +18118,8 @@ |
1066 | - |
1067 | - tmpl = len - appndl; |
1068 | - |
1069 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
1070 | +- if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && |
1071 | +- (tmpl + stripl >= numconds)) { |
1072 | - |
1073 | - // generate new root word by removing prefix and adding |
1074 | - // back any characters that would have been stripped |
1075 | @@ -18061,8 +18138,8 @@ |
1076 | - if (test_condition(tmpword)) { |
1077 | - tmpl += stripl; |
1078 | - |
1079 | -- // prefix matched but no root word was found |
1080 | -- // if aeXPRODUCT is allowed, try again but now |
1081 | +- // prefix matched but no root word was found |
1082 | +- // if aeXPRODUCT is allowed, try again but now |
1083 | - // ross checked combined with a suffix |
1084 | - |
1085 | - if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { |
1086 | @@ -18074,7 +18151,7 @@ |
1087 | - return NULL; |
1088 | -} |
1089 | - |
1090 | --// check if this prefix entry matches |
1091 | +-// check if this prefix entry matches |
1092 | -char * PfxEntry::check_morph(const char * word, int len, char in_compound, const FLAG needflag) |
1093 | -{ |
1094 | - int tmpl; // length of tmpword |
1095 | @@ -18082,7 +18159,7 @@ |
1096 | - char tmpword[MAXWORDUTF8LEN + 4]; |
1097 | - char result[MAXLNLEN]; |
1098 | - char * st; |
1099 | -- |
1100 | +- |
1101 | - *result = '\0'; |
1102 | - |
1103 | - // on entry prefix is 0 length or already matches the beginning of the word. |
1104 | @@ -18092,7 +18169,8 @@ |
1105 | - |
1106 | - tmpl = len - appndl; |
1107 | - |
1108 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
1109 | +- if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && |
1110 | +- (tmpl + stripl >= numconds)) { |
1111 | - |
1112 | - // generate new root word by removing prefix and adding |
1113 | - // back any characters that would have been stripped |
1114 | @@ -18113,41 +18191,56 @@ |
1115 | - if ((he = pmyMgr->lookup(tmpword)) != NULL) { |
1116 | - do { |
1117 | - if (TESTAFF(he->astr, aflag, he->alen) && |
1118 | -- // forbid single prefixes with pseudoroot flag |
1119 | -- ! TESTAFF(contclass, pmyMgr->get_pseudoroot(), contclasslen) && |
1120 | +- // forbid single prefixes with needaffix flag |
1121 | +- ! TESTAFF(contclass, pmyMgr->get_needaffix(), contclasslen) && |
1122 | - // needflag |
1123 | - ((!needflag) || TESTAFF(he->astr, needflag, he->alen) || |
1124 | - (contclass && TESTAFF(contclass, needflag, contclasslen)))) { |
1125 | -- if (morphcode) strcat(result, morphcode); else strcat(result,getKey()); |
1126 | -- if (he->description) { |
1127 | -- if ((*(he->description)=='[')||(*(he->description)=='<')) strcat(result,he->word); |
1128 | -- strcat(result,he->description); |
1129 | -- } |
1130 | -- strcat(result, "\n"); |
1131 | +- if (morphcode) { |
1132 | +- mystrcat(result, " ", MAXLNLEN); |
1133 | +- mystrcat(result, morphcode, MAXLNLEN); |
1134 | +- } else mystrcat(result,getKey(), MAXLNLEN); |
1135 | +- if (!HENTRY_FIND(he, MORPH_STEM)) { |
1136 | +- mystrcat(result, " ", MAXLNLEN); |
1137 | +- mystrcat(result, MORPH_STEM, MAXLNLEN); |
1138 | +- mystrcat(result, HENTRY_WORD(he), MAXLNLEN); |
1139 | +- } |
1140 | +- // store the pointer of the hash entry |
1141 | +- if (HENTRY_DATA(he)) { |
1142 | +- mystrcat(result, " ", MAXLNLEN); |
1143 | +- mystrcat(result, HENTRY_DATA2(he), MAXLNLEN); |
1144 | +- } else { |
1145 | +- // return with debug information |
1146 | +- char * flag = pmyMgr->encode_flag(getFlag()); |
1147 | +- mystrcat(result, " ", MAXLNLEN); |
1148 | +- mystrcat(result, MORPH_FLAG, MAXLNLEN); |
1149 | +- mystrcat(result, flag, MAXLNLEN); |
1150 | +- free(flag); |
1151 | +- } |
1152 | +- mystrcat(result, "\n", MAXLNLEN); |
1153 | - } |
1154 | - he = he->next_homonym; |
1155 | - } while (he); |
1156 | - } |
1157 | - |
1158 | -- // prefix matched but no root word was found |
1159 | -- // if aeXPRODUCT is allowed, try again but now |
1160 | +- // prefix matched but no root word was found |
1161 | +- // if aeXPRODUCT is allowed, try again but now |
1162 | - // ross checked combined with a suffix |
1163 | - |
1164 | - if ((opts & aeXPRODUCT) && (in_compound != IN_CPD_BEGIN)) { |
1165 | -- st = pmyMgr->suffix_check_morph(tmpword, tmpl, aeXPRODUCT, (AffEntry *)this, |
1166 | +- st = pmyMgr->suffix_check_morph(tmpword, tmpl, aeXPRODUCT, (AffEntry *)this, |
1167 | - FLAG_NULL, needflag); |
1168 | - if (st) { |
1169 | -- strcat(result, st); |
1170 | +- mystrcat(result, st, MAXLNLEN); |
1171 | - free(st); |
1172 | - } |
1173 | - } |
1174 | - } |
1175 | - } |
1176 | -- |
1177 | +- |
1178 | - if (*result) return mystrdup(result); |
1179 | - return NULL; |
1180 | -} |
1181 | --#endif // END OF HUNSPELL_EXPERIMENTAL CODE |
1182 | - |
1183 | -SfxEntry::SfxEntry(AffixMgr * pmgr, affentry* dp) |
1184 | -{ |
1185 | @@ -18155,22 +18248,22 @@ |
1186 | - pmyMgr = pmgr; |
1187 | - |
1188 | - // set up its intial values |
1189 | -- aflag = dp->aflag; // char flag |
1190 | +- aflag = dp->aflag; // char flag |
1191 | - strip = dp->strip; // string to strip |
1192 | - appnd = dp->appnd; // string to append |
1193 | - stripl = dp->stripl; // length of strip string |
1194 | - appndl = dp->appndl; // length of append string |
1195 | -- numconds = dp->numconds; // number of conditions to match |
1196 | -- opts = dp->opts; // cross product flag |
1197 | +- numconds = dp->numconds; // length of the condition |
1198 | +- opts = dp->opts; // cross product flag |
1199 | - |
1200 | - // then copy over all of the conditions |
1201 | -- memcpy(&conds.base[0],&dp->conds.base[0],SETSIZE*sizeof(conds.base[0])); |
1202 | +- if (opts & aeLONGCOND) { |
1203 | +- memcpy(c.l.conds1, dp->c.l.conds1, MAXCONDLEN_1); |
1204 | +- c.l.conds2 = dp->c.l.conds2; |
1205 | +- } else memcpy(c.conds, dp->c.conds, MAXCONDLEN); |
1206 | - |
1207 | - rappnd = myrevstrdup(appnd); |
1208 | -- |
1209 | --#ifdef HUNSPELL_EXPERIMENTAL |
1210 | - morphcode = dp->morphcode; |
1211 | --#endif |
1212 | - contclass = dp->contclass; |
1213 | - contclasslen = dp->contclasslen; |
1214 | -} |
1215 | @@ -18184,15 +18277,9 @@ |
1216 | - if (strip) free(strip); |
1217 | - pmyMgr = NULL; |
1218 | - appnd = NULL; |
1219 | -- strip = NULL; |
1220 | -- if (opts & aeUTF8) { |
1221 | -- for (int i = 0; i < numconds; i++) { |
1222 | -- if (conds.utf8.wchars[i]) free(conds.utf8.wchars[i]); |
1223 | -- } |
1224 | -- } |
1225 | --#ifdef HUNSPELL_EXPERIMENTAL |
1226 | +- strip = NULL; |
1227 | +- if (opts & aeLONGCOND) free(c.l.conds2); |
1228 | - if (morphcode && !(opts & aeALIASM)) free(morphcode); |
1229 | --#endif |
1230 | - if (contclass && !(opts & aeALIASF)) free(contclass); |
1231 | -} |
1232 | - |
1233 | @@ -18202,7 +18289,8 @@ |
1234 | - char tword[MAXWORDUTF8LEN + 4]; |
1235 | - |
1236 | - /* make sure all conditions match */ |
1237 | -- if ((len > stripl) && (len >= numconds) && test_condition(word + len, word) && |
1238 | +- if ((len > stripl || (len == 0 && pmyMgr->get_fullstrip())) && |
1239 | +- (len >= numconds) && test_condition(word + len, word) && |
1240 | - (!stripl || (strcmp(word + len - stripl, strip) == 0)) && |
1241 | - ((MAXWORDUTF8LEN + 4) > (len + appndl - stripl))) { |
1242 | - /* we have a match so add suffix */ |
1243 | @@ -18217,56 +18305,114 @@ |
1244 | - return NULL; |
1245 | -} |
1246 | - |
1247 | +-inline char * SfxEntry::nextchar(char * p) { |
1248 | +- if (p) { |
1249 | +- p++; |
1250 | +- if (opts & aeLONGCOND) { |
1251 | +- // jump to the 2nd part of the condition |
1252 | +- if (p == c.l.conds1 + MAXCONDLEN_1) return c.l.conds2; |
1253 | +- // end of the MAXCONDLEN length condition |
1254 | +- } else if (p == c.conds + MAXCONDLEN) return NULL; |
1255 | +- return *p ? p : NULL; |
1256 | +- } |
1257 | +- return NULL; |
1258 | +-} |
1259 | - |
1260 | -inline int SfxEntry::test_condition(const char * st, const char * beg) |
1261 | -{ |
1262 | -- int cond; |
1263 | -- unsigned char * cp = (unsigned char *) st; |
1264 | -- if (!(opts & aeUTF8)) { // 256-character codepage |
1265 | -- // Domolki affix algorithm |
1266 | -- for (cond = numconds; --cond >= 0; ) { |
1267 | -- if ((conds.base[*--cp] & (1 << cond)) == 0) return 0; |
1268 | -- } |
1269 | -- } else { // UTF-8 encoding |
1270 | -- unsigned short wc; |
1271 | -- for (cond = numconds; --cond >= 0; ) { |
1272 | -- // go to next character position and check limit |
1273 | -- if ((char *) --cp < beg) return 0; |
1274 | -- // a simple 7-bit ASCII character in UTF-8 |
1275 | -- if ((*cp >> 7) == 0) { |
1276 | -- if ((conds.utf8.ascii[*cp] & (1 << cond)) == 0) return 0; |
1277 | -- // UTF-8 multibyte character |
1278 | -- } else { |
1279 | -- // go to first character of UTF-8 multibyte character |
1280 | -- for (; (*cp & 0xc0) == 0x80; cp--); |
1281 | -- // not dot wildcard in rule |
1282 | -- if (!conds.utf8.all[cond]) { |
1283 | -- if (conds.utf8.neg[cond]) { |
1284 | -- u8_u16((w_char *) &wc, 1, (char *) cp); |
1285 | -- if (conds.utf8.wchars[cond] && |
1286 | -- flag_bsearch((unsigned short *)conds.utf8.wchars[cond], |
1287 | -- wc, (short) conds.utf8.wlen[cond])) return 0; |
1288 | -- } else { |
1289 | -- if (!conds.utf8.wchars[cond]) return 0; |
1290 | -- u8_u16((w_char *) &wc, 1, (char *) cp); |
1291 | -- if (!flag_bsearch((unsigned short *)conds.utf8.wchars[cond], |
1292 | -- wc, (short)conds.utf8.wlen[cond])) return 0; |
1293 | +- const char * pos = NULL; // group with pos input position |
1294 | +- bool neg = false; // complementer |
1295 | +- bool ingroup = false; // character in the group |
1296 | +- if (numconds == 0) return 1; |
1297 | +- char * p = c.conds; |
1298 | +- st--; |
1299 | +- int i = 1; |
1300 | +- while (1) { |
1301 | +- switch (*p) { |
1302 | +- case '\0': return 1; |
1303 | +- case '[': { p = nextchar(p); pos = st; break; } |
1304 | +- case '^': { p = nextchar(p); neg = true; break; } |
1305 | +- case ']': { if (!neg && !ingroup) return 0; |
1306 | +- i++; |
1307 | +- // skip the next character |
1308 | +- if (!ingroup) { |
1309 | +- for (; (opts & aeUTF8) && (st >= beg) && (*st & 0xc0) == 0x80; st--); |
1310 | +- st--; |
1311 | +- } |
1312 | +- pos = NULL; |
1313 | +- neg = false; |
1314 | +- ingroup = false; |
1315 | +- p = nextchar(p); |
1316 | +- if (st < beg && p) return 0; // word <= condition |
1317 | +- break; |
1318 | +- } |
1319 | +- case '.': if (!pos) { // dots are not metacharacters in groups: [.] |
1320 | +- p = nextchar(p); |
1321 | +- // skip the next character |
1322 | +- for (st--; (opts & aeUTF8) && (st >= beg) && (*st & 0xc0) == 0x80; st--); |
1323 | +- if (st < beg) { // word <= condition |
1324 | +- if (p) return 0; else return 1; |
1325 | +- } |
1326 | +- if ((opts & aeUTF8) && (*st & 0x80)) { // head of the UTF-8 character |
1327 | +- st--; |
1328 | +- if (st < beg) { // word <= condition |
1329 | +- if (p) return 0; else return 1; |
1330 | +- } |
1331 | - } |
1332 | -- } |
1333 | -- } |
1334 | +- break; |
1335 | +- } |
1336 | +- default: { |
1337 | +- if (*st == *p) { |
1338 | +- p = nextchar(p); |
1339 | +- if ((opts & aeUTF8) && (*st & 0x80)) { |
1340 | +- st--; |
1341 | +- while (p && (st >= beg)) { |
1342 | +- if (*p != *st) { |
1343 | +- if (!pos) return 0; |
1344 | +- st = pos; |
1345 | +- break; |
1346 | +- } |
1347 | +- // first byte of the UTF-8 multibyte character |
1348 | +- if ((*p & 0xc0) != 0x80) break; |
1349 | +- p = nextchar(p); |
1350 | +- st--; |
1351 | +- } |
1352 | +- if (pos && st != pos) { |
1353 | +- if (neg) return 0; |
1354 | +- else if (i == numconds) return 1; |
1355 | +- ingroup = true; |
1356 | +- while (p && *p != ']' && (p = nextchar(p))); |
1357 | +- st--; |
1358 | +- } |
1359 | +- if (p && *p != ']') p = nextchar(p); |
1360 | +- } else if (pos) { |
1361 | +- if (neg) return 0; |
1362 | +- else if (i == numconds) return 1; |
1363 | +- ingroup = true; |
1364 | +- while (p && *p != ']' && (p = nextchar(p))); |
1365 | +-// if (p && *p != ']') p = nextchar(p); |
1366 | +- st--; |
1367 | +- } |
1368 | +- if (!pos) { |
1369 | +- i++; |
1370 | +- st--; |
1371 | +- } |
1372 | +- if (st < beg && p && *p != ']') return 0; // word <= condition |
1373 | +- } else if (pos) { // group |
1374 | +- p = nextchar(p); |
1375 | +- } else return 0; |
1376 | +- } |
1377 | - } |
1378 | +- if (!p) return 1; |
1379 | - } |
1380 | -- return 1; |
1381 | -} |
1382 | - |
1383 | -- |
1384 | -- |
1385 | --// see if this suffix is present in the word |
1386 | +-// see if this suffix is present in the word |
1387 | -struct hentry * SfxEntry::checkword(const char * word, int len, int optflags, |
1388 | - AffEntry* ppfx, char ** wlst, int maxSug, int * ns, const FLAG cclass, const FLAG needflag, |
1389 | - const FLAG badflag) |
1390 | -{ |
1391 | -- int tmpl; // length of tmpword |
1392 | +- int tmpl; // length of tmpword |
1393 | - struct hentry * he; // hash entry pointer |
1394 | - unsigned char * cp; |
1395 | - char tmpword[MAXWORDUTF8LEN + 4]; |
1396 | @@ -18286,8 +18432,9 @@ |
1397 | - tmpl = len - appndl; |
1398 | - // the second condition is not enough for UTF-8 strings |
1399 | - // it checked in test_condition() |
1400 | -- |
1401 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
1402 | +- |
1403 | +- if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && |
1404 | +- (tmpl + stripl >= numconds)) { |
1405 | - |
1406 | - // generate new root word by removing suffix and adding |
1407 | - // back any characters that would have been stripped or |
1408 | @@ -18303,7 +18450,8 @@ |
1409 | - |
1410 | - // now make sure all of the conditions on characters |
1411 | - // are met. Please see the appendix at the end of |
1412 | -- // this file for more info on exactly what is being // tested |
1413 | +- // this file for more info on exactly what is being |
1414 | +- // tested |
1415 | - |
1416 | - // if all conditions are met then check if resulting |
1417 | - // root word in the dictionary |
1418 | @@ -18317,21 +18465,21 @@ |
1419 | - do { |
1420 | - // check conditional suffix (enabled by prefix) |
1421 | - if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && |
1422 | -- TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && |
1423 | -- (((optflags & aeXPRODUCT) == 0) || |
1424 | +- TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && |
1425 | +- (((optflags & aeXPRODUCT) == 0) || |
1426 | - TESTAFF(he->astr, ep->getFlag(), he->alen) || |
1427 | - // enabled by prefix |
1428 | - ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) |
1429 | - ) && |
1430 | - // handle cont. class |
1431 | -- ((!cclass) || |
1432 | +- ((!cclass) || |
1433 | - ((contclass) && TESTAFF(contclass, cclass, contclasslen)) |
1434 | - ) && |
1435 | - // check only in compound homonyms (bad flags) |
1436 | - (!badflag || !TESTAFF(he->astr, badflag, he->alen) |
1437 | -- ) && |
1438 | +- ) && |
1439 | - // handle required flag |
1440 | -- ((!needflag) || |
1441 | +- ((!needflag) || |
1442 | - (TESTAFF(he->astr, needflag, he->alen) || |
1443 | - ((contclass) && TESTAFF(contclass, needflag, contclasslen))) |
1444 | - ) |
1445 | @@ -18339,12 +18487,12 @@ |
1446 | - he = he->next_homonym; // check homonyms |
1447 | - } while (he); |
1448 | - |
1449 | -- // obsolote stemming code (used only by the |
1450 | +- // obsolote stemming code (used only by the |
1451 | - // experimental SuffixMgr:suggest_pos_stems) |
1452 | - // store resulting root in wlst |
1453 | - } else if (wlst && (*ns < maxSug)) { |
1454 | - int cwrd = 1; |
1455 | -- for (int k=0; k < *ns; k++) |
1456 | +- for (int k=0; k < *ns; k++) |
1457 | - if (strcmp(tmpword, wlst[k]) == 0) cwrd = 0; |
1458 | - if (cwrd) { |
1459 | - wlst[*ns] = mystrdup(tmpword); |
1460 | @@ -18361,11 +18509,11 @@ |
1461 | - return NULL; |
1462 | -} |
1463 | - |
1464 | --// see if two-level suffix is present in the word |
1465 | +-// see if two-level suffix is present in the word |
1466 | -struct hentry * SfxEntry::check_twosfx(const char * word, int len, int optflags, |
1467 | - AffEntry* ppfx, const FLAG needflag) |
1468 | -{ |
1469 | -- int tmpl; // length of tmpword |
1470 | +- int tmpl; // length of tmpword |
1471 | - struct hentry * he; // hash entry pointer |
1472 | - unsigned char * cp; |
1473 | - char tmpword[MAXWORDUTF8LEN + 4]; |
1474 | @@ -18385,7 +18533,8 @@ |
1475 | - |
1476 | - tmpl = len - appndl; |
1477 | - |
1478 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
1479 | +- if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && |
1480 | +- (tmpl + stripl >= numconds)) { |
1481 | - |
1482 | - // generate new root word by removing suffix and adding |
1483 | - // back any characters that would have been stripped or |
1484 | @@ -18409,7 +18558,7 @@ |
1485 | - if (test_condition((char *) cp, (char *) tmpword)) { |
1486 | - if (ppfx) { |
1487 | - // handle conditional suffix |
1488 | -- if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) |
1489 | +- if ((contclass) && TESTAFF(contclass, ep->getFlag(), contclasslen)) |
1490 | - he = pmyMgr->suffix_check(tmpword, tmpl, 0, NULL, NULL, 0, NULL, (FLAG) aflag, needflag); |
1491 | - else |
1492 | - he = pmyMgr->suffix_check(tmpword, tmpl, optflags, ppfx, NULL, 0, NULL, (FLAG) aflag, needflag); |
1493 | @@ -18422,19 +18571,18 @@ |
1494 | - return NULL; |
1495 | -} |
1496 | - |
1497 | --#ifdef HUNSPELL_EXPERIMENTAL |
1498 | --// see if two-level suffix is present in the word |
1499 | +-// see if two-level suffix is present in the word |
1500 | -char * SfxEntry::check_twosfx_morph(const char * word, int len, int optflags, |
1501 | - AffEntry* ppfx, const FLAG needflag) |
1502 | -{ |
1503 | -- int tmpl; // length of tmpword |
1504 | +- int tmpl; // length of tmpword |
1505 | - unsigned char * cp; |
1506 | - char tmpword[MAXWORDUTF8LEN + 4]; |
1507 | - PfxEntry* ep = (PfxEntry *) ppfx; |
1508 | - char * st; |
1509 | - |
1510 | - char result[MAXLNLEN]; |
1511 | -- |
1512 | +- |
1513 | - *result = '\0'; |
1514 | - |
1515 | - // if this suffix is being cross checked with a prefix |
1516 | @@ -18450,7 +18598,8 @@ |
1517 | - |
1518 | - tmpl = len - appndl; |
1519 | - |
1520 | -- if ((tmpl > 0) && (tmpl + stripl >= numconds)) { |
1521 | +- if ((tmpl > 0 || (tmpl == 0 && pmyMgr->get_fullstrip())) && |
1522 | +- (tmpl + stripl >= numconds)) { |
1523 | - |
1524 | - // generate new root word by removing suffix and adding |
1525 | - // back any characters that would have been stripped or |
1526 | @@ -18478,16 +18627,17 @@ |
1527 | - st = pmyMgr->suffix_check_morph(tmpword, tmpl, 0, NULL, aflag, needflag); |
1528 | - if (st) { |
1529 | - if (((PfxEntry *) ppfx)->getMorph()) { |
1530 | -- strcat(result, ((PfxEntry *) ppfx)->getMorph()); |
1531 | +- mystrcat(result, ((PfxEntry *) ppfx)->getMorph(), MAXLNLEN); |
1532 | +- mystrcat(result, " ", MAXLNLEN); |
1533 | - } |
1534 | -- strcat(result,st); |
1535 | +- mystrcat(result,st, MAXLNLEN); |
1536 | - free(st); |
1537 | - mychomp(result); |
1538 | - } |
1539 | - } else { |
1540 | - st = pmyMgr->suffix_check_morph(tmpword, tmpl, optflags, ppfx, aflag, needflag); |
1541 | - if (st) { |
1542 | -- strcat(result, st); |
1543 | +- mystrcat(result, st, MAXLNLEN); |
1544 | - free(st); |
1545 | - mychomp(result); |
1546 | - } |
1547 | @@ -18495,7 +18645,7 @@ |
1548 | - } else { |
1549 | - st = pmyMgr->suffix_check_morph(tmpword, tmpl, 0, NULL, aflag, needflag); |
1550 | - if (st) { |
1551 | -- strcat(result, st); |
1552 | +- mystrcat(result, st, MAXLNLEN); |
1553 | - free(st); |
1554 | - mychomp(result); |
1555 | - } |
1556 | @@ -18505,10 +18655,9 @@ |
1557 | - } |
1558 | - return NULL; |
1559 | -} |
1560 | --#endif // END OF HUNSPELL_EXPERIMENTAL CODE |
1561 | - |
1562 | -// get next homonym with same affix |
1563 | --struct hentry * SfxEntry::get_next_homonym(struct hentry * he, int optflags, AffEntry* ppfx, |
1564 | +-struct hentry * SfxEntry::get_next_homonym(struct hentry * he, int optflags, AffEntry* ppfx, |
1565 | - const FLAG cclass, const FLAG needflag) |
1566 | -{ |
1567 | - PfxEntry* ep = (PfxEntry *) ppfx; |
1568 | @@ -18516,18 +18665,18 @@ |
1569 | - |
1570 | - while (he->next_homonym) { |
1571 | - he = he->next_homonym; |
1572 | -- if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && |
1573 | -- ((optflags & aeXPRODUCT) == 0 || |
1574 | +- if ((TESTAFF(he->astr, aflag, he->alen) || (ep && ep->getCont() && TESTAFF(ep->getCont(), aflag, ep->getContLen()))) && |
1575 | +- ((optflags & aeXPRODUCT) == 0 || |
1576 | - TESTAFF(he->astr, eFlag, he->alen) || |
1577 | - // handle conditional suffix |
1578 | - ((contclass) && TESTAFF(contclass, eFlag, contclasslen)) |
1579 | - ) && |
1580 | - // handle cont. class |
1581 | -- ((!cclass) || |
1582 | +- ((!cclass) || |
1583 | - ((contclass) && TESTAFF(contclass, cclass, contclasslen)) |
1584 | - ) && |
1585 | - // handle required flag |
1586 | -- ((!needflag) || |
1587 | +- ((!needflag) || |
1588 | - (TESTAFF(he->astr, needflag, he->alen) || |
1589 | - ((contclass) && TESTAFF(contclass, needflag, contclasslen))) |
1590 | - ) |
1591 | @@ -18658,12 +18807,11 @@ |
1592 | - |
1593 | - |
1594 | -#endif |
1595 | -- |
1596 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affentry.hxx |
1597 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affentry.hxx |
1598 | =================================================================== |
1599 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affentry.hxx |
1600 | -+++ /dev/null |
1601 | -@@ -1,187 +0,0 @@ |
1602 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affentry.hxx 2010-06-20 03:48:06.973136693 -0400 |
1603 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1604 | +@@ -1,188 +0,0 @@ |
1605 | -/******* BEGIN LICENSE BLOCK ******* |
1606 | - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
1607 | - * |
1608 | @@ -18723,9 +18871,9 @@ |
1609 | -#ifndef _AFFIX_HXX_ |
1610 | -#define _AFFIX_HXX_ |
1611 | - |
1612 | +-#include "affixmgr.hxx" |
1613 | -#include "atypes.hxx" |
1614 | -#include "baseaffix.hxx" |
1615 | --#include "affixmgr.hxx" |
1616 | - |
1617 | -/* A Prefix Entry */ |
1618 | - |
1619 | @@ -18776,6 +18924,7 @@ |
1620 | - inline void setNextEQ(PfxEntry * ptr) { nexteq = ptr; } |
1621 | - inline void setFlgNxt(PfxEntry * ptr) { flgnxt = ptr; } |
1622 | - |
1623 | +- inline char * nextchar(char * p); |
1624 | - inline int test_condition(const char * st); |
1625 | -}; |
1626 | - |
1627 | @@ -18845,17 +18994,17 @@ |
1628 | - inline void setNextEQ(SfxEntry * ptr) { nexteq = ptr; } |
1629 | - inline void setFlgNxt(SfxEntry * ptr) { flgnxt = ptr; } |
1630 | - |
1631 | +- inline char * nextchar(char * p); |
1632 | - inline int test_condition(const char * st, const char * begin); |
1633 | +- |
1634 | -}; |
1635 | - |
1636 | -#endif |
1637 | -- |
1638 | -- |
1639 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affixmgr.cpp |
1640 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affixmgr.cpp |
1641 | =================================================================== |
1642 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affixmgr.cpp |
1643 | -+++ /dev/null |
1644 | -@@ -1,4155 +0,0 @@ |
1645 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affixmgr.cpp 2010-06-20 03:48:06.903137645 -0400 |
1646 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
1647 | +@@ -1,4373 +0,0 @@ |
1648 | -/******* BEGIN LICENSE BLOCK ******* |
1649 | - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
1650 | - * |
1651 | @@ -18918,28 +19067,29 @@ |
1652 | -#include <cctype> |
1653 | -#include <cstdio> |
1654 | -#else |
1655 | --#include <stdlib.h> |
1656 | +-#include <stdlib.h> |
1657 | -#include <string.h> |
1658 | --#include <stdio.h> |
1659 | +-#include <stdio.h> |
1660 | -#include <ctype.h> |
1661 | -#endif |
1662 | - |
1663 | +-#include "affentry.hxx" |
1664 | -#include "affixmgr.hxx" |
1665 | --#include "affentry.hxx" |
1666 | +-#include "csutil.hxx" |
1667 | -#include "langnum.hxx" |
1668 | - |
1669 | --#include "csutil.hxx" |
1670 | -- |
1671 | -#ifndef MOZILLA_CLIENT |
1672 | -#ifndef W32 |
1673 | -using namespace std; |
1674 | -#endif |
1675 | -#endif |
1676 | - |
1677 | --AffixMgr::AffixMgr(const char * affpath, HashMgr* ptr) |
1678 | +-AffixMgr::AffixMgr(const char * affpath, HashMgr** ptr, int * md, const char * key) |
1679 | -{ |
1680 | - // register hash manager and load affix data from aff file |
1681 | -- pHMgr = ptr; |
1682 | +- pHMgr = ptr[0]; |
1683 | +- alldic = ptr; |
1684 | +- maxdic = md; |
1685 | - keystring = NULL; |
1686 | - trystring = NULL; |
1687 | - encoding=NULL; |
1688 | @@ -18951,7 +19101,11 @@ |
1689 | - numbreak = 0; |
1690 | - reptable = NULL; |
1691 | - numrep = 0; |
1692 | +- iconvtable = NULL; |
1693 | +- oconvtable = NULL; |
1694 | - checkcpdtable = NULL; |
1695 | +- // allow simplified compound forms (see 3rd field of CHECKCOMPOUNDPATTERN) |
1696 | +- simplifiedcpd = 0; |
1697 | - numcheckcpd = 0; |
1698 | - defcpdtable = NULL; |
1699 | - numdefcpd = 0; |
1700 | @@ -18967,11 +19121,12 @@ |
1701 | - checkcompoundrep = 0; // forbid bad compounds (may be non compound word with a REP substitution) |
1702 | - checkcompoundcase = 0; // forbid upper and lowercase combinations at word bounds |
1703 | - checkcompoundtriple = 0; // forbid compounds with triple letters |
1704 | -- forbiddenword = FLAG_NULL; // forbidden word signing flag |
1705 | +- simplifiedtriple = 0; // allow simplified triple letters in compounds (Schiff+fahrt -> Schiffahrt) |
1706 | +- forbiddenword = FORBIDDENWORD; // forbidden word signing flag |
1707 | - nosuggest = FLAG_NULL; // don't suggest words signed with NOSUGGEST flag |
1708 | - lang = NULL; // language |
1709 | - langnum = 0; // language code (see http://l10n.openoffice.org/languages.html) |
1710 | -- pseudoroot = FLAG_NULL; // forbidden root, allowed only with suffixes |
1711 | +- needaffix = FLAG_NULL; // forbidden root, allowed only with suffixes |
1712 | - cpdwordmax = -1; // default: unlimited wordcount in compound words |
1713 | - cpdmin = -1; // undefined |
1714 | - cpdmaxsyllable = 0; // default: unlimited syllablecount in compound words |
1715 | @@ -18995,14 +19150,14 @@ |
1716 | - lemma_present = FLAG_NULL; |
1717 | - circumfix = FLAG_NULL; |
1718 | - onlyincompound = FLAG_NULL; |
1719 | -- flag_mode = FLAG_CHAR; // default one-character flags in affix and dic file |
1720 | - maxngramsugs = -1; // undefined |
1721 | - nosplitsugs = 0; |
1722 | - sugswithdots = 0; |
1723 | - keepcase = 0; |
1724 | - checksharps = 0; |
1725 | +- substandard = FLAG_NULL; |
1726 | +- fullstrip = 0; |
1727 | - |
1728 | -- derived = NULL; // XXX not threadsafe variable for experimental stemming |
1729 | - sfx = NULL; |
1730 | - pfx = NULL; |
1731 | - |
1732 | @@ -19017,7 +19172,7 @@ |
1733 | - contclasses[j] = 0; |
1734 | - } |
1735 | - |
1736 | -- if (parse_file(affpath)) { |
1737 | +- if (parse_file(affpath, key)) { |
1738 | - HUNSPELL_WARNING(stderr, "Failure loading aff file %s\n",affpath); |
1739 | - } |
1740 | - |
1741 | @@ -19090,6 +19245,8 @@ |
1742 | - free(reptable); |
1743 | - reptable = NULL; |
1744 | - } |
1745 | +- if (iconvtable) delete iconvtable; |
1746 | +- if (oconvtable) delete oconvtable; |
1747 | - if (phone && phone->rules) { |
1748 | - for (int j=0; j < phone->num + 1; j++) { |
1749 | - free(phone->rules[j * 2]); |
1750 | @@ -19113,8 +19270,10 @@ |
1751 | - for (int j=0; j < numcheckcpd; j++) { |
1752 | - free(checkcpdtable[j].pattern); |
1753 | - free(checkcpdtable[j].pattern2); |
1754 | +- free(checkcpdtable[j].pattern3); |
1755 | - checkcpdtable[j].pattern = NULL; |
1756 | - checkcpdtable[j].pattern2 = NULL; |
1757 | +- checkcpdtable[j].pattern3 = NULL; |
1758 | - } |
1759 | - free(checkcpdtable); |
1760 | - checkcpdtable = NULL; |
1761 | @@ -19129,7 +19288,7 @@ |
1762 | - FREE_FLAG(compoundroot); |
1763 | - FREE_FLAG(forbiddenword); |
1764 | - FREE_FLAG(nosuggest); |
1765 | -- FREE_FLAG(pseudoroot); |
1766 | +- FREE_FLAG(needaffix); |
1767 | - FREE_FLAG(lemma_present); |
1768 | - FREE_FLAG(circumfix); |
1769 | - FREE_FLAG(onlyincompound); |
1770 | @@ -19148,20 +19307,15 @@ |
1771 | - if (ignorechars) free(ignorechars); |
1772 | - if (ignorechars_utf16) free(ignorechars_utf16); |
1773 | - if (version) free(version); |
1774 | -- if (derived) free(derived); |
1775 | - checknum=0; |
1776 | -} |
1777 | - |
1778 | - |
1779 | -// read in aff file and build up prefix and suffix entry objects |
1780 | --int AffixMgr::parse_file(const char * affpath) |
1781 | +-int AffixMgr::parse_file(const char * affpath, const char * key) |
1782 | -{ |
1783 | -- |
1784 | -- // io buffers |
1785 | -- char line[MAXLNLEN+1]; |
1786 | -- |
1787 | -- // affix type |
1788 | -- char ft; |
1789 | +- char * line; // io buffers |
1790 | +- char ft; // affix type |
1791 | - |
1792 | - // checking flag duplication |
1793 | - char dupflags[CONTSIZE]; |
1794 | @@ -19171,8 +19325,7 @@ |
1795 | - int firstline = 1; |
1796 | - |
1797 | - // open the affix file |
1798 | -- FILE * afflst; |
1799 | -- afflst = fopen(affpath,"r"); |
1800 | +- FileMgr * afflst = new FileMgr(affpath, key); |
1801 | - if (!afflst) { |
1802 | - HUNSPELL_WARNING(stderr, "error: could not open affix description file %s\n",affpath); |
1803 | - return 1; |
1804 | @@ -19181,10 +19334,9 @@ |
1805 | - // step one is to parse the affix file building up the internal |
1806 | - // affix data structures |
1807 | - |
1808 | -- |
1809 | - // read in each line ignoring any that do not |
1810 | - // start with a known line type indicator |
1811 | -- while (fgets(line,MAXLNLEN,afflst)) { |
1812 | +- while ((line = afflst->getline())) { |
1813 | - mychomp(line); |
1814 | - |
1815 | - /* remove byte order mark */ |
1816 | @@ -19198,24 +19350,24 @@ |
1817 | - |
1818 | - /* parse in the keyboard string */ |
1819 | - if (strncmp(line,"KEY",3) == 0) { |
1820 | -- if (parse_string(line, &keystring, "KEY")) { |
1821 | -- fclose(afflst); |
1822 | +- if (parse_string(line, &keystring, afflst->getlinenum())) { |
1823 | +- delete afflst; |
1824 | - return 1; |
1825 | - } |
1826 | - } |
1827 | - |
1828 | - /* parse in the try string */ |
1829 | - if (strncmp(line,"TRY",3) == 0) { |
1830 | -- if (parse_string(line, &trystring, "TRY")) { |
1831 | -- fclose(afflst); |
1832 | +- if (parse_string(line, &trystring, afflst->getlinenum())) { |
1833 | +- delete afflst; |
1834 | - return 1; |
1835 | - } |
1836 | - } |
1837 | - |
1838 | - /* parse in the name of the character set used by the .dict and .aff */ |
1839 | - if (strncmp(line,"SET",3) == 0) { |
1840 | -- if (parse_string(line, &encoding, "SET")) { |
1841 | -- fclose(afflst); |
1842 | +- if (parse_string(line, &encoding, afflst->getlinenum())) { |
1843 | +- delete afflst; |
1844 | - return 1; |
1845 | - } |
1846 | - if (strcmp(encoding, "UTF-8") == 0) { |
1847 | @@ -19234,8 +19386,8 @@ |
1848 | - |
1849 | - /* parse in the flag used by the controlled compound words */ |
1850 | - if (strncmp(line,"COMPOUNDFLAG",12) == 0) { |
1851 | -- if (parse_flag(line, &compoundflag, "COMPOUNDFLAG")) { |
1852 | -- fclose(afflst); |
1853 | +- if (parse_flag(line, &compoundflag, afflst)) { |
1854 | +- delete afflst; |
1855 | - return 1; |
1856 | - } |
1857 | - } |
1858 | @@ -19243,13 +19395,13 @@ |
1859 | - /* parse in the flag used by compound words */ |
1860 | - if (strncmp(line,"COMPOUNDBEGIN",13) == 0) { |
1861 | - if (complexprefixes) { |
1862 | -- if (parse_flag(line, &compoundend, "COMPOUNDBEGIN")) { |
1863 | -- fclose(afflst); |
1864 | +- if (parse_flag(line, &compoundend, afflst)) { |
1865 | +- delete afflst; |
1866 | - return 1; |
1867 | - } |
1868 | - } else { |
1869 | -- if (parse_flag(line, &compoundbegin, "COMPOUNDBEGIN")) { |
1870 | -- fclose(afflst); |
1871 | +- if (parse_flag(line, &compoundbegin, afflst)) { |
1872 | +- delete afflst; |
1873 | - return 1; |
1874 | - } |
1875 | - } |
1876 | @@ -19257,21 +19409,21 @@ |
1877 | - |
1878 | - /* parse in the flag used by compound words */ |
1879 | - if (strncmp(line,"COMPOUNDMIDDLE",14) == 0) { |
1880 | -- if (parse_flag(line, &compoundmiddle, "COMPOUNDMIDDLE")) { |
1881 | -- fclose(afflst); |
1882 | +- if (parse_flag(line, &compoundmiddle, afflst)) { |
1883 | +- delete afflst; |
1884 | - return 1; |
1885 | - } |
1886 | - } |
1887 | - /* parse in the flag used by compound words */ |
1888 | - if (strncmp(line,"COMPOUNDEND",11) == 0) { |
1889 | - if (complexprefixes) { |
1890 | -- if (parse_flag(line, &compoundbegin, "COMPOUNDEND")) { |
1891 | -- fclose(afflst); |
1892 | +- if (parse_flag(line, &compoundbegin, afflst)) { |
1893 | +- delete afflst; |
1894 | - return 1; |
1895 | - } |
1896 | - } else { |
1897 | -- if (parse_flag(line, &compoundend, "COMPOUNDEND")) { |
1898 | -- fclose(afflst); |
1899 | +- if (parse_flag(line, &compoundend, afflst)) { |
1900 | +- delete afflst; |
1901 | - return 1; |
1902 | - } |
1903 | - } |
1904 | @@ -19279,32 +19431,32 @@ |
1905 | - |
1906 | - /* parse in the data used by compound_check() method */ |
1907 | - if (strncmp(line,"COMPOUNDWORDMAX",15) == 0) { |
1908 | -- if (parse_num(line, &cpdwordmax, "COMPOUNDWORDMAX")) { |
1909 | -- fclose(afflst); |
1910 | +- if (parse_num(line, &cpdwordmax, afflst)) { |
1911 | +- delete afflst; |
1912 | - return 1; |
1913 | - } |
1914 | - } |
1915 | - |
1916 | - /* parse in the flag sign compounds in dictionary */ |
1917 | - if (strncmp(line,"COMPOUNDROOT",12) == 0) { |
1918 | -- if (parse_flag(line, &compoundroot, "COMPOUNDROOT")) { |
1919 | -- fclose(afflst); |
1920 | +- if (parse_flag(line, &compoundroot, afflst)) { |
1921 | +- delete afflst; |
1922 | - return 1; |
1923 | - } |
1924 | - } |
1925 | - |
1926 | - /* parse in the flag used by compound_check() method */ |
1927 | - if (strncmp(line,"COMPOUNDPERMITFLAG",18) == 0) { |
1928 | -- if (parse_flag(line, &compoundpermitflag, "COMPOUNDPERMITFLAG")) { |
1929 | -- fclose(afflst); |
1930 | +- if (parse_flag(line, &compoundpermitflag, afflst)) { |
1931 | +- delete afflst; |
1932 | - return 1; |
1933 | - } |
1934 | - } |
1935 | - |
1936 | - /* parse in the flag used by compound_check() method */ |
1937 | - if (strncmp(line,"COMPOUNDFORBIDFLAG",18) == 0) { |
1938 | -- if (parse_flag(line, &compoundforbidflag, "COMPOUNDFORBIDFLAG")) { |
1939 | -- fclose(afflst); |
1940 | +- if (parse_flag(line, &compoundforbidflag, afflst)) { |
1941 | +- delete afflst; |
1942 | - return 1; |
1943 | - } |
1944 | - } |
1945 | @@ -19321,69 +19473,73 @@ |
1946 | - checkcompoundtriple = 1; |
1947 | - } |
1948 | - |
1949 | +- if (strncmp(line,"SIMPLIFIEDTRIPLE",16) == 0) { |
1950 | +- simplifiedtriple = 1; |
1951 | +- } |
1952 | +- |
1953 | - if (strncmp(line,"CHECKCOMPOUNDCASE",17) == 0) { |
1954 | - checkcompoundcase = 1; |
1955 | - } |
1956 | - |
1957 | - if (strncmp(line,"NOSUGGEST",9) == 0) { |
1958 | -- if (parse_flag(line, &nosuggest, "NOSUGGEST")) { |
1959 | -- fclose(afflst); |
1960 | +- if (parse_flag(line, &nosuggest, afflst)) { |
1961 | +- delete afflst; |
1962 | - return 1; |
1963 | - } |
1964 | - } |
1965 | - |
1966 | - /* parse in the flag used by forbidden words */ |
1967 | - if (strncmp(line,"FORBIDDENWORD",13) == 0) { |
1968 | -- if (parse_flag(line, &forbiddenword, "FORBIDDENWORD")) { |
1969 | -- fclose(afflst); |
1970 | +- if (parse_flag(line, &forbiddenword, afflst)) { |
1971 | +- delete afflst; |
1972 | - return 1; |
1973 | - } |
1974 | - } |
1975 | - |
1976 | - /* parse in the flag used by forbidden words */ |
1977 | - if (strncmp(line,"LEMMA_PRESENT",13) == 0) { |
1978 | -- if (parse_flag(line, &lemma_present, "LEMMA_PRESENT")) { |
1979 | -- fclose(afflst); |
1980 | +- if (parse_flag(line, &lemma_present, afflst)) { |
1981 | +- delete afflst; |
1982 | - return 1; |
1983 | - } |
1984 | - } |
1985 | - |
1986 | - /* parse in the flag used by circumfixes */ |
1987 | - if (strncmp(line,"CIRCUMFIX",9) == 0) { |
1988 | -- if (parse_flag(line, &circumfix, "CIRCUMFIX")) { |
1989 | -- fclose(afflst); |
1990 | +- if (parse_flag(line, &circumfix, afflst)) { |
1991 | +- delete afflst; |
1992 | - return 1; |
1993 | - } |
1994 | - } |
1995 | - |
1996 | - /* parse in the flag used by fogemorphemes */ |
1997 | - if (strncmp(line,"ONLYINCOMPOUND",14) == 0) { |
1998 | -- if (parse_flag(line, &onlyincompound, "ONLYINCOMPOUND")) { |
1999 | -- fclose(afflst); |
2000 | +- if (parse_flag(line, &onlyincompound, afflst)) { |
2001 | +- delete afflst; |
2002 | - return 1; |
2003 | - } |
2004 | - } |
2005 | - |
2006 | -- /* parse in the flag used by `pseudoroots' */ |
2007 | +- /* parse in the flag used by `needaffixs' */ |
2008 | - if (strncmp(line,"PSEUDOROOT",10) == 0) { |
2009 | -- if (parse_flag(line, &pseudoroot, "PSEUDOROOT")) { |
2010 | -- fclose(afflst); |
2011 | +- if (parse_flag(line, &needaffix, afflst)) { |
2012 | +- delete afflst; |
2013 | - return 1; |
2014 | - } |
2015 | - } |
2016 | - |
2017 | -- /* parse in the flag used by `pseudoroots' */ |
2018 | +- /* parse in the flag used by `needaffixs' */ |
2019 | - if (strncmp(line,"NEEDAFFIX",9) == 0) { |
2020 | -- if (parse_flag(line, &pseudoroot, "NEEDAFFIX")) { |
2021 | -- fclose(afflst); |
2022 | +- if (parse_flag(line, &needaffix, afflst)) { |
2023 | +- delete afflst; |
2024 | - return 1; |
2025 | - } |
2026 | - } |
2027 | - |
2028 | - /* parse in the minimal length for words in compounds */ |
2029 | - if (strncmp(line,"COMPOUNDMIN",11) == 0) { |
2030 | -- if (parse_num(line, &cpdmin, "COMPOUNDMIN")) { |
2031 | -- fclose(afflst); |
2032 | +- if (parse_num(line, &cpdmin, afflst)) { |
2033 | +- delete afflst; |
2034 | - return 1; |
2035 | - } |
2036 | - if (cpdmin < 1) cpdmin = 1; |
2037 | @@ -19391,16 +19547,16 @@ |
2038 | - |
2039 | - /* parse in the max. words and syllables in compounds */ |
2040 | - if (strncmp(line,"COMPOUNDSYLLABLE",16) == 0) { |
2041 | -- if (parse_cpdsyllable(line)) { |
2042 | -- fclose(afflst); |
2043 | +- if (parse_cpdsyllable(line, afflst)) { |
2044 | +- delete afflst; |
2045 | - return 1; |
2046 | - } |
2047 | - } |
2048 | - |
2049 | - /* parse in the flag used by compound_check() method */ |
2050 | - if (strncmp(line,"SYLLABLENUM",11) == 0) { |
2051 | -- if (parse_string(line, &cpdsyllablenum, "SYLLABLENUM")) { |
2052 | -- fclose(afflst); |
2053 | +- if (parse_string(line, &cpdsyllablenum, afflst->getlinenum())) { |
2054 | +- delete afflst; |
2055 | - return 1; |
2056 | - } |
2057 | - } |
2058 | @@ -19412,16 +19568,16 @@ |
2059 | - |
2060 | - /* parse in the extra word characters */ |
2061 | - if (strncmp(line,"WORDCHARS",9) == 0) { |
2062 | -- if (parse_array(line, &wordchars, &wordchars_utf16, &wordchars_utf16_len, "WORDCHARS", utf8)) { |
2063 | -- fclose(afflst); |
2064 | +- if (parse_array(line, &wordchars, &wordchars_utf16, &wordchars_utf16_len, utf8, afflst->getlinenum())) { |
2065 | +- delete afflst; |
2066 | - return 1; |
2067 | - } |
2068 | - } |
2069 | - |
2070 | - /* parse in the ignored characters (for example, Arabic optional diacretics charachters */ |
2071 | - if (strncmp(line,"IGNORE",6) == 0) { |
2072 | -- if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, "IGNORE", utf8)) { |
2073 | -- fclose(afflst); |
2074 | +- if (parse_array(line, &ignorechars, &ignorechars_utf16, &ignorechars_utf16_len, utf8, afflst->getlinenum())) { |
2075 | +- delete afflst; |
2076 | - return 1; |
2077 | - } |
2078 | - } |
2079 | @@ -19429,7 +19585,23 @@ |
2080 | - /* parse in the typical fault correcting table */ |
2081 | - if (strncmp(line,"REP",3) == 0) { |
2082 | - if (parse_reptable(line, afflst)) { |
2083 | -- fclose(afflst); |
2084 | +- delete afflst; |
2085 | +- return 1; |
2086 | +- } |
2087 | +- } |
2088 | +- |
2089 | +- /* parse in the input conversion table */ |
2090 | +- if (strncmp(line,"ICONV",5) == 0) { |
2091 | +- if (parse_convtable(line, afflst, &iconvtable, "ICONV")) { |
2092 | +- delete afflst; |
2093 | +- return 1; |
2094 | +- } |
2095 | +- } |
2096 | +- |
2097 | +- /* parse in the input conversion table */ |
2098 | +- if (strncmp(line,"OCONV",5) == 0) { |
2099 | +- if (parse_convtable(line, afflst, &oconvtable, "OCONV")) { |
2100 | +- delete afflst; |
2101 | - return 1; |
2102 | - } |
2103 | - } |
2104 | @@ -19437,7 +19609,7 @@ |
2105 | - /* parse in the phonetic translation table */ |
2106 | - if (strncmp(line,"PHONE",5) == 0) { |
2107 | - if (parse_phonetable(line, afflst)) { |
2108 | -- fclose(afflst); |
2109 | +- delete afflst; |
2110 | - return 1; |
2111 | - } |
2112 | - } |
2113 | @@ -19445,7 +19617,7 @@ |
2114 | - /* parse in the checkcompoundpattern table */ |
2115 | - if (strncmp(line,"CHECKCOMPOUNDPATTERN",20) == 0) { |
2116 | - if (parse_checkcpdtable(line, afflst)) { |
2117 | -- fclose(afflst); |
2118 | +- delete afflst; |
2119 | - return 1; |
2120 | - } |
2121 | - } |
2122 | @@ -19453,7 +19625,7 @@ |
2123 | - /* parse in the defcompound table */ |
2124 | - if (strncmp(line,"COMPOUNDRULE",12) == 0) { |
2125 | - if (parse_defcpdtable(line, afflst)) { |
2126 | -- fclose(afflst); |
2127 | +- delete afflst; |
2128 | - return 1; |
2129 | - } |
2130 | - } |
2131 | @@ -19461,7 +19633,7 @@ |
2132 | - /* parse in the related character map table */ |
2133 | - if (strncmp(line,"MAP",3) == 0) { |
2134 | - if (parse_maptable(line, afflst)) { |
2135 | -- fclose(afflst); |
2136 | +- delete afflst; |
2137 | - return 1; |
2138 | - } |
2139 | - } |
2140 | @@ -19469,30 +19641,28 @@ |
2141 | - /* parse in the word breakpoints table */ |
2142 | - if (strncmp(line,"BREAK",5) == 0) { |
2143 | - if (parse_breaktable(line, afflst)) { |
2144 | -- fclose(afflst); |
2145 | +- delete afflst; |
2146 | - return 1; |
2147 | - } |
2148 | - } |
2149 | - |
2150 | - /* parse in the language for language specific codes */ |
2151 | - if (strncmp(line,"LANG",4) == 0) { |
2152 | -- if (parse_string(line, &lang, "LANG")) { |
2153 | -- fclose(afflst); |
2154 | +- if (parse_string(line, &lang, afflst->getlinenum())) { |
2155 | +- delete afflst; |
2156 | - return 1; |
2157 | - } |
2158 | - langnum = get_lang_num(lang); |
2159 | - } |
2160 | - |
2161 | - if (strncmp(line,"VERSION",7) == 0) { |
2162 | -- if (parse_string(line, &version, "VERSION")) { |
2163 | -- fclose(afflst); |
2164 | -- return 1; |
2165 | -- } |
2166 | +- for(line = line + 7; *line == ' ' || *line == '\t'; line++); |
2167 | +- version = mystrdup(line); |
2168 | - } |
2169 | - |
2170 | - if (strncmp(line,"MAXNGRAMSUGS",12) == 0) { |
2171 | -- if (parse_num(line, &maxngramsugs, "MAXNGRAMSUGS")) { |
2172 | -- fclose(afflst); |
2173 | +- if (parse_num(line, &maxngramsugs, afflst)) { |
2174 | +- delete afflst; |
2175 | - return 1; |
2176 | - } |
2177 | - } |
2178 | @@ -19501,14 +19671,26 @@ |
2179 | - nosplitsugs=1; |
2180 | - } |
2181 | - |
2182 | +- if (strncmp(line,"FULLSTRIP",9) == 0) { |
2183 | +- fullstrip=1; |
2184 | +- } |
2185 | +- |
2186 | - if (strncmp(line,"SUGSWITHDOTS",12) == 0) { |
2187 | - sugswithdots=1; |
2188 | - } |
2189 | - |
2190 | - /* parse in the flag used by forbidden words */ |
2191 | - if (strncmp(line,"KEEPCASE",8) == 0) { |
2192 | -- if (parse_flag(line, &keepcase, "KEEPCASE")) { |
2193 | -- fclose(afflst); |
2194 | +- if (parse_flag(line, &keepcase, afflst)) { |
2195 | +- delete afflst; |
2196 | +- return 1; |
2197 | +- } |
2198 | +- } |
2199 | +- |
2200 | +- /* parse in the flag used by the affix generator */ |
2201 | +- if (strncmp(line,"SUBSTANDARD",11) == 0) { |
2202 | +- if (parse_flag(line, &substandard, afflst)) { |
2203 | +- delete afflst; |
2204 | - return 1; |
2205 | - } |
2206 | - } |
2207 | @@ -19527,7 +19709,7 @@ |
2208 | - dupflags_ini = 0; |
2209 | - } |
2210 | - if (parse_affix(line, ft, afflst, dupflags)) { |
2211 | -- fclose(afflst); |
2212 | +- delete afflst; |
2213 | - process_pfx_tree_to_list(); |
2214 | - process_sfx_tree_to_list(); |
2215 | - return 1; |
2216 | @@ -19535,7 +19717,7 @@ |
2217 | - } |
2218 | - |
2219 | - } |
2220 | -- fclose(afflst); |
2221 | +- delete afflst; |
2222 | - |
2223 | - // convert affix trees to sorted list |
2224 | - process_pfx_tree_to_list(); |
2225 | @@ -19568,17 +19750,37 @@ |
2226 | - process_sfx_order(); |
2227 | - |
2228 | - /* get encoding for CHECKCOMPOUNDCASE */ |
2229 | +- if (!utf8) { |
2230 | - char * enc = get_encoding(); |
2231 | - csconv = get_current_cs(enc); |
2232 | - free(enc); |
2233 | - enc = NULL; |
2234 | - |
2235 | -- // temporary BREAK definition for German dash handling (OOo issue 64400) |
2236 | -- if ((langnum == LANG_de) && (!breaktable)) { |
2237 | -- breaktable = (char **) malloc(sizeof(char *)); |
2238 | +- char expw[MAXLNLEN]; |
2239 | +- if (wordchars) { |
2240 | +- strcpy(expw, wordchars); |
2241 | +- free(wordchars); |
2242 | +- } else *expw = '\0'; |
2243 | +- |
2244 | +- for (int i = 0; i <= 255; i++) { |
2245 | +- if ( (csconv[i].cupper != csconv[i].clower) && |
2246 | +- (! strchr(expw, (char) i))) { |
2247 | +- *(expw + strlen(expw) + 1) = '\0'; |
2248 | +- *(expw + strlen(expw)) = (char) i; |
2249 | +- } |
2250 | +- } |
2251 | +- |
2252 | +- wordchars = mystrdup(expw); |
2253 | +- } |
2254 | +- |
2255 | +- // default BREAK definition |
2256 | +- if (!breaktable) { |
2257 | +- breaktable = (char **) malloc(sizeof(char *) * 3); |
2258 | - if (!breaktable) return 1; |
2259 | - breaktable[0] = mystrdup("-"); |
2260 | -- numbreak = 1; |
2261 | +- breaktable[1] = mystrdup("^-"); |
2262 | +- breaktable[2] = mystrdup("-$"); |
2263 | +- if (breaktable[0] && breaktable[1] && breaktable[2]) numbreak = 3; |
2264 | - } |
2265 | - return 0; |
2266 | -} |
2267 | @@ -19852,191 +20054,52 @@ |
2268 | - return 0; |
2269 | -} |
2270 | - |
2271 | -- |
2272 | -- |
2273 | --// takes aff file condition string and creates the |
2274 | --// conds array - please see the appendix at the end of the |
2275 | --// file affentry.cpp which describes what is going on here |
2276 | --// in much more detail |
2277 | +-// add flags to the result for dictionary debugging |
2278 | +-void AffixMgr::debugflag(char * result, unsigned short flag) { |
2279 | +- char * st = encode_flag(flag); |
2280 | +- mystrcat(result, " ", MAXLNLEN); |
2281 | +- mystrcat(result, MORPH_FLAG, MAXLNLEN); |
2282 | +- if (st) { |
2283 | +- mystrcat(result, st, MAXLNLEN); |
2284 | +- free(st); |
2285 | +- } |
2286 | +-} |
2287 | +- |
2288 | +-// calculate the character length of the condition |
2289 | +-int AffixMgr::condlen(char * st) |
2290 | +-{ |
2291 | +- int l = 0; |
2292 | +- bool group = false; |
2293 | +- for(; *st; st++) { |
2294 | +- if (*st == '[') { |
2295 | +- group = true; |
2296 | +- l++; |
2297 | +- } else if (*st == ']') group = false; |
2298 | +- else if (!group && (!utf8 || |
2299 | +- (!(*st & 0x80) || ((*st & 0xc0) == 0x80)))) l++; |
2300 | +- } |
2301 | +- return l; |
2302 | +-} |
2303 | - |
2304 | -int AffixMgr::encodeit(struct affentry * ptr, char * cs) |
2305 | -{ |
2306 | -- unsigned char c; |
2307 | -- int i, j, k; |
2308 | -- unsigned char mbr[MAXLNLEN]; |
2309 | -- w_char wmbr[MAXLNLEN]; |
2310 | -- w_char * wpos = wmbr; |
2311 | -- |
2312 | -- // now clear the conditions array */ |
2313 | -- for (i=0;i<SETSIZE;i++) ptr->conds.base[i] = (unsigned char) 0; |
2314 | -- |
2315 | -- // now parse the string to create the conds array */ |
2316 | -- int nc = strlen(cs); |
2317 | -- unsigned char neg = 0; // complement indicator |
2318 | -- int grp = 0; // group indicator |
2319 | -- unsigned char n = 0; // number of conditions |
2320 | -- int ec = 0; // end condition indicator |
2321 | -- int nm = 0; // number of member in group |
2322 | -- |
2323 | -- // if no condition just return |
2324 | -- if (strcmp(cs,".")==0) { |
2325 | +- if (strcmp(cs,".") != 0) { |
2326 | +- ptr->numconds = (char) condlen(cs); |
2327 | +- strncpy(ptr->c.conds, cs, MAXCONDLEN); |
2328 | +- // long condition (end of conds padded by strncpy) |
2329 | +- if (ptr->c.conds[MAXCONDLEN - 1] && cs[MAXCONDLEN]) { |
2330 | +- ptr->opts += aeLONGCOND; |
2331 | +- ptr->c.l.conds2 = mystrdup(cs + MAXCONDLEN_1); |
2332 | +- if (!ptr->c.l.conds2) return 1; |
2333 | +- } |
2334 | +- } else { |
2335 | - ptr->numconds = 0; |
2336 | -- return 0; |
2337 | -- } |
2338 | -- |
2339 | -- i = 0; |
2340 | -- while (i < nc) { |
2341 | -- c = *((unsigned char *)(cs + i)); |
2342 | -- |
2343 | -- // start group indicator |
2344 | -- if (c == '[') { |
2345 | -- grp = 1; |
2346 | -- c = 0; |
2347 | -- } |
2348 | -- |
2349 | -- // complement flag |
2350 | -- if ((grp == 1) && (c == '^')) { |
2351 | -- neg = 1; |
2352 | -- c = 0; |
2353 | -- } |
2354 | -- |
2355 | -- // end goup indicator |
2356 | -- if (c == ']') { |
2357 | -- ec = 1; |
2358 | -- c = 0; |
2359 | -- } |
2360 | -- |
2361 | -- // add character of group to list |
2362 | -- if ((grp == 1) && (c != 0)) { |
2363 | -- *(mbr + nm) = c; |
2364 | -- nm++; |
2365 | -- c = 0; |
2366 | -- } |
2367 | -- |
2368 | -- // end of condition |
2369 | -- if (c != 0) { |
2370 | -- ec = 1; |
2371 | -- } |
2372 | -- |
2373 | -- if (ec) { |
2374 | -- if (!utf8) { |
2375 | -- if (grp == 1) { |
2376 | -- if (neg == 0) { |
2377 | -- // set the proper bits in the condition array vals for those chars |
2378 | -- for (j=0;j<nm;j++) { |
2379 | -- k = (unsigned int) mbr[j]; |
2380 | -- ptr->conds.base[k] = ptr->conds.base[k] | ((unsigned char)1 << n); |
2381 | -- } |
2382 | -- } else { |
2383 | -- // complement so set all of them and then unset indicated ones |
2384 | -- for (j=0;j<SETSIZE;j++) ptr->conds.base[j] = ptr->conds.base[j] | ((unsigned char)1 << n); |
2385 | -- for (j=0;j<nm;j++) { |
2386 | -- k = (unsigned int) mbr[j]; |
2387 | -- ptr->conds.base[k] = ptr->conds.base[k] & ~((unsigned char)1 << n); |
2388 | -- } |
2389 | -- } |
2390 | -- neg = 0; |
2391 | -- grp = 0; |
2392 | -- nm = 0; |
2393 | -- } else { |
2394 | -- // not a group so just set the proper bit for this char |
2395 | -- // but first handle special case of . inside condition |
2396 | -- if (c == '.') { |
2397 | -- // wild card character so set them all |
2398 | -- for (j=0;j<SETSIZE;j++) ptr->conds.base[j] = ptr->conds.base[j] | ((unsigned char)1 << n); |
2399 | -- } else { |
2400 | -- ptr->conds.base[(unsigned int) c] = ptr->conds.base[(unsigned int)c] | ((unsigned char)1 << n); |
2401 | -- } |
2402 | -- } |
2403 | -- n++; |
2404 | -- ec = 0; |
2405 | -- } else { // UTF-8 character set |
2406 | -- if (grp == 1) { |
2407 | -- ptr->conds.utf8.neg[n] = neg; |
2408 | -- if (neg == 0) { |
2409 | -- // set the proper bits in the condition array vals for those chars |
2410 | -- for (j=0;j<nm;j++) { |
2411 | -- k = (unsigned int) mbr[j]; |
2412 | -- if (k >> 7) { |
2413 | -- u8_u16(wpos, 1, (char *) mbr + j); |
2414 | -- wpos++; |
2415 | -- if ((k & 0xe0) == 0xe0) j+=2; else j++; // 3-byte UTF-8 character |
2416 | -- } else { |
2417 | -- ptr->conds.utf8.ascii[k] = ptr->conds.utf8.ascii[k] | ((unsigned char)1 << n); |
2418 | -- } |
2419 | -- } |
2420 | -- } else { // neg == 1 |
2421 | -- // complement so set all of them and then unset indicated ones |
2422 | -- for (j=0;j<(SETSIZE/2);j++) ptr->conds.utf8.ascii[j] = ptr->conds.utf8.ascii[j] | ((unsigned char)1 << n); |
2423 | -- for (j=0;j<nm;j++) { |
2424 | -- k = (unsigned int) mbr[j]; |
2425 | -- if (k >> 7) { |
2426 | -- u8_u16(wpos, 1, (char *) mbr + j); |
2427 | -- wpos++; |
2428 | -- if ((k & 0xe0) == 0xe0) j+=2; else j++; // 3-byte UTF-8 character |
2429 | -- } else { |
2430 | -- ptr->conds.utf8.ascii[k] = ptr->conds.utf8.ascii[k] & ~((unsigned char)1 << n); |
2431 | -- } |
2432 | -- } |
2433 | -- } |
2434 | -- neg = 0; |
2435 | -- grp = 0; |
2436 | -- nm = 0; |
2437 | -- ptr->conds.utf8.wlen[n] = wpos - wmbr; |
2438 | -- if ((wpos - wmbr) != 0) { |
2439 | -- ptr->conds.utf8.wchars[n] = (w_char *) malloc(sizeof(w_char) * (wpos - wmbr)); |
2440 | -- if (!ptr->conds.utf8.wchars[n]) return 1; |
2441 | -- memcpy(ptr->conds.utf8.wchars[n], wmbr, sizeof(w_char) * (wpos - wmbr)); |
2442 | -- flag_qsort((unsigned short *) ptr->conds.utf8.wchars[n], 0, ptr->conds.utf8.wlen[n]); |
2443 | -- wpos = wmbr; |
2444 | -- } |
2445 | -- } else { // grp == 0 |
2446 | -- // is UTF-8 character? |
2447 | -- if (c >> 7) { |
2448 | -- ptr->conds.utf8.wchars[n] = (w_char *) malloc(sizeof(w_char)); |
2449 | -- if (!ptr->conds.utf8.wchars[n]) return 1; |
2450 | -- ptr->conds.utf8.wlen[n] = 1; |
2451 | -- u8_u16(ptr->conds.utf8.wchars[n], 1, cs + i); |
2452 | -- if ((c & 0xe0) == 0xe0) i+=2; else i++; // 3-byte UFT-8 character |
2453 | -- } else { |
2454 | -- ptr->conds.utf8.wchars[n] = NULL; |
2455 | -- // not a group so just set the proper bit for this char |
2456 | -- // but first handle special case of . inside condition |
2457 | -- if (c == '.') { |
2458 | -- ptr->conds.utf8.all[n] = 1; |
2459 | -- // wild card character so set them all |
2460 | -- for (j=0;j<(SETSIZE/2);j++) ptr->conds.utf8.ascii[j] = ptr->conds.utf8.ascii[j] | ((unsigned char)1 << n); |
2461 | -- } else { |
2462 | -- ptr->conds.utf8.all[n] = 0; |
2463 | -- ptr->conds.utf8.ascii[(unsigned int) c] = ptr->conds.utf8.ascii[(unsigned int)c] | ((unsigned char)1 << n); |
2464 | -- } |
2465 | -- } |
2466 | -- neg = 0; |
2467 | -- } |
2468 | -- n++; |
2469 | -- ec = 0; |
2470 | -- neg = 0; |
2471 | -- } |
2472 | -- } |
2473 | -- |
2474 | -- i++; |
2475 | -- } |
2476 | -- ptr->numconds = n; |
2477 | +- ptr->c.conds[0] = '\0'; |
2478 | +- } |
2479 | - return 0; |
2480 | -} |
2481 | - |
2482 | -- // return 1 if s1 is a leading subset of s2 |
2483 | --/* inline int AffixMgr::isSubset(const char * s1, const char * s2) |
2484 | -- { |
2485 | -- while ((*s1 == *s2) && *s1) { |
2486 | -- s1++; |
2487 | -- s2++; |
2488 | -- } |
2489 | -- return (*s1 == '\0'); |
2490 | -- } |
2491 | --*/ |
2492 | -- |
2493 | -- // return 1 if s1 is a leading subset of s2 (dots are for infixes) |
2494 | +-// return 1 if s1 is a leading subset of s2 (dots are for infixes) |
2495 | -inline int AffixMgr::isSubset(const char * s1, const char * s2) |
2496 | - { |
2497 | - while (((*s1 == *s2) || (*s1 == '.')) && (*s1 != '\0')) { |
2498 | @@ -20146,7 +20209,6 @@ |
2499 | - return NULL; |
2500 | -} |
2501 | - |
2502 | --#ifdef HUNSPELL_EXPERIMENTAL |
2503 | -// check word for prefixes |
2504 | -char * AffixMgr::prefix_check_morph(const char * word, int len, char in_compound, |
2505 | - const FLAG needflag) |
2506 | @@ -20164,7 +20226,7 @@ |
2507 | - while (pe) { |
2508 | - st = pe->check_morph(word,len,in_compound, needflag); |
2509 | - if (st) { |
2510 | -- strcat(result, st); |
2511 | +- mystrcat(result, st, MAXLNLEN); |
2512 | - free(st); |
2513 | - } |
2514 | - // if (rv) return rv; |
2515 | @@ -20182,7 +20244,7 @@ |
2516 | - // fogemorpheme |
2517 | - if ((in_compound != IN_CPD_NOT) || !((pptr->getCont() && |
2518 | - (TESTAFF(pptr->getCont(), onlyincompound, pptr->getContLen()))))) { |
2519 | -- strcat(result, st); |
2520 | +- mystrcat(result, st, MAXLNLEN); |
2521 | - pfx = (AffEntry *)pptr; |
2522 | - } |
2523 | - free(st); |
2524 | @@ -20215,7 +20277,7 @@ |
2525 | - while (pe) { |
2526 | - st = pe->check_twosfx_morph(word,len,in_compound, needflag); |
2527 | - if (st) { |
2528 | -- strcat(result, st); |
2529 | +- mystrcat(result, st, MAXLNLEN); |
2530 | - free(st); |
2531 | - } |
2532 | - pe = pe->getNext(); |
2533 | @@ -20229,7 +20291,7 @@ |
2534 | - if (isSubset(pptr->getKey(),word)) { |
2535 | - st = pptr->check_twosfx_morph(word, len, in_compound, needflag); |
2536 | - if (st) { |
2537 | -- strcat(result, st); |
2538 | +- mystrcat(result, st, MAXLNLEN); |
2539 | - free(st); |
2540 | - pfx = (AffEntry *)pptr; |
2541 | - } |
2542 | @@ -20242,8 +20304,6 @@ |
2543 | - if (*result) return mystrdup(result); |
2544 | - return NULL; |
2545 | -} |
2546 | --#endif // END OF HUNSPELL_EXPERIMENTAL CODE |
2547 | -- |
2548 | - |
2549 | -// Is word a non compound with a REP substitution (see checkcompoundrep)? |
2550 | -int AffixMgr::cpdrep_check(const char * word, int wl) |
2551 | @@ -20272,11 +20332,15 @@ |
2552 | -} |
2553 | - |
2554 | -// forbid compoundings when there are special patterns at word bound |
2555 | --int AffixMgr::cpdpat_check(const char * word, int pos) |
2556 | +-int AffixMgr::cpdpat_check(const char * word, int pos, hentry * r1, hentry * r2) |
2557 | -{ |
2558 | - int len; |
2559 | - for (int i = 0; i < numcheckcpd; i++) { |
2560 | - if (isSubset(checkcpdtable[i].pattern2, word + pos) && |
2561 | +- (!r1 || !checkcpdtable[i].cond || |
2562 | +- (r1->astr && TESTAFF(r1->astr, checkcpdtable[i].cond, r1->alen))) && |
2563 | +- (!r2 || !checkcpdtable[i].cond2 || |
2564 | +- (r2->astr && TESTAFF(r2->astr, checkcpdtable[i].cond2, r2->alen))) && |
2565 | - (len = strlen(checkcpdtable[i].pattern)) && (pos > len) && |
2566 | - (strncmp(word + pos - len, checkcpdtable[i].pattern, len) == 0)) return 1; |
2567 | - } |
2568 | @@ -20294,7 +20358,8 @@ |
2569 | - u8_u16(&w, 1, p); |
2570 | - unsigned short a = (u.h << 8) + u.l; |
2571 | - unsigned short b = (w.h << 8) + w.l; |
2572 | -- if (((unicodetoupper(a, langnum) == a) || (unicodetoupper(b, langnum) == b))) return 1; |
2573 | +- if (((unicodetoupper(a, langnum) == a) || (unicodetoupper(b, langnum) == b)) && |
2574 | +- (a != '-') && (b != '-')) return 1; |
2575 | - } else { |
2576 | - unsigned char a = *(word + pos - 1); |
2577 | - unsigned char b = *(word + pos); |
2578 | @@ -20310,15 +20375,35 @@ |
2579 | - signed short btwp[MAXWORDLEN]; // word positions for metacharacters |
2580 | - int btnum[MAXWORDLEN]; // number of matched characters in metacharacter positions |
2581 | - short bt = 0; |
2582 | -- int i; |
2583 | +- int i, j; |
2584 | - int ok; |
2585 | - int w = 0; |
2586 | +- |
2587 | - if (!*words) { |
2588 | - w = 1; |
2589 | - *words = def; |
2590 | - } |
2591 | - (*words)[wnum] = rv; |
2592 | - |
2593 | +- // has the last word COMPOUNDRULE flag? |
2594 | +- if (rv->alen == 0) { |
2595 | +- (*words)[wnum] = NULL; |
2596 | +- if (w) *words = NULL; |
2597 | +- return 0; |
2598 | +- } |
2599 | +- ok = 0; |
2600 | +- for (i = 0; i < numdefcpd; i++) { |
2601 | +- for (j = 0; j < defcpdtable[i].len; j++) { |
2602 | +- if (defcpdtable[i].def[j] != '*' && defcpdtable[i].def[j] != '?' && |
2603 | +- TESTAFF(rv->astr, defcpdtable[i].def[j], rv->alen)) ok = 1; |
2604 | +- } |
2605 | +- } |
2606 | +- if (ok == 0) { |
2607 | +- (*words)[wnum] = NULL; |
2608 | +- if (w) *words = NULL; |
2609 | +- return 0; |
2610 | +- } |
2611 | +- |
2612 | - for (i = 0; i < numdefcpd; i++) { |
2613 | - signed short pp = 0; // pattern position |
2614 | - signed short wp = 0; // "words" position |
2615 | @@ -20363,17 +20448,18 @@ |
2616 | - while ((defcpdtable[i].len > r) && ((r+1) < defcpdtable[i].len) && |
2617 | - ((defcpdtable[i].def[r+1] == '*') || (defcpdtable[i].def[r+1] == '?'))) r+=2; |
2618 | - if (defcpdtable[i].len <= r) return 1; |
2619 | -- } |
2620 | +- } |
2621 | - // backtrack |
2622 | - if (bt) do { |
2623 | - ok = 1; |
2624 | - btnum[bt - 1]--; |
2625 | - pp = btpp[bt - 1]; |
2626 | -- wp = btwp[bt - 1] + btnum[bt - 1]; |
2627 | +- wp = btwp[bt - 1] + (signed short) btnum[bt - 1]; |
2628 | - } while ((btnum[bt - 1] < 0) && --bt); |
2629 | - } while (bt); |
2630 | - |
2631 | -- if (ok && ok2 && (!all || (defcpdtable[i].len <= pp))) return 1; |
2632 | +- if (ok && ok2 && (!all || (defcpdtable[i].len <= pp))) return 1; |
2633 | +- |
2634 | - // check zero ending |
2635 | - while (ok && ok2 && (defcpdtable[i].len > pp) && ((pp+1) < defcpdtable[i].len) && |
2636 | - ((defcpdtable[i].def[pp+1] == '*') || (defcpdtable[i].def[pp+1] == '?'))) pp+=2; |
2637 | @@ -20421,15 +20507,29 @@ |
2638 | - return num; |
2639 | -} |
2640 | - |
2641 | +-void AffixMgr::setcminmax(int * cmin, int * cmax, const char * word, int len) { |
2642 | +- if (utf8) { |
2643 | +- int i; |
2644 | +- for (*cmin = 0, i = 0; (i < cpdmin) && word[*cmin]; i++) { |
2645 | +- for ((*cmin)++; (word[*cmin] & 0xc0) == 0x80; (*cmin)++); |
2646 | +- } |
2647 | +- for (*cmax = len, i = 0; (i < (cpdmin - 1)) && *cmax; i++) { |
2648 | +- for ((*cmax)--; (word[*cmax] & 0xc0) == 0x80; (*cmax)--); |
2649 | +- } |
2650 | +- } else { |
2651 | +- *cmin = cpdmin; |
2652 | +- *cmax = len - cpdmin + 1; |
2653 | +- } |
2654 | +-} |
2655 | +- |
2656 | -// check if compound word is correctly spelled |
2657 | -// hu_mov_rule = spec. Hungarian rule (XXX) |
2658 | -struct hentry * AffixMgr::compound_check(const char * word, int len, |
2659 | - short wordnum, short numsyllable, short maxwordnum, short wnum, hentry ** words = NULL, |
2660 | -- char hu_mov_rule = 0, int * cmpdstemnum = NULL, int * cmpdstem = NULL, char is_sug = 0) |
2661 | +- char hu_mov_rule = 0, char is_sug = 0) |
2662 | -{ |
2663 | - int i; |
2664 | - short oldnumsyllable, oldnumsyllable2, oldwordnum, oldwordnum2; |
2665 | -- int oldcmpdstemnum = 0; |
2666 | - struct hentry * rv = NULL; |
2667 | - struct hentry * rv_first; |
2668 | - struct hentry * rwords[MAXWORDLEN]; // buffer for COMPOUND pattern checking |
2669 | @@ -20437,31 +20537,17 @@ |
2670 | - char ch; |
2671 | - int cmin; |
2672 | - int cmax; |
2673 | -- |
2674 | +- int striple = 0; |
2675 | +- int scpd = 0; |
2676 | +- int soldi = 0; |
2677 | +- int oldcmin = 0; |
2678 | +- int oldcmax = 0; |
2679 | +- int oldlen = 0; |
2680 | +- int checkedstriple = 0; |
2681 | +- |
2682 | - int checked_prefix; |
2683 | - |
2684 | --#ifdef HUNSTEM |
2685 | -- if (cmpdstemnum) { |
2686 | -- if (wordnum == 0) { |
2687 | -- *cmpdstemnum = 1; |
2688 | -- } else { |
2689 | -- (*cmpdstemnum)++; |
2690 | -- } |
2691 | -- } |
2692 | --#endif |
2693 | -- if (utf8) { |
2694 | -- for (cmin = 0, i = 0; (i < cpdmin) && word[cmin]; i++) { |
2695 | -- cmin++; |
2696 | -- for (; (word[cmin] & 0xc0) == 0x80; cmin++); |
2697 | -- } |
2698 | -- for (cmax = len, i = 0; (i < (cpdmin - 1)) && cmax; i++) { |
2699 | -- cmax--; |
2700 | -- for (; (word[cmax] & 0xc0) == 0x80; cmax--); |
2701 | -- } |
2702 | -- } else { |
2703 | -- cmin = cpdmin; |
2704 | -- cmax = len - cpdmin + 1; |
2705 | -- } |
2706 | +- setcminmax(&cmin, &cmax, word, len); |
2707 | - |
2708 | - strcpy(st, word); |
2709 | - |
2710 | @@ -20477,20 +20563,42 @@ |
2711 | - if (i >= cmax) return NULL; |
2712 | - } |
2713 | - |
2714 | -- |
2715 | +- do { // simplified checkcompoundpattern loop |
2716 | +- |
2717 | +- if (scpd > 0) { |
2718 | +- for (; scpd <= numcheckcpd && (!checkcpdtable[scpd-1].pattern3 || |
2719 | +- strncmp(word + i, checkcpdtable[scpd-1].pattern3, strlen(checkcpdtable[scpd-1].pattern3)) != 0); scpd++); |
2720 | +- |
2721 | +- if (scpd > numcheckcpd) break; // break simplified checkcompoundpattern loop |
2722 | +- strcpy(st + i, checkcpdtable[scpd-1].pattern); |
2723 | +- soldi = i; |
2724 | +- i += strlen(checkcpdtable[scpd-1].pattern); |
2725 | +- strcpy(st + i, checkcpdtable[scpd-1].pattern2); |
2726 | +- strcpy(st + i + strlen(checkcpdtable[scpd-1].pattern2), word + soldi + strlen(checkcpdtable[scpd-1].pattern3)); |
2727 | +- |
2728 | +- oldlen = len; |
2729 | +- len += strlen(checkcpdtable[scpd-1].pattern) + strlen(checkcpdtable[scpd-1].pattern2) - strlen(checkcpdtable[scpd-1].pattern3); |
2730 | +- oldcmin = cmin; |
2731 | +- oldcmax = cmax; |
2732 | +- setcminmax(&cmin, &cmax, st, len); |
2733 | +- |
2734 | +- cmax = len - cpdmin + 1; |
2735 | +- } |
2736 | +- |
2737 | +- |
2738 | - ch = st[i]; |
2739 | - st[i] = '\0'; |
2740 | - |
2741 | - sfx = NULL; |
2742 | - pfx = NULL; |
2743 | -- |
2744 | +- |
2745 | - // FIRST WORD |
2746 | -- |
2747 | +- |
2748 | - rv = lookup(st); // perhaps without prefix |
2749 | - |
2750 | - // search homonym with compound flag |
2751 | - while ((rv) && !hu_mov_rule && |
2752 | -- ((pseudoroot && TESTAFF(rv->astr, pseudoroot, rv->alen)) || |
2753 | +- ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || |
2754 | - !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || |
2755 | - (compoundbegin && !wordnum && |
2756 | - TESTAFF(rv->astr, compoundbegin, rv->alen)) || |
2757 | @@ -20498,8 +20606,10 @@ |
2758 | - TESTAFF(rv->astr, compoundmiddle, rv->alen)) || |
2759 | - (numdefcpd && |
2760 | - ((!words && !wordnum && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)) || |
2761 | -- (words && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0)))) |
2762 | -- ))) { |
2763 | +- (words && defcpd_check(&words, wnum, rv, (hentry **) &rwords, 0))))) || |
2764 | +- (scpd != 0 && checkcpdtable[scpd-1].cond != FLAG_NULL && |
2765 | +- !TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen))) |
2766 | +- ) { |
2767 | - rv = rv->next_homonym; |
2768 | - } |
2769 | - |
2770 | @@ -20516,6 +20626,7 @@ |
2771 | - rv = NULL; |
2772 | - } |
2773 | - } |
2774 | +- |
2775 | - if (rv || |
2776 | - (((wordnum == 0) && compoundbegin && |
2777 | - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || |
2778 | @@ -20524,9 +20635,9 @@ |
2779 | - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || |
2780 | - (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle))))) |
2781 | - ) checked_prefix = 1; |
2782 | -- // else check forbiddenwords and pseudoroot |
2783 | +- // else check forbiddenwords and needaffix |
2784 | - } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) || |
2785 | -- TESTAFF(rv->astr, pseudoroot, rv->alen) || |
2786 | +- TESTAFF(rv->astr, needaffix, rv->alen) || |
2787 | - (is_sug && nosuggest && TESTAFF(rv->astr, nosuggest, rv->alen)) |
2788 | - )) { |
2789 | - st[i] = ch; |
2790 | @@ -20554,7 +20665,7 @@ |
2791 | - ((SfxEntry*)sfx)->getContLen())))) { |
2792 | - rv = NULL; |
2793 | - } |
2794 | -- |
2795 | +- |
2796 | - // check compoundmiddle flag in suffix and prefix |
2797 | - if ((rv) && !checked_prefix && (wordnum==0) && compoundmiddle && !hu_mov_rule && |
2798 | - ((pfx && ((PfxEntry*)pfx)->getCont() && |
2799 | @@ -20564,7 +20675,7 @@ |
2800 | - TESTAFF(((SfxEntry*)sfx)->getCont(), compoundmiddle, |
2801 | - ((SfxEntry*)sfx)->getContLen())))) { |
2802 | - rv = NULL; |
2803 | -- } |
2804 | +- } |
2805 | - |
2806 | - // check forbiddenwords |
2807 | - if ((rv) && (rv->astr) && (TESTAFF(rv->astr, forbiddenword, rv->alen) || |
2808 | @@ -20594,19 +20705,20 @@ |
2809 | - ) |
2810 | - ) |
2811 | -// END of LANG_hu section |
2812 | +- ) && |
2813 | +- ( |
2814 | +- // test CHECKCOMPOUNDPATTERN conditions |
2815 | +- scpd == 0 || checkcpdtable[scpd-1].cond == FLAG_NULL || |
2816 | +- TESTAFF(rv->astr, checkcpdtable[scpd-1].cond, rv->alen) |
2817 | - ) |
2818 | -- && ! (( checkcompoundtriple && // test triple letters |
2819 | +- && ! (( checkcompoundtriple && scpd == 0 && !words && // test triple letters |
2820 | - (word[i-1]==word[i]) && ( |
2821 | -- ((i>1) && (word[i-1]==word[i-2])) || |
2822 | +- ((i>1) && (word[i-1]==word[i-2])) || |
2823 | - ((word[i-1]==word[i+1])) // may be word[i+1] == '\0' |
2824 | - ) |
2825 | - ) || |
2826 | -- ( |
2827 | -- // test CHECKCOMPOUNDPATTERN |
2828 | -- numcheckcpd && cpdpat_check(word, i) |
2829 | -- ) || |
2830 | -- ( |
2831 | -- checkcompoundcase && cpdcase_check(word, i) |
2832 | +- ( |
2833 | +- checkcompoundcase && scpd == 0 && !words && cpdcase_check(word, i) |
2834 | - )) |
2835 | - ) |
2836 | -// LANG_hu section: spec. Hungarian rule |
2837 | @@ -20614,15 +20726,14 @@ |
2838 | - (sfx && ((SfxEntry*)sfx)->getCont() && ( // XXX hardwired Hungarian dic. codes |
2839 | - TESTAFF(((SfxEntry*)sfx)->getCont(), (unsigned short) 'x', ((SfxEntry*)sfx)->getContLen()) || |
2840 | - TESTAFF(((SfxEntry*)sfx)->getCont(), (unsigned short) '%', ((SfxEntry*)sfx)->getContLen()) |
2841 | -- ) |
2842 | +- ) |
2843 | - ) |
2844 | - ) |
2845 | --// END of LANG_hu section |
2846 | -- ) { |
2847 | +- ) { // first word is ok condition |
2848 | - |
2849 | -// LANG_hu section: spec. Hungarian rule |
2850 | - if (langnum == LANG_hu) { |
2851 | -- // calculate syllable number of the word |
2852 | +- // calculate syllable number of the word |
2853 | - numsyllable += get_syllable(st, i); |
2854 | - |
2855 | - // + 1 word, if syllable number of the prefix > 1 (hungarian convention) |
2856 | @@ -20630,23 +20741,35 @@ |
2857 | - } |
2858 | -// END of LANG_hu section |
2859 | - |
2860 | --#ifdef HUNSTEM |
2861 | -- if (cmpdstem) cmpdstem[*cmpdstemnum - 1] = i; |
2862 | --#endif |
2863 | - |
2864 | - // NEXT WORD(S) |
2865 | - rv_first = rv; |
2866 | -- rv = lookup((word+i)); // perhaps without prefix |
2867 | +- st[i] = ch; |
2868 | +- |
2869 | +- do { // striple loop |
2870 | +- |
2871 | +- // check simplifiedtriple |
2872 | +- if (simplifiedtriple) { |
2873 | +- if (striple) { |
2874 | +- checkedstriple = 1; |
2875 | +- i--; // check "fahrt" instead of "ahrt" in "Schiffahrt" |
2876 | +- } else if (i > 2 && *(word+i - 1) == *(word + i - 2)) striple = 1; |
2877 | +- } |
2878 | +- |
2879 | +- rv = lookup((st+i)); // perhaps without prefix |
2880 | - |
2881 | - // search homonym with compound flag |
2882 | -- while ((rv) && ((pseudoroot && TESTAFF(rv->astr, pseudoroot, rv->alen)) || |
2883 | +- while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || |
2884 | - !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || |
2885 | - (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) || |
2886 | -- (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))))) { |
2887 | +- (numdefcpd && words && defcpd_check(&words, wnum + 1, rv, NULL,1))) || |
2888 | +- (scpd != 0 && checkcpdtable[scpd-1].cond2 != FLAG_NULL && |
2889 | +- !TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen)) |
2890 | +- )) { |
2891 | - rv = rv->next_homonym; |
2892 | - } |
2893 | - |
2894 | -- if (rv && words && words[wnum + 1]) return rv; |
2895 | +- if (rv && words && words[wnum + 1]) return rv_first; |
2896 | - |
2897 | - oldnumsyllable2 = numsyllable; |
2898 | - oldwordnum2 = wordnum; |
2899 | @@ -20678,20 +20801,27 @@ |
2900 | - ) |
2901 | - && ( |
2902 | - ((cpdwordmax==-1) || (wordnum+1<cpdwordmax)) || |
2903 | -- ((cpdmaxsyllable==0) || |
2904 | -- (numsyllable + get_syllable(&(rv->word), rv->clen)<=cpdmaxsyllable)) |
2905 | -- ) |
2906 | -- && ( |
2907 | +- ((cpdmaxsyllable!=0) && |
2908 | +- (numsyllable + get_syllable(HENTRY_WORD(rv), rv->clen)<=cpdmaxsyllable)) |
2909 | +- ) && |
2910 | +- ( |
2911 | +- // test CHECKCOMPOUNDPATTERN |
2912 | +- !numcheckcpd || scpd != 0 || !cpdpat_check(word, i, rv_first, rv) |
2913 | +- ) && |
2914 | +- ( |
2915 | - (!checkcompounddup || (rv != rv_first)) |
2916 | - ) |
2917 | +- // test CHECKCOMPOUNDPATTERN conditions |
2918 | +- && (scpd == 0 || checkcpdtable[scpd-1].cond2 == FLAG_NULL || |
2919 | +- TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen)) |
2920 | - ) |
2921 | - { |
2922 | - // forbid compound word, if it is a non compound word with typical fault |
2923 | - if (checkcompoundrep && cpdrep_check(word,len)) return NULL; |
2924 | -- return rv; |
2925 | +- return rv_first; |
2926 | - } |
2927 | - |
2928 | -- numsyllable = oldnumsyllable2 ; |
2929 | +- numsyllable = oldnumsyllable2; |
2930 | - wordnum = oldwordnum2; |
2931 | - |
2932 | - // perhaps second word has prefix or/and suffix |
2933 | @@ -20703,13 +20833,20 @@ |
2934 | - pfx = NULL; |
2935 | - rv = affix_check((word+i),strlen(word+i), compoundend, IN_CPD_END); |
2936 | - } |
2937 | -- |
2938 | +- |
2939 | - if (!rv && numdefcpd && words) { |
2940 | - rv = affix_check((word+i),strlen(word+i), 0, IN_CPD_END); |
2941 | -- if (rv && defcpd_check(&words, wnum + 1, rv, NULL, 1)) return rv; |
2942 | +- if (rv && defcpd_check(&words, wnum + 1, rv, NULL, 1)) return rv_first; |
2943 | - rv = NULL; |
2944 | - } |
2945 | - |
2946 | +- // test CHECKCOMPOUNDPATTERN conditions (allowed forms) |
2947 | +- if (rv && !(scpd == 0 || checkcpdtable[scpd-1].cond2 == FLAG_NULL || |
2948 | +- TESTAFF(rv->astr, checkcpdtable[scpd-1].cond2, rv->alen))) rv = NULL; |
2949 | +- |
2950 | +- // test CHECKCOMPOUNDPATTERN conditions (forbidden compounds) |
2951 | +- if (rv && numcheckcpd && scpd == 0 && cpdpat_check(word, i, rv_first, rv)) rv = NULL; |
2952 | +- |
2953 | - // check non_compound flag in suffix and prefix |
2954 | - if ((rv) && |
2955 | - ((pfx && ((PfxEntry*)pfx)->getCont() && |
2956 | @@ -20733,7 +20870,7 @@ |
2957 | - if (langnum == LANG_hu) { |
2958 | - // calculate syllable number of the word |
2959 | - numsyllable += get_syllable(word + i, strlen(word + i)); |
2960 | -- |
2961 | +- |
2962 | - // - affix syllable num. |
2963 | - // XXX only second suffix (inflections, not derivations) |
2964 | - if (sfxappnd) { |
2965 | @@ -20741,13 +20878,13 @@ |
2966 | - numsyllable -= get_syllable(tmp, strlen(tmp)); |
2967 | - free(tmp); |
2968 | - } |
2969 | -- |
2970 | +- |
2971 | - // + 1 word, if syllable number of the prefix > 1 (hungarian convention) |
2972 | - if (pfx && (get_syllable(((PfxEntry *)pfx)->getKey(),strlen(((PfxEntry *)pfx)->getKey())) > 1)) wordnum++; |
2973 | - |
2974 | - // increment syllable num, if last word has a SYLLABLENUM flag |
2975 | - // and the suffix is beginning `s' |
2976 | -- |
2977 | +- |
2978 | - if (cpdsyllablenum) { |
2979 | - switch (sfxflag) { |
2980 | - case 'c': { numsyllable+=2; break; } |
2981 | @@ -20756,7 +20893,7 @@ |
2982 | - } |
2983 | - } |
2984 | - } |
2985 | -- |
2986 | +- |
2987 | - // increment word number, if the second word has a compoundroot flag |
2988 | - if ((rv) && (compoundroot) && |
2989 | - (TESTAFF(rv->astr, compoundroot, rv->alen))) { |
2990 | @@ -20770,7 +20907,7 @@ |
2991 | - if ((rv) && |
2992 | - ( |
2993 | - ((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) || |
2994 | -- ((cpdmaxsyllable == 0) || |
2995 | +- ((cpdmaxsyllable != 0) && |
2996 | - (numsyllable <= cpdmaxsyllable)) |
2997 | - ) |
2998 | - && ( |
2999 | @@ -20778,41 +20915,61 @@ |
3000 | - )) { |
3001 | - // forbid compound word, if it is a non compound word with typical fault |
3002 | - if (checkcompoundrep && cpdrep_check(word, len)) return NULL; |
3003 | -- return rv; |
3004 | +- return rv_first; |
3005 | - } |
3006 | - |
3007 | - numsyllable = oldnumsyllable2; |
3008 | - wordnum = oldwordnum2; |
3009 | --#ifdef HUNSTEM |
3010 | -- if (cmpdstemnum) oldcmpdstemnum = *cmpdstemnum; |
3011 | --#endif |
3012 | +- |
3013 | - // perhaps second word is a compound word (recursive call) |
3014 | - if (wordnum < maxwordnum) { |
3015 | -- rv = compound_check((word+i),strlen(word+i), wordnum+1, |
3016 | -- numsyllable, maxwordnum, wnum + 1, words, |
3017 | -- 0, cmpdstemnum, cmpdstem, is_sug); |
3018 | +- rv = compound_check((st+i),strlen(st+i), wordnum+1, |
3019 | +- numsyllable, maxwordnum, wnum + 1, words, 0, is_sug); |
3020 | +- if (rv && numcheckcpd && (scpd == 0 && cpdpat_check(word, i, rv_first, rv) || |
3021 | +- scpd != 0 && !cpdpat_check(word, i, rv_first, rv))) rv = NULL; |
3022 | - } else { |
3023 | - rv=NULL; |
3024 | - } |
3025 | - if (rv) { |
3026 | - // forbid compound word, if it is a non compound word with typical fault |
3027 | - if (checkcompoundrep && cpdrep_check(word, len)) return NULL; |
3028 | -- return rv; |
3029 | -- } else { |
3030 | --#ifdef HUNSTEM |
3031 | -- if (cmpdstemnum) *cmpdstemnum = oldcmpdstemnum; |
3032 | --#endif |
3033 | +- return rv_first; |
3034 | - } |
3035 | +- } while (striple && !checkedstriple); // end of striple loop |
3036 | +- |
3037 | +- if (checkedstriple) { |
3038 | +- i++; |
3039 | +- checkedstriple = 0; |
3040 | +- striple = 0; |
3041 | +- } |
3042 | +- |
3043 | +- } // first word is ok condition |
3044 | +- |
3045 | +- if (soldi != 0) { |
3046 | +- i = soldi; |
3047 | +- soldi = 0; |
3048 | +- len = oldlen; |
3049 | +- cmin = oldcmin; |
3050 | +- cmax = oldcmax; |
3051 | - } |
3052 | -- st[i] = ch; |
3053 | +- scpd++; |
3054 | +- |
3055 | +- } while (simplifiedcpd && scpd <= numcheckcpd); // end of simplifiedcpd loop |
3056 | +- |
3057 | +- if (soldi != 0) { |
3058 | +- i = soldi; |
3059 | +- strcpy(st, word); // XXX add more optim. |
3060 | +- soldi = 0; |
3061 | +- } else st[i] = ch; |
3062 | +- |
3063 | +- scpd = 0; |
3064 | - wordnum = oldwordnum; |
3065 | - numsyllable = oldnumsyllable; |
3066 | - } |
3067 | -- |
3068 | +- |
3069 | - return NULL; |
3070 | --} |
3071 | +-} |
3072 | - |
3073 | --#ifdef HUNSPELL_EXPERIMENTAL |
3074 | -// check if compound word is correctly spelled |
3075 | -// hu_mov_rule = spec. Hungarian rule (XXX) |
3076 | -int AffixMgr::compound_check_morph(const char * word, int len, |
3077 | @@ -20828,26 +20985,14 @@ |
3078 | - struct hentry * rwords[MAXWORDLEN]; // buffer for COMPOUND pattern checking |
3079 | - char st [MAXWORDUTF8LEN + 4]; |
3080 | - char ch; |
3081 | -- |
3082 | +- |
3083 | - int checked_prefix; |
3084 | - char presult[MAXLNLEN]; |
3085 | - |
3086 | - int cmin; |
3087 | - int cmax; |
3088 | -- |
3089 | -- if (utf8) { |
3090 | -- for (cmin = 0, i = 0; (i < cpdmin) && word[cmin]; i++) { |
3091 | -- cmin++; |
3092 | -- for (; (word[cmin] & 0xc0) == 0x80; cmin++); |
3093 | -- } |
3094 | -- for (cmax = len, i = 0; (i < (cpdmin - 1)) && cmax; i++) { |
3095 | -- cmax--; |
3096 | -- for (; (word[cmax] & 0xc0) == 0x80; cmax--); |
3097 | -- } |
3098 | -- } else { |
3099 | -- cmin = cpdmin; |
3100 | -- cmax = len - cpdmin + 1; |
3101 | -- } |
3102 | +- |
3103 | +- setcminmax(&cmin, &cmax, word, len); |
3104 | - |
3105 | - strcpy(st, word); |
3106 | - |
3107 | @@ -20861,7 +21006,7 @@ |
3108 | - for (; (st[i] & 0xc0) == 0x80; i++); |
3109 | - if (i >= cmax) return 0; |
3110 | - } |
3111 | -- |
3112 | +- |
3113 | - ch = st[i]; |
3114 | - st[i] = '\0'; |
3115 | - sfx = NULL; |
3116 | @@ -20869,12 +21014,12 @@ |
3117 | - // FIRST WORD |
3118 | - *presult = '\0'; |
3119 | - if (partresult) strcat(presult, partresult); |
3120 | -- |
3121 | +- |
3122 | - rv = lookup(st); // perhaps without prefix |
3123 | - |
3124 | - // search homonym with compound flag |
3125 | - while ((rv) && !hu_mov_rule && |
3126 | -- ((pseudoroot && TESTAFF(rv->astr, pseudoroot, rv->alen)) || |
3127 | +- ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || |
3128 | - !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || |
3129 | - (compoundbegin && !wordnum && |
3130 | - TESTAFF(rv->astr, compoundbegin, rv->alen)) || |
3131 | @@ -20888,13 +21033,16 @@ |
3132 | - } |
3133 | - |
3134 | - if (rv) { |
3135 | -- if (rv->description) { |
3136 | -- if ((!rv->astr) || !TESTAFF(rv->astr, lemma_present, rv->alen)) |
3137 | -- strcat(presult, st); |
3138 | -- strcat(presult, rv->description); |
3139 | -- } |
3140 | -- } |
3141 | -- |
3142 | +- sprintf(presult + strlen(presult), "%c%s%s", MSEP_FLD, MORPH_PART, st); |
3143 | +- if (!HENTRY_FIND(rv, MORPH_STEM)) { |
3144 | +- sprintf(presult + strlen(presult), "%c%s%s", MSEP_FLD, MORPH_STEM, st); |
3145 | +- } |
3146 | +- // store the pointer of the hash entry |
3147 | +-// sprintf(presult + strlen(presult), "%c%s%p", MSEP_FLD, MORPH_HENTRY, rv); |
3148 | +- if (HENTRY_DATA(rv)) { |
3149 | +- sprintf(presult + strlen(presult), "%c%s", MSEP_FLD, HENTRY_DATA2(rv)); |
3150 | +- } |
3151 | +- } |
3152 | - if (!rv) { |
3153 | - if (compoundflag && |
3154 | - !(rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundflag))) { |
3155 | @@ -20908,7 +21056,7 @@ |
3156 | - rv = NULL; |
3157 | - } |
3158 | - } |
3159 | -- |
3160 | +- |
3161 | - if (rv || |
3162 | - (((wordnum == 0) && compoundbegin && |
3163 | - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundbegin, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || |
3164 | @@ -20917,35 +21065,28 @@ |
3165 | - ((rv = suffix_check(st, i, 0, NULL, NULL, 0, NULL, FLAG_NULL, compoundmiddle, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN)) || |
3166 | - (rv = prefix_check(st, i, hu_mov_rule ? IN_CPD_OTHER : IN_CPD_BEGIN, compoundmiddle))))) |
3167 | - ) { |
3168 | -- //char * p = prefix_check_morph(st, i, 0, compound); |
3169 | +- // char * p = prefix_check_morph(st, i, 0, compound); |
3170 | - char * p = NULL; |
3171 | - if (compoundflag) p = affix_check_morph(st, i, compoundflag); |
3172 | - if (!p || (*p == '\0')) { |
3173 | +- if (p) free(p); |
3174 | +- p = NULL; |
3175 | - if ((wordnum == 0) && compoundbegin) { |
3176 | - p = affix_check_morph(st, i, compoundbegin); |
3177 | - } else if ((wordnum > 0) && compoundmiddle) { |
3178 | - p = affix_check_morph(st, i, compoundmiddle); |
3179 | - } |
3180 | - } |
3181 | -- if (*p != '\0') { |
3182 | -- line_uniq(p); |
3183 | -- if (strchr(p, '\n')) { |
3184 | -- strcat(presult, "("); |
3185 | -- strcat(presult, line_join(p, '|')); |
3186 | -- strcat(presult, ")"); |
3187 | -- } else { |
3188 | -- strcat(presult, p); |
3189 | -- } |
3190 | -- } |
3191 | -- if (presult[strlen(presult) - 1] == '\n') { |
3192 | -- presult[strlen(presult) - 1] = '\0'; |
3193 | -- } |
3194 | +- if (p && (*p != '\0')) { |
3195 | +- sprintf(presult + strlen(presult), "%c%s%s%s", MSEP_FLD, |
3196 | +- MORPH_PART, st, line_uniq_app(&p, MSEP_REC)); |
3197 | +- } |
3198 | +- if (p) free(p); |
3199 | - checked_prefix = 1; |
3200 | -- //strcat(presult, "+"); |
3201 | - } |
3202 | - // else check forbiddenwords |
3203 | - } else if (rv->astr && (TESTAFF(rv->astr, forbiddenword, rv->alen) || |
3204 | -- TESTAFF(rv->astr, pseudoroot, rv->alen))) { |
3205 | +- TESTAFF(rv->astr, needaffix, rv->alen))) { |
3206 | - st[i] = ch; |
3207 | - continue; |
3208 | - } |
3209 | @@ -21008,7 +21149,7 @@ |
3210 | - ) |
3211 | -// END of LANG_hu section |
3212 | - ) |
3213 | -- && ! (( checkcompoundtriple && // test triple letters |
3214 | +- && ! (( checkcompoundtriple && !words && // test triple letters |
3215 | - (word[i-1]==word[i]) && ( |
3216 | - ((i>1) && (word[i-1]==word[i-2])) || |
3217 | - ((word[i-1]==word[i+1])) // may be word[i+1] == '\0' |
3218 | @@ -21016,10 +21157,10 @@ |
3219 | - ) || |
3220 | - ( |
3221 | - // test CHECKCOMPOUNDPATTERN |
3222 | -- numcheckcpd && cpdpat_check(word, i) |
3223 | +- numcheckcpd && !words && cpdpat_check(word, i, rv, NULL) |
3224 | - ) || |
3225 | - ( |
3226 | -- checkcompoundcase && cpdcase_check(word, i) |
3227 | +- checkcompoundcase && !words && cpdcase_check(word, i) |
3228 | - )) |
3229 | - ) |
3230 | -// LANG_hu section: spec. Hungarian rule |
3231 | @@ -21048,7 +21189,7 @@ |
3232 | - rv = lookup((word+i)); // perhaps without prefix |
3233 | - |
3234 | - // search homonym with compound flag |
3235 | -- while ((rv) && ((pseudoroot && TESTAFF(rv->astr, pseudoroot, rv->alen)) || |
3236 | +- while ((rv) && ((needaffix && TESTAFF(rv->astr, needaffix, rv->alen)) || |
3237 | - !((compoundflag && !words && TESTAFF(rv->astr, compoundflag, rv->alen)) || |
3238 | - (compoundend && !words && TESTAFF(rv->astr, compoundend, rv->alen)) || |
3239 | - (numdefcpd && defcpd_check(&words, wnum + 1, rv, NULL,1))))) { |
3240 | @@ -21057,11 +21198,21 @@ |
3241 | - |
3242 | - if (rv && words && words[wnum + 1]) { |
3243 | - strcat(*result, presult); |
3244 | -- if (complexprefixes && rv->description) strcat(*result, rv->description); |
3245 | -- if (rv->description && ((!rv->astr) || |
3246 | -- !TESTAFF(rv->astr, lemma_present, rv->alen))) |
3247 | -- strcat(*result, &(rv->word)); |
3248 | -- if (!complexprefixes && rv->description) strcat(*result, rv->description); |
3249 | +- strcat(*result, " "); |
3250 | +- strcat(*result, MORPH_PART); |
3251 | +- strcat(*result, word+i); |
3252 | +- if (complexprefixes && HENTRY_DATA(rv)) strcat(*result, HENTRY_DATA2(rv)); |
3253 | +- if (!HENTRY_FIND(rv, MORPH_STEM)) { |
3254 | +- strcat(*result, " "); |
3255 | +- strcat(*result, MORPH_STEM); |
3256 | +- strcat(*result, HENTRY_WORD(rv)); |
3257 | +- } |
3258 | +- // store the pointer of the hash entry |
3259 | +-// sprintf(*result + strlen(*result), " %s%p", MORPH_HENTRY, rv); |
3260 | +- if (!complexprefixes && HENTRY_DATA(rv)) { |
3261 | +- strcat(*result, " "); |
3262 | +- strcat(*result, HENTRY_DATA2(rv)); |
3263 | +- } |
3264 | - strcat(*result, "\n"); |
3265 | - ok = 1; |
3266 | - return 0; |
3267 | @@ -21086,7 +21237,7 @@ |
3268 | - st[i] = ch; |
3269 | - continue; |
3270 | - } |
3271 | -- |
3272 | +- |
3273 | - // second word is acceptable, as a root? |
3274 | - // hungarian conventions: compounding is acceptable, |
3275 | - // when compound forms consist of 2 words, or if more, |
3276 | @@ -21097,8 +21248,8 @@ |
3277 | - ) |
3278 | - && ( |
3279 | - ((cpdwordmax==-1) || (wordnum+1<cpdwordmax)) || |
3280 | -- ((cpdmaxsyllable==0) || |
3281 | -- (numsyllable+get_syllable(&(rv->word),rv->wlen)<=cpdmaxsyllable)) |
3282 | +- ((cpdmaxsyllable!=0) && |
3283 | +- (numsyllable+get_syllable(HENTRY_WORD(rv),rv->blen)<=cpdmaxsyllable)) |
3284 | - ) |
3285 | - && ( |
3286 | - (!checkcompounddup || (rv != rv_first)) |
3287 | @@ -21107,12 +21258,23 @@ |
3288 | - { |
3289 | - // bad compound word |
3290 | - strcat(*result, presult); |
3291 | -- |
3292 | -- if (rv->description) { |
3293 | -- if (complexprefixes) strcat(*result, rv->description); |
3294 | -- if ((!rv->astr) || !TESTAFF(rv->astr, lemma_present, rv->alen)) |
3295 | -- strcat(*result, &(rv->word)); |
3296 | -- if (!complexprefixes) strcat(*result, rv->description); |
3297 | +- strcat(*result, " "); |
3298 | +- strcat(*result, MORPH_PART); |
3299 | +- strcat(*result, word+i); |
3300 | +- |
3301 | +- if (HENTRY_DATA(rv)) { |
3302 | +- if (complexprefixes) strcat(*result, HENTRY_DATA2(rv)); |
3303 | +- if (! HENTRY_FIND(rv, MORPH_STEM)) { |
3304 | +- strcat(*result, " "); |
3305 | +- strcat(*result, MORPH_STEM); |
3306 | +- strcat(*result, HENTRY_WORD(rv)); |
3307 | +- } |
3308 | +- // store the pointer of the hash entry |
3309 | +-// sprintf(*result + strlen(*result), " %s%p", MORPH_HENTRY, rv); |
3310 | +- if (!complexprefixes) { |
3311 | +- strcat(*result, " "); |
3312 | +- strcat(*result, HENTRY_DATA2(rv)); |
3313 | +- } |
3314 | - } |
3315 | - strcat(*result, "\n"); |
3316 | - ok = 1; |
3317 | @@ -21138,20 +21300,16 @@ |
3318 | - if (rv && words && defcpd_check(&words, wnum + 1, rv, NULL, 1)) { |
3319 | - char * m = NULL; |
3320 | - if (compoundflag) m = affix_check_morph((word+i),strlen(word+i), compoundflag); |
3321 | -- if ((!m || *m == '\0') && compoundend) |
3322 | +- if ((!m || *m == '\0') && compoundend) { |
3323 | +- if (m) free(m); |
3324 | - m = affix_check_morph((word+i),strlen(word+i), compoundend); |
3325 | +- } |
3326 | - strcat(*result, presult); |
3327 | -- if (m) { |
3328 | -- line_uniq(m); |
3329 | -- if (strchr(m, '\n')) { |
3330 | -- strcat(*result, "("); |
3331 | -- strcat(*result, line_join(m, '|')); |
3332 | -- strcat(*result, ")"); |
3333 | -- } else { |
3334 | -- strcat(*result, m); |
3335 | -- } |
3336 | -- free(m); |
3337 | +- if (m || (*m != '\0')) { |
3338 | +- sprintf(*result + strlen(*result), "%c%s%s%s", MSEP_FLD, |
3339 | +- MORPH_PART, word + i, line_uniq_app(&m, MSEP_REC)); |
3340 | - } |
3341 | +- if (m) free(m); |
3342 | - strcat(*result, "\n"); |
3343 | - ok = 1; |
3344 | - } |
3345 | @@ -21170,7 +21328,7 @@ |
3346 | - |
3347 | - // check forbiddenwords |
3348 | - if ((rv) && (rv->astr) && (TESTAFF(rv->astr,forbiddenword,rv->alen)) |
3349 | -- && (! TESTAFF(rv->astr, pseudoroot, rv->alen))) { |
3350 | +- && (! TESTAFF(rv->astr, needaffix, rv->alen))) { |
3351 | - st[i] = ch; |
3352 | - continue; |
3353 | - } |
3354 | @@ -21214,7 +21372,7 @@ |
3355 | - if ((rv) && |
3356 | - ( |
3357 | - ((cpdwordmax==-1) || (wordnum+1<cpdwordmax)) || |
3358 | -- ((cpdmaxsyllable==0) || |
3359 | +- ((cpdmaxsyllable!=0) && |
3360 | - (numsyllable <= cpdmaxsyllable)) |
3361 | - ) |
3362 | - && ( |
3363 | @@ -21222,21 +21380,17 @@ |
3364 | - )) { |
3365 | - char * m = NULL; |
3366 | - if (compoundflag) m = affix_check_morph((word+i),strlen(word+i), compoundflag); |
3367 | -- if ((!m || *m == '\0') && compoundend) |
3368 | +- if ((!m || *m == '\0') && compoundend) { |
3369 | +- if (m) free(m); |
3370 | - m = affix_check_morph((word+i),strlen(word+i), compoundend); |
3371 | +- } |
3372 | - strcat(*result, presult); |
3373 | -- if (m) { |
3374 | -- line_uniq(m); |
3375 | -- if (strchr(m, '\n')) { |
3376 | -- strcat(*result, "("); |
3377 | -- strcat(*result, line_join(m, '|')); |
3378 | -- strcat(*result, ")"); |
3379 | -- } else { |
3380 | -- strcat(*result, m); |
3381 | -- } |
3382 | -- free(m); |
3383 | +- if (m && (*m != '\0')) { |
3384 | +- sprintf(*result + strlen(*result), "%c%s%s%s", MSEP_FLD, |
3385 | +- MORPH_PART, word + i, line_uniq_app(&m, MSEP_REC)); |
3386 | - } |
3387 | -- strcat(*result, "\n"); |
3388 | +- if (m) free(m); |
3389 | +- sprintf(*result + strlen(*result), "%c", MSEP_REC); |
3390 | - ok = 1; |
3391 | - } |
3392 | - |
3393 | @@ -21257,7 +21411,6 @@ |
3394 | - } |
3395 | - return 0; |
3396 | -} |
3397 | --#endif // END OF HUNSPELL_EXPERIMENTAL CODE |
3398 | - |
3399 | - // return 1 if s1 (reversed) is a leading subset of end of s2 |
3400 | -/* inline int AffixMgr::isRevSubset(const char * s1, const char * end_of_s2, int len) |
3401 | @@ -21288,8 +21441,6 @@ |
3402 | - const FLAG cclass, const FLAG needflag, char in_compound) |
3403 | -{ |
3404 | - struct hentry * rv = NULL; |
3405 | -- char result[MAXLNLEN]; |
3406 | -- |
3407 | - PfxEntry* ep = (PfxEntry *) ppfx; |
3408 | - |
3409 | - // first handle the special case of 0 length suffixes |
3410 | @@ -21313,11 +21464,11 @@ |
3411 | - // fogemorpheme |
3412 | - (in_compound || |
3413 | - !((se->getCont() && (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) && |
3414 | -- // pseudoroot on prefix or first suffix |
3415 | +- // needaffix on prefix or first suffix |
3416 | - (cclass || |
3417 | -- !(se->getCont() && TESTAFF(se->getCont(), pseudoroot, se->getContLen())) || |
3418 | +- !(se->getCont() && TESTAFF(se->getCont(), needaffix, se->getContLen())) || |
3419 | - (ppfx && !((ep->getCont()) && |
3420 | -- TESTAFF(ep->getCont(), pseudoroot, |
3421 | +- TESTAFF(ep->getCont(), needaffix, |
3422 | - ep->getContLen()))) |
3423 | - ) |
3424 | - ) { |
3425 | @@ -21355,11 +21506,11 @@ |
3426 | - // fogemorpheme |
3427 | - (in_compound || |
3428 | - !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) && |
3429 | -- // pseudoroot on prefix or first suffix |
3430 | +- // needaffix on prefix or first suffix |
3431 | - (cclass || |
3432 | -- !(sptr->getCont() && TESTAFF(sptr->getCont(), pseudoroot, sptr->getContLen())) || |
3433 | +- !(sptr->getCont() && TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) || |
3434 | - (ppfx && !((ep->getCont()) && |
3435 | -- TESTAFF(ep->getCont(), pseudoroot, |
3436 | +- TESTAFF(ep->getCont(), needaffix, |
3437 | - ep->getContLen()))) |
3438 | - ) |
3439 | - ) { |
3440 | @@ -21369,17 +21520,6 @@ |
3441 | - sfx=(AffEntry *)sptr; // BUG: sfx not stateless |
3442 | - sfxflag = sptr->getFlag(); // BUG: sfxflag not stateless |
3443 | - if (!sptr->getCont()) sfxappnd=sptr->getKey(); // BUG: sfxappnd not stateless |
3444 | -- if (cclass || sptr->getCont()) { |
3445 | -- if (!derived) { |
3446 | -- derived = mystrdup(word); |
3447 | -- } else { |
3448 | -- strcpy(result, derived); // XXX check size |
3449 | -- strcat(result, "\n"); |
3450 | -- strcat(result, word); |
3451 | -- free(derived); |
3452 | -- derived = mystrdup(result); |
3453 | -- } |
3454 | -- } |
3455 | - return rv; |
3456 | - } |
3457 | - } |
3458 | @@ -21434,7 +21574,6 @@ |
3459 | - return NULL; |
3460 | -} |
3461 | - |
3462 | --#ifdef HUNSPELL_EXPERIMENTAL |
3463 | -char * AffixMgr::suffix_check_twosfx_morph(const char * word, int len, |
3464 | - int sfxopts, AffEntry * ppfx, const FLAG needflag) |
3465 | -{ |
3466 | @@ -21456,12 +21595,18 @@ |
3467 | - st = se->check_twosfx_morph(word,len, sfxopts, ppfx, needflag); |
3468 | - if (st) { |
3469 | - if (ppfx) { |
3470 | -- if (((PfxEntry *) ppfx)->getMorph()) strcat(result, ((PfxEntry *) ppfx)->getMorph()); |
3471 | +- if (((PfxEntry *) ppfx)->getMorph()) { |
3472 | +- mystrcat(result, ((PfxEntry *) ppfx)->getMorph(), MAXLNLEN); |
3473 | +- mystrcat(result, " ", MAXLNLEN); |
3474 | +- } else debugflag(result, ((PfxEntry *) ppfx)->getFlag()); |
3475 | - } |
3476 | -- strcat(result, st); |
3477 | +- mystrcat(result, st, MAXLNLEN); |
3478 | - free(st); |
3479 | -- if (se->getMorph()) strcat(result, se->getMorph()); |
3480 | -- strcat(result, "\n"); |
3481 | +- if (se->getMorph()) { |
3482 | +- mystrcat(result, " ", MAXLNLEN); |
3483 | +- mystrcat(result, se->getMorph(), MAXLNLEN); |
3484 | +- } else debugflag(result, se->getFlag()); |
3485 | +- mystrcat(result, "\n", MAXLNLEN); |
3486 | - } |
3487 | - } |
3488 | - se = se->getNext(); |
3489 | @@ -21483,19 +21628,14 @@ |
3490 | - free(st); |
3491 | - |
3492 | - result3[0] = '\0'; |
3493 | --#ifdef DEBUG |
3494 | -- unsigned short flag = sptr->getFlag(); |
3495 | -- if (flag_mode == FLAG_NUM) { |
3496 | -- sprintf(result3, "<%d>", sptr->getKey()); |
3497 | -- } else if (flag_mode == FLAG_LONG) { |
3498 | -- sprintf(result3, "<%c%c>", flag >> 8, (flag << 8) >>8); |
3499 | -- } else sprintf(result3, "<%c>", flag); |
3500 | -- strcat(result3, ":"); |
3501 | --#endif |
3502 | -- if (sptr->getMorph()) strcat(result3, sptr->getMorph()); |
3503 | +- |
3504 | +- if (sptr->getMorph()) { |
3505 | +- mystrcat(result3, " ", MAXLNLEN); |
3506 | +- mystrcat(result3, sptr->getMorph(), MAXLNLEN); |
3507 | +- } else debugflag(result3, sptr->getFlag()); |
3508 | - strlinecat(result2, result3); |
3509 | -- strcat(result2, "\n"); |
3510 | -- strcat(result, result2); |
3511 | +- mystrcat(result2, "\n", MAXLNLEN); |
3512 | +- mystrcat(result, result2, MAXLNLEN); |
3513 | - } |
3514 | - } |
3515 | - sptr = sptr->getNextEQ(); |
3516 | @@ -21503,7 +21643,7 @@ |
3517 | - sptr = sptr->getNextNE(); |
3518 | - } |
3519 | - } |
3520 | -- if (result) return mystrdup(result); |
3521 | +- if (*result) return mystrdup(result); |
3522 | - return NULL; |
3523 | -} |
3524 | - |
3525 | @@ -21538,26 +21678,40 @@ |
3526 | - // fogemorpheme |
3527 | - (in_compound || |
3528 | - !((se->getCont() && (TESTAFF(se->getCont(), onlyincompound, se->getContLen()))))) && |
3529 | -- // pseudoroot on prefix or first suffix |
3530 | +- // needaffix on prefix or first suffix |
3531 | - (cclass || |
3532 | -- !(se->getCont() && TESTAFF(se->getCont(), pseudoroot, se->getContLen())) || |
3533 | +- !(se->getCont() && TESTAFF(se->getCont(), needaffix, se->getContLen())) || |
3534 | - (ppfx && !((ep->getCont()) && |
3535 | -- TESTAFF(ep->getCont(), pseudoroot, |
3536 | +- TESTAFF(ep->getCont(), needaffix, |
3537 | - ep->getContLen()))) |
3538 | - ) |
3539 | - )) |
3540 | - rv = se->checkword(word,len, sfxopts, ppfx, NULL, 0, 0, cclass, needflag); |
3541 | - while (rv) { |
3542 | - if (ppfx) { |
3543 | -- if (((PfxEntry *) ppfx)->getMorph()) strcat(result, ((PfxEntry *) ppfx)->getMorph()); |
3544 | -- } |
3545 | -- if (complexprefixes && rv->description) strcat(result, rv->description); |
3546 | -- if (rv->description && ((!rv->astr) || |
3547 | -- !TESTAFF(rv->astr, lemma_present, rv->alen))) |
3548 | -- strcat(result, &(rv->word)); |
3549 | -- if (!complexprefixes && rv->description) strcat(result, rv->description); |
3550 | -- if (se->getMorph()) strcat(result, se->getMorph()); |
3551 | -- strcat(result, "\n"); |
3552 | +- if (((PfxEntry *) ppfx)->getMorph()) { |
3553 | +- mystrcat(result, ((PfxEntry *) ppfx)->getMorph(), MAXLNLEN); |
3554 | +- mystrcat(result, " ", MAXLNLEN); |
3555 | +- } else debugflag(result, ((PfxEntry *) ppfx)->getFlag()); |
3556 | +- } |
3557 | +- if (complexprefixes && HENTRY_DATA(rv)) mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); |
3558 | +- if (! HENTRY_FIND(rv, MORPH_STEM)) { |
3559 | +- mystrcat(result, " ", MAXLNLEN); |
3560 | +- mystrcat(result, MORPH_STEM, MAXLNLEN); |
3561 | +- mystrcat(result, HENTRY_WORD(rv), MAXLNLEN); |
3562 | +- } |
3563 | +- // store the pointer of the hash entry |
3564 | +-// sprintf(result + strlen(result), " %s%p", MORPH_HENTRY, rv); |
3565 | +- |
3566 | +- if (!complexprefixes && HENTRY_DATA(rv)) { |
3567 | +- mystrcat(result, " ", MAXLNLEN); |
3568 | +- mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); |
3569 | +- } |
3570 | +- if (se->getMorph()) { |
3571 | +- mystrcat(result, " ", MAXLNLEN); |
3572 | +- mystrcat(result, se->getMorph(), MAXLNLEN); |
3573 | +- } else debugflag(result, se->getFlag()); |
3574 | +- mystrcat(result, "\n", MAXLNLEN); |
3575 | - rv = se->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag); |
3576 | - } |
3577 | - } |
3578 | @@ -21587,30 +21741,36 @@ |
3579 | - // fogemorpheme |
3580 | - (in_compound || |
3581 | - !((sptr->getCont() && (TESTAFF(sptr->getCont(), onlyincompound, sptr->getContLen()))))) && |
3582 | -- // pseudoroot on first suffix |
3583 | +- // needaffix on first suffix |
3584 | - (cclass || !(sptr->getCont() && |
3585 | -- TESTAFF(sptr->getCont(), pseudoroot, sptr->getContLen()))) |
3586 | +- TESTAFF(sptr->getCont(), needaffix, sptr->getContLen()))) |
3587 | - )) rv = sptr->checkword(word,len, sfxopts, ppfx, NULL, 0, 0, cclass, needflag); |
3588 | - while (rv) { |
3589 | - if (ppfx) { |
3590 | -- if (((PfxEntry *) ppfx)->getMorph()) strcat(result, ((PfxEntry *) ppfx)->getMorph()); |
3591 | +- if (((PfxEntry *) ppfx)->getMorph()) { |
3592 | +- mystrcat(result, ((PfxEntry *) ppfx)->getMorph(), MAXLNLEN); |
3593 | +- mystrcat(result, " ", MAXLNLEN); |
3594 | +- } else debugflag(result, ((PfxEntry *) ppfx)->getFlag()); |
3595 | - } |
3596 | -- if (complexprefixes && rv->description) strcat(result, rv->description); |
3597 | -- if (rv->description && ((!rv->astr) || |
3598 | -- !TESTAFF(rv->astr, lemma_present, rv->alen))) strcat(result, &(rv->word)); |
3599 | -- if (!complexprefixes && rv->description) strcat(result, rv->description); |
3600 | --#ifdef DEBUG |
3601 | -- unsigned short flag = sptr->getFlag(); |
3602 | -- if (flag_mode == FLAG_NUM) { |
3603 | -- sprintf(result, "<%d>", sptr->getKey()); |
3604 | -- } else if (flag_mode == FLAG_LONG) { |
3605 | -- sprintf(result, "<%c%c>", flag >> 8, (flag << 8) >>8); |
3606 | -- } else sprintf(result, "<%c>", flag); |
3607 | -- strcat(result, ":"); |
3608 | --#endif |
3609 | -- |
3610 | -- if (sptr->getMorph()) strcat(result, sptr->getMorph()); |
3611 | -- strcat(result, "\n"); |
3612 | +- if (complexprefixes && HENTRY_DATA(rv)) mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); |
3613 | +- if (! HENTRY_FIND(rv, MORPH_STEM)) { |
3614 | +- mystrcat(result, " ", MAXLNLEN); |
3615 | +- mystrcat(result, MORPH_STEM, MAXLNLEN); |
3616 | +- mystrcat(result, HENTRY_WORD(rv), MAXLNLEN); |
3617 | +- } |
3618 | +- // store the pointer of the hash entry |
3619 | +-// sprintf(result + strlen(result), " %s%p", MORPH_HENTRY, rv); |
3620 | +- |
3621 | +- if (!complexprefixes && HENTRY_DATA(rv)) { |
3622 | +- mystrcat(result, " ", MAXLNLEN); |
3623 | +- mystrcat(result, HENTRY_DATA2(rv), MAXLNLEN); |
3624 | +- } |
3625 | +- |
3626 | +- if (sptr->getMorph()) { |
3627 | +- mystrcat(result, " ", MAXLNLEN); |
3628 | +- mystrcat(result, sptr->getMorph(), MAXLNLEN); |
3629 | +- } else debugflag(result, sptr->getFlag()); |
3630 | +- mystrcat(result, "\n", MAXLNLEN); |
3631 | - rv = sptr->get_next_homonym(rv, sfxopts, ppfx, cclass, needflag); |
3632 | - } |
3633 | - sptr = sptr->getNextEQ(); |
3634 | @@ -21622,15 +21782,11 @@ |
3635 | - if (*result) return mystrdup(result); |
3636 | - return NULL; |
3637 | -} |
3638 | --#endif // END OF HUNSPELL_EXPERIMENTAL CODE |
3639 | -- |
3640 | - |
3641 | -// check if word with affixes is correctly spelled |
3642 | -struct hentry * AffixMgr::affix_check (const char * word, int len, const FLAG needflag, char in_compound) |
3643 | -{ |
3644 | - struct hentry * rv= NULL; |
3645 | -- if (derived) free(derived); |
3646 | -- derived = NULL; |
3647 | - |
3648 | - // check all prefixes (also crossed with suffixes if allowed) |
3649 | - rv = prefix_check(word, len, in_compound, needflag); |
3650 | @@ -21652,7 +21808,6 @@ |
3651 | - return rv; |
3652 | -} |
3653 | - |
3654 | --#ifdef HUNSPELL_EXPERIMENTAL |
3655 | -// check if word with affixes is correctly spelled |
3656 | -char * AffixMgr::affix_check_morph(const char * word, int len, const FLAG needflag, char in_compound) |
3657 | -{ |
3658 | @@ -21664,14 +21819,14 @@ |
3659 | - // check all prefixes (also crossed with suffixes if allowed) |
3660 | - st = prefix_check_morph(word, len, in_compound); |
3661 | - if (st) { |
3662 | -- strcat(result, st); |
3663 | +- mystrcat(result, st, MAXLNLEN); |
3664 | - free(st); |
3665 | - } |
3666 | - |
3667 | - // if still not found check all suffixes |
3668 | - st = suffix_check_morph(word, len, 0, NULL, '\0', needflag, in_compound); |
3669 | - if (st) { |
3670 | -- strcat(result, st); |
3671 | +- mystrcat(result, st, MAXLNLEN); |
3672 | - free(st); |
3673 | - } |
3674 | - |
3675 | @@ -21681,41 +21836,119 @@ |
3676 | - // if still not found check all two-level suffixes |
3677 | - st = suffix_check_twosfx_morph(word, len, 0, NULL, needflag); |
3678 | - if (st) { |
3679 | -- strcat(result, st); |
3680 | +- mystrcat(result, st, MAXLNLEN); |
3681 | - free(st); |
3682 | - } |
3683 | - |
3684 | - // if still not found check all two-level suffixes |
3685 | - st = prefix_check_twosfx_morph(word, len, IN_CPD_NOT, needflag); |
3686 | - if (st) { |
3687 | -- strcat(result, st); |
3688 | +- mystrcat(result, st, MAXLNLEN); |
3689 | - free(st); |
3690 | - } |
3691 | - } |
3692 | -- |
3693 | +- |
3694 | - return mystrdup(result); |
3695 | -} |
3696 | --#endif // END OF HUNSPELL_EXPERIMENTAL CODE |
3697 | +- |
3698 | +-char * AffixMgr::morphgen(char * ts, int wl, const unsigned short * ap, |
3699 | +- unsigned short al, char * morph, char * targetmorph, int level) |
3700 | +-{ |
3701 | +- // handle suffixes |
3702 | +- char * stemmorph; |
3703 | +- char * stemmorphcatpos; |
3704 | +- char mymorph[MAXLNLEN]; |
3705 | +- |
3706 | +- if (!morph && !targetmorph) return NULL; |
3707 | +- |
3708 | +- // check substandard flag |
3709 | +- if (TESTAFF(ap, substandard, al)) return NULL; |
3710 | +- |
3711 | +- if (morphcmp(morph, targetmorph) == 0) return mystrdup(ts); |
3712 | +- |
3713 | +-// int targetcount = get_sfxcount(targetmorph); |
3714 | +- |
3715 | +- // use input suffix fields, if exist |
3716 | +- if (strstr(morph, MORPH_INFL_SFX) || strstr(morph, MORPH_DERI_SFX)) { |
3717 | +- stemmorph = mymorph; |
3718 | +- strcpy(stemmorph, morph); |
3719 | +- strcat(stemmorph, " "); |
3720 | +- stemmorphcatpos = stemmorph + strlen(stemmorph); |
3721 | +- } else { |
3722 | +- stemmorph = morph; |
3723 | +- stemmorphcatpos = NULL; |
3724 | +- } |
3725 | +- |
3726 | +- for (int i = 0; i < al; i++) { |
3727 | +- const unsigned char c = (unsigned char) (ap[i] & 0x00FF); |
3728 | +- SfxEntry * sptr = (SfxEntry *)sFlag[c]; |
3729 | +- while (sptr) { |
3730 | +- if (sptr->getFlag() == ap[i] && sptr->getMorph() && ((sptr->getContLen() == 0) || |
3731 | +- // don't generate forms with substandard affixes |
3732 | +- !TESTAFF(sptr->getCont(), substandard, sptr->getContLen()))) { |
3733 | +- |
3734 | +- if (stemmorphcatpos) strcpy(stemmorphcatpos, sptr->getMorph()); |
3735 | +- else stemmorph = (char *) sptr->getMorph(); |
3736 | +- |
3737 | +- int cmp = morphcmp(stemmorph, targetmorph); |
3738 | +- |
3739 | +- if (cmp == 0) { |
3740 | +- char * newword = sptr->add(ts, wl); |
3741 | +- if (newword) { |
3742 | +- hentry * check = pHMgr->lookup(newword); // XXX extra dic |
3743 | +- if (!check || !check->astr || |
3744 | +- !TESTAFF(check->astr, forbiddenword, check->alen)) { |
3745 | +- return newword; |
3746 | +- } |
3747 | +- free(newword); |
3748 | +- } |
3749 | +- } |
3750 | +- |
3751 | +- // recursive call for secondary suffixes |
3752 | +- if ((level == 0) && (cmp == 1) && (sptr->getContLen() > 0) && |
3753 | +-// (get_sfxcount(stemmorph) < targetcount) && |
3754 | +- !TESTAFF(sptr->getCont(), substandard, sptr->getContLen())) { |
3755 | +- char * newword = sptr->add(ts, wl); |
3756 | +- if (newword) { |
3757 | +- char * newword2 = morphgen(newword, strlen(newword), sptr->getCont(), |
3758 | +- sptr->getContLen(), stemmorph, targetmorph, 1); |
3759 | +- |
3760 | +- if (newword2) { |
3761 | +- free(newword); |
3762 | +- return newword2; |
3763 | +- } |
3764 | +- free(newword); |
3765 | +- newword = NULL; |
3766 | +- } |
3767 | +- } |
3768 | +- } |
3769 | +- sptr = (SfxEntry *)sptr ->getFlgNxt(); |
3770 | +- } |
3771 | +- } |
3772 | +- return NULL; |
3773 | +-} |
3774 | - |
3775 | - |
3776 | -int AffixMgr::expand_rootword(struct guessword * wlst, int maxn, const char * ts, |
3777 | - int wl, const unsigned short * ap, unsigned short al, char * bad, int badl, |
3778 | -- char * phone) |
3779 | +- char * phon) |
3780 | -{ |
3781 | -- |
3782 | - int nh=0; |
3783 | - // first add root word to list |
3784 | -- if ((nh < maxn) && !(al && ((pseudoroot && TESTAFF(ap, pseudoroot, al)) || |
3785 | +- if ((nh < maxn) && !(al && ((needaffix && TESTAFF(ap, needaffix, al)) || |
3786 | - (onlyincompound && TESTAFF(ap, onlyincompound, al))))) { |
3787 | - wlst[nh].word = mystrdup(ts); |
3788 | +- if (!wlst[nh].word) return 0; |
3789 | - wlst[nh].allow = (1 == 0); |
3790 | - wlst[nh].orig = NULL; |
3791 | - nh++; |
3792 | - // add special phonetic version |
3793 | -- if (phone && (nh < maxn)) { |
3794 | -- wlst[nh].word = mystrdup(phone); |
3795 | +- if (phon && (nh < maxn)) { |
3796 | +- wlst[nh].word = mystrdup(phon); |
3797 | +- if (!wlst[nh].word) return nh - 1; |
3798 | - wlst[nh].allow = (1 == 0); |
3799 | - wlst[nh].orig = mystrdup(ts); |
3800 | +- if (!wlst[nh].orig) return nh - 1; |
3801 | - nh++; |
3802 | - } |
3803 | - } |
3804 | @@ -21727,9 +21960,9 @@ |
3805 | - while (sptr) { |
3806 | - if ((sptr->getFlag() == ap[i]) && (!sptr->getKeyLen() || ((badl > sptr->getKeyLen()) && |
3807 | - (strcmp(sptr->getAffix(), bad + badl - sptr->getKeyLen()) == 0))) && |
3808 | -- // check pseudoroot flag |
3809 | -- !(sptr->getCont() && ((pseudoroot && |
3810 | -- TESTAFF(sptr->getCont(), pseudoroot, sptr->getContLen())) || |
3811 | +- // check needaffix flag |
3812 | +- !(sptr->getCont() && ((needaffix && |
3813 | +- TESTAFF(sptr->getCont(), needaffix, sptr->getContLen())) || |
3814 | - (circumfix && |
3815 | - TESTAFF(sptr->getCont(), circumfix, sptr->getContLen())) || |
3816 | - (onlyincompound && |
3817 | @@ -21743,14 +21976,16 @@ |
3818 | - wlst[nh].orig = NULL; |
3819 | - nh++; |
3820 | - // add special phonetic version |
3821 | -- if (phone && (nh < maxn)) { |
3822 | +- if (phon && (nh < maxn)) { |
3823 | - char st[MAXWORDUTF8LEN]; |
3824 | -- strcpy(st, phone); |
3825 | +- strcpy(st, phon); |
3826 | - strcat(st, sptr->getKey()); |
3827 | -- reverseword(st + strlen(phone)); |
3828 | +- reverseword(st + strlen(phon)); |
3829 | - wlst[nh].word = mystrdup(st); |
3830 | +- if (!wlst[nh].word) return nh - 1; |
3831 | - wlst[nh].allow = (1 == 0); |
3832 | - wlst[nh].orig = mystrdup(newword); |
3833 | +- if (!wlst[nh].orig) return nh - 1; |
3834 | - nh++; |
3835 | - } |
3836 | - } else { |
3837 | @@ -21768,7 +22003,7 @@ |
3838 | - for (int j=1;j<n ;j++) |
3839 | - if (wlst[j].allow) { |
3840 | - for (int k = 0; k < al; k++) { |
3841 | -- const unsigned char c = (unsigned char) (ap[k] & 0x00FF); |
3842 | +- const unsigned char c = (unsigned char) (ap[k] & 0x00FF); |
3843 | - PfxEntry * cptr = (PfxEntry *) pFlag[c]; |
3844 | - while (cptr) { |
3845 | - if ((cptr->getFlag() == ap[k]) && cptr->allowCross() && (!cptr->getKeyLen() || ((badl > cptr->getKeyLen()) && |
3846 | @@ -21779,7 +22014,7 @@ |
3847 | - if (nh < maxn) { |
3848 | - wlst[nh].word = newword; |
3849 | - wlst[nh].allow = cptr->allowCross(); |
3850 | -- wlst[nh].orig = NULL; |
3851 | +- wlst[nh].orig = NULL; |
3852 | - nh++; |
3853 | - } else { |
3854 | - free(newword); |
3855 | @@ -21799,9 +22034,9 @@ |
3856 | - while (ptr) { |
3857 | - if ((ptr->getFlag() == ap[m]) && (!ptr->getKeyLen() || ((badl > ptr->getKeyLen()) && |
3858 | - (strncmp(ptr->getKey(), bad, ptr->getKeyLen()) == 0))) && |
3859 | -- // check pseudoroot flag |
3860 | -- !(ptr->getCont() && ((pseudoroot && |
3861 | -- TESTAFF(ptr->getCont(), pseudoroot, ptr->getContLen())) || |
3862 | +- // check needaffix flag |
3863 | +- !(ptr->getCont() && ((needaffix && |
3864 | +- TESTAFF(ptr->getCont(), needaffix, ptr->getContLen())) || |
3865 | - (circumfix && |
3866 | - TESTAFF(ptr->getCont(), circumfix, ptr->getContLen())) || |
3867 | - (onlyincompound && |
3868 | @@ -21826,8 +22061,6 @@ |
3869 | - return nh; |
3870 | -} |
3871 | - |
3872 | -- |
3873 | -- |
3874 | -// return length of replacing table |
3875 | -int AffixMgr::get_numrep() |
3876 | -{ |
3877 | @@ -21841,6 +22074,20 @@ |
3878 | - return reptable; |
3879 | -} |
3880 | - |
3881 | +-// return iconv table |
3882 | +-RepList * AffixMgr::get_iconvtable() |
3883 | +-{ |
3884 | +- if (! iconvtable ) return NULL; |
3885 | +- return iconvtable; |
3886 | +-} |
3887 | +- |
3888 | +-// return oconv table |
3889 | +-RepList * AffixMgr::get_oconvtable() |
3890 | +-{ |
3891 | +- if (! oconvtable ) return NULL; |
3892 | +- return oconvtable; |
3893 | +-} |
3894 | +- |
3895 | -// return replacing table |
3896 | -struct phonetable * AffixMgr::get_phonetable() |
3897 | -{ |
3898 | @@ -21877,9 +22124,7 @@ |
3899 | -// return text encoding of dictionary |
3900 | -char * AffixMgr::get_encoding() |
3901 | -{ |
3902 | -- if (! encoding ) { |
3903 | -- encoding = mystrdup("ISO8859-1"); |
3904 | -- } |
3905 | +- if (! encoding ) encoding = mystrdup(SPELL_ENCODING); |
3906 | - return mystrdup(encoding); |
3907 | -} |
3908 | - |
3909 | @@ -21895,6 +22140,12 @@ |
3910 | - return complexprefixes; |
3911 | -} |
3912 | - |
3913 | +-// return FULLSTRIP option |
3914 | +-int AffixMgr::get_fullstrip() |
3915 | +-{ |
3916 | +- return fullstrip; |
3917 | +-} |
3918 | +- |
3919 | -FLAG AffixMgr::get_keepcase() |
3920 | -{ |
3921 | - return keepcase; |
3922 | @@ -21905,6 +22156,12 @@ |
3923 | - return checksharps; |
3924 | -} |
3925 | - |
3926 | +-char * AffixMgr::encode_flag(unsigned short aflag) |
3927 | +-{ |
3928 | +- return pHMgr->encode_flag(aflag); |
3929 | +-} |
3930 | +- |
3931 | +- |
3932 | -// return the preferred ignore string for suggestions |
3933 | -char * AffixMgr::get_ignore() |
3934 | -{ |
3935 | @@ -21922,7 +22179,7 @@ |
3936 | -// return the keyboard string for suggestions |
3937 | -char * AffixMgr::get_key_string() |
3938 | -{ |
3939 | -- if (! keystring ) return NULL; |
3940 | +- if (! keystring ) keystring = mystrdup(SPELL_KEYSTRING); |
3941 | - return mystrdup(keystring); |
3942 | -} |
3943 | - |
3944 | @@ -21970,9 +22227,9 @@ |
3945 | -} |
3946 | - |
3947 | -// return the forbidden words flag modify flag |
3948 | --FLAG AffixMgr::get_pseudoroot() |
3949 | +-FLAG AffixMgr::get_needaffix() |
3950 | -{ |
3951 | -- return pseudoroot; |
3952 | +- return needaffix; |
3953 | -} |
3954 | - |
3955 | -// return the onlyincompound flag |
3956 | @@ -22012,12 +22269,6 @@ |
3957 | - return sfxappnd; |
3958 | -} |
3959 | - |
3960 | --// return the value of derived form (base word with first suffix). |
3961 | --const char * AffixMgr::get_derived() |
3962 | --{ |
3963 | -- return derived; |
3964 | --} |
3965 | -- |
3966 | -// return the value of suffix |
3967 | -const char * AffixMgr::get_version() |
3968 | -{ |
3969 | @@ -22033,8 +22284,12 @@ |
3970 | -// utility method to look up root words in hash table |
3971 | -struct hentry * AffixMgr::lookup(const char * word) |
3972 | -{ |
3973 | -- if (! pHMgr) return NULL; |
3974 | -- return pHMgr->lookup(word); |
3975 | +- int i; |
3976 | +- struct hentry * he = NULL; |
3977 | +- for (i = 0; i < *maxdic && !he; i++) { |
3978 | +- he = (alldic[i])->lookup(word); |
3979 | +- } |
3980 | +- return he; |
3981 | -} |
3982 | - |
3983 | -// return the value of suffix |
3984 | @@ -22068,33 +22323,33 @@ |
3985 | -} |
3986 | - |
3987 | -/* parse flag */ |
3988 | --int AffixMgr::parse_flag(char * line, unsigned short * out, const char * name) { |
3989 | +-int AffixMgr::parse_flag(char * line, unsigned short * out, FileMgr * af) { |
3990 | - char * s = NULL; |
3991 | -- if (*out != FLAG_NULL) { |
3992 | -- HUNSPELL_WARNING(stderr, "error: duplicate %s line\n", name); |
3993 | +- if (*out != FLAG_NULL && !(*out >= DEFAULTFLAGS)) { |
3994 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix file parameter\n", af->getlinenum()); |
3995 | - return 1; |
3996 | - } |
3997 | -- if (parse_string(line, &s, name)) return 1; |
3998 | +- if (parse_string(line, &s, af->getlinenum())) return 1; |
3999 | - *out = pHMgr->decode_flag(s); |
4000 | - free(s); |
4001 | - return 0; |
4002 | -} |
4003 | - |
4004 | -/* parse num */ |
4005 | --int AffixMgr::parse_num(char * line, int * out, const char * name) { |
4006 | +-int AffixMgr::parse_num(char * line, int * out, FileMgr * af) { |
4007 | - char * s = NULL; |
4008 | - if (*out != -1) { |
4009 | -- HUNSPELL_WARNING(stderr, "error: duplicate %s line\n", name); |
4010 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix file parameter\n", af->getlinenum()); |
4011 | - return 1; |
4012 | - } |
4013 | -- if (parse_string(line, &s, name)) return 1; |
4014 | +- if (parse_string(line, &s, af->getlinenum())) return 1; |
4015 | - *out = atoi(s); |
4016 | - free(s); |
4017 | - return 0; |
4018 | -} |
4019 | - |
4020 | -/* parse in the max syllablecount of compound words and */ |
4021 | --int AffixMgr::parse_cpdsyllable(char * line) |
4022 | +-int AffixMgr::parse_cpdsyllable(char * line, FileMgr * af) |
4023 | -{ |
4024 | - char * tp = line; |
4025 | - char * piece; |
4026 | @@ -22127,11 +22382,10 @@ |
4027 | - } |
4028 | - i++; |
4029 | - } |
4030 | -- free(piece); |
4031 | - piece = mystrsep(&tp, 0); |
4032 | - } |
4033 | - if (np < 2) { |
4034 | -- HUNSPELL_WARNING(stderr, "error: missing compoundsyllable information\n"); |
4035 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing compoundsyllable information\n", af->getlinenum()); |
4036 | - return 1; |
4037 | - } |
4038 | - if (np == 2) cpdvowels = mystrdup("aeiouAEIOU"); |
4039 | @@ -22139,10 +22393,10 @@ |
4040 | -} |
4041 | - |
4042 | -/* parse in the typical fault correcting table */ |
4043 | --int AffixMgr::parse_reptable(char * line, FILE * af) |
4044 | +-int AffixMgr::parse_reptable(char * line, FileMgr * af) |
4045 | -{ |
4046 | - if (numrep != 0) { |
4047 | -- HUNSPELL_WARNING(stderr, "error: duplicate REP tables used\n"); |
4048 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4049 | - return 1; |
4050 | - } |
4051 | - char * tp = line; |
4052 | @@ -22157,8 +22411,7 @@ |
4053 | - case 1: { |
4054 | - numrep = atoi(piece); |
4055 | - if (numrep < 1) { |
4056 | -- HUNSPELL_WARNING(stderr, "incorrect number of entries in replacement table\n"); |
4057 | -- free(piece); |
4058 | +- HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n", af->getlinenum()); |
4059 | - return 1; |
4060 | - } |
4061 | - reptable = (replentry *) malloc(numrep * sizeof(struct replentry)); |
4062 | @@ -22170,18 +22423,17 @@ |
4063 | - } |
4064 | - i++; |
4065 | - } |
4066 | -- free(piece); |
4067 | - piece = mystrsep(&tp, 0); |
4068 | - } |
4069 | - if (np != 2) { |
4070 | -- HUNSPELL_WARNING(stderr, "error: missing replacement table information\n"); |
4071 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4072 | - return 1; |
4073 | - } |
4074 | - |
4075 | - /* now parse the numrep lines to read in the remainder of the table */ |
4076 | -- char * nl = line; |
4077 | +- char * nl; |
4078 | - for (int j=0; j < numrep; j++) { |
4079 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4080 | +- if (!(nl = af->getline())) return 1; |
4081 | - mychomp(nl); |
4082 | - tp = nl; |
4083 | - i = 0; |
4084 | @@ -22193,9 +22445,8 @@ |
4085 | - switch(i) { |
4086 | - case 0: { |
4087 | - if (strncmp(piece,"REP",3) != 0) { |
4088 | -- HUNSPELL_WARNING(stderr, "error: replacement table is corrupt\n"); |
4089 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4090 | - numrep = 0; |
4091 | -- free(piece); |
4092 | - return 1; |
4093 | - } |
4094 | - break; |
4095 | @@ -22206,11 +22457,10 @@ |
4096 | - } |
4097 | - i++; |
4098 | - } |
4099 | -- free(piece); |
4100 | - piece = mystrsep(&tp, 0); |
4101 | - } |
4102 | - if ((!(reptable[j].pattern)) || (!(reptable[j].pattern2))) { |
4103 | -- HUNSPELL_WARNING(stderr, "error: replacement table is corrupt\n"); |
4104 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4105 | - numrep = 0; |
4106 | - return 1; |
4107 | - } |
4108 | @@ -22219,10 +22469,92 @@ |
4109 | -} |
4110 | - |
4111 | -/* parse in the typical fault correcting table */ |
4112 | --int AffixMgr::parse_phonetable(char * line, FILE * af) |
4113 | +-int AffixMgr::parse_convtable(char * line, FileMgr * af, RepList ** rl, const char * keyword) |
4114 | +-{ |
4115 | +- if (*rl) { |
4116 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4117 | +- return 1; |
4118 | +- } |
4119 | +- char * tp = line; |
4120 | +- char * piece; |
4121 | +- int i = 0; |
4122 | +- int np = 0; |
4123 | +- int numrl = 0; |
4124 | +- piece = mystrsep(&tp, 0); |
4125 | +- while (piece) { |
4126 | +- if (*piece != '\0') { |
4127 | +- switch(i) { |
4128 | +- case 0: { np++; break; } |
4129 | +- case 1: { |
4130 | +- numrl = atoi(piece); |
4131 | +- if (numrl < 1) { |
4132 | +- HUNSPELL_WARNING(stderr, "error: line %d: incorrect entry number\n", af->getlinenum()); |
4133 | +- return 1; |
4134 | +- } |
4135 | +- *rl = new RepList(numrl); |
4136 | +- if (!rl) return 1; |
4137 | +- np++; |
4138 | +- break; |
4139 | +- } |
4140 | +- default: break; |
4141 | +- } |
4142 | +- i++; |
4143 | +- } |
4144 | +- piece = mystrsep(&tp, 0); |
4145 | +- } |
4146 | +- if (np != 2) { |
4147 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4148 | +- return 1; |
4149 | +- } |
4150 | +- |
4151 | +- /* now parse the num lines to read in the remainder of the table */ |
4152 | +- char * nl; |
4153 | +- for (int j=0; j < numrl; j++) { |
4154 | +- if (!(nl = af->getline())) return 1; |
4155 | +- mychomp(nl); |
4156 | +- tp = nl; |
4157 | +- i = 0; |
4158 | +- char * pattern = NULL; |
4159 | +- char * pattern2 = NULL; |
4160 | +- piece = mystrsep(&tp, 0); |
4161 | +- while (piece) { |
4162 | +- if (*piece != '\0') { |
4163 | +- switch(i) { |
4164 | +- case 0: { |
4165 | +- if (strncmp(piece, keyword, sizeof(keyword)) != 0) { |
4166 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4167 | +- delete *rl; |
4168 | +- *rl = NULL; |
4169 | +- return 1; |
4170 | +- } |
4171 | +- break; |
4172 | +- } |
4173 | +- case 1: { pattern = mystrrep(mystrdup(piece),"_"," "); break; } |
4174 | +- case 2: { |
4175 | +- pattern2 = mystrrep(mystrdup(piece),"_"," "); |
4176 | +- break; |
4177 | +- } |
4178 | +- default: break; |
4179 | +- } |
4180 | +- i++; |
4181 | +- } |
4182 | +- piece = mystrsep(&tp, 0); |
4183 | +- } |
4184 | +- if (!pattern || !pattern2) { |
4185 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4186 | +- return 1; |
4187 | +- } |
4188 | +- (*rl)->add(pattern, pattern2); |
4189 | +- } |
4190 | +- return 0; |
4191 | +-} |
4192 | +- |
4193 | +- |
4194 | +-/* parse in the typical fault correcting table */ |
4195 | +-int AffixMgr::parse_phonetable(char * line, FileMgr * af) |
4196 | -{ |
4197 | - if (phone) { |
4198 | -- HUNSPELL_WARNING(stderr, "error: duplicate PHONE tables used\n"); |
4199 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4200 | - return 1; |
4201 | - } |
4202 | - char * tp = line; |
4203 | @@ -22235,14 +22567,13 @@ |
4204 | - switch(i) { |
4205 | - case 0: { np++; break; } |
4206 | - case 1: { |
4207 | -- phone = (phonetable *) malloc(sizeof(struct phonetable)); |
4208 | -- phone->num = atoi(piece); |
4209 | -- phone->rules = NULL; |
4210 | -- phone->utf8 = utf8; |
4211 | +- phone = (phonetable *) malloc(sizeof(struct phonetable)); |
4212 | +- phone->num = atoi(piece); |
4213 | +- phone->rules = NULL; |
4214 | +- phone->utf8 = (char) utf8; |
4215 | - if (!phone) return 1; |
4216 | - if (phone->num < 1) { |
4217 | -- HUNSPELL_WARNING(stderr, "incorrect number of entries in phonelacement table\n"); |
4218 | -- free(piece); |
4219 | +- HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); |
4220 | - return 1; |
4221 | - } |
4222 | - phone->rules = (char * *) malloc(2 * (phone->num + 1) * sizeof(char *)); |
4223 | @@ -22254,18 +22585,17 @@ |
4224 | - } |
4225 | - i++; |
4226 | - } |
4227 | -- free(piece); |
4228 | - piece = mystrsep(&tp, 0); |
4229 | - } |
4230 | - if (np != 2) { |
4231 | -- HUNSPELL_WARNING(stderr, "error: missing PHONE table information\n"); |
4232 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4233 | - return 1; |
4234 | - } |
4235 | - |
4236 | - /* now parse the phone->num lines to read in the remainder of the table */ |
4237 | -- char * nl = line; |
4238 | +- char * nl; |
4239 | - for (int j=0; j < phone->num; j++) { |
4240 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4241 | +- if (!(nl = af->getline())) return 1; |
4242 | - mychomp(nl); |
4243 | - tp = nl; |
4244 | - i = 0; |
4245 | @@ -22277,9 +22607,8 @@ |
4246 | - switch(i) { |
4247 | - case 0: { |
4248 | - if (strncmp(piece,"PHONE",5) != 0) { |
4249 | -- HUNSPELL_WARNING(stderr, "error: PHONE table is corrupt\n"); |
4250 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4251 | - phone->num = 0; |
4252 | -- free(piece); |
4253 | - return 1; |
4254 | - } |
4255 | - break; |
4256 | @@ -22290,11 +22619,10 @@ |
4257 | - } |
4258 | - i++; |
4259 | - } |
4260 | -- free(piece); |
4261 | - piece = mystrsep(&tp, 0); |
4262 | - } |
4263 | - if ((!(phone->rules[j * 2])) || (!(phone->rules[j * 2 + 1]))) { |
4264 | -- HUNSPELL_WARNING(stderr, "error: PHONE table is corrupt\n"); |
4265 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4266 | - phone->num = 0; |
4267 | - return 1; |
4268 | - } |
4269 | @@ -22306,10 +22634,10 @@ |
4270 | -} |
4271 | - |
4272 | -/* parse in the checkcompoundpattern table */ |
4273 | --int AffixMgr::parse_checkcpdtable(char * line, FILE * af) |
4274 | +-int AffixMgr::parse_checkcpdtable(char * line, FileMgr * af) |
4275 | -{ |
4276 | - if (numcheckcpd != 0) { |
4277 | -- HUNSPELL_WARNING(stderr, "error: duplicate compound pattern tables used\n"); |
4278 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4279 | - return 1; |
4280 | - } |
4281 | - char * tp = line; |
4282 | @@ -22324,11 +22652,10 @@ |
4283 | - case 1: { |
4284 | - numcheckcpd = atoi(piece); |
4285 | - if (numcheckcpd < 1) { |
4286 | -- HUNSPELL_WARNING(stderr, "incorrect number of entries in compound pattern table\n"); |
4287 | -- free(piece); |
4288 | +- HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); |
4289 | - return 1; |
4290 | - } |
4291 | -- checkcpdtable = (replentry *) malloc(numcheckcpd * sizeof(struct replentry)); |
4292 | +- checkcpdtable = (patentry *) malloc(numcheckcpd * sizeof(struct patentry)); |
4293 | - if (!checkcpdtable) return 1; |
4294 | - np++; |
4295 | - break; |
4296 | @@ -22337,59 +22664,75 @@ |
4297 | - } |
4298 | - i++; |
4299 | - } |
4300 | -- free(piece); |
4301 | - piece = mystrsep(&tp, 0); |
4302 | - } |
4303 | - if (np != 2) { |
4304 | -- HUNSPELL_WARNING(stderr, "error: missing compound pattern table information\n"); |
4305 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4306 | - return 1; |
4307 | -- } |
4308 | -- |
4309 | +- } |
4310 | +- |
4311 | - /* now parse the numcheckcpd lines to read in the remainder of the table */ |
4312 | -- char * nl = line; |
4313 | +- char * nl; |
4314 | - for (int j=0; j < numcheckcpd; j++) { |
4315 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4316 | +- if (!(nl = af->getline())) return 1; |
4317 | - mychomp(nl); |
4318 | - tp = nl; |
4319 | - i = 0; |
4320 | - checkcpdtable[j].pattern = NULL; |
4321 | - checkcpdtable[j].pattern2 = NULL; |
4322 | +- checkcpdtable[j].pattern3 = NULL; |
4323 | +- checkcpdtable[j].cond = FLAG_NULL; |
4324 | +- checkcpdtable[j].cond2 = FLAG_NULL; |
4325 | - piece = mystrsep(&tp, 0); |
4326 | - while (piece) { |
4327 | - if (*piece != '\0') { |
4328 | - switch(i) { |
4329 | - case 0: { |
4330 | - if (strncmp(piece,"CHECKCOMPOUNDPATTERN",20) != 0) { |
4331 | -- HUNSPELL_WARNING(stderr, "error: compound pattern table is corrupt\n"); |
4332 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4333 | - numcheckcpd = 0; |
4334 | -- free(piece); |
4335 | - return 1; |
4336 | - } |
4337 | - break; |
4338 | - } |
4339 | -- case 1: { checkcpdtable[j].pattern = mystrdup(piece); break; } |
4340 | -- case 2: { checkcpdtable[j].pattern2 = mystrdup(piece); break; } |
4341 | +- case 1: { |
4342 | +- checkcpdtable[j].pattern = mystrdup(piece); |
4343 | +- char * p = strchr(checkcpdtable[j].pattern, '/'); |
4344 | +- if (p) { |
4345 | +- *p = '\0'; |
4346 | +- checkcpdtable[j].cond = pHMgr->decode_flag(p + 1); |
4347 | +- } |
4348 | +- break; } |
4349 | +- case 2: { |
4350 | +- checkcpdtable[j].pattern2 = mystrdup(piece); |
4351 | +- char * p = strchr(checkcpdtable[j].pattern2, '/'); |
4352 | +- if (p) { |
4353 | +- *p = '\0'; |
4354 | +- checkcpdtable[j].cond2 = pHMgr->decode_flag(p + 1); |
4355 | +- } |
4356 | +- break; |
4357 | +- } |
4358 | +- case 3: { checkcpdtable[j].pattern3 = mystrdup(piece); simplifiedcpd = 1; break; } |
4359 | - default: break; |
4360 | - } |
4361 | - i++; |
4362 | - } |
4363 | -- free(piece); |
4364 | - piece = mystrsep(&tp, 0); |
4365 | - } |
4366 | - if ((!(checkcpdtable[j].pattern)) || (!(checkcpdtable[j].pattern2))) { |
4367 | -- HUNSPELL_WARNING(stderr, "error: compound pattern table is corrupt\n"); |
4368 | -- numcheckcpd = 0; |
4369 | -- return 1; |
4370 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4371 | +- numcheckcpd = 0; |
4372 | +- return 1; |
4373 | - } |
4374 | - } |
4375 | - return 0; |
4376 | -} |
4377 | - |
4378 | -/* parse in the compound rule table */ |
4379 | --int AffixMgr::parse_defcpdtable(char * line, FILE * af) |
4380 | +-int AffixMgr::parse_defcpdtable(char * line, FileMgr * af) |
4381 | -{ |
4382 | - if (numdefcpd != 0) { |
4383 | -- HUNSPELL_WARNING(stderr, "error: duplicate compound rule tables used\n"); |
4384 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4385 | - return 1; |
4386 | - } |
4387 | - char * tp = line; |
4388 | @@ -22404,8 +22747,7 @@ |
4389 | - case 1: { |
4390 | - numdefcpd = atoi(piece); |
4391 | - if (numdefcpd < 1) { |
4392 | -- HUNSPELL_WARNING(stderr, "incorrect number of entries in compound rule table\n"); |
4393 | -- free(piece); |
4394 | +- HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); |
4395 | - return 1; |
4396 | - } |
4397 | - defcpdtable = (flagentry *) malloc(numdefcpd * sizeof(flagentry)); |
4398 | @@ -22417,18 +22759,17 @@ |
4399 | - } |
4400 | - i++; |
4401 | - } |
4402 | -- free(piece); |
4403 | - piece = mystrsep(&tp, 0); |
4404 | - } |
4405 | - if (np != 2) { |
4406 | -- HUNSPELL_WARNING(stderr, "error: missing compound rule table information\n"); |
4407 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4408 | - return 1; |
4409 | - } |
4410 | - |
4411 | - /* now parse the numdefcpd lines to read in the remainder of the table */ |
4412 | -- char * nl = line; |
4413 | +- char * nl; |
4414 | - for (int j=0; j < numdefcpd; j++) { |
4415 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4416 | +- if (!(nl = af->getline())) return 1; |
4417 | - mychomp(nl); |
4418 | - tp = nl; |
4419 | - i = 0; |
4420 | @@ -22439,27 +22780,45 @@ |
4421 | - switch(i) { |
4422 | - case 0: { |
4423 | - if (strncmp(piece, "COMPOUNDRULE", 12) != 0) { |
4424 | -- HUNSPELL_WARNING(stderr, "error: compound rule table is corrupt\n"); |
4425 | -- free(piece); |
4426 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4427 | - numdefcpd = 0; |
4428 | - return 1; |
4429 | - } |
4430 | - break; |
4431 | - } |
4432 | -- case 1: { |
4433 | -- defcpdtable[j].len = |
4434 | -- pHMgr->decode_flags(&(defcpdtable[j].def), piece); |
4435 | +- case 1: { // handle parenthesized flags |
4436 | +- if (strchr(piece, '(')) { |
4437 | +- defcpdtable[j].def = (FLAG *) malloc(sizeof(piece) * sizeof(FLAG)); |
4438 | +- defcpdtable[j].len = 0; |
4439 | +- int end = 0; |
4440 | +- FLAG * conv; |
4441 | +- while (!end) { |
4442 | +- char * par = piece + 1; |
4443 | +- while (*par != '(' && *par != ')' && *par != '\0') par++; |
4444 | +- if (*par == '\0') end = 1; else *par = '\0'; |
4445 | +- if (*piece == '(') piece++; |
4446 | +- if (*piece == '*' || *piece == '?') { |
4447 | +- defcpdtable[j].def[defcpdtable[j].len++] = (FLAG) *piece; |
4448 | +- } else if (*piece != '\0') { |
4449 | +- int l = pHMgr->decode_flags(&conv, piece, af); |
4450 | +- for (int k = 0; k < l; k++) defcpdtable[j].def[defcpdtable[j].len++] = conv[k]; |
4451 | +- free(conv); |
4452 | +- } |
4453 | +- piece = par + 1; |
4454 | +- } |
4455 | +- } else { |
4456 | +- defcpdtable[j].len = pHMgr->decode_flags(&(defcpdtable[j].def), piece, af); |
4457 | +- } |
4458 | - break; |
4459 | - } |
4460 | - default: break; |
4461 | - } |
4462 | - i++; |
4463 | - } |
4464 | -- free(piece); |
4465 | - piece = mystrsep(&tp, 0); |
4466 | - } |
4467 | - if (!defcpdtable[j].len) { |
4468 | -- HUNSPELL_WARNING(stderr, "error: compound rule table is corrupt\n"); |
4469 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4470 | - numdefcpd = 0; |
4471 | - return 1; |
4472 | - } |
4473 | @@ -22469,10 +22828,10 @@ |
4474 | - |
4475 | - |
4476 | -/* parse in the character map table */ |
4477 | --int AffixMgr::parse_maptable(char * line, FILE * af) |
4478 | +-int AffixMgr::parse_maptable(char * line, FileMgr * af) |
4479 | -{ |
4480 | - if (nummap != 0) { |
4481 | -- HUNSPELL_WARNING(stderr, "error: duplicate MAP tables used\n"); |
4482 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4483 | - return 1; |
4484 | - } |
4485 | - char * tp = line; |
4486 | @@ -22487,8 +22846,7 @@ |
4487 | - case 1: { |
4488 | - nummap = atoi(piece); |
4489 | - if (nummap < 1) { |
4490 | -- HUNSPELL_WARNING(stderr, "incorrect number of entries in map table\n"); |
4491 | -- free(piece); |
4492 | +- HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); |
4493 | - return 1; |
4494 | - } |
4495 | - maptable = (mapentry *) malloc(nummap * sizeof(struct mapentry)); |
4496 | @@ -22500,18 +22858,17 @@ |
4497 | - } |
4498 | - i++; |
4499 | - } |
4500 | -- free(piece); |
4501 | - piece = mystrsep(&tp, 0); |
4502 | - } |
4503 | - if (np != 2) { |
4504 | -- HUNSPELL_WARNING(stderr, "error: missing map table information\n"); |
4505 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4506 | - return 1; |
4507 | - } |
4508 | - |
4509 | - /* now parse the nummap lines to read in the remainder of the table */ |
4510 | -- char * nl = line; |
4511 | +- char * nl; |
4512 | - for (int j=0; j < nummap; j++) { |
4513 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4514 | +- if (!(nl = af->getline())) return 1; |
4515 | - mychomp(nl); |
4516 | - tp = nl; |
4517 | - i = 0; |
4518 | @@ -22523,9 +22880,8 @@ |
4519 | - switch(i) { |
4520 | - case 0: { |
4521 | - if (strncmp(piece,"MAP",3) != 0) { |
4522 | -- HUNSPELL_WARNING(stderr, "error: map table is corrupt\n"); |
4523 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4524 | - nummap = 0; |
4525 | -- free(piece); |
4526 | - return 1; |
4527 | - } |
4528 | - break; |
4529 | @@ -22553,11 +22909,10 @@ |
4530 | - } |
4531 | - i++; |
4532 | - } |
4533 | -- free(piece); |
4534 | - piece = mystrsep(&tp, 0); |
4535 | - } |
4536 | - if ((!(maptable[j].set || maptable[j].set_utf16)) || (!(maptable[j].len))) { |
4537 | -- HUNSPELL_WARNING(stderr, "error: map table is corrupt\n"); |
4538 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4539 | - nummap = 0; |
4540 | - return 1; |
4541 | - } |
4542 | @@ -22566,10 +22921,10 @@ |
4543 | -} |
4544 | - |
4545 | -/* parse in the word breakpoint table */ |
4546 | --int AffixMgr::parse_breaktable(char * line, FILE * af) |
4547 | +-int AffixMgr::parse_breaktable(char * line, FileMgr * af) |
4548 | -{ |
4549 | - if (numbreak != 0) { |
4550 | -- HUNSPELL_WARNING(stderr, "error: duplicate word breakpoint tables used\n"); |
4551 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple table definitions\n", af->getlinenum()); |
4552 | - return 1; |
4553 | - } |
4554 | - char * tp = line; |
4555 | @@ -22584,8 +22939,7 @@ |
4556 | - case 1: { |
4557 | - numbreak = atoi(piece); |
4558 | - if (numbreak < 1) { |
4559 | -- HUNSPELL_WARNING(stderr, "incorrect number of entries in BREAK table\n"); |
4560 | -- free(piece); |
4561 | +- HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", af->getlinenum()); |
4562 | - return 1; |
4563 | - } |
4564 | - breaktable = (char **) malloc(numbreak * sizeof(char *)); |
4565 | @@ -22597,18 +22951,17 @@ |
4566 | - } |
4567 | - i++; |
4568 | - } |
4569 | -- free(piece); |
4570 | - piece = mystrsep(&tp, 0); |
4571 | - } |
4572 | - if (np != 2) { |
4573 | -- HUNSPELL_WARNING(stderr, "error: missing word breakpoint table information\n"); |
4574 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4575 | - return 1; |
4576 | - } |
4577 | - |
4578 | - /* now parse the numbreak lines to read in the remainder of the table */ |
4579 | -- char * nl = line; |
4580 | +- char * nl; |
4581 | - for (int j=0; j < numbreak; j++) { |
4582 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4583 | +- if (!(nl = af->getline())) return 1; |
4584 | - mychomp(nl); |
4585 | - tp = nl; |
4586 | - i = 0; |
4587 | @@ -22618,8 +22971,7 @@ |
4588 | - switch(i) { |
4589 | - case 0: { |
4590 | - if (strncmp(piece,"BREAK",5) != 0) { |
4591 | -- HUNSPELL_WARNING(stderr, "error: BREAK table is corrupt\n"); |
4592 | -- free(piece); |
4593 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4594 | - numbreak = 0; |
4595 | - return 1; |
4596 | - } |
4597 | @@ -22633,11 +22985,10 @@ |
4598 | - } |
4599 | - i++; |
4600 | - } |
4601 | -- free(piece); |
4602 | - piece = mystrsep(&tp, 0); |
4603 | - } |
4604 | - if (!breaktable) { |
4605 | -- HUNSPELL_WARNING(stderr, "error: BREAK table is corrupt\n"); |
4606 | +- HUNSPELL_WARNING(stderr, "error: line %d: table is corrupt\n", af->getlinenum()); |
4607 | - numbreak = 0; |
4608 | - return 1; |
4609 | - } |
4610 | @@ -22645,7 +22996,32 @@ |
4611 | - return 0; |
4612 | -} |
4613 | - |
4614 | --int AffixMgr::parse_affix(char * line, const char at, FILE * af, char * dupflags) |
4615 | +-void AffixMgr::reverse_condition(char * piece) { |
4616 | +- int neg = 0; |
4617 | +- for (char * k = piece + strlen(piece) - 1; k >= piece; k--) { |
4618 | +- switch(*k) { |
4619 | +- case '[': { |
4620 | +- if (neg) *(k+1) = '['; else *k = ']'; |
4621 | +- break; |
4622 | +- } |
4623 | +- case ']': { |
4624 | +- *k = '['; |
4625 | +- if (neg) *(k+1) = '^'; |
4626 | +- neg = 0; |
4627 | +- break; |
4628 | +- } |
4629 | +- case '^': { |
4630 | +- if (*(k+1) == ']') neg = 1; else *(k+1) = *k; |
4631 | +- break; |
4632 | +- } |
4633 | +- default: { |
4634 | +- if (neg) *(k+1) = *k; |
4635 | +- } |
4636 | +- } |
4637 | +- } |
4638 | +-} |
4639 | +- |
4640 | +-int AffixMgr::parse_affix(char * line, const char at, FileMgr * af, char * dupflags) |
4641 | -{ |
4642 | - int numents = 0; // number of affentry structures to parse |
4643 | - |
4644 | @@ -22668,6 +23044,7 @@ |
4645 | - // split affix header line into pieces |
4646 | - |
4647 | - int np = 0; |
4648 | +- |
4649 | - piece = mystrsep(&tp, 0); |
4650 | - while (piece) { |
4651 | - if (*piece != '\0') { |
4652 | @@ -22681,10 +23058,11 @@ |
4653 | - aflag = pHMgr->decode_flag(piece); |
4654 | - if (((at == 'S') && (dupflags[aflag] & dupSFX)) || |
4655 | - ((at == 'P') && (dupflags[aflag] & dupPFX))) { |
4656 | -- HUNSPELL_WARNING(stderr, "error: duplicate affix flag %s in line %s\n", piece, nl); |
4657 | +- HUNSPELL_WARNING(stderr, "error: line %d: multiple definitions of an affix flag\n", |
4658 | +- af->getlinenum()); |
4659 | - // return 1; XXX permissive mode for bad dictionaries |
4660 | - } |
4661 | -- dupflags[aflag] += ((at == 'S') ? dupSFX : dupPFX); |
4662 | +- dupflags[aflag] += (char) ((at == 'S') ? dupSFX : dupPFX); |
4663 | - break; |
4664 | - } |
4665 | - // piece 3 - is cross product indicator |
4666 | @@ -22696,9 +23074,11 @@ |
4667 | - numents = atoi(piece); |
4668 | - if (numents == 0) { |
4669 | - char * err = pHMgr->encode_flag(aflag); |
4670 | -- HUNSPELL_WARNING(stderr, "error: affix %s header has incorrect entry count in line %s\n", |
4671 | -- err, nl); |
4672 | -- free(err); |
4673 | +- if (err) { |
4674 | +- HUNSPELL_WARNING(stderr, "error: line %d: bad entry number\n", |
4675 | +- af->getlinenum()); |
4676 | +- free(err); |
4677 | +- } |
4678 | - return 1; |
4679 | - } |
4680 | - ptr = (struct affentry *) malloc(numents * sizeof(struct affentry)); |
4681 | @@ -22706,9 +23086,7 @@ |
4682 | - ptr->opts = ff; |
4683 | - if (utf8) ptr->opts += aeUTF8; |
4684 | - if (pHMgr->is_aliasf()) ptr->opts += aeALIASF; |
4685 | --#ifdef HUNSPELL_EXPERIMENTAL |
4686 | - if (pHMgr->is_aliasm()) ptr->opts += aeALIASM; |
4687 | --#endif |
4688 | - ptr->aflag = aflag; |
4689 | - } |
4690 | - |
4691 | @@ -22716,14 +23094,15 @@ |
4692 | - } |
4693 | - i++; |
4694 | - } |
4695 | -- free(piece); |
4696 | - piece = mystrsep(&tp, 0); |
4697 | - } |
4698 | - // check to make sure we parsed enough pieces |
4699 | - if (np != 4) { |
4700 | -- char * err = pHMgr->encode_flag(aflag); |
4701 | -- HUNSPELL_WARNING(stderr, "error: affix %s header has insufficient data in line %s\n", err, nl); |
4702 | -- free(err); |
4703 | +- char * err = pHMgr->encode_flag(aflag); |
4704 | +- if (err) { |
4705 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing data\n", af->getlinenum()); |
4706 | +- free(err); |
4707 | +- } |
4708 | - free(ptr); |
4709 | - return 1; |
4710 | - } |
4711 | @@ -22733,7 +23112,7 @@ |
4712 | - |
4713 | - // now parse numents affentries for this affix |
4714 | - for (int j=0; j < numents; j++) { |
4715 | -- if (!fgets(nl,MAXLNLEN,af)) return 1; |
4716 | +- if (!(nl = af->getline())) return 1; |
4717 | - mychomp(nl); |
4718 | - tp = nl; |
4719 | - i = 0; |
4720 | @@ -22747,7 +23126,8 @@ |
4721 | - // piece 1 - is type |
4722 | - case 0: { |
4723 | - np++; |
4724 | -- if (nptr != ptr) nptr->opts = ptr->opts; |
4725 | +- if (nptr != ptr) nptr->opts = ptr->opts & |
4726 | +- (char) (aeXPRODUCT + aeUTF8 + aeALIASF + aeALIASM); |
4727 | - break; |
4728 | - } |
4729 | - |
4730 | @@ -22756,10 +23136,11 @@ |
4731 | - np++; |
4732 | - if (pHMgr->decode_flag(piece) != aflag) { |
4733 | - char * err = pHMgr->encode_flag(aflag); |
4734 | -- HUNSPELL_WARNING(stderr, "error: affix %s is corrupt near line %s\n", err, nl); |
4735 | -- HUNSPELL_WARNING(stderr, "error: possible incorrect count\n"); |
4736 | -- free(err); |
4737 | -- free(piece); |
4738 | +- if (err) { |
4739 | +- HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n", |
4740 | +- af->getlinenum(), err); |
4741 | +- free(err); |
4742 | +- } |
4743 | - return 1; |
4744 | - } |
4745 | - |
4746 | @@ -22786,9 +23167,7 @@ |
4747 | - // piece 4 - is affix string or 0 for null |
4748 | - case 3: { |
4749 | - char * dash; |
4750 | --#ifdef HUNSPELL_EXPERIMENTAL |
4751 | - nptr->morphcode = NULL; |
4752 | --#endif |
4753 | - nptr->contclass = NULL; |
4754 | - nptr->contclasslen = 0; |
4755 | - np++; |
4756 | @@ -22803,17 +23182,18 @@ |
4757 | - remove_ignored_chars(piece,ignorechars); |
4758 | - } |
4759 | - } |
4760 | -- |
4761 | +- |
4762 | - if (complexprefixes) { |
4763 | - if (utf8) reverseword_utf(piece); else reverseword(piece); |
4764 | - } |
4765 | - nptr->appnd = mystrdup(piece); |
4766 | -- |
4767 | +- |
4768 | - if (pHMgr->is_aliasf()) { |
4769 | - int index = atoi(dash + 1); |
4770 | -- nptr->contclasslen = (unsigned short) pHMgr->get_aliasf(index, &(nptr->contclass)); |
4771 | +- nptr->contclasslen = (unsigned short) pHMgr->get_aliasf(index, &(nptr->contclass), af); |
4772 | +- if (!nptr->contclasslen) HUNSPELL_WARNING(stderr, "error: bad affix flag alias: \"%s\"\n", dash+1); |
4773 | - } else { |
4774 | -- nptr->contclasslen = (unsigned short) pHMgr->decode_flags(&(nptr->contclass), dash + 1); |
4775 | +- nptr->contclasslen = (unsigned short) pHMgr->decode_flags(&(nptr->contclass), dash + 1, af); |
4776 | - flag_qsort(nptr->contclass, 0, nptr->contclasslen); |
4777 | - } |
4778 | - *dash = '/'; |
4779 | @@ -22834,9 +23214,9 @@ |
4780 | - if (complexprefixes) { |
4781 | - if (utf8) reverseword_utf(piece); else reverseword(piece); |
4782 | - } |
4783 | -- nptr->appnd = mystrdup(piece); |
4784 | +- nptr->appnd = mystrdup(piece); |
4785 | - } |
4786 | -- |
4787 | +- |
4788 | - nptr->appndl = (unsigned char) strlen(nptr->appnd); |
4789 | - if (strcmp(nptr->appnd,"0") == 0) { |
4790 | - free(nptr->appnd); |
4791 | @@ -22850,82 +23230,67 @@ |
4792 | - case 4: { |
4793 | - np++; |
4794 | - if (complexprefixes) { |
4795 | -- int neg = 0; |
4796 | - if (utf8) reverseword_utf(piece); else reverseword(piece); |
4797 | -- // reverse condition |
4798 | -- for (char * k = piece + strlen(piece) - 1; k >= piece; k--) { |
4799 | -- switch(*k) { |
4800 | -- case '[': { |
4801 | -- if (neg) *(k+1) = '['; else *k = ']'; |
4802 | -- break; |
4803 | -- } |
4804 | -- case ']': { |
4805 | -- *k = '['; |
4806 | -- if (neg) *(k+1) = '^'; |
4807 | -- neg = 0; |
4808 | -- break; |
4809 | -- } |
4810 | -- case '^': { |
4811 | -- if (*(k+1) == ']') neg = 1; else *(k+1) = *k; |
4812 | -- break; |
4813 | -- } |
4814 | -- default: { |
4815 | -- if (neg) *(k+1) = *k; |
4816 | -- } |
4817 | -- } |
4818 | -- } |
4819 | +- reverse_condition(piece); |
4820 | - } |
4821 | - if (nptr->stripl && (strcmp(piece, ".") != 0) && |
4822 | -- redundant_condition(at, nptr->strip, nptr->stripl, piece, nl)) |
4823 | +- redundant_condition(at, nptr->strip, nptr->stripl, piece, af->getlinenum())) |
4824 | - strcpy(piece, "."); |
4825 | -- if (encodeit(nptr,piece)) return 1; |
4826 | +- if (at == 'S') { |
4827 | +- reverseword(piece); |
4828 | +- reverse_condition(piece); |
4829 | +- } |
4830 | +- if (encodeit(nptr, piece)) return 1; |
4831 | - break; |
4832 | - } |
4833 | -- |
4834 | --#ifdef HUNSPELL_EXPERIMENTAL |
4835 | +- |
4836 | - case 5: { |
4837 | - np++; |
4838 | - if (pHMgr->is_aliasm()) { |
4839 | - int index = atoi(piece); |
4840 | - nptr->morphcode = pHMgr->get_aliasm(index); |
4841 | - } else { |
4842 | -- if (complexprefixes) { |
4843 | +- if (complexprefixes) { // XXX - fix me for morph. gen. |
4844 | - if (utf8) reverseword_utf(piece); else reverseword(piece); |
4845 | - } |
4846 | +- // add the remaining of the line |
4847 | +- if (*tp) { |
4848 | +- *(tp - 1) = ' '; |
4849 | +- tp = tp + strlen(tp); |
4850 | +- } |
4851 | - nptr->morphcode = mystrdup(piece); |
4852 | +- if (!nptr->morphcode) return 1; |
4853 | - } |
4854 | - break; |
4855 | - } |
4856 | --#endif |
4857 | -- |
4858 | - default: break; |
4859 | - } |
4860 | - i++; |
4861 | - } |
4862 | -- free(piece); |
4863 | - piece = mystrsep(&tp, 0); |
4864 | - } |
4865 | - // check to make sure we parsed enough pieces |
4866 | - if (np < 4) { |
4867 | - char * err = pHMgr->encode_flag(aflag); |
4868 | -- HUNSPELL_WARNING(stderr, "error: affix %s is corrupt near line %s\n", err, nl); |
4869 | -- free(err); |
4870 | +- if (err) { |
4871 | +- HUNSPELL_WARNING(stderr, "error: line %d: affix %s is corrupt\n", |
4872 | +- af->getlinenum(), err); |
4873 | +- free(err); |
4874 | +- } |
4875 | - free(ptr); |
4876 | - return 1; |
4877 | - } |
4878 | - |
4879 | -#ifdef DEBUG |
4880 | --#ifdef HUNSPELL_EXPERIMENTAL |
4881 | - // detect unnecessary fields, excepting comments |
4882 | - if (basefieldnum) { |
4883 | - int fieldnum = !(nptr->morphcode) ? 5 : ((*(nptr->morphcode)=='#') ? 5 : 6); |
4884 | - if (fieldnum != basefieldnum) |
4885 | -- HUNSPELL_WARNING(stderr, "warning: bad field number:\n%s\n", nl); |
4886 | +- HUNSPELL_WARNING(stderr, "warning: line %d: bad field number\n", af->getlinenum()); |
4887 | - } else { |
4888 | - basefieldnum = !(nptr->morphcode) ? 5 : ((*(nptr->morphcode)=='#') ? 5 : 6); |
4889 | - } |
4890 | -#endif |
4891 | --#endif |
4892 | - nptr++; |
4893 | - } |
4894 | - |
4895 | @@ -22941,12 +23306,12 @@ |
4896 | - build_sfxtree((AffEntry *)sfxptr); |
4897 | - } |
4898 | - nptr++; |
4899 | -- } |
4900 | +- } |
4901 | - free(ptr); |
4902 | - return 0; |
4903 | -} |
4904 | - |
4905 | --int AffixMgr::redundant_condition(char ft, char * strip, int stripl, const char * cond, char * warnvar) { |
4906 | +-int AffixMgr::redundant_condition(char ft, char * strip, int stripl, const char * cond, int linenum) { |
4907 | - int condl = strlen(cond); |
4908 | - int i; |
4909 | - int j; |
4910 | @@ -22959,7 +23324,8 @@ |
4911 | - for (i = 0, j = 0; (i < stripl) && (j < condl); i++, j++) { |
4912 | - if (cond[j] != '[') { |
4913 | - if (cond[j] != strip[i]) { |
4914 | -- HUNSPELL_WARNING(stderr, "warning: incompatible stripping characters and condition:\n%s\n", warnvar); |
4915 | +- HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); |
4916 | +- return 0; |
4917 | - } |
4918 | - } else { |
4919 | - neg = (cond[j+1] == '^') ? 1 : 0; |
4920 | @@ -22969,12 +23335,12 @@ |
4921 | - if (strip[i] == cond[j]) in = 1; |
4922 | - } while ((j < (condl - 1)) && (cond[j] != ']')); |
4923 | - if (j == (condl - 1) && (cond[j] != ']')) { |
4924 | -- HUNSPELL_WARNING(stderr, "error: missing ] in condition:\n%s\n", warnvar); |
4925 | +- HUNSPELL_WARNING(stderr, "error: line %d: missing ] in condition:\n%s\n", linenum); |
4926 | - return 0; |
4927 | - } |
4928 | - if ((!neg && !in) || (neg && in)) { |
4929 | -- HUNSPELL_WARNING(stderr, "warning: incompatible stripping characters and condition:\n%s\n", warnvar); |
4930 | -- return 0; |
4931 | +- HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); |
4932 | +- return 0; |
4933 | - } |
4934 | - } |
4935 | - } |
4936 | @@ -22987,7 +23353,8 @@ |
4937 | - for (i = stripl - 1, j = condl - 1; (i >= 0) && (j >= 0); i--, j--) { |
4938 | - if (cond[j] != ']') { |
4939 | - if (cond[j] != strip[i]) { |
4940 | -- HUNSPELL_WARNING(stderr, "warning: incompatible stripping characters and condition:\n%s\n", warnvar); |
4941 | +- HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); |
4942 | +- return 0; |
4943 | - } |
4944 | - } else { |
4945 | - in = 0; |
4946 | @@ -22996,26 +23363,26 @@ |
4947 | - if (strip[i] == cond[j]) in = 1; |
4948 | - } while ((j > 0) && (cond[j] != '[')); |
4949 | - if ((j == 0) && (cond[j] != '[')) { |
4950 | -- HUNSPELL_WARNING(stderr, "error: missing ] in condition:\n%s\n", warnvar); |
4951 | +- HUNSPELL_WARNING(stderr, "error: error: %d: missing ] in condition:\n%s\n", linenum); |
4952 | - return 0; |
4953 | - } |
4954 | - neg = (cond[j+1] == '^') ? 1 : 0; |
4955 | - if ((!neg && !in) || (neg && in)) { |
4956 | -- HUNSPELL_WARNING(stderr, "warning: incompatible stripping characters and condition:\n%s\n", warnvar); |
4957 | -- return 0; |
4958 | +- HUNSPELL_WARNING(stderr, "warning: line %d: incompatible stripping characters and condition\n", linenum); |
4959 | +- return 0; |
4960 | - } |
4961 | - } |
4962 | - } |
4963 | - if (j < 0) return 1; |
4964 | -- } |
4965 | +- } |
4966 | - } |
4967 | - return 0; |
4968 | -} |
4969 | -Index: songbird-1.1.1/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affixmgr.hxx |
4970 | +Index: songbird-2.0.0~a~svn20100618r18971/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affixmgr.hxx |
4971 | =================================================================== |
4972 | ---- songbird-1.1.1.orig/build-tree/songbird/dependencies/vendor/xulrunner/mozilla/extensions/spellcheck/hunspell/src/affixmgr.hxx |
4973 | -+++ /dev/null |
4974 | -@@ -1,272 +0,0 @@ |
4975 | +--- songbird-2.0.0~a~svn20100618r18971.orig/build-tree/songbird/dependencies/vendor/xulrunner-1.9.2/mozilla/extensions/spellcheck/hunspell/src/affixmgr.hxx 2010-06-20 03:48:06.843136654 -0400 |
4976 | ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 |
4977 | +@@ -1,293 +0,0 @@ |
4978 | -/******* BEGIN LICENSE BLOCK ******* |
4979 | - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4980 | - * |
4981 | @@ -23088,6 +23455,7 @@ |
4982 | -#include "baseaffix.hxx" |
4983 | -#include "hashmgr.hxx" |
4984 | -#include "phonet.hxx" |
4985 | +-#include "replist.hxx" |
4986 | - |
4987 | -// check flag duplication |
4988 | -#define dupSFX (1 << 0) |
4989 | @@ -23098,9 +23466,11 @@ |
4990 | - |
4991 | - AffEntry * pStart[SETSIZE]; |
4992 | - AffEntry * sStart[SETSIZE]; |
4993 | -- AffEntry * pFlag[CONTSIZE]; |
4994 | -- AffEntry * sFlag[CONTSIZE]; |
4995 | +- AffEntry * pFlag[SETSIZE]; |
4996 | +- AffEntry * sFlag[SETSIZE]; |
4997 | - HashMgr * pHMgr; |
4998 | +- HashMgr ** alldic; |
4999 | +- int * maxdic; |
5000 | - char * keystring; |