Whole file
careless25/text2digits
The author described this change as “Fix handling of time formats, add tests (from PR #27)”. It counts as a record because the check below fails on the code as it stood at ceba3d954 and passes on 0ddb34121, with nothing else changed between the two runs.
Projectcareless25/text2digits
Fix saved2020-04-29
Sharing licenceMIT · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
Fix handling of time formats, add tests (from PR #27)
The change
| 76 | 76 | self.type = WordType.SCALES | |
| 77 | 77 | elif self._word in Token.CONJUNCTION: | |
| 78 | 78 | self.type = WordType.CONJUNCTION | |
| 79 | - | elif re.search(r'\d+\.\d*|\d*\.\d+', self._word): | |
| 79 | + | elif re.search(r'^\d+\.\d*|\d*\.\d+$', self._word): | |
| 80 | 80 | self.type = WordType.LITERAL_FLOAT | |
| 81 | - | elif re.search(r'\d+', self._word): | |
| 81 | + | elif re.search(r'^\d+$', self._word): | |
| 82 | 82 | self.type = WordType.LITERAL_INT | |
| 83 | 83 | else: | |
| 84 | 84 | self.type = WordType.OTHER |
The check that tells the two apart
fail→pass·tests/test_number_conversion.py::test_time_formats[at
Check file tests/test_number_conversion.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before itceba3d954fc923cf7b14906194e232a42eb53636
Broken version dated2020-04-27
Moduletext2digits.tokens_basic
Units changedToken
Fingerprintd25e0f42f33a8d25
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in careless25/text2digits
- 2026-04-28Fix how 'oh' is handled
- 2026-04-28Raise valueError if value/scale didnt match
- 2026-04-28find_similar_word
- 2026-04-28bigram_similarity
- 2026-04-24split_glues