Spaces:
Sleeping
Sleeping
Commit ·
6a57ce1
1
Parent(s): 35d690d
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,17 +13,11 @@ def capture_numbers (input_sentence):
|
|
| 13 |
'''
|
| 14 |
|
| 15 |
try:
|
| 16 |
-
|
| 17 |
# Define the regular expression patterns
|
| 18 |
pattern1 = r"\b(\w+)\s+(point|decimal|dot|comma)\s+(\w+)\b"
|
| 19 |
|
| 20 |
# Find all matches in the text
|
| 21 |
-
|
| 22 |
-
matches2 = re.findall(pattern2, input_sentence)
|
| 23 |
-
matches3 = re.findall(pattern3, input_sentence)
|
| 24 |
-
matches4 = re.findall(pattern4, input_sentence)
|
| 25 |
-
|
| 26 |
-
matches = matches1 + matches2 + matches3 + matches4
|
| 27 |
|
| 28 |
# This part is to capture cases like six point five, 5 point five, six point 5, 5 point 5
|
| 29 |
pattern_numbers = []
|
|
@@ -62,7 +56,6 @@ def capture_numbers (input_sentence):
|
|
| 62 |
except:
|
| 63 |
return 0
|
| 64 |
|
| 65 |
-
|
| 66 |
def numeric_freetext_dot_freetext(text):
|
| 67 |
'''
|
| 68 |
This is a function to convert cases of 'six point five'
|
|
|
|
| 13 |
'''
|
| 14 |
|
| 15 |
try:
|
|
|
|
| 16 |
# Define the regular expression patterns
|
| 17 |
pattern1 = r"\b(\w+)\s+(point|decimal|dot|comma)\s+(\w+)\b"
|
| 18 |
|
| 19 |
# Find all matches in the text
|
| 20 |
+
matches = re.findall(pattern1, input_sentence)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# This part is to capture cases like six point five, 5 point five, six point 5, 5 point 5
|
| 23 |
pattern_numbers = []
|
|
|
|
| 56 |
except:
|
| 57 |
return 0
|
| 58 |
|
|
|
|
| 59 |
def numeric_freetext_dot_freetext(text):
|
| 60 |
'''
|
| 61 |
This is a function to convert cases of 'six point five'
|