Skip to content

Distance recommendations for ri #45

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

Closed
erikh opened this issue Jun 10, 2011 · 4 comments · Fixed by #533
Closed

Distance recommendations for ri #45

erikh opened this issue Jun 10, 2011 · 4 comments · Fixed by #533

Comments

@erikh
Copy link
Contributor

erikh commented Jun 10, 2011

Could work similar to rubygems' levenshtein matcher, e.g.:

 $ ri Hash.deltee
 WHY HELLO THERE PILGRIM: DID YOU MEAN Hash#delete ?
@drbrain
Copy link
Member

drbrain commented Jun 10, 2011

I wonder if we can apply an appropriate lever to get string distance matching into Ruby itself so both RDoc and RubyGems can benefit from the same code.

Currently this works:

$ ri19 Encoding.compatibleEncoding.compatible not found, maybe you meant:

Encoding::compatible?

@drbrain
Copy link
Member

drbrain commented Jun 10, 2011

Oh, if there's only one option ri should just show it, no need to beat the user with their own typos

@erikh
Copy link
Contributor Author

erikh commented Jun 10, 2011

I think that'd be a good idea, agreed on the single option too, but maybe with some indicator (e.g., how google does it by conspicuously warning you it's changed your search terms)

Big projects are out due to recent developments that are pretty much sapping all my free time, but I'll be happy to send a string patch to the right places if you'd be willing to review and back it for this purpose, which should hopefully simplify things a bit for you.

@drbrain
Copy link
Member

drbrain commented Jun 10, 2011

Can you copy the distance code in from RubyGems and apply it to RDoc::RI::Driver?

It looks like it would go in #display_name

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

Successfully merging a pull request may close this issue.

2 participants