I did it a few years back for a personnal project (bookmarks management, but I had finished making it a generic library by the time real life caught up to me).
It worked forwards _and_ backwards (I was mostly interested in the backwards part, actually).
One of the lessons it taught me was how much my directory organisation sucked.
Besides the homonyms and synonyms, the structure was unequally precise, depending on how many elements I had to organise. Sometimes, the same information was implicit, and sometimes explicit.
The tagged result suffers from these directory-based approximations.
For exampl, you may not have needed an implicit tag/directory level in some places of your directory tree, but if it does exist elsewhere, it will also be present in your tags. Elements where this information was implicit will not have it explicitly, which can be a bother.
To avoid this, you have to either rebalance your directories or create some rules to deal with "implicit" information, which opens up another can of worm.
If you are interested, feel free to contact me: I still have the code (some bit-rot) and I remember most of my reasoning and useful optimisations strategies.