Enrico Zini: apt-xapian-index: dynamically generated tag clouds
apt-xapian-index: dynamically generated tag clouds
About apt-xapian-index, I have already posted:
Generating a tag cloud out of any Xapian query is simple, and it
is just a matter of presenting into a tag cloud the information
that you get with the technique shown in a
smart way of querying tags: you get the tags related to the
query, and you lay out their names with a font size proportional to
their Xapian rank.
For the presentation, we can load pretty names from the Debtags
vocabulary in
The query then goes on as usual, and when we get the tags from
the
Finally, you mark up a
That's it, try it out.
You can use the
git web interface to get to the full source code and the
module it uses.
- an introduction of apt-xapian-index;
- an example of how to query it;
- a way to add simple result filters to the query;
- a way to suggest keywords and tags to use to improve the query.
- a way to search for similar packages.
- a way to implement an adaptive cutoff on result quality.
- a smart way of querying tags
- how to implement search as you type
Generating a tag cloud out of any Xapian query is simple, and it
is just a matter of presenting into a tag cloud the information
that you get with the technique shown in a
smart way of querying tags: you get the tags related to the
query, and you lay out their names with a font size proportional to
their Xapian rank.
For the presentation, we can load pretty names from the Debtags
vocabulary in /var/lib/debtags/vocabulary:
from debian_bundle import deb822 # Facet name -> Short description facets = dict() # Tag name -> Short description tags = dict() for p in deb822.Deb822.iter_paragraphs(open("/var/lib/debtags/vocabulary", "r")): if "Description" not in p: continue desc = p["Description"].split("\n", 1)[0] if "Tag" in p: tags[p["Tag"]] = desc elif "Facet" in p: facets[p["Facet"]] = desc
eset we also record their score and normalise it
between 0 and 1. I found that computing the logarithm of scores
helps to avoid having a tag cloud with a few huge tags and a lot of
tiny tiny tags:
class Filter(xapian.ExpandDecider): def __call__(self, term): return term[:2] == "XT" def format(k): if k in tags: facet = k.split("::", 1)[0] if facet in facets: return "<i>%s: %s</i>" % (facets[facet], tags[k]) else: return "<i>%s</i>" % tags[k] else: return k taglist = [] maxscore = None for res in enquire.get_eset(15, rset, Filter()): # Normalise the score in the interval [0, 1] weight = math.log(res.weight) if maxscore == None: maxscore = weight tag = res.term[2:] taglist.append( (tag, format(tag), float(weight) / maxscore) ) taglist.sort(key=lambda x:x[0])
gtkhtml2.Document to display
in a gtkhtml2 widget:
def mark_text_up(result_list): # 0-100 score, key (facet::tag), description document = gtkhtml2.Document() document.clear() document.open_stream("text/html") document.write_stream("""<html><head> <style type="text/css"> a text-decoration: none; color: black; </style> </head><body>""") for tag, desc, score in result_list: document.write_stream('<a href="%s" style="font-size: %d%%">%s</a> ' % (tag, score*150, desc)) document.write_stream("</body></html>") document.close_stream() return document
I'm not attending DebConf. I don't have much time these days :(
But if I can, I enjoy watching the
Some time ago, there was some flamewars^H^Hdebate about the Release Team’s removals of RC-buggy packages from testing. Basically, some people claimed that popular packages shouldn’t be removed, even if RC-buggy.
But, do we really miss popular packages in testing?
It’s difficult to know. You could get the popcon data, and compare it with the Packages files for testing and unstable. Or work with source packages (which removes a lot of noise), but then, you have to convert the popcon data (which uses binary packages names) to source packages. Not completely trivial.
That’s where the Ultimate Debian Database GSOC project comes to the rescue. The goal of Christian von Essen’s project is to gather data from various sources in Debian into a single SQL DB, so queries that combine all those data sources can easily be written.
For example, here is the query that lists the source packages that are in unstable, but not in testing, sorted by their popcon (using the number of insts of the most popular binary package of the source package as value for the source package):
One of the things of getting too much mail is that you will
get swamped in it, sometimes to the level of not even managing to figure
out there's been replies on your blog for the past several weeks.
Oops.
Apparently quite a number of people answered to
A few days ago I noticed that suspend to RAM didn’t work anymore on my T60 running sid. By chance I stumbled upon
I am following closely this 
Tomorrow, I'll leave /home for more than 3 weeks:
I've been rather disconnected lately, trying to finish my PhD, find a job, etc. I got permission from my committee to start writing my thesis a few weeks ago, so I've been trying to get that in gear, as well as finishing up data for publication. This should all be done by November, if all goes well, so I can get back to spending more time on the things that I love.
Saturday
For everyone at GUADEC, there’s a boat party sponsored by 













Actual I’m involved into a project which maybe of interest for you if you like opera particular when you are a
Netgear has jumped the bandwagon and released