[texdoc] Some small bugs and more
tkt.asakura at gmail.com
Sun Nov 12 06:33:04 CET 2017
I'm thinking the "fuzzy search" function will run only when
- the conventional search method cannot find any document; and
- using interactive menus.
In that situation, texdoc will ask something like
Do you mean "FOOBAZ"? (y/N)
Sorry, no documentation found for FOOBAR
This is parctical because the new fuction will not slow down the conventional
Talking about the technical method, I agree with Paulo's suggestion.
Based on the concept, I wrote a simple experimental code:
This script works well than I thoght, and it finish the calculation in less than
0.5 seconds in my laptop (1.3 GHz Intel Core i5; 8 GB RAM).
The script is using very naive way to find the minimum Levenshtein distance.
There are more effective method (Bitap algorithm) but it seems we don't have to
implement such a complicated algorithm because the number of packages in TeX Live
is not so large at this point.
Currently, the ocject of the fuzzy search is restricted to the package names but
I think this is very enough for the time being.
More information about the texdoc