Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spelled_numbers.c doesn't always get the right answer #360

Open
smcameron opened this issue Jun 26, 2024 · 0 comments
Open

spelled_numbers.c doesn't always get the right answer #360

smcameron opened this issue Jun 26, 2024 · 0 comments

Comments

@smcameron
Copy link
Owner

This is an old known bug, just documenting it here.

spelled_numbers.c converts things like "one hundred" to the integer 100. It is needed because speech recognition of spoken things like "set the warp drive to 100%" results in a string like "set the warp drive to one hundred percent", and we need to extract the number out of that.

There are several test cases in spelled_numbers.c that fail:

Failed: input = 'nineteen fifty six'
    output = '75'
  expected = '1956'
Failed: input = 'it was a different time, nineteen fifty seven, fifty eight.'
    output = 'it was a different time, 76, 58.'
  expected = 'it was a different time, 1957, 58.'
Failed: input = 'twentyfour'
    output = 'twentyfour'
  expected = '24'
Failed: input = 'one hundred and ten thousand'
    output = '1000000'
  expected = '110000'

Luckily, such numbers don't often come up in the context of telling your spacecraft computer what you want it to do.

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

No branches or pull requests

1 participant