Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,12 +6,10 @@ dictionary=dictionaryFile.readlines() # Read words file into list
|
|
6 |
|
7 |
# Work
|
8 |
def get_matches(text):
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
except Exception as ex: # Print error if error
|
14 |
-
return(ex)
|
15 |
|
16 |
iface = gr.Interface(fn=get_matches, inputs="text", outputs="text")
|
17 |
iface.launch()
|
|
|
6 |
|
7 |
# Work
|
8 |
def get_matches(text):
|
9 |
+
try:
|
10 |
+
return(difflib.get_close_matches(text, dictionary,1)[0].replace("\n", ""))
|
11 |
+
except Exception as ex: # Print error if error
|
12 |
+
return(ex)
|
|
|
|
|
13 |
|
14 |
iface = gr.Interface(fn=get_matches, inputs="text", outputs="text")
|
15 |
iface.launch()
|