An extension of PyEnchant Wrapper
Project description
EnchantX
An extension of pyenchant package to serve better.
What is EnchantX?
This package is an extension of PyEnchant (which provides a set of Python language bindings for the Enchant spellchecking library). This package is extended to provide most appropriate suggestions based on given text. EnchantX Visualizer is available on the EnchantX website:
http://enchantx.live/
What is Enchant?
Enchant is used to check the spelling of words and suggest corrections for words that are miss-spelled. It can use many popular spellchecking packages to perform this task, including ispell, aspell and MySpell. It is quite flexible at handling multiple dictionaries and multiple languages.
More information is available on the Enchant website:
http://www.abisource.com/enchant/
How do I install it?
Install the package using pip::
$ pip install enchantx
This package will also install its dependency of pyenchant package which bundle a pre-built copy of the underlying enchant library. Users on other platforms will need to install "enchant" using their system package manager (brew on macOS).
Once the software is installed, python's on-line help facilities can get you started. Launch python and issue the following commands:
>>> import enchantx
>>> help(enchantx)
Note: EnchantX requires binary file "GoogleNews-vectors-negative300.bin" to work correctly. By default, It will try to search for the file in the following locations:
- "/home/<$user>/.enchantx/"
- Inside current working directory
It is recommended to provide the path of binary file while creating the XDict Object.
How do I use it?
>>> import enchantx
>>> spellchecker = enchantx.XDict("/home/ubuntu/GoogleNews-vectors-negative300.bin")
>>> spellchecker.check("wofl")
False
>>> spellchecker.suggest("wofl")
['Wolf', 'wolf', 'wool', 'FOFL', 'ROFL']
>>> example = "quanfiction movie"
>>> spellchecker.check("movie")
True
>>> spellchecker.check("quanfiction")
False
>>> spellchecker.suggest("quanfiction")
['qualification', 'quantification', 'nonfiction']
>>> spellchecker.smart_suggest(word="quanfiction", next_word="movie")
['nonfiction', 'qualification', 'quantification']
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file EnchantX-0.1.1-py3-none-any.whl.
File metadata
- Download URL: EnchantX-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200604 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73b4e86bbfeed52f1411ca10e1f1f605cb68e8e91e19d30269f91446154e1765
|
|
| MD5 |
8e889258d7aa67a269239bd828f8ce9d
|
|
| BLAKE2b-256 |
531f6222c562d51c0f34e45049a2f18452809f9aef612e5b479f46b854b70792
|