Spelling mistake detection - "nearly right" spelling suggestion #161

benkasminbullock opened this Issue Jun 21, 2012 · 2 comments


None yet

2 participants


Would it be possible to put some kind of spelling mistake detection in the underlying application (the Google App Engine part) whereby if someone mistypes a name, e.g.

cpanm CGI::Compress:Gzip


cpanm Lingua::Stopwords

then it would do an edit-distance based search (like the one in "git" if you type "git cofig":

git: 'cofig' is not a git command. See 'git --help'.

Did you mean this?  <----------- THIS

This would be quite a big help.


while I agree that it would be nice to have such extension, there's not so much I can do about it given the number of distributions we have on CPAN (not like number of git commands).

Also, many applications (carton, pinto, pm-outdated, lots of sysadmin scripts) uses cpanm as a scripting interface, and suggestions like this would bother them.

Anyway, feel free to make such a service yourself and write cpanm wrapper that uses it if you want. Note that the app is not running on AppEngine, it's a standard perl application running on Linode. The code is on my github.

@miyagawa miyagawa closed this Jun 21, 2012

Unfortunately I don't have the resources, knowledge, ability and time to write such a service. But just as a proof of concept for anyone who does, I wrote a test case for searching the file 02packages list, which is here:


On my computer, it takes between 0.8 and 1.5 seconds to search using the uncompressed file and more than 2 seconds using the compressed file, so it is a bit slow. Reading the uncompressed file takes 0.05 seconds, so the main bottleneck is the edit distance search function, which could be speeded up by setting a minimum distance allowable.

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