RobPruzan commited on
Commit
33a9b02
1 Parent(s): a968a38

fixing bugs

Browse files
Files changed (1) hide show
  1. app.py +17 -9
app.py CHANGED
@@ -315,17 +315,25 @@ def phon(text):
315
  pronun.append(alph[word][0])
316
  except Exception as e:
317
  pronun.append(word)
318
-
319
- def remove_digits(lists):
320
- for lst in lists:
321
- for idx, word in enumerate(lst):
322
- lst[idx] = ''.join([letter for letter in word if not letter.isdigit()])
323
- return lists
324
-
 
 
 
 
 
 
325
  output = []
326
- for i in remove_digits(pronun):
 
327
  output.append('-'.join(i).lower())
328
- return ' '.join(output)
 
329
 
330
 
331
  def plot():
 
315
  pronun.append(alph[word][0])
316
  except Exception as e:
317
  pronun.append(word)
318
+
319
+ def flatten(l):
320
+ new_l = []
321
+ for i in l:
322
+ if type(i) is list:
323
+ for j in i:
324
+ new_l.append(''.join([i.lower() for i in j if not i.isdigit()]))
325
+
326
+ else:
327
+ new_l.append(str(i))
328
+ print('here')
329
+ new_l.append(' ')
330
+ return "-".join(new_l)
331
  output = []
332
+ f = flatten(pronun)
333
+ for idx, i in enumerate(f):
334
  output.append('-'.join(i).lower())
335
+ print(output)
336
+ return ''.join(output)
337
 
338
 
339
  def plot():