<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://plaindrops.de/assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Plain DrOps (Posts about python)</title><link>https://plaindrops.de/</link><description></description><atom:link href="https://plaindrops.de/categories/python.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:andy@plaindrops.de"&gt;Andy Drop&lt;/a&gt; </copyright><lastBuildDate>Tue, 16 Dec 2025 13:28:45 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Collecting and Categorizing Web Links in Org-mode</title><link>https://plaindrops.de/blog/2025/tagwood/</link><dc:creator>Andy Drop</dc:creator><description>&lt;p&gt;
Whether they’re called bookmarks, favorites, or weblinks, we all accumulate a large number of them over time. At some point, it all becomes overwhelming and needs organizing. So, I wrote a Python tool for that. 
&lt;/p&gt;
&lt;!-- TEASER_END --&gt;
&lt;h2 class="collapsible" id="orgd9a2b66"&gt;What Has Happened So Far&lt;/h2&gt;
&lt;div id="outline-container-orgd9a2b66" class="outline-2 collapsme"&gt;
&lt;div class="outline-text-2" id="text-orgd9a2b66"&gt;
&lt;p&gt;
New weblinks always originate from my browser. whether it's Firefox on my desktop and laptop or on my phone. I could simply leave them in Firefox, allowing me to sync and access them across devices. Sounds good enough, right?
&lt;/p&gt;

&lt;p&gt;
But I also maintain a &lt;a href="https://plaindrops.de/page/links/"&gt;page with links&lt;/a&gt; on this blog that I want to share publicly. Ideally, I wouldn’t have to manage these links separately. That’s why, years ago, I decided not to use built-in or online bookmark managers. Instead, I store all my weblinks as plaintext in Orgmode format. Each link is a heading with the page title, linked to the respective URL.
&lt;/p&gt;

&lt;p&gt;
If I feel like it, I add a short note or a quote from the page. On my laptop and desktop, a small browser add-on (Org Capture) appends new links to my Links.org file using Emacs’ org-capture protocol. On my phone, this add-on doesn’t work, so I share the page with the &lt;a href="https://github.com/orgzly-revived/orgzly-android-revived"&gt;Orgzly-revived&lt;/a&gt; app, which lets me edit Org-mode files on Android. The link also ends up in Links.org, and I sync my entire &lt;i&gt;org&lt;/i&gt; directory across all my devices.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 class="collapsible" id="org72f6bbb"&gt;The Links.org File in Detail&lt;/h2&gt;
&lt;div id="outline-container-org72f6bbb" class="outline-2 collapsme"&gt;
&lt;div class="outline-text-2" id="text-org72f6bbb"&gt;
&lt;p&gt;
The file starts with a set of metadata lines that my static site generator needs to create the public link page. It looks like this:
&lt;/p&gt;
&lt;pre class="example" id="org7466407"&gt;
#+BEGIN_COMMENT
.. title: Links
.. description: All the links I can recommend
.. slug: links
.. date: 2019-01-01 00:00:00 UTC+01:00
.. tags: links, emacs, orgmode, qutebrowser, plaintext, pim
.. previewimage: qrcodebus.png
#+END_COMMENT
#+OPTIONS: tags:nil
&lt;/pre&gt;
&lt;p&gt;
The last line ensures that tags assigned to individual links aren’t exported to HTML.
&lt;/p&gt;

&lt;p&gt;
All new links start as second-level headings. The first-level headings are divided into four sections:
&lt;/p&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="org08e3943"&gt;1. Quicklinks&lt;/h3&gt;
&lt;div id="outline-container-org08e3943" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-org08e3943"&gt;
&lt;p&gt;
These are my frequently used links, marked with :noexport:, so they don’t appear in the public link list. They are placed at the top of the file for quick access.
&lt;/p&gt;
&lt;pre class="example" id="orga0b65c9"&gt;
* ------ Quick Links ----- :noexport:
 :PROPERTIES:
 :VISIBILITY: children
 :END:
&lt;/pre&gt;
&lt;table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"&gt;


&lt;colgroup&gt;
&lt;col class="org-left"&gt;

&lt;col class="org-left"&gt;

&lt;col class="org-left"&gt;

&lt;col class="org-left"&gt;

&lt;col class="org-left"&gt;

&lt;col class="org-left"&gt;

