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

fix: extractnumber_xx API incompatibility #71

Conversation

YuukanOO
Copy link
Contributor

For some languages, the definition of extractnumber_xx was incompatible with the use of extract_numbers_generic since it lacks short_scale and ordinals keyword args.

This PR fix this.

It also updates the extractnumber_fr when no number has been found on the given text by returning False instead of a normalized string to make it in sync with all other extractnumber_xx methods in other languages which return a number or False if no number has been parsed. Doing so handle cases such as extractnumbers('2 heures') which failed otherwise.

@devs-mycroft devs-mycroft added the CLA: Needed Need signed CLA from https://mycroft.ai/cla label Jan 20, 2020
@devs-mycroft
Copy link
Collaborator

Hello, @YuukanOO, thank you for helping with the Mycroft project! We welcome everyone
into the community and greatly appreciate your help as we work to build an AI
for Everyone.

To protect yourself, the project, and users of Mycroft technologies we require
a Contributor Licensing Agreement (CLA) before accepting any code
contribution. This agreement makes it crystal clear that along with your
code you are offering a license to use it within the confines of this project.
You retain ownership of the code, this is just a license.

Please visit https://mycroft.ai/cla to initiate this one-time signing. Thank
you!

@krisgesling krisgesling added CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors) and removed CLA: Needed Need signed CLA from https://mycroft.ai/cla labels Jan 20, 2020
@ChanceNCounter
Copy link
Contributor

Properly formatted, fixes an oversight (this fix made it to the Spanish parser, but none of the others.) @YuukanOO even carried the TODO over. What service!

💯

@YuukanOO
Copy link
Contributor Author

Really like this project and trying to implement the extractduration_fr, I ran into those issues so I fixed them 😉

@ChanceNCounter
Copy link
Contributor

It's occurred to me that these should just return result or False. If you wanna get that change before merging this, cool. If not, we'll deal with it later.

@YuukanOO
Copy link
Contributor Author

I'll take care of that 👍

@ChanceNCounter
Copy link
Contributor

Thanks! I'll verify this when I'm back at a workstation, if nobody beats me to it.

@ChanceNCounter ChanceNCounter changed the base branch from master to fix/extractnumber-incompatibility January 27, 2020 05:29
@ChanceNCounter ChanceNCounter merged commit 0421b8c into MycroftAI:fix/extractnumber-incompatibility Jan 27, 2020
@ChanceNCounter
Copy link
Contributor

@YuukanOO I thought I commented on this at the time, but I guess I didn't hit submit.

Your authorship got knocked off the commit in a botched attempt to migrate the branch before merging. If I'd realized that would happen, I would just have asked you to check the "contributors can modify" box, but I was clueless and wound up making your name go poof from the repo.

However, there's a major refactor in process that touches these functions again. If it's good by you, I'd like to take the opportunity to put you back in git log, by throwing you in the merge commit message as a collaborator. It'll still be Wrong in git blame, but at least we can put the thing back in your portfolio.

@YuukanOO YuukanOO deleted the fix/extractnumber-incompatibility branch July 8, 2020 22:43
@YuukanOO
Copy link
Contributor Author

YuukanOO commented Jul 8, 2020

Hi @ChanceNCounter !

Sounds good to me. Stuff like this can happen, not a problem 😉 Thanks for reporting it!

ChanceNCounter added a commit to ChanceNCounter/lingua-franca that referenced this pull request Oct 9, 2020
User @Yuukan00 in PR MycroftAI#71 fixed a number of incompatibilities with non-English languages.
Their commits were accidentally reassigned to another dev during a botched merge.
This is to reintroduce them to git log, using GitHub's coauthorship feature.

Co-authored by: YuukanOO <julien+github@leicher.me>
ChanceNCounter added a commit to ChanceNCounter/lingua-franca that referenced this pull request Oct 9, 2020
User @Yuukan00 in PR MycroftAI#71 fixed a number of incompatibilities with non-English languages.
Their commits were accidentally reassigned to another dev during a botched merge.
This is to reintroduce them to git log, using GitHub's coauthorship feature.

Co-authored by: YuukanOO <julien+github@leicher.me>
ChanceNCounter added a commit to ChanceNCounter/lingua-franca that referenced this pull request Oct 10, 2020
User @Yuukan00 in PR MycroftAI#71 fixed a number of incompatibilities with non-English languages.
Their commits were accidentally reassigned to another dev during a botched merge.
This is to reintroduce them to git log, using GitHub's coauthorship feature.

Co-authored by: YuukanOO <julien+github@leicher.me>
ChanceNCounter added a commit to ChanceNCounter/lingua-franca that referenced this pull request Oct 10, 2020
User @Yuukan00 in PR MycroftAI#71 fixed a number of incompatibilities with non-English languages.
Their commits were accidentally reassigned to another dev during a botched merge.
This is to reintroduce them to git log, using GitHub's coauthorship feature.

Co-authored by: YuukanOO <julien+github@leicher.me>
ChanceNCounter added a commit to ChanceNCounter/lingua-franca that referenced this pull request Oct 10, 2020
User @Yuukan00 in PR MycroftAI#71 fixed a number of incompatibilities with non-English languages.
Their commits were accidentally reassigned to another dev during a botched merge.
This is to reintroduce them to git log, using GitHub's coauthorship feature.

Co-authored-by: YuukanOO <julien+github@leicher.me>
ChanceNCounter added a commit to ChanceNCounter/lingua-franca that referenced this pull request Dec 3, 2020
User @Yuukan00 in PR MycroftAI#71 fixed a number of incompatibilities with non-English languages.
Their commits were accidentally reassigned to another dev during a botched merge.
This is to reintroduce them to git log, using GitHub's coauthorship feature.

Co-authored-by: YuukanOO <julien+github@leicher.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA: Yes Contributor License Agreement exists (see https://github.com/MycroftAI/contributors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants