Skip to content

Fix 4-digit length restriction bug in numb command - #975

Open
amirf147 wants to merge 1 commit into
dictation-toolbox:masterfrom
amirf147:fix/numeric-digit-series-limit
Open

Fix 4-digit length restriction bug in numb command#975
amirf147 wants to merge 1 commit into
dictation-toolbox:masterfrom
amirf147:fix/numeric-digit-series-limit

Conversation

@amirf147

Copy link
Copy Markdown
Contributor

Fix 4-digit length restriction bug in numb command

PR description written with Agent in Antigravity IDE

Description

Migrates the wnKK extra in castervoice/rules/core/numbers_rules/numeric.py from ShortIntegerRef to NumberRef("wnKK", zero=True). This resolves digit sequence length constraints and allows arbitrary strings of digits to be dictated up to Dragonfly's maximum series length (7 digits).

Note: This change alone does not resolve the leading zero truncation issue (e.g. dictating "numb zero one one" will still print "11" because the leading zero is mathematically dropped by unmodified Dragonfly).

Related Issue

Motivation and Context

  • Why this change is required: ShortIntegerRef is designed for shorthand magnitudes, which restricts the engine from cleanly parsing arbitrary sequential digit dictations longer than 4 characters (e.g., "one two three four five").
  • What it solves: By switching to NumberRef, the parsing is delegated to Dragonfly's native loop-based Repetition grammar, extending the length limit to 7 digits.
  • Dragonfly Dependency: To fully resolve the leading zero truncation (e.g., preserving "011"), this PR should be paired with the proposed Dragonfly fix (see Fix number series sequence matching, length limits, and zero formatting dragonfly#409) that implements a custom StringInt return type. However, even without the Dragonfly patch, this PR stands alone as a valuable upgrade by immediately resolving the digit length limit (Unable to dictate 5 consecutive numbers #857).

How Has This Been Tested

  • Tested locally within Caster using Kaldi back end.
  • Dictating "numb one two three four five six seven" successfully parsed and typed out the full sequence.

Types of changes

  • Bug fix (non-breaking change which fixes an issue or bug)

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My code implements all the features I wish to merge in this pull request.

Video Demo

In the demo, I'm using baseline Dragonfly, not the other fix I proposed in dragonfly PR 409. This shows this number fix works independently for length limit but not leading zeroes getting chopped off.

2026-07-18.04-34-42.mp4

Migrates the wnKK extra from ShortIntegerRef to NumberRef in the Caster
numeric rule. This resolves digit sequence length constraints and allows
arbitrary strings of digits to be dictated.

Note: This change does not resolve the leading zero truncation issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to dictate 5 consecutive numbers

1 participant