Name | Größe | Rev. | Zeit | Autor | Log Message |
---|---|---|---|---|---|
![]() |
2.84 k | r9693 | 2007-06-08 01:53:33 | stefankueng | Replace MySpell with Hunspell. Only k... |
![]() |
2.54 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
14.36 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
2.54 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
540 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
3.09 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
4.51 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
41.9 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
3.18 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
64.28 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
490 | r23898 | 2013-02-07 01:51:26 | stefankueng | Update to hunspell 1.3.2 |
![]() |
6.65 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
8.9 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
511 | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
126.12 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
12.12 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
1.93 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
3.81 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
6.68 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
33.38 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
6.53 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
6.25 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
3.06 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
8.22 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
4.42 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
68.25 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
4.09 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
5.62 k | r23898 | 2013-02-07 01:51:26 | stefankueng | Update to hunspell 1.3.2 |
![]() |
4.09 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
9.66 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
7.56 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
8.25 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
2.49 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
1.57 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
![]() |
148.51 k | r28704 | 2019-12-21 21:40:19 | csware | Update Hunspell to 1.7. Based on Tor... |
Hunspell is a free spell checker and morphological analyzer library and command-line tool, licensed under LGPL/GPL/MPL tri-license.
Hunspell is used by LibreOffice office suite, free browsers, like Mozilla Firefox and Google Chrome, and other tools and OSes, like Linux distributions and macOS. It is also a command-line tool for Linux, Unix-like and other OSes.
It is designed for quick and high quality spell checking and correcting for languages with word-level writing system, including languages with rich morphology, complex word compounding and character encoding.
Hunspell interfaces: Ispell-like terminal interface using Curses library, Ispell pipe interface, C++/C APIs and shared library, also with existing language bindings for other programming languages.
Hunspell's code base comes from OpenOffice.org's MySpell library, developed by Kevin Hendricks (originally a C++ reimplementation of spell checking and affixation of Geoff Kuenning's International Ispell from scratch, later extended with eg. n-gram suggestions), see http://lingucomponent.openoffice.org/MySpell-3.zip, and its README, CONTRIBUTORS and license.readme (here: license.myspell) files.
Main features of Hunspell library, developed by László Németh:
Main features of Hunspell command line tool, developed by László Németh:
See man hunspell, man 3 hunspell, man 5 hunspell for complete manual.
Build only dependencies:
g++ make autoconf automake autopoint libtool
Runtime dependencies:
Mandatory | Optional | |
---|---|---|
libhunspell | ||
hunspell tool | libiconv gettext | ncurses readline |
We first need to download the dependencies. On Linux, gettext
and
libiconv
are part of the standard library. On other Unixes we
need to manually install them.
For Ubuntu:
sudo apt install autoconf automake autopoint libtool
Then run the following commands:
autoreconf -vfi
./configure
make
sudo make install
sudo ldconfig
For dictionary development, use the --with-warnings
option of
configure.
For interactive user interface of Hunspell executable, use the
--with-ui option
.
Optional developer packages:
In Ubuntu, the packages are:
libncurses5-dev libreadline-dev
On macOS for compiler always use clang
and not g++
because Homebrew
dependencies are build with that.
brew install autoconf automake libtool gettext
brew link gettext --force
Then run autoreconf, configure, make. See above.
Download Msys2, update everything and install the following packages:
pacman -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-libtool
Open Mingw-w64 Win64 prompt and compile the same way as on Linux, see above.
Download and install Cygwin environment for Windows with the following extra packages:
Then compile the same way as on Linux. Cygwin builds depend on Cygwin1.dll.
It is recommended to install a debug build of the standard library:
libstdc++6-6-dbg
For debugging we need to create a debug build and then we need to start
gdb
.
./configure CXXFLAGS='-g -O0 -Wall -Wextra'
make
./libtool --mode=execute gdb src/tools/hunspell
You can also pass the CXXFLAGS
directly to make
without calling
./configure
, but we don't recommend this way during long development
sessions.
If you like to develop and debug with an IDE, see documentation at https://github.com/hunspell/hunspell/wiki/IDE-Setup
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
features and dictionary format:
man 5 hunspell
man hunspell
hunspell -h
http://hunspell.github.io/
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_GB -l <text.txt
Dictionaries consist of an affix (.aff) and dictionary (.dic) file, for example, download American English dictionary files of LibreOffice (older version, but with stemming and morphological generation) with
wget -O en_US.aff https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.aff?id=a4473e06b56bfe35187e302754f6baaa8d75e54f
wget -O en_US.dic https://cgit.freedesktop.org/libreoffice/dictionaries/plain/en/en_US.dic?id=a4473e06b56bfe35187e302754f6baaa8d75e54f
and with command line input and output, it's possible to check its work quickly, for example with the input words "example", "examples", "teached" and "verybaaaaaaaaaaaaaaaaaaaaaad":
$ hunspell -d en_US
Hunspell 1.7.0
example
*
examples
+ example
teached
& teached 9 0: taught, teased, reached, teaches, teacher, leached, beached
verybaaaaaaaaaaaaaaaaaaaaaad
# verybaaaaaaaaaaaaaaaaaaaaaad 0
Where in the output, *
and +
mean correct (accepted) words (*
= dictionary stem,
+
= affixed forms of the following dictionary stem), and
&
and #
mean bad (rejected) words (&
= with suggestions, #
= without suggestions)
(see man hunspell).
Example for stemming:
$ hunspell -d en_US -s
mice
mice mouse
Example for morphological analysis (very limited with this English dictionary):
$ hunspell -d en_US -m
mice
mice st:mouse ts:Ns
cats
cats st:cat ts:0 is:Ns
cats st:cat ts:0 is:Vs
The src/tools directory contains the following executables after compiling.
Example for morphological generation:
$ ~/hunspell/src/tools/analyze en_US.aff en_US.dic /dev/stdin
cat mice
generate(cat, mice) = cats
mouse cats
generate(mouse, cats) = mice
generate(mouse, cats) = mouses
Including in your program:
#include <hunspell.hxx>
Linking with Hunspell static library:
g++ -lhunspell-1.7 example.cxx
# or better, use pkg-config
g++ $(pkg-config --cflags --libs hunspell) example.cxx
Hunspell (MySpell) dictionaries:
Aspell dictionaries (conversion: man 5 hunspell):
László Németh, nemeth at numbertext org