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

Match start of method name #50

Closed
trevorrjohn opened this issue Apr 14, 2015 · 2 comments
Closed

Match start of method name #50

trevorrjohn opened this issue Apr 14, 2015 · 2 comments

Comments

@trevorrjohn
Copy link

We had an issue where no matches were returned despite there being a string match.

class Foo
  def self.set_result_count; end
end

Foo.set_result
#=> NoMethodError: undefined method `set_result' for Foo:Class

Foo.set_result_c
#=> NoMethodError: undefined method `set_result_c' for Foo:Class

    Did you mean? .set_result_count

It would be desirable for the suggestion to appear if everything matches except the postfix. I am not sure how this would look on shorter method names.

@yuki24
Copy link
Member

yuki24 commented Apr 16, 2015

@tjohn Actually it was already implemented (more specifically Jaro-Winkler distance), but it often suggests too many suggestions (see #49). I guess the combination of Levenshtein and Jaro-Winkler distance would be a good fit.

It's hard to make did_you_mean smarter, but the next major version should be coming with a better suggestion algorithm.

Thanks!

@yuki24
Copy link
Member

yuki24 commented Aug 21, 2015

I'm closing this issue since a prefix-based spellchecker has been implemented and shipped with v0.10.0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants