-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
enh(parser) beginKeyword no longer bestows double relevance #2953
enh(parser) beginKeyword no longer bestows double relevance #2953
Conversation
- titles are not given relevance - attributes are typically not given relevance (other than when a key part of language like HTML, JSON, etc)
Commit history here is clean if one wanted to review per commit. |
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.
Looks good, but do we really need floating-point relevance (1.5)? I guess 2 didn't work, but still...
Well, need is a strong word. I don't want to encourage it (if not necessary), but it was helpful here; and honestly DOUBLE relevance (not to mention 10x) is really a pretty huge multiple to be the only choice. And many of the really "smart" things we could do with relevance will ultimately result in fractional relevance values.
|
Previously something like:
Would bestow 2 relevance. 1 for the rule match and a second for the
keywords
match. This is not correct behavior. A single "token" shoulddefault to a single relevance point, not 2.
Changes
This changes the default relevance of a mode containing
beginKeywords
to 0 forcing it to only gain relevance from keyword matches alone.
This of course revealed a few auto-detect balance issues (because some
grammars had been benefiting from this extra boost) which this PR
also resolves.
Checklist
CHANGES.md
AUTHORS.txt
, under Contributors