Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rmdort/regextypofix
Simple Regex spellchecker based on Wikipedia's `RegExTypoFix` project
https://github.com/rmdort/regextypofix
Last synced: 18 days ago
JSON representation
Simple Regex spellchecker based on Wikipedia's `RegExTypoFix` project
- Host: GitHub
- URL: https://github.com/rmdort/regextypofix
- Owner: rmdort
- License: other
- Created: 2018-01-02T01:43:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-24T22:52:44.000Z (9 months ago)
- Last Synced: 2024-04-26T08:04:06.174Z (7 months ago)
- Language: Python
- Size: 221 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.rst
- License: License.txt
Awesome Lists containing this project
README
RegEx Typo Fix
====Regex spellchecker based on Wikipedia's RegExTypoFix_ project
The dictionary prepared by wikipedia contains most common misspelled words.
Usage
-----The easiest way to install it is using pip::
pip install regextypofix
from regextypofix import correct
print (correct('whiel selled'))Add more patterns
-----
You can either create your own dictionary or just append to the default dictionary::from regextypofix import correct, create_dictionary
# Build default dictionary
default_dictionary = create_dictionary()# User defined dictionary
user_dictionary = create_dictionary('./path_to_text_files')# Complete dictionary
dictionary = default_dictionary + user_dictionary# Now pass dictionary to `correct`
correct('whiel selled', dictionary=dictionary)
Other RegExTypoFix libraries: Topy_
.. _Topy: https://github.com/intgr/topy/
.. _RegExTypoFix: https://en.wikipedia.org/wiki/Wikipedia:AutoWikiBrowser/Typos