views:

156

answers:

2

Hi all,

Is it possible to make use of the Open Office spell-checker outside of Open Office for other Java programs?

Walter

A: 

OpenOffice simply uses hunspell for the spell checking - you should investigate it instead. Its home page mentions the existence of two java interfaces/ports.

Bozhidar Batsov
I could use a Java port of MySpell since that is also popular.
+1  A: 

We have done exactly that - used the hunspell engine from java. There is a JNA bridge that can be used to invoke hunspell from java. Very nice to use - takes care of loading the appropriate native library from the jar.

The only problem is that the bridge is not updated with the latest hunspell engine - it is at version 1.1.12, and at the time I looked (last year), hunspell was at 1.2.18, which contained fixes we needed. It's not a big deal to build the hunspell libraries and rebuild the JNA wrapper with the latest hunspell engines, although it does involve cross-platform compilation. IIRC we used a windows box and a linux box to rebuild both those platforms (cygwin on windows didn't cut it) and we didn't need the version for OS X. I can let you have what we built if that's useful.

See

mdma
Ok, guess it won't be totally painless, but if it is a good spell checker, then I guess it can be worth the effort.
We were developing our own checker - you may not need the latest version and can simply go with version 1.1.12. (The fixes were regarding compound word handling, which is much less used in English than in Germanic languages.)
mdma