Comments (5)
I'm starting to think that this (and #94) is maybe more of an issue with the scoring than with how the results are displayed.
Example:
$ texdoc -lM qwert # unstable results here
qwert 7.0 /usr/local/texlive/2022/texmf-dist/doc/fonts/bera/bera.pdf Font samples
qwert 1.8 /usr/local/texlive/2022/texmf-dist/doc/fonts/bera/README Readme
qwert 1.6 /usr/local/texlive/2022/texmf-dist/doc/fonts/bera/bera.txt
$ texdoc -lM texbytopi
texdoc warning: No good result found, showing all results.
texbytopi -8.5 /usr/local/texlive/2022/texmf-dist/doc/plain/texbytopic/TeXbyTopic.pdf The book itself
texbytopi -9.8 /usr/local/texlive/2022/texmf-dist/doc/plain/texbytopic/README Readme
$ texdoc -lM zezbytopiz
zezbytopiz 7.0 /usr/local/texlive/2022/texmf-dist/doc/plain/texbytopic/TeXbyTopic.pdf The book itself
zezbytopiz 1.8 /usr/local/texlive/2022/texmf-dist/doc/plain/texbytopic/README Readme
With the first case, no one will really care what message we show since there aren't really any sensible results for the search. What would be bad here would be to just open a random document with no notice, but that is what is happening here.
For the second case, texdoc "should" be able to open the correct document automatically. Showing any message here would be fairly annoying, but that is what is happening here.
The third case shows texdoc being helpful and correcting my terrible spelling. I think that it's a tossup here for if an "ideal" texdoc should ask first or just open up the first matching document. Also interesting is how the scores here compare to the scores in the second case.
(Also, this is not a dig at texdoc's scoring. I find that texdoc works really well in practice; these are just some surprising edge cases)
I'm thinking that if fuzzy/Levenshtein searching is penalized more and the fuzzy search algorithm also considers adding letters (maybe it does already but it's just penalized too much?), we might not need to add any config options.
(#96 seems like a good idea to me regardless)
from texdoc.
Another value view
to show the top ones anyway, even if there are only negative matches. This is the identical behavior as in v3.x.
from texdoc.
When the value is other than ask
, it would be better to display a warning as in the case of going to showall in the current list mode.
$ texdoc -l topic
texdoc warning: No good result found, showing all results.
1 /usr/local/texlive/2023/texmf-dist/doc/latex/bibtopic/bibtopic.pdf
= Package documentation
...
from texdoc.
from texdoc.
I think the second case (texdoc -lM texbytopi
) is the one that really needs improvement. Could you please create a separate issue?
The fuzzy search I introduced in Texdoc v3.0 is incomplete. The fuzzy search is only executed when Texdoc fails to find anything in the standard search; in the second case, the fuzzy search is not working because something was found even though only negative matches were found. This is why the results are worse than in the third case (texdoc -lM zezbytopiz
).
The fuzzy search should be triggered even when only bad results are found. More to the point, you could always use fuzzy search in any case and, as you say, give an appropriate penalty based on edit distance. However, the latter would require more drastic changes than the former.
In any case, I don't think it will eliminate the cases where only negative matches are found, no matter how hard you try to calculate the score. In such cases, I think adding this config item is worthwhile, as there are those who do not want to see any online search options and those who want to do online searches. Improving score calculation and improving the way negative matches are displayed should both be done independently.
from texdoc.
Related Issues (20)
- Extension of fuzzy search targets
- Reduce cache file size HOT 1
- No "Locale unmatch" penalty when "lang" is missing HOT 1
- It seems the texdoc.cnf installed in texmf-dist/texdoc by default uses lastfile_switch=true thus preventing file in TEXMFHOME to have any effect HOT 7
- geeomtry-de preferred? HOT 5
- pkgname.pdf vs. pkgname-{foo,doc}.pdf HOT 2
- CTAN search link is deprecated HOT 2
- texdoc 4.0.1 prefers geometry-de HOT 2
- texdoc metafun finds mycow.pdf HOT 1
- erroneous option syntax -= gives lua error
- display them all -> allow number HOT 2
- structuredlog -> ltfilehook-doc
- Prefixes of `Docfile.name` are inconsistent
- Texdoc 4.0 Release HOT 1
- 4.0: Is opening doc with negative score disabled? HOT 3
- texdoc plain HOT 8
- Prompt for no "good" results HOT 2
- Prompt when there are too many results HOT 2
- Fuzzy search should always be attempted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from texdoc.