Skip to content

Fix number word conversion offset - #141

Open
dajiaohuang wants to merge 1 commit into
AlbertMN:masterfrom
dajiaohuang:fix-number-word-off-by-one
Open

dajiaohuang wants to merge 1 commit into
AlbertMN:masterfrom
dajiaohuang:fix-number-word-off-by-one

Conversation

@dajiaohuang

Copy link
Copy Markdown

WordsToNumbers.EnglishGet starts its accumulator at -1 but returns recognized values unchanged, shifting spoken numbers down by one. Because Actions.SetVolume treats -1 as invalid, "one" currently maps to 0% and "zero" is rejected.

Track whether a number word was recognized; return the correctly offset value only for recognized input and preserve -1 for invalid input.

Validation: an isolated synthetic C# harness compiled the current source and verified zero, one, two, ten, twenty, thirty five, one hundred, unknown, and empty inputs. No system-volume or other OS action was invoked. git diff --check passed.

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.

1 participant