Spaces:
Runtime error
Runtime error
fixing bugs
Browse files
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
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
output = []
|
| 326 |
-
|
|
|
|
| 327 |
output.append('-'.join(i).lower())
|
| 328 |
-
|
|
|
|
| 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():
|