[texdoc] changes in aliasing and scoring

Manuel Pégourié-Gonnard mpg at elzevir.fr
Fri Nov 20 15:41:10 CET 2009


Hi all,

I'm preparing a major update of texdoc (currently in the master branch).
The two main points are:

1. Aliases are no longer name substitutions, but instead /add/ keywords
to be looked for.
2. There is know a scoring system, better separated from the search
system, and with (hopefully) improved performance.

The basics are explained in the updated documentation (temporarily
available at <http://tug.org/texdoc/dev/texdoc.pdf>). Here are a few
more details an questions.

Concerning aliases. The old behaviour was to override the original name,
now aliases add more names to look for. However, results found found
from an alias get a high score, so the win over other results, so the
new behaviour should be sort-of compatible, at least if only the first
result is taken into account.

Do you think there is a need for a "substitute" directive that would
"kill" the original name? I can't see any reasonable use for it. Also,
it is rather unclear to me how it should interact with aliases.

Concerning scoring, I finally implemented quite a few items which were
waiting in the wishlist:
- foo/foo.pdf now wins over anything/foo.pdf
- foo-doc.pdf or foodoc.pdf wins over foo-bar.pdf which wins over
foolish.pdf
- tex-virtual-academy-pl gets a malus (it is even possible to kill it)
- Makefile's are killed
- files without extension get score 0 (configurable).

This triggered a little rework of mode. Now, the old "search" mode is
called "showall" and just means to show also results with score <= 0. I
intend to drop regex mode sooner or later since it makes too many
special cases in the code and more generally, doesn't fit well with the
current texdoc philosophy IMO.

As a result of these reworks, texdoc will sometimes show more results
than before, sometimes less, but overall I think it tends to show
relevant results and only them more often than before (fingers crossed).

I still have a few more items on my list for the upcoming 0.60. Mainly,
I want to finish making the thing more configurable, by adding a
stopalias directive so that a user can prevent a name from being aliased
in the main configuration file, and options to setscore/adjscore in the
same vein.

Comments and suggestions are welcome as usual.

Manuel.


More information about the texdoc mailing list