Created
February 10, 2020 12:00
-
-
Save muhammetfaik/41fbec52a75dc1718f94ab5ef96515f9 to your computer and use it in GitHub Desktop.
spellchecker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jamspell | |
corrector = jamspell.TSpellCorrector() | |
corrector.LoadLangModel('en.bin') | |
print(corrector.FixFragment('I am the begt spell cherken!')) | |
# u'I am the best spell checker!' | |
print(corrector.GetCandidates(['i', 'am', 'the', 'begt', 'spell', 'cherken'], 3)) | |
# (u'best', u'beat', u'belt', u'bet', u'bent', ... ) | |
print(corrector.GetCandidates(['i', 'am', 'the', 'begt', 'spell', 'cherken'], 5)) | |
# (u'checker', u'chicken', u'checked', u'wherein', u'coherent', ...) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment