Bug 81415 - kspell2 doesn't like ipsell hash files
Summary: kspell2 doesn't like ipsell hash files
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kspell (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Zack Rusin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-12 11:51 UTC by Harri Porten
Modified: 2008-08-25 19:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harri Porten 2004-05-12 11:51:33 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

kspell2 gives me these error messages

Illegal format hash table /usr/lib/ispell/american.hash - expected magic2 0x9602, got 0x4956
Illegal format hash table /usr/lib/ispell/british.hash - expected magic2 0x9602, got 0x5400

allthough the ispell tool works fine with its data files. I'm using Debian 3.0 (stable) which has ispell 3.1.20. I can send the hash files if desired :)
Comment 1 Jeroen Wijnhout 2004-05-21 16:00:15 UTC
I have the same behavior.

FYI I'm using :

ispell -v
@(#) International Ispell Version 3.2.06 08/01/01

aspell -v
@(#) International Ispell Version 3.1.20 (but really Aspell 0.50.3)

Could it be that the headers of the .hash files do not have the same structure for various versions of ISpell? Looking at the ispell.h for 3.1.20 and for 3.2.06, I noticed that there could be subtle changes in the headers. The KSpell2 code assumes a certain structure of the header (by including a particular ispell.h in the source code).

best,
Jeroen
Comment 2 dag 2005-10-13 07:52:56 UTC
Same here
Comment 3 Matthias Apitz 2006-01-30 10:18:34 UTC
I've the same problem with KDE 3.4.2 / KWord 1.4.1 on FreeBSD 6.0-REL:

$ ispell -v
@(#) International Ispell Version 3.2.06 08/01/01

$ ispell -w'$' -d/usr/local/share/ispell/espanol.hash -T.txt test

works fine while KWord gives:

$ kword test
Illegal format hash table /usr/local/share/ispell/espanol.hash - expected magic2 0x9602, got 0x0
kword: ERROR: Language "es" doesn't exist for Ispell
$  

I've watched it with strace and it tries to read the file but
don't understand it:

   ...
   open("/usr/local/share/ispell/espanol.hash", O_RDONLY) = 11
   fstat(11, {st_mode=0177777, st_size=9223372034707292159, ...}) = 0
   read(11, "\2\226\7\0\0\2\n\0\3\0\377\377\224^\10\0\'\23\1\0\275\276"..., 4096) = 4096
   read(11, "\335\1\336\1\337\1\340\1\341\1\342\1\343\1\344\1\345\1"..., 4096) = 4096
   write(2, "\355\1\356\1\357\1\360\1\361\1\362\1\363\1\364\1\365\1"..., 98) = 98
   ...



Comment 4 SED 2006-03-25 00:36:39 UTC
Ditto. I'm using KDE 3.5.1 and KWord 1.4.2, AMD64 (kde and kword are compiled as 64 bit) and Gentoo. My xsession error is a little bit different though:

Illegal format hash table /usr/lib/ispell/american.hash - expected magic2 0x9602, got 0x0
Illegal format hash table /usr/lib/ispell/british.hash - expected magic2 0x9602,  got 0x0

The "got" part is 0, instead of what Harri posted. Ispell and Aspell are both installed, Aspell en_US dictionary is installed, and both tools work from the command line.
Comment 5 Zack Rusin 2006-03-25 01:15:04 UTC
yeah, it expects the ispell dictionaries done for enchant. 
Comment 6 SED 2006-03-29 00:01:15 UTC
So what does that mean? uninstall ispell and reinstall enchant? I already have enchant, but I think I have installed ispell more recently. Do they conflict?

Scott
Comment 7 SED 2006-04-15 00:17:38 UTC
I just installed kword, koffice-libs and koffice-data v1.5.0 and I still get this behavior.
Comment 8 Mihail Zenkov 2006-04-24 11:22:58 UTC
I fix this bug. We need MAXSTRINGCHARS=512, like in ispell config.X

Please, add this fix in KDE-3.5.3


diff -ur kdelibs-3.5.2-orig/kspell2/plugins/ispell/ispell.h kdelibs-3.5.2-ispell_fixed/kspell2/plugins/ispell/ispel
l.h
--- kdelibs-3.5.2-orig/kspell2/plugins/ispell/ispell.h  2005-10-10 18:05:54.000000000 +0300
+++ kdelibs-3.5.2-ispell_fixed/kspell2/plugins/ispell/ispell.h  2006-04-24 12:13:08.000000000 +0300
@@ -329,7 +329,7 @@
 ** character counts as two!
 */
 #ifndef MAXSTRINGCHARS
-#define MAXSTRINGCHARS 128
+#define MAXSTRINGCHARS 512
 #endif /* MAXSTRINGCHARS */

 /*

Comment 9 Jacob R Rideout 2007-01-09 21:31:12 UTC
This bug is more complex then Mihail's patch suggests. Ispell uses a very brittle binary file format. It varies widely, in usage, there are enianness conficts, string size conflicts and other problems. Commiting Mihail's patch only breaks only dictionaries.

Until a better heuristic to determine the nature of the ispell data is available KDE will not regress in the data that is does support. Dom Lachowicz (of Abiword fame) might do the work with his Enchant plugin for Ispell and we could then backport it.

However, I highly suggest using Aspell of Myspell/Hunspell.
Comment 10 Zack Rusin 2008-08-25 19:40:27 UTC
We removed our custom Ispell plugin, Ispell dictionaries go only through Enchant now.