4 NOTICE: Version 2 is in the works. For contributing see
5 [version 2 specification][v2spec] and the folder `src/hunspell2`.
7 [v2spec]: https://github.com/hunspell/hunspell/wiki/Version-2-Specification
9 Hunspell is a spell checker and morphological analyzer library and program
10 designed for languages with rich morphology and complex word compounding or
11 character encoding. Hunspell interfaces: Ispell-like terminal interface
12 using Curses library, Ispell pipe interface, C++ class and C functions.
14 Hunspell's code base comes from the OpenOffice.org MySpell
15 (http://lingucomponent.openoffice.org/MySpell-3.zip). See README.MYSPELL,
16 AUTHORS.MYSPELL and license.myspell files.
17 Hunspell is designed to eventually replace Myspell in OpenOffice.org.
19 Main features of Hunspell spell checker and morphological analyzer:
21 - Unicode support (affix rules work only with the first 65535 Unicode
23 - Morphological analysis (in custom item and arrangement style) and stemming
24 - Max. 65535 affix classes and twofold affix stripping (for agglutinative
25 languages, like Azeri, Basque, Estonian, Finnish, Hungarian, Turkish, etc.)
26 - Support complex compoundings (for example, Hungarian and German)
27 - Support language specific features (for example, special casing of
28 Azeri and Turkish dotted i, or German sharp s)
29 - Handle conditional affixes, circumfixes, fogemorphemes,
30 forbidden words, pseudoroots and homonyms.
31 - Free software. Versions 1.x are licenced under LGPL, GPL, MPL tri-license.
32 Version 2 is licenced only under GNU LGPL.
34 Compiling on GNU/Linux and Unixes
35 =================================
43 For dictionary development, use the `--with-warnings` option of configure.
45 For interactive user interface of Hunspell executable, use the `--with-ui option`.
47 The developer packages you need to compile Hunspell's interface:
49 autoconf automake autopoint libtool g++
51 Optional developer packages:
53 - ncurses (need for --with-ui), eg. libncursesw5 for UTF-8
54 - readline (for fancy input line editing,
55 configure parameter: --with-readline)
56 - locale and gettext (but you can also use the
57 --with-included-gettext configure parameter)
62 ## 1. Compiling with Mingw64 and MSYS2
64 Download Msys2, update everything and install the following packages:
66 pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-libtool
68 Open Mingw-w64 Win64 prompt and compile the same way as on Linux, see above.
70 ## 2. Compiling in Cygwin environment
72 Download and install Cygwin environment for Windows with the following
79 - gcc-g++ development package
80 - ncurses, readline (for user interface)
81 - iconv (character conversion)
83 Then compile the same way as on Linux. Cygwin builds depend on Cygwin1.dll.
88 For debugging we need to create a debug build and then we need to start `gdb`.
91 make CXXFLAGS='-g -O0'
92 libtool --mode=execute gdb src/tools/hunspell
97 Testing Hunspell (see tests in tests/ subdirectory):
101 or with Valgrind debugger:
104 VALGRIND=[Valgrind_tool] make check
109 VALGRIND=memcheck make check
114 features and dictionary format:
120 http://hunspell.github.io/
125 The src/tools directory contains ten executables after compiling:
127 - affixcompress: dictionary generation from large (millions of words)
129 - analyze: example of spell checking, stemming and morphological analysis
130 - chmorph: example of automatic morphological generation and conversion
131 - example: example of spell checking and suggestion
132 - hunspell: main program for spell checking and others (see manual)
133 - hunzip: decompressor of hzip format
134 - hzip: compressor of hzip format
135 - makealias: alias compression (Hunspell only, not back compatible with MySpell)
136 - munch: dictionary generation from vocabularies (it needs an affix file, too).
137 - unmunch: list all recognized words of a MySpell dictionary
138 - wordforms: word generation (Hunspell version of unmunch)
140 After compiling and installing (see INSTALL) you can
141 run the Hunspell spell checker (compiled with user interface)
142 with a Hunspell or Myspell dictionary:
144 hunspell -d en_US text.txt
146 or without interface:
149 hunspell -d en_UK -l <text.txt
151 Dictionaries consist of an affix and dictionary file, see tests/
152 or http://wiki.services.openoffice.org/wiki/Dictionaries.
154 Using Hunspell library with GCC
155 ===============================
157 Including in your program:
159 #include <hunspell.hxx>
161 Linking with Hunspell static library:
163 g++ -lhunspell example.cxx
168 Myspell & Hunspell dictionaries:
170 - http://extensions.libreoffice.org
171 - http://cgit.freedesktop.org/libreoffice/dictionaries
172 - http://extensions.openoffice.org
173 - http://wiki.services.openoffice.org/wiki/Dictionaries
175 Aspell dictionaries (need some conversion):
177 - ftp://ftp.gnu.org/gnu/aspell/dict
179 Conversion steps: see relevant feature request at http://hunspell.github.io/ .
182 nemeth at numbertext org