Hunspell ported to pure Python
Project description
Spylls is an effort of porting prominent spellcheckers into clear, well-structured, well-documented Python. It is inteded to be useful both as a library and as some kind of “reference (or investigatory, if you will) implementation”. Currently, only Hunspell is ported.
Hunspell is long-living, complicated, almost undocumented piece of software, and it was our feeling that the significant part of human knowledge is somehow “locked” in a form of large C++ project. That’s how spylls was born: as an attempt to “unlock” it, via well-structured and well-documented implementation in high-level language.
Usage as a library
$ pip install spylls
from spylls.hunspell import Dictionary
# from folder where en_US.aff and en_US.dic are present
dictionary = Dictionary.from_files('/path/to/dictionary/en_US')
# or, from Firefox/LibreOffice dictionary extension
dictionary = Dictionary.from_archive('/path/to/dictionary/en_US.odt')
# or, from system folders (on Linux)
dictionary = Dictionary.from_system('en_US')
print(dictionary.lookup('spylls'))
# False
for suggestion in dictionary.suggest('spylls'):
print(sugestion)
# spell
# spill
# spy ll
# spy-ll
Documentation
Full documentation, including detailed source code/algorithms walkthrough, more detailed reasoning and some completeness reports, is available at https://spylls.readthedocs.io/.
Project Links
License
MIT licensed. See the bundled LICENSE file for more details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for spylls-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb000b3c7e5c236f9dd4b570588b248f34fb8c5b6a6955c82ea62fb92377f98c |
|
MD5 | f410ad725bc292c5f37bfa45b0fd4d72 |
|
BLAKE2b-256 | a8cd16f35010bd832b07ebb56547d7655f4443b89cf83e6020514750cf53e224 |