Whole file

allo-media/text2num

The author described this change as [DE] fix hundred addition. It counts as a record because the check below fails on the code as it stood at 7fea5d1de and passes on 079ea8cee, with nothing else changed between the two runs.

Fix saved2023-11-24
Sharing licenceMIT · LICENSE
Change size+2 0

What the code was meant to do, written into the code itself as a save note

[DE] fix hundred addition

The change

346346 elif (ng[hundred_index - 1] in self.lang.UNITS) or (
347347 ng[hundred_index - 1] in self.lang.STENS
348348 ):
349+ if hundred_index - 2 >= 0 and ng[hundred_index - 2] not in self.lang.MULTIPLIERS:
350+ raise ValueError("invalid {} without multiplier: {}".format(STATIC_HUNDRED, repr(ng)))
349351 multiplier = German.NUMBER_DICT_GER[ng[hundred_index - 1]]
350352 equation += "(" + str(multiplier) + " * 100)"
351353 equation_results.append(multiplier * 100)

The check that tells the two apart

failpass·tests/test_text_to_num_de.py::TestTextToNumDE::test_text2num_hundred_addition

Check file tests/test_text_to_num_de.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 it7fea5d1deef15f2119c6236954fa9bd6d2dd2f58
Broken version dated2023-11-23
Moduletext_to_num.parsers
Units changedWordStreamValueParserGerman
Fingerprint7c3d5625a66ea398
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 allo-media/text2num