<davexunit>civodul: I was thinking that adding levenshtein edit distance to improve `guix package -A foo` output would be a fun hack for this weekend.
<mark_weaver>davexunit: shortly after you asked about this before, I implemented a procedure that computes the edit distance and also shows the associated list of minimal edits. however, for what you're talking about it to be reasonably efficient, we'd need something more elaborate than what I wrote. I found links on wikipedia for such things, but now I've forgotten them. levenshtein automata maybe? or something like that?
<davexunit>How should we display this information to the user? I was thinking that if there are no packages that match the given pattern, we display a message like "No packages match 'whatever'. Did you mean one of these?" and then give a list of packages that have an edit distance of 2 or so.
<mark_weaver>davexunit: one thing: transpositions are one of the most common errors that people make, so if the maximum edit distance is small, make sure to take that into account. there are a couple of variants of levenshtein that consider transpositions to be a single edit.
<mark_weaver>as for how to display it, that's a good question! let's get the hard part implemented first, and we can worry about those details later.
<davexunit>mark_weaver: okay, I'll keep transpositions in mind.
<davexunit>I'm still hunting for information about the automaton
<mark_weaver>other possible algorithms, possibly better, are from Ukkonen in 1985, and the "bitap" algorithm.
<mark_weaver>phant0mas: I suspect the destination has to be the new name. the 'cp' program is clever and figures out what you want based on whether the destination is an existing directory, but 'copy-file' is lower-level.
<phant0mas>bits is a folder which I want to copy the file in