&lt;col class="org-left"&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope="col" class="org-left"&gt;Social Media&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Shopping&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;News&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Finanzen&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Haustechnik&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Konten&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Other&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="org-left"&gt;&lt;a href="https://chaos.social"&gt;Mastodon&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://idealo.de"&gt;Idealo&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://tagesschau.de"&gt;Tagesschau&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.volksbank-eg.de/services_cloud/portal/"&gt;Volksbank&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://fritz.box/"&gt;FritzBox&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://bibload.onleihe.de/"&gt;BibLoad&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.thingiverse.com/"&gt;Thingiverse&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt;&lt;a href="https://feddit.de"&gt;Feddit&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.amazon.de/"&gt;Amazon&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.theguardian.com/europe"&gt;The Guardian&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://banking.barclays.de/Login"&gt;Barclays&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://192.168.9.32"&gt;Wechselrichter&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://sb-warendorf.lmscloud.net/"&gt;Stadtbücherei&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://cults3d.com/de"&gt;Cults&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.ebay.de/"&gt;eBay&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.schwaebisch-hall.de/meinkonto/login-mein-konto.html"&gt;Schw. Hall&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://192.168.9.38/"&gt;Stromzähler&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt;&lt;a href="https://codeberg.org/user/login"&gt;Codeberg&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.otto.de/"&gt;Otto&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://kachelmannwetter.com/de/wetter/2814127-warendorf"&gt;Wetter WAF&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.paypal.com/signin"&gt;Paypal&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://192.168.9.25:8123"&gt;Home Assistant&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://configure.zsa.io/my_layouts"&gt;Oryx&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt;&lt;a href="https://app.wallabag.it/"&gt;Wallabag&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.kaufland.de/"&gt;Kaufland&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.destatis.de/DE/Home/_inhalt.html"&gt;Stat. Bundesamt&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://127.0.0.1:631/"&gt;CUPS&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://www.dashboard-deutschland.de/"&gt;Dashboard DE&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://127.0.0.1:8081/"&gt;Syncthing&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt;&lt;a href="https://chat.openai.com"&gt;ChatGPT&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="https://de.statista.com/"&gt;Statista&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt;&lt;a href="http://localhost:8080/"&gt;Jenkins&lt;/a&gt;&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt;Wiki&lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;td class="org-left"&gt; &lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="org244d84a"&gt;2. Public Links&lt;/h3&gt;
&lt;div id="outline-container-org244d84a" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-org244d84a"&gt;
&lt;p&gt;
These links are visible on the blog. My site generator processes this section and turns it into a dynamic list using a bit of CSS magic.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="orge1c3def"&gt;3. Private Links&lt;/h3&gt;
&lt;div id="outline-container-orge1c3def" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-orge1c3def"&gt;
&lt;p&gt;
This is where things get interesting. Right now (March 4, 2025), this section holds around 450 links, categorized with up to four tags. The organization, however, is… let’s say, questionable. More of a dumpster fire, really.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="orgebfdfb4"&gt;4. The INBOX&lt;/h3&gt;
&lt;div id="outline-container-orgebfdfb4" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-orgebfdfb4"&gt;
&lt;p&gt;
Basically, the same chaotic mess as the private links. just without any tags assigned yet.
&lt;/p&gt;

&lt;p&gt;
So, my tool’s job is to process sections 3 and 4.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 class="collapsible" id="orgb69f609"&gt;What’s the Goal?&lt;/h2&gt;
&lt;div id="outline-container-orgb69f609" class="outline-2 collapsme"&gt;
&lt;div class="outline-text-2" id="text-orgb69f609"&gt;
&lt;p&gt;
The tool should take all weblinks from sections 3 and 4 and organize them into one logical tree structure based on their tags. The tricky words here are &lt;b&gt;one&lt;/b&gt; and &lt;b&gt;logical&lt;/b&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="orgb194b95"&gt;Are There Multiple Possible Trees?&lt;/h3&gt;
&lt;div id="outline-container-orgb194b95" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-orgb194b95"&gt;
&lt;p&gt;
Of course, otherwise, it would be too easy. Tags are inherently non-hierarchical. If I tag a link with a and b
&lt;/p&gt;
&lt;pre class="example" id="org97580fb"&gt;
* Link :a:b:
&lt;/pre&gt;

&lt;p&gt;
I can create two different trees:
&lt;/p&gt;
&lt;pre class="example" id="orge8c9bf0"&gt;
├── a
│   └── b
│       └── Link
└── b
    └── a
        └── Link
&lt;/pre&gt;

