Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 =
|
10 |
terms = symsp.lookup_compound(sentence,max_edit_distance=2)
|
11 |
return terms[0].term
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
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 |
|