Vihang28 commited on
Commit
14e9155
·
verified ·
1 Parent(s): 3a08ae3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -3,20 +3,20 @@ from symspellpy import SymSpell
3
  import autocorrect
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
 
21
  with gr.Blocks(title=title) as demo:
22
  gr.Markdown(f'<h1 style="text-align: center; margin-bottom: 1rem;">{title}</h1>')
 
3
  import autocorrect
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(inp_text):
15
  check = Speller(lang='en')
16
  sentence = inp_text
17
  return check(sentence)
18
 
19
+ title = "Misspell Correction"
20
 
21
  with gr.Blocks(title=title) as demo:
22
  gr.Markdown(f'<h1 style="text-align: center; margin-bottom: 1rem;">{title}</h1>')