handle UnboundLocalError in ar_spelling_checker

#4
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -123,6 +123,7 @@ def ar_spelling_checker(text):
123
  result = {}
124
 
125
  for word in word_l:
 
126
  if not word in vocab:
127
  tmp_corrections = get_corrections(word, vocab)
128
  if len(tmp_corrections) == 0:
 
123
  result = {}
124
 
125
  for word in word_l:
126
+ tmp_corrections = []
127
  if not word in vocab:
128
  tmp_corrections = get_corrections(word, vocab)
129
  if len(tmp_corrections) == 0: