hexgrad commited on
Commit
5895ac2
·
verified ·
1 Parent(s): f3d4c6b

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 second_half == '00':
60
- return f'{first_half} hundred{s}'
61
- elif int(second_half) < 10:
62
- return f'{first_half} oh {second_half}{s}'
63
- return f'{first_half} {second_half}{s}'
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?