barrust / pyspellchecker

Pure Python Spell Checking http://pyspellchecker.readthedocs.io/en/latest/
MIT License
691 stars 101 forks source link

Adding dictionary for Arabic #129

Closed msalhab96 closed 1 year ago

msalhab96 commented 2 years ago

I used the Arabic dataset provided by opus to create an Arabic dictionary for the Arabic language, in this pull request I've made the following:

I have tested the code and it works, here's an example

from spellchecker import SpellChecker

spell = SpellChecker(language='ar')

# find those words that may be misspelled
misspelled = spell.unknown(["اذلهب", "كتا", "اساح"])

for word in misspelled:
    print(word)

    # Get a list of `likely` options
    print(spell.candidates(word))

    # Get the one `most likely` answer
    print(spell.correction(word))