[texdoc] Some small bugs and more

朝倉卓人 tkt.asakura at gmail.com
Sun Nov 12 06:33:04 CET 2017


Hello everyone,

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)

instead of

	Sorry, no documentation found for FOOBAR

This is parctical because the new fuction will not slow down the conventional
calculation process.


Talking about the technical method, I agree with Paulo's suggestion.
Based on the concept, I wrote a simple experimental code:

	https://gist.github.com/wtsnjp/2b193a5b8096126050055f12ea90ee43

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.

Best regards,
Takuto


More information about the texdoc mailing list