Spaces:
Sleeping
Sleeping
Update app.py
Browse files3 unmodified lines456789101112131415161718193 unmodified linesfrom autocorrect import Spellerdef text_checker(inp_text):symsp = SymSpell()symsp.load_dictionary('dictionay.txt',term_index=0, count_index=1, separator=' ')sentence = inp_textterms = symsp.lookup_compound(sentence,max_edit_distance=2)return terms[0].term# def text_checker(inp_text):# check = Speller(lang='en')# sentence = inp_text# return check(sentence)title = "Text Correction"3 unmodified lines45678910111213141516171819203 unmodified linesfrom autocorrect import Spellerdef text_checker(inp_text):updated_text = text_checker_pre(inp_text)symsp = SymSpell()symsp.load_dictionary('dictionay.txt',term_index=0, count_index=1, separator=' ')sentence = updated_textterms = symsp.lookup_compound(sentence,max_edit_distance=2)return terms[0].termdef text_checker_pre(inp_text):check = Speller(lang='en')sentence = inp_textreturn check(sentence)title = "Text Correction"
app.py+6-5