Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,6 +141,15 @@ def soundex(word):
|
|
| 141 |
soundex_code = soundex_code.replace('0', '') + '000'
|
| 142 |
return soundex_code[:4]
|
| 143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
# Function to convert text to numerical representation
|
| 145 |
def text2int(textnum, numwords={}):
|
| 146 |
units = ['Z600', 'O500','T000','T600','F600','F100','S220','S150','E300','N500',
|
|
@@ -226,7 +235,7 @@ for word in textnum.split():
|
|
| 226 |
|
| 227 |
if onnumber:
|
| 228 |
curstring += repr(result + current)
|
| 229 |
-
|
| 230 |
return curstring
|
| 231 |
|
| 232 |
# Convert sentence to transcript using Soundex
|
|
|
|
| 141 |
soundex_code = soundex_code.replace('0', '') + '000'
|
| 142 |
return soundex_code[:4]
|
| 143 |
|
| 144 |
+
def is_number(x):
|
| 145 |
+
if type(x) == str:
|
| 146 |
+
x = x.replace(',', '')
|
| 147 |
+
try:
|
| 148 |
+
float(x)
|
| 149 |
+
except:
|
| 150 |
+
return False
|
| 151 |
+
return True
|
| 152 |
+
|
| 153 |
# Function to convert text to numerical representation
|
| 154 |
def text2int(textnum, numwords={}):
|
| 155 |
units = ['Z600', 'O500','T000','T600','F600','F100','S220','S150','E300','N500',
|
|
|
|
| 235 |
|
| 236 |
if onnumber:
|
| 237 |
curstring += repr(result + current)
|
| 238 |
+
|
| 239 |
return curstring
|
| 240 |
|
| 241 |
# Convert sentence to transcript using Soundex
|