Share

CLOPS

Tracker: Feature Requests

5 Din you mean... - ID: 2826456
Last Update: Comment added ( radugrigore )

When an illegal option is found, CLOS should recognize possible typos and
get the user a list of options he likely mean.


Viliam Holub ( viliamholub ) - 2009-07-24 08:48

5

Open

None

Nobody/Anonymous

Core

v0.3

Public


Comments ( 5 )

Date: 2009-08-22 17:05
Sender: radugrigoreProject Admin

command-not-found has a gdbm database that maps commands to lists of
packages. Now they added the spell checking code from Peter Norvig (to
which I linked before).


Date: 2009-08-19 09:17
Sender: fintanfProject Admin

An article discussing the recently added behaviour for the
command-not-found hook in bash for ubuntu.

http://webupd8.blogspot.com/2009/08/command-not-found-becomes-more-useful.html

It might be worth checking the implementation for this, how they go from a
list of potential commands and the users input to suggestions of what they
might have meant.


Date: 2009-07-27 12:57
Sender: radugrigoreProject Admin

Levenshtein Distance is not quite what you want in a spell-checker.
Luckily, it's really easy to implement a spell-checker:
http://norvig.com/spell-correct.html


Date: 2009-07-27 11:21
Sender: nobody

Apache commons lang has an implementation of Levenshtein Distance that
could be used. See
org.apache.commons.lang.StringUtils.getLevenshteinDistance(String,String)->int.

There's more to it though than just looking at what can appear at a
position. We get an unknown option also when a user uses a genuine option
somewhere in the format that it cannot appear.

Due to the new error reporting system it might make sense for
UnknownOptionError to carry an optional payload of information. Even
without suggesting via edit distance we should be able to differentiate
between when a real option is used in the wrong place and when an unknown
option is used.


Date: 2009-07-24 11:06
Sender: mikolasjProject Admin

that sounds quite similar to the TAB completion problem, if you know which
strings can appear at some position, you can pick the one with smallest
edit distance


Attached File

No Files Currently Attached

Change ( 1 )

Field Old Value Date By
artifact_group_id None 2009-08-10 15:38 jgcharles