[Chennaipy] Chennaipy - Monday Module - 07 Nov 2022
selvi dct
selvi.dct at gmail.com
Mon Nov 7 13:28:27 EST 2022
Date: 07 Nov 2022
Module : tamilspellchecker
Installation : pip install tamilspellchecker
About:
Tamil Spell Checker is used to suggest different spellings for a word.
Source:
from tamilspellchecker.TamilSpellingAutoCorrect import
TamilSpellingAutoCorrect, get_data
from pprint import pprint
from tamil.utf8 import get_letters
spellchecker = TamilSpellingAutoCorrect(get_data("tamil_bloom_filter.txt"),
get_data("tamilwordlist.txt"))
results = spellchecker.tamil_Norvig_correct_spelling("தமிழ்னாடு")
###தமிழ்நாடு
என்பது சரியான சொல்.
results = list(filter(lambda x: len(get_letters(x)) >= 4,results )) #filter
for words >= 4 letters
results = list(filter(lambda x: len(get_letters(x)) <= 6,results )) #and
for words <= 6 letters
pprint(results)
Output:
['தமிழ்கு',
'தமிழ்பு',
'தகை்னாடு',
'தமிழ்கொடு',
'தன்னாடு',
'தமிழ்ஏடு',
'தமிழ்நாடு',
'தமிழ்து',
'தமிணனாடு',
'தமிழ்பாடு',
'தமிழ்மு',
'தமிழ்விடு',
'தமினோோடு',
'தமிழ்கு',
'தமிழ்பு',
'தரீ்ஙோடு',
'தமிழ்கொடு',
'தமிழ்ஏடு',
'தமிழ்நாடு',
'தமிழோடு',
'தமிழ்து',
'தமிழ்பாடு',
'தமிழ்மு',
'தமிழ்விடு']
Reference:
https://pypi.org/project/tamilspellchecker/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/chennaipy/attachments/20221107/6f7baf6b/attachment.html>
More information about the Chennaipy
mailing list