DocumentServer/NodeJsProjects/SpellChecker/nodehun/src/hunspell
2015-04-28 17:59:00 +03:00
..
intl init repo 2014-07-05 18:22:49 +00:00
m4 init repo 2014-07-05 18:22:49 +00:00
man init repo 2014-07-05 18:22:49 +00:00
po init repo 2014-07-05 18:22:49 +00:00
src 3.0 source code 2015-04-28 17:59:00 +03:00
ABOUT-NLS init repo 2014-07-05 18:22:49 +00:00
aclocal.m4 init repo 2014-07-05 18:22:49 +00:00
AUTHORS init repo 2014-07-05 18:22:49 +00:00
AUTHORS.myspell init repo 2014-07-05 18:22:49 +00:00
binding.gyp init repo 2014-07-05 18:22:49 +00:00
BUGS init repo 2014-07-05 18:22:49 +00:00
ChangeLog init repo 2014-07-05 18:22:49 +00:00
ChangeLog.O init repo 2014-07-05 18:22:49 +00:00
config.guess init repo 2014-07-05 18:22:49 +00:00
config.h.in init repo 2014-07-05 18:22:49 +00:00
config.rpath init repo 2014-07-05 18:22:49 +00:00
config.sub init repo 2014-07-05 18:22:49 +00:00
configure init repo 2014-07-05 18:22:49 +00:00
configure.ac init repo 2014-07-05 18:22:49 +00:00
COPYING init repo 2014-07-05 18:22:49 +00:00
COPYING.LGPL init repo 2014-07-05 18:22:49 +00:00
COPYING.MPL init repo 2014-07-05 18:22:49 +00:00
depcomp init repo 2014-07-05 18:22:49 +00:00
hunspell.pc.in init repo 2014-07-05 18:22:49 +00:00
INSTALL init repo 2014-07-05 18:22:49 +00:00
install-sh init repo 2014-07-05 18:22:49 +00:00
license.hunspell init repo 2014-07-05 18:22:49 +00:00
license.myspell init repo 2014-07-05 18:22:49 +00:00
ltmain.sh init repo 2014-07-05 18:22:49 +00:00
Makefile.am init repo 2014-07-05 18:22:49 +00:00
Makefile.in init repo 2014-07-05 18:22:49 +00:00
missing init repo 2014-07-05 18:22:49 +00:00
mkinstalldirs init repo 2014-07-05 18:22:49 +00:00
NEWS init repo 2014-07-05 18:22:49 +00:00
README init repo 2014-07-05 18:22:49 +00:00
README.myspell init repo 2014-07-05 18:22:49 +00:00
THANKS init repo 2014-07-05 18:22:49 +00:00
TODO init repo 2014-07-05 18:22:49 +00:00

About Hunspell
--------------

Hunspell is a spell checker and morphological analyzer library and program
designed for languages with rich morphology and complex word compounding or
character encoding. Hunspell interfaces: Ispell-like terminal interface
using Curses library, Ispell pipe interface, OpenOffice.org UNO module.

Hunspell's code base comes from the OpenOffice.org MySpell
(http://lingucomponent.openoffice.org/MySpell-3.zip). See README.MYSPELL,
AUTHORS.MYSPELL and license.myspell files.
Hunspell is designed to eventually replace Myspell in OpenOffice.org.

Main features of Hunspell spell checker and morphological analyzer:

- Unicode support (affix rules work only with the first 65535 Unicode characters)

- Morphological analysis (in custom item and arrangement style) and stemming

- Max. 65535 affix classes and twofold affix stripping (for agglutinative
  languages, like Azeri, Basque, Estonian, Finnish, Hungarian, Turkish, etc.)

- Support complex compoundings (for example, Hungarian and German)

- Support language specific features (for example, special casing of
  Azeri and Turkish dotted i, or German sharp s)

- Handle conditional affixes, circumfixes, fogemorphemes,
  forbidden words, pseudoroots and homonyms.

- Free software (LGPL, GPL, MPL tri-license)

Compiling on Unix/Linux
-----------------------

./configure
make
make install

For dictionary development, use the --with-warnings option of configure.

For interactive user interface of Hunspell executable, use the --with-ui option.

The developer packages you need to compile Hunspell's interface:

glibc-devel

optional developer packages:

ncurses (need for --with-ui)
readline (for fancy input line editing,
  configure parameter: --with-readline)
locale and gettext (but you can also use the
  --with-included-gettext configure parameter)

Hunspell distribution uses new Autoconf (2.59) and Automake (1.9).

Compiling on Windows
--------------------

1. Compiling with Windows SDK

Download the free Windows SDK of Microsoft, open a command prompt
window and cd into hunspell/src/win_api. Use the following command
to compile hunspell:

vcbuild

2. Compiling in Cygwin environment

Download and install Cygwin environment for Windows with the following
extra packages: 

make
gcc-g++ development package
mingw development package (for cygwin.dll free native Windows compilation)
ncurses, readline (for user interface)
iconv (character conversion)

2.1. Cygwin1.dll dependent compiling

Open a Cygwin shell, cd into the hunspell root directory:

./configure
make
make install

For dictionary development, use the --with-warnings option of configure.

For interactive user interface of Hunspell executable, use the --with-ui option.

readline configure parameter: --with-readline (for fancy input line editing)

1.2. Cygwin1.dll free compiling

Open a Cygwin shell, cd into the hunspell/src/win_api and

make -f Makefile.cygwin

Testing
-------

Testing Hunspell (see tests in tests/ subdirectory):

make check

or with Valgrind debugger:

make check
VALGRIND=[Valgrind_tool] make check

For example:

make check
VALGRIND=memcheck make check

Documentation
-------------

features and dictionary format:
man 4 hunspell

man hunspell
hunspell -h
http://hunspell.sourceforge.net

Usage
-----

The src/tools dictionary contains ten executables after compiling
(or some of them are in the src/win_api):

affixcompress: dictionary generation from large (millions of words) vocabularies
  analyze: example of spell checking, stemming and morphological analysis
  chmorph: example of automatic morphological generation and conversion
  example: example of spell checking and suggestion
 hunspell: main program for spell checking and others (see manual)
   hunzip: decompressor of hzip format
     hzip: compressor of hzip format
makealias: alias compression (Hunspell only, not back compatible with MySpell)
    munch: dictionary generation from vocabularies (it needs an affix file, too).
  unmunch: list all recognized words of a MySpell dictionary
wordforms: word generation (Hunspell version of unmunch)

After compiling and installing (see INSTALL) you can
run the Hunspell spell checker (compiled with user interface)
with a Hunspell or Myspell dictionary:

hunspell -d en_US text.txt

or without interface:

hunspell
hunspell -d en_UK -l <text.txt

Dictionaries consist of an affix and dictionary file, see tests/
or http://wiki.services.openoffice.org/wiki/Dictionaries.

Using Hunspell library with GCC
-------------------------------

Including in your program:
#include <hunspell.hxx>

Linking with Hunspell static library:
g++ -lhunspell example.cxx 

Dictionaries
------------

Myspell & Hunspell dictionaries:
http://wiki.services.openoffice.org/wiki/Dictionaries

Aspell dictionaries (need some conversion):
ftp://ftp.gnu.org/gnu/aspell/dict
Conversion steps: see relevant feature request at http://hunspell.sf.net.

László Németh
nemeth at OOo