/pyhunspell

Python bindings for the Hunspell spellchecker engine

Primary LanguageCOtherNOASSERTION

Build Status

About PyHunSpell

pyhunspell is a set of Python bindings for the Hunspell spellchecker engine. It lets developers load Hunspell dictionaries, check words, get suggestions, add new words, etc. It also provides some basic morphological analysis related methods.

See ChangeLog for activity.

See Authors for all contributors.

Installation

Make sure that python-dev and libhunspell-dev are installed.

You can install this package using pip:

pip install hunspell

Or from source using the following command as root:

python setup.py install

For OSX 10.10 @mimrock indicated that you might need to do something like this:

ln -s /usr/local/lib/libhunspell-1.4.a /usr/local/lib/libhunspell.a

For windows7 @tallforasmurf compiled a python 3.4 compatible version of the pyhunspell==0.3.3 package available here: http://pyhunspell.latinier.fr (Warning: Those windows compiled packages are not reviewed or tested). It could work for other windows version or python versions.

Documentation

Go here for some documentation

Usage

>>> import hunspell
>>> hobj = hunspell.HunSpell('/usr/share/hunspell/en_US.dic', '/usr/share/hunspell/en_US.aff')
>>> hobj.spell('spookie')
False
>>> hobj.suggest('spookie')
['spookier', 'spookiness', 'spook', 'cookie', 'bookie', 'Spokane', 'spoken']
>>> hobj.spell('spooky')
True
>>> hobj.analyze('linked')
[' st:linked', ' st:link fl:D']
>>> hobj.stem('linked')
['linked', 'link']
>>> hobj.spell('spookie')
False
>>> hobj.add('spookie')
>>> hobj.spell('spookie')
True
>>> hobj.remove('spookie')
>>> hobj.spell('spookie')
False

Misc

Saw a bug ? Wan't a feature ? Go fill an issue here

For information, version naming (introduced for 0.4.0) is based on Hungarian cities ordered by population except Budapest. The reason why is that hunspell stands for Hungarian Spell.

License

PyHunspell itself is licensed under the LGPL version 3 or later, see lgpl-3.0.txt and gpl-3.0.txt. The files in the debian/ directory and setup.py are licensed under the GPL version 3.