Spaces:
Running
on
Zero
Running
on
Zero
Upload app.py
Browse files
app.py
CHANGED
@@ -56,11 +56,11 @@ def split_num(num):
|
|
56 |
left, right = num[:2], num[2:4],
|
57 |
s = 's' if num.endswith('s') else ''
|
58 |
if 100 <= year % 1000 <= 999:
|
59 |
-
if
|
60 |
-
return f'{
|
61 |
-
elif int(
|
62 |
-
return f'{
|
63 |
-
return f'{
|
64 |
|
65 |
def normalize(text):
|
66 |
# TODO: Custom text normalization rules?
|
|
|
56 |
left, right = num[:2], num[2:4],
|
57 |
s = 's' if num.endswith('s') else ''
|
58 |
if 100 <= year % 1000 <= 999:
|
59 |
+
if right == '00':
|
60 |
+
return f'{left} hundred{s}'
|
61 |
+
elif int(right) < 10:
|
62 |
+
return f'{left} oh {right}{s}'
|
63 |
+
return f'{left} {right}{s}'
|
64 |
|
65 |
def normalize(text):
|
66 |
# TODO: Custom text normalization rules?
|