c-n-f does not suggest commands with numbers ('bzip' does not suggest 'bzip2')

Bug #507760 reported by Jim Cheetham
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
command-not-found
Fix Released
Low
Zygmunt Krynicki
command-not-found (Ubuntu)
Fix Released
Wishlist
Unassigned

Bug Description

Binary package hint: command-not-found

The function similar_words in CommandNotFound.py does not consider numbers in command names, and therefore c-n-f fails to suggest 'bzip2' when given the input 'bzip'.

jim@roro:~$ bzip
No command 'bzip' found, did you mean:
 Command 'bip' from package 'bip' (universe)
 Command 'jzip' from package 'jzip' (universe)
 Command 'zip' from package 'zip' (main)
 Command 'xzip' from package 'xzip' (universe)
 Command 'mzip' from package 'mtools' (main)
 Command 'wzip' from package 'wzip' (universe)
 Command 'ebzip' from package 'eb-utils' (universe)
 Command 'lzip' from package 'lzip' (universe)
 Command 'rzip' from package 'rzip' (universe)
 Command 'gzip' from package 'gzip' (main)
bzip: command not found

Adding numbers to the available 'alphabet' in the similar_words function fixes this situation

jim@roro:~$ bzip
No command 'bzip' found, did you mean:
 Command 'jzip' from package 'jzip' (universe)
 Command 'zip' from package 'zip' (main)
 Command 'ebzip' from package 'eb-utils' (universe)
 Command 'lzip' from package 'lzip' (universe)
 Command 'wzip' from package 'wzip' (universe)
 Command 'xzip' from package 'xzip' (universe)
 Command 'mzip' from package 'mtools' (main)
 Command 'gzip' from package 'gzip' (main)
 Command 'bip' from package 'bip' (universe)
 Command 'bzip2' from package 'bzip2' (main)
 Command 'rzip' from package 'rzip' (universe)
bzip: command not found

Tags: patch
Revision history for this message
Jim Cheetham (jim.cheetham) wrote :

Credit: Reported by ol on #ubuntu-nz, similar_words() identified by ajmitch on #ubuntu-nz. Diff produced by yojimbo-san on #ubuntu-nz.

Revision history for this message
Jim Cheetham (jim.cheetham) wrote :

Sorry, I trusted a wildcard to make my diff; it's in the wrong direction ... here's a better one.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

confirming for lucid

Changed in command-not-found (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
tags: added: patch
Revision history for this message
Rolf Leggewie (r0lf) wrote :

patch looks simple enough that I think we should try to get this in before lucid release

Changed in command-not-found (Ubuntu):
milestone: none → ubuntu-10.04-beta-1
Zygmunt Krynicki (zyga)
Changed in command-not-found:
milestone: none → 0.2.41
importance: Undecided → Low
assignee: nobody → Zygmunt Krynicki (zkrynicki)
status: New → Fix Committed
Zygmunt Krynicki (zyga)
Changed in command-not-found:
status: Fix Committed → Fix Released
Michael Vogt (mvo)
Changed in command-not-found (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package command-not-found - 0.2.40ubuntu3

---------------
command-not-found (0.2.40ubuntu3) lucid; urgency=low

  * CommandNotFound/CommandNotFound.py:
    - cherry pick "add numbers to the alphabet used for suggestions "
      from trunk (r116) (LP: #507760)
  * scan.data:
    - updated for beta-1
 -- Michael Vogt <email address hidden> Mon, 15 Mar 2010 09:36:32 +0100

Changed in command-not-found (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.