Vihang28 commited on
Commit
3a08ae3
·
verified ·
1 Parent(s): 6b55655

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -4,16 +4,17 @@ import autocorrect
4
  from autocorrect import Speller
5
 
6
  def text_checker(inp_text):
 
7
  symsp = SymSpell()
8
  symsp.load_dictionary('dictionay.txt',term_index=0, count_index=1, separator=' ')
9
- sentence = inp_text
10
  terms = symsp.lookup_compound(sentence,max_edit_distance=2)
11
  return terms[0].term
12
 
13
- # def text_checker(inp_text):
14
- # check = Speller(lang='en')
15
- # sentence = inp_text
16
- # return check(sentence)
17
 
18
  title = "Text Correction"
19
 
 
4
  from autocorrect import Speller
5
 
6
  def text_checker(inp_text):
7
+ updated_text = text_checker_pre(inp_text)
8
  symsp = SymSpell()
9
  symsp.load_dictionary('dictionay.txt',term_index=0, count_index=1, separator=' ')
10
+ sentence = updated_text
11
  terms = symsp.lookup_compound(sentence,max_edit_distance=2)
12
  return terms[0].term
13
 
14
+ def text_checker_pre(inp_text):
15
+ check = Speller(lang='en')
16
+ sentence = inp_text
17
+ return check(sentence)
18
 
19
  title = "Text Correction"
20