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

Cannot extract numbers hyphenated with word eg "2-day" #211

Open
krisgesling opened this issue Oct 7, 2021 · 1 comment
Open

Cannot extract numbers hyphenated with word eg "2-day" #211

krisgesling opened this issue Oct 7, 2021 · 1 comment
Labels
bug Something isn't working en relates to english language

Comments

@krisgesling
Copy link
Contributor

Describe the bug
Some STT engines hyphenate the day count (i.e. 3-day). This is not currently handled by extract_number(). Can remove the hyphen if it is there as a work around, but would be nice to cover this scenario natively.

Are there are scenarios where "{number}-{word}" should not be extracted as a number?

I'm also interested in whether this affects other languages.

To Reproduce

        self.assertEqual(extract_number("give me the 2-day forecast"), 2)
        self.assertEqual(extract_number("3-day cruise"), 3)

Expected behavior
Ability to extract numbers hyphenated to another word.

Context
Identified in: MycroftAI/skill-weather#185

@krisgesling krisgesling added bug Something isn't working en relates to english language labels Oct 7, 2021
@ChanceNCounter
Copy link
Contributor

Are there are scenarios where "{number}-{word}" should not be extracted as a number?

Apartment/suite numbers, perhaps. Nothing else springs to mind.

Also the names of droids

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working en relates to english language
Projects
None yet
Development

No branches or pull requests

2 participants