-
Notifications
You must be signed in to change notification settings - Fork 21.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
Move the did_you_mean spellchecker to require-time #32792
Move the did_you_mean spellchecker to require-time #32792
Conversation
r? @schneems (@rails-bot has picked a reviewer for you, use r? to override) |
Smart :) |
I find this harder to grok than the existing code. What's this costing us at runtime? |
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 seconded @kaspth comment. I wonder if we separate our own spellchecker and this file it'll make it much more cleaner (so this file would only do the conditional to see if did_you_mean
exists or not, and if not it just call our new class).
I'm still dubious about the benefit of us using DYM here at all. When it meant we didn't have to maintain our own implementation (#32289), sure.. but now (#32781), I think any incremental gain we receive from some future DYM improvement is likely outweighed by the fact we're adapterizing something that just doesn't matter -- AFAIK we're not even testing both implementations? |
@matthewd agreed, let's just kill it 👍 |
Cool, will drop the whole |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
a697fc2
to
26335b3
Compare
26335b3
to
bd56be8
Compare
The gentle bot nudge made me wanna finish this PR and remove the With the Levenstein algorithm, we always had suggestions as the first ones in the list are the closest ones to the given input. What do you folks think, is it worth it to remove the feature above and drop the |
@gsamokovarov all good ✌️ |
This change conditionally defines
Rails::Command::Spellchecker
basedon the
did_you_mean
presence in require time, so we don't have thecondition executing at runtime.