-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Add parameter to configure priority in every regex skill (proposal) #692
Conversation
30b88e7
to
bf19884
Compare
Codecov Report
@@ Coverage Diff @@
## master #692 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 24 24
Lines 1521 1522 +1
=====================================
+ Hits 1521 1522 +1
Continue to review full report at Codecov.
|
This is really great! Thanks for getting back into it. I'm happy with this approach, it should help us progress with matchers like the parser one you started previously. |
bf19884
to
115da14
Compare
Nice! So I added some explanation in docs, please review it (my English structures can fail sometimes) 😄 |
docs/matchers/regex.md
Outdated
|
||
In order to make NLU skills execute over regex skills, opsdroid always applies a factor of `0.6` to every regex evaluated score. | ||
|
||
Sometimes can be interesting for a developer to get a regex skill executed over a NLU skill, and `score_factor` keyword argument can be used to archieve this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would restructure this sentence like this:
"If a developer want to have a regex skill executed over a NLU one then the keyword argument score_factor
can be used to achieve this."
Hey @anxodio thanks for updating the documentation so quickly. I am going to merge this PR now 😄 👍 |
Description
Here I am again! Hacktoberfest motivated me :)
So I'm recovering an old discussion that was gone stale, I read it again, and I wrote this changes that I think would make all of us happy.
The point here is change the concept of
REGEX_MAX_SCORE
toREGEX_SCORE_FACTOR
(in fact, it was a factor all the time, not a max score), add an optional keyword argument inmatch_regex
to empower the developer to change this factor, but if not provided will be the configuredREGEX_SCORE_FACTOR
(stills in 0.6).With this change, we let the developers prioritize skills that they want to be executed over the NLU skills.
It's a proposal, so if contributors are happy with it, I will update the docs before merging the PR.
Fixes #458
Status
UNDER DEVELOPMENT
Type of change
How Has This Been Tested?
TestParserRegex.test_parse_regex_priority
: it registers the same regex with different factors and ensures the skill with higher priority is executed.Checklist: