Python prototypes and smart search GUI
Benjamin Mesing
bensmail at gmx.net
Fri Sep 8 20:22:16 UTC 2006
Hello
> Do it. Really. Now.
Ok, done, even though I had to remove gdeskcal for that ;-)
> tagsByRelevance
> Gets debtags data and a package list on input, and outputs the tags
> sorted by how relevant they are to that subset of packages. The
> last tags are the most relevant. This can be used to study the
> relevance algorithm, and it's 34 lines of code.
>
> Use: apt-cache search image editor | ./tagsByRelevance /var/lib/debtags/package-tags | tail -20
So these relevance functions are some kind of magic going on ;-)
However, looking at the current formular, one thing seems a bit weird to
me (I've removed some syntactic sugar and changed some braces for
readability..):
sub.card(tag) / full.card(tag) * sqrt[full.card(tag) / full.packageCount()]
Why do you divide by full.packageCount() inside the square root? As long
as the full collection stays the same for all tags (which I suppose it
does) this will not change the relation between packages. This is,
because the equation can be rewritten to:
[ sub.card(tag) / full.card(tag) * sqrt(full.card(tag)) ] / sqrt(full.packageCount())
and the additional factor would be meaningless for the '<' '=' '>'
relations (as long as it is positive anyways...).
> wxssearch
> GUI prototype of a smartsearch interface. The interaction feels
> quite good, at least to me.
>
> Quirk: you may need to resize the window so that the tags on the
> left don't wrap to the next line. I don't know how to easily solve
> that, besides implementing from scratch a custom widget for it.
>
> Check the help menu: it's got an introduction in the about box and
> context-sensitive help. Wow! :)
>
> Use: ./wxsearch
> then input the keywords in the search box and search for
> packages using the tags that appear below.
Cool, a UI tool to try out :-)
Very good, I think a very useful feature is, to be able to enter a new
search expression to get a new tag set. This allows for an incremental
search using tags. I think I will steal some ideas there :-)
Regards
Ben
More information about the Debtags-devel
mailing list