ShailChoksi / text2digits

Converts text such as "twenty three" to number/digit "23" in any sentence
MIT License
66 stars 22 forks source link

gh-26: padded numbers are not respected, breaking time format #27

Closed fersarr closed 4 years ago

fersarr commented 4 years ago

Added a few tests under tests/test_number_conversion.py::test_zero_padding_is_not_kept

All previously existing tests pass as well:

$ pytest -sv tests/test_number_conversion.py
...
tests/test_number_conversion.py::test_zero_padding_is_not_kept[when I was eleven, I used to sleep at 2:1-when I was 11, I used to sleep at 2:1] PASSED
tests/test_number_conversion.py::test_zero_padding_is_not_kept[at 00:00 I will turn 15-at 0:0 I will turn 15] PASSED
tests/test_number_conversion.py::test_zero_padding_is_not_kept[at 03:03 I will turn 15-at 3:3 I will turn 15] PASSED

...====== 103 passed in 0.15s ====
fersarr commented 4 years ago

closing. Fixed in https://github.com/ShailChoksi/text2digits/pull/28