&lt;p&gt;
As soon as I have three tags, I can insert the additional tag at three different levels. in each of the two trees. resulting in six possible trees.
&lt;/p&gt;

&lt;p&gt;
The mathematical representation is 3! (i.e., 3 factorial). If anyone remembers exponential growth from the COVID era, that’s nothing compared to factorial growth. it’s child’s play in comparison.
&lt;/p&gt;

&lt;p&gt;
With six tags, we’re already at 720 possible trees, and just eight tags result in 40,320 trees.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="org84769f2"&gt;And what do I do with all these trees?&lt;/h3&gt;
&lt;div id="outline-container-org84769f2" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-org84769f2"&gt;
&lt;p&gt;
The common approach would be to use them all. That means a link with four tags would appear 24 times in the link list. but there would also be 24 ways to find it. Roughly estimated, my 450 links would result in about 3,000 links in the output file. And that’s too much for me.
&lt;/p&gt;

&lt;p&gt;
Many of these paths wouldn’t even make sense. Suppose I bookmark the location where I last parked my car:
&lt;/p&gt;
&lt;pre class="example" id="orgc673f51"&gt;
* Auto :germany:munic:mainstreet:
&lt;/pre&gt;
&lt;p&gt;
Then I don’t think, "Hmm, I remember parking on Main Street, so show me all the countries that have cities with a Main Street so I can pick the right one."
&lt;/p&gt;

&lt;p&gt;
So, I need to cut down the trees that don’t make sense. This brings in the second key word: the structure should be a logical tree. But, as should have been clear even before Trump, there are some pretty strange interpretations of logic. and that’s not even considering alternative logic.
&lt;/p&gt;

&lt;p&gt;
Computers aren’t particularly good at determining what makes sense in a search. So instead, I rely on a different criterion: frequency. Because counting is something computers are really good at.
&lt;/p&gt;

&lt;p&gt;
If my file contains the tag emacs 200 times but the tag orgmode only 100 times, then the tree looks like this:
&lt;/p&gt;
&lt;pre class="example" id="orgc164ff5"&gt;
└── emacs
    └── orgmode
        └── Link
&lt;/pre&gt;

&lt;p&gt;
That works pretty well, but now and then, some strange hierarchies still appear. especially with tags that are rarely used overall. In those cases, a single extra use can already make a difference in how the sorting plays out.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="orgf100483"&gt;And now I’m even cheating a little.&lt;/h3&gt;
&lt;div id="outline-container-orgf100483" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-orgf100483"&gt;
&lt;p&gt;
In most cases, rare tags don’t really matter. But when this happens with major (frequent) tags, it can be quite annoying. That’s why I cheat a bit.
Sticking with the car example, I’d actually write it like this:
&lt;/p&gt;
&lt;pre class="example" id="orgb50ae62"&gt;
* Auto :Germany:Munic:mainstreet:
&lt;/pre&gt;
&lt;p&gt;
See the difference? The first two tags are now capitalized. For my tool, this signals that country and city are hierarchically more important than the street. This still leaves two possible trees, but it eliminates four others right away. I can only enforce one strict hierarchy level this way, but it helps handle the edge cases quite well.
&lt;/p&gt;

&lt;p&gt;
Why is this cheating? Well, according to the textbook, tags don’t carry hierarchical information, and my programmer’s heart does feel a little dirty about it.
&lt;/p&gt;

&lt;p&gt;
Now, on to the technical part, in case anyone wants to implement this in another language:
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 class="collapsible" id="orga8b13b7"&gt;The Algorithm&lt;/h2&gt;
&lt;div id="outline-container-orga8b13b7" class="outline-2 collapsme"&gt;
&lt;div class="outline-text-2" id="text-orga8b13b7"&gt;
&lt;ol class="org-ol"&gt;
&lt;li&gt;Collecting Links:
&lt;ul class="org-ul"&gt;
&lt;li&gt;First, I gather all the links I want to process and store them in a dictionary.&lt;/li&gt;
&lt;li&gt;The key is a hash of the actual link, which eliminates accidental duplicates.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;

&lt;li&gt;Generating Permutations:
&lt;ul class="org-ul"&gt;
&lt;li&gt;I generate all possible tag permutations.&lt;/li&gt;
&lt;li&gt;Any permutations that violate my "cheated" tag hierarchy are skipped.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;

&lt;li&gt;Building the Tree:
&lt;ul class="org-ul"&gt;
&lt;li&gt;The list of links is passed into the core function that constructs the tree.&lt;/li&gt;
&lt;li&gt;Since trees lend themselves well to recursion, the function is recursive.&lt;/li&gt;
&lt;li&gt;Each function call processes one hierarchy level and then calls itself for deeper levels.&lt;/li&gt;
&lt;li&gt;The recursion stops when there are no more links left that don’t already belong to a tag.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;

&lt;li&gt;Inside the Recursive Function:
&lt;ul class="org-ul"&gt;
&lt;li&gt;The current tag is added as a node in the tree.&lt;/li&gt;
&lt;li&gt;All links that fit exactly at this level (i.e., having exactly the required tags for this depth) are added.&lt;/li&gt;
&lt;li&gt;If links remain, the voting process begins:
&lt;ul class="org-ul"&gt;
&lt;li&gt;Each remaining link votes for the tag it would like to see added next.&lt;/li&gt;
&lt;li&gt;The tag with the most votes is chosen.&lt;/li&gt;
&lt;li&gt;A new list of links that voted for this tag is created.&lt;/li&gt;
&lt;li&gt;The function calls itself with this list and the chosen tag, building the subtree.&lt;/li&gt;
&lt;li&gt;Once processed, those links are removed, and another voting round occurs if any links remain.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;

&lt;li&gt;Exporting the Tree:
&lt;ul class="org-ul"&gt;
&lt;li&gt;Once fully built, the tree is written back into an Org-mode file.&lt;/li&gt;
&lt;li&gt;Done!&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;h2 class="collapsible" id="org2114e78"&gt;The Result&lt;/h2&gt;
&lt;div id="outline-container-org2114e78" class="outline-2 collapsme"&gt;
&lt;div class="outline-text-2" id="text-org2114e78"&gt;
&lt;p&gt;
The output file now contains a &lt;b&gt;hierarchically structured and sorted&lt;/b&gt;  list of tags:
&lt;/p&gt;

&lt;ul class="org-ul"&gt;
&lt;li&gt;The most &lt;b&gt;frequent&lt;/b&gt;  tags appear first.&lt;/li&gt;
&lt;li&gt;If two tags have the same frequency, they are sorted &lt;b&gt;alphabetically&lt;/b&gt; .&lt;/li&gt;
&lt;li&gt;&lt;b&gt;All links&lt;/b&gt;  are included in the tree.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;No duplicate links&lt;/b&gt;  exist.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
This gives me a &lt;b&gt;link tree that is highly usable&lt;/b&gt;. While it may not be the &lt;b&gt;perfect&lt;/b&gt; tree I would create manually, it's &lt;b&gt;close enough&lt;/b&gt;. And the best part? There's still plenty of room for &lt;b&gt;optimization&lt;/b&gt;  in the algorithm.
&lt;/p&gt;
&lt;/div&gt;
&lt;h3 class="collapsible" id="orgb77e32b"&gt;&lt;b&gt;Tweaking the Voting&lt;/b&gt;&lt;/h3&gt;
&lt;div id="outline-container-orgb77e32b" class="outline-3 collapsme"&gt;
&lt;div class="outline-text-3" id="text-orgb77e32b"&gt;
&lt;p&gt;
Anyone interested in voting systems will have realized that there are dozens, if not hundreds, of different voting methods, each leading to slightly different results and optimized for various goals (fixed number of seats, weighting by stock share, minimizing the tags traveled by horse to the capital, etc.).
&lt;/p&gt;

&lt;p&gt;
This also applies to the voting in this algorithm. Currently, every link votes for every tag that benefits it in some way with one vote. However, other variants could also be considered:
&lt;/p&gt;

&lt;ul class="org-ul"&gt;
&lt;li&gt;If a link sees 3 possible trees for Tag A and 2 possible trees for Tag B, it could vote with 3 and 2 votes for the respective tags.&lt;/li&gt;
&lt;li&gt;The votes could be weighted based on whether a tag is immediately needed at this level or possibly further down the tree.&lt;/li&gt;
&lt;li&gt;etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Overall, I am already very satisfied with the results. My repository with the current state of the tool can be found &lt;a href="https://codeberg.org/dr.ops/tagwood"&gt;(here)&lt;/a&gt;.
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><category>emacs</category><category>orgmode</category><category>python</category><guid>https://plaindrops.de/blog/2025/tagwood/</guid><pubDate>Tue, 04 Mar 2025 09:00:00 GMT</pubDate></item></channel></rss>