Re: fstrcmp
Jérôme Pouiller writes:
> On Sunday 31 May 2009 03:49:37 Peter Miller wrote:
> [...]
>>This goes for packages as well. Wouldn't it be great if
>>
>> apt-get install dns-utils
>>
>>instead of saying
>>
>> E: Couldn't find package dns-utils
>>
>>it said something more useful, like
>>
>> E: Couldn't find package dns-utils, did you mean dnsutils instead?
>
> It is naive to think matching algorithm iterates on all items until it
> find the correct one. At least, algorithm use a sorted index with a
> dichotomy search.
>
> Nevertheless, your idea is interesting. But you should implement a
> function to match the nearest string in a set of strings. Take a look in
> spell checking libraries to have an idea how to implement it.
Isn't this optimization premature? I would say: Package the library,
implement the fuzzy matching, and if it is too slow for people to like
the case where they misspell a package name, *then* optimize for
run-time. I would rather have the fuzzy matching sooner than have it
shave a few milliseconds off the display time for a correction.
Michael Poole
Reply to: