Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -6,12 +6,10 @@ dictionary=dictionaryFile.readlines() # Read words file into list
6
 
7
  # Work
8
  def get_matches(text):
9
- while True: # Work cycle
10
- try:
11
- return(difflib.get_close_matches(text, dictionary,1)[0].replace("\n", ""))
12
- time.sleep(.1)
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()