Skip to main content

Python bidings for Nuspell - a fast and safe spellcheckingC++ library

Project description

PyNuspell Nuspell Build Python Black


About PyNuspell

PyNuspell is a set of Python 3.x bindings for Nuspell spellchecking C++ library.

About Nuspell

Nuspell is a fast and safe spelling checker software program. It is designed for languages with rich morphology and complex word compounding. Nuspell is written in modern C++ and it supports Hunspell dictionaries.

Main features of Nuspell spelling checker:

  • Provides software library and command-line tool.
  • Suggests high-quality spelling corrections.
  • Backward compatibility with Hunspell dictionary file format.
  • Up to 3 times faster than Hunspell.
  • Full Unicode support backed by ICU.
  • Twofold affix stripping (for agglutinative languages, like Azeri, Basque, Estonian, Finnish, Hungarian, Turkish, etc.).
  • Supports complex compounds (for example, Hungarian, German and Dutch).
  • Supports advanced features, for example: special casing rules (Turkish dotted i or German sharp s), conditional affixes, circumfixes, fogemorphemes, forbidden words, pseudoroots and homonyms.
  • Free and open source software. Licensed under GNU LGPL v3 or later.

See more details at https://nuspell.github.io/ and https://github.com/nuspell/nuspell

Installing using pip

You can install this package using pip:

pip install pynuspell

To download dictionaries, please refer to https://github.com/nuspell/nuspell/wiki/Dictionaries-and-Contacts

Installing from source

Requirements:

  • Python 3.6 or later
  • Git
  • C++ compiler with cmake

Open a terminal and run the following commands:

# Clone repository
git clone --recurse-submodules https://github.com/scherzocrk/pynuspell.git
cd pynuspell

# Install vcpkg (Windows)
.\extern\vcpkg\bootstrap-vcpkg.bat
set VCPKG_ROOT=.\extern\vcpkg

# Install vcpkg (Linux/MacOS)
.\extern\vcpkg\bootstrap-vcpkg.sh
export VCPKG_ROOT=.\extern\vcpkg

# Install nuspell
.\extern\vcpkg\vcpkg install nuspell

# Build and install pynuspell
python setup.py install

# You can generate stub files for IntelliSense using:
pip install pybind11-stubgen
pybind11-stubgen --no-setup-py pynuspell

# You can run somes tests using:
pip install pytest
pytest tests/tests.py

Usage

>>> import pynuspell
>>> nuspell_dict = pynuspell.load_from_path('en-US')  # path to where en_US.aff and en_US.dic are found
>>> nuspell_dict.spell('spookie')
False
>>> nuspell_dict.suggest('spookie')
['spookier', 'spook']
>>> nuspell_dict.spell('spookier')
True

Next Steps

  • Add more bindings to existing features
  • Keep up to date with new releases of Nuspell
  • Anyone is more than welcome to contribute to this package

Contact information:

Acknowledgments

Special thanks to Nuspell and PyBind11 developers

License

PyNuspell is licensed under the LGPL version 3 or later, see LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pynuspell-1.0.0-cp39-cp39-win_amd64.whl (12.4 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

pynuspell-1.0.0-cp39-cp39-win32.whl (12.2 MB view hashes)

Uploaded CPython 3.9 Windows x86

pynuspell-1.0.0-cp39-cp39-manylinux2014_x86_64.whl (12.3 MB view hashes)

Uploaded CPython 3.9

pynuspell-1.0.0-cp39-cp39-macosx_10_9_x86_64.whl (12.2 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pynuspell-1.0.0-cp38-cp38-win_amd64.whl (12.4 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

pynuspell-1.0.0-cp38-cp38-win32.whl (12.2 MB view hashes)

Uploaded CPython 3.8 Windows x86

pynuspell-1.0.0-cp38-cp38-manylinux2014_x86_64.whl (12.3 MB view hashes)

Uploaded CPython 3.8

pynuspell-1.0.0-cp38-cp38-macosx_10_9_x86_64.whl (12.2 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pynuspell-1.0.0-cp37-cp37m-win_amd64.whl (12.4 MB view hashes)

Uploaded CPython 3.7m Windows x86-64

pynuspell-1.0.0-cp37-cp37m-win32.whl (12.2 MB view hashes)

Uploaded CPython 3.7m Windows x86

pynuspell-1.0.0-cp37-cp37m-manylinux2014_x86_64.whl (12.3 MB view hashes)

Uploaded CPython 3.7m

pynuspell-1.0.0-cp37-cp37m-macosx_10_9_x86_64.whl (12.2 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pynuspell-1.0.0-cp36-cp36m-win_amd64.whl (12.4 MB view hashes)

Uploaded CPython 3.6m Windows x86-64

pynuspell-1.0.0-cp36-cp36m-win32.whl (12.2 MB view hashes)

Uploaded CPython 3.6m Windows x86

pynuspell-1.0.0-cp36-cp36m-manylinux2014_x86_64.whl (12.3 MB view hashes)

Uploaded CPython 3.6m

pynuspell-1.0.0-cp36-cp36m-macosx_10_9_x86_64.whl (12.2 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page