This package uses the [spaCy 2.0 extensions](https://spacy.io/usage/processing-pipelines#extensions)
to add [Hunspell](http://hunspell.github.io) support for spellchecking.
Inspired from [this discussion here](https://github.com/explosion/spaCy/issues/315#issuecomment-346194645).
## Usage
Add the spaCyHunSpell to the spaCy pipeline.
```
import spacy
from spacy_hunspell import spaCyHunSpell
nlp = spacy.load('en_core_web_sm')
hunspell = spaCyHunSpell('mac')
nlp.add_pipe(hunspell)
doc = nlp('I can haz cheezeburger.')
haz = doc[2]
haz._.hunspell_spell # False
haz._.hunspell_suggest # ['ha', 'haze', 'hazy', 'has', 'hat', 'had', 'hag', 'ham', 'hap', 'hay', 'haw', 'ha z']
```
There are two default locations for Hunspell dictionaries for each platform
(`mac`, and `linux`). If there are not you can specify the two files manually.
```
hunspell = spaCyHunSpell('mac')
hunspell = spaCyHunSpell('linux')
hunspell = spaCyHunSpell('en_US.dic', 'en_US.aff')
```
You can find the [English dictionary files here](http://wordlist.aspell.net/dicts/).
## Installation
You can install the package directly if you have the prerequisites to
install Hunspell. If it errors out, manually install Hunspell (see below).
```
pip install spacy_hunspell
```
Install Hunspell on Linux.
```
sudo apt-get install libhunspell-dev
```
Install Hunspell on Mac.
```
brew install hunspell
```
Install the Python bindings for Hunspell ([`pyhunspell`](https://github.com/blatinier/pyhunspell)):
```
pip install hunspell
```
For Mac, you may have to add a few steps before pip installing:
```
export C_INCLUDE_PATH=/usr/local/include/hunspell
ln -s /usr/local/lib/libhunspell-{VERSION_NUMBER}.a /usr/local/lib/libhunspell.a
```
For Mac 10.13 High Sierra, you may have to set the C flags ([issue](https://github.com/blatinier/pyhunspell/issues/33)).
```
CFLAGS=$(pkg-config --cflags hunspell) LDFLAGS=$(pkg-config --libs hunspell) pip install hunspell
```
Install the rest of the requirements.
```
pip install -r requirements.txt
```
And download at least one spaCy model.
```
python -m spacy download en_core_web_sm
```
Metadata
Release files for spacy_hunspell 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| spacy_hunspell-0.1.0.tar.gz | 2.8 kB | Without provenance | Details |
Release files / spacy_hunspell-0.1.0.tar.gz
| Download URL | spacy_hunspell-0.1.0.tar.gz |
|---|---|
| Size | 2.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d3c34cc7197d0d484c41f4c58bc6282aca48be2178f53aac93121fac6fedd7c6
|
|
BLAKE2b-256 checksum How to use checksums |
d96ad977f74eff8354a5fdd6b5c0d8b4f8caa8d676970e18ff961694d978e7f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for spacy_hunspell 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.