Read numbers from their digits, not through float
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with wiki/audits/ovos-number-parser/design-audit-exact-numbers.md, then inspect the public pronounce_number, extract_number, and numbers_to_digits paths and their language backends. Check consumers of the extract functions before deciding how an opt-in exact return should work; the issue says that API choice needs an owner decision. Done means the listed examples preserve every digit and tests cover the stated cases.
Written by the indexing model from the issue text.
Description
🤖 Auto-generated by Claude Opus 5.5 (claude-opus-5-5) via Claude Code — NOT human-reviewed. Verify before acting. The three examples below were run against the code of #403 and #405 (verified); the design steps are a recommendation (judgment).
What
The parser reads and builds numbers through float. A float holds 15 to 17 significant digits. When a number has more digits than that, the parser speaks or writes digits that are not in the input.
Fixes #401 to #405 remove the float from every path that the public types allow. These cases remain:
| Input | Result | Expected |
|---|---|---|
pronounce_number(Decimal("123456789012345678.25"), "en", places=2) |
"… six hundred and eighty" | "… six hundred and seventy eight point two five" |
pronounce_number(Decimal("0.1234567890123456789"), "en", places=19) |
"… four five six eight" | "… four five six seven eight nine" |
extract_number("twelve quintillion three hundred forty five point two five", "en") |
1.2e+19 |
Decimal("12000000000000000345.25") from the opt-in exact form (step 4) |
numbers_to_digits of the same text |
"1.2e+19" |
"12000000000000000345.25" |
Whole numbers are not affected. An int or an integral Decimal reads with every digit, and whole-number text extracts as an exact int.
Why
The digits of a number are its meaning. A wrong digit in speech or in a skill's data is a wrong answer, and nothing tells the user. Consumers such as text2spoken and the phoonnx SSML reader read the digits themselves to avoid this. Each such workaround is a second number reader that can disagree with this one.
Every defect found in the float paths came from a float conversion placed where the digits already existed as text. Reading the text directly removes the class of defect, not one case of it.
How
The design audit wiki/audits/ovos-number-parser/design-audit-exact-numbers.md (workspace knowledge base) gives the full argument. The steps:
pronounce_numberconverts every input once, at entry, to a small frozen value: sign, integer digits, fraction digits. A float enters throughrepr(), which gives the shortest string that round-trips. ADecimalenters through its own digits. Never useDecimal(float).- The language backends receive that value. One shared reader speaks the fraction digits; each language keeps its own whole-number reader. The per-language public functions keep their signatures, because ovos-date-parser imports them.
- The extractors collect digits as text and build the result from the text.
numbers_to_digitsreturns a string, so it is exact always. extract_numberkeepsintandfloatas its return types, because skills do arithmetic on the result and send it in bus messages. An exact result (for example aDecimal) is opt-in, through a new keyword or function.
Step 4 adds public API. That needs an owner decision before the work starts, and an org-wide search for consumers of the extract functions.
Done when
- Each row of the table above gives the expected result.
- A Decimal or float with any number of digits reads every digit to
places. - No path inside the parser converts a value with a fraction to
float, except the documented default return ofextract_number.
- Dominant language
- Python
- Stars
- 4
- Forks
- 5
- Avg merge
- 5h 40m
- Merged PRs (30d)
- 97
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenVoiceOS/ovos-number-parser
-
Bosnian 11 and 16 are spelled "jedenaest" and "šestnaest"; the words are "jedanaest" and "šesnaest"Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenVoiceOS/ovos-number-parser#589 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
OpenVoiceOS/ovos-number-parser#573 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
OpenVoiceOS/ovos-number-parser#559 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 73/100
OpenVoiceOS/ovos-number-parser#585 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 58/100
OpenVoiceOS/ovos-number-parser#576 ·
Maintainers usually reply within 1 day
All issues in OpenVoiceOS/ovos-number-parser
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gke-labs/kube-agents#7441 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
open-webui/open-webui#35142 · 1 comment ·
Maintainers usually reply within 1 day