One function
find_similar_word in careless25/text2digits
The author described this change as “Fix off-by-one error in find_similar_word”. It counts as a record because the check below fails on the code as it stood at 55b5ca05f and passes on 15e16fbec, with nothing else changed between the two runs.
Projectcareless25/text2digits
Fix saved2026-04-28
Sharing licenceMIT · LICENSE
Change size+3 −3
What the code was meant to do, written into the code itself as a docstring
Returns the most syntactically similar word in the collection to the specified word.
The change
| 9 | 9 | for item in collection: | |
| 10 | 10 | similarity = bigram_similarity(word, item) | |
| 11 | 11 | ||
| 12 | - | # The similarity must be above the threshold and if this is true for | |
| 13 | - | # multiple words, we take the most similar one | |
| 14 | - | if similarity > max(max_similarity, threshold): | |
| 12 | + | # The similarity must meet or exceed the threshold and if this is true | |
| 13 | + | # for multiple words, we take the most similar one | |
| 14 | + | if similarity >= threshold and similarity > max_similarity: | |
| 15 | 15 | match = item | |
| 16 | 16 | max_similarity = similarity | |
| 17 | 17 |
The check that tells the two apart
fail→pass·tests/test_text_processing_helpers.py::TestFindSimilarWord::test_exact_threshold_is_accepted
Check file tests/test_text_processing_helpers.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 it55b5ca05f1b718ef29b22d7cecee274ef58f2feb
Broken version dated2026-04-28
Moduletext2digits.text_processing_helpers
Units changedfind_similar_word
Fingerprintf662e71fbb4aa59c
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-28bigram_similarity
- 2026-04-24split_glues
- 2020-04-29Fix handling of time formats, add tests (from PR #27)