TAX2THESAURUS(1p)
π tax2thesaurus β indented taxonomy to thesaurus π
okay bestie, so this is TAX2THESAURUS(1p), a little Perl script from the user-contributed Perl docs section, and it is literally the glow-up pipeline from a plain indented taxonomy to a full-on thesaurus. no cap. πΈ
β¨ SYNOPSIS β¨
tax2thesaurus file.tax > file.the
that's it. that's the whole vibe. you feed it a .tax and it gives you a .the on stdout. redirect and slay. π
π¦ DESCRIPTION π¦
so here's the tea: a top term called _top gets added to the taxonomy. iconic behavior, honestly β every tree needs a root and this one is _top. π
π example of the taxonomy format
science
physics
dynamics
math
algebra
trignometry
literature
look at that indentation doing all the work. two spaces here, five spaces there, and it just knows who belongs to whom. main character energy fr fr. β¨
π Correspondent output
science
BT _top
#lev 1
physics
BT science
#lev 2
dynamics
BT physics
#lev 3
math
BT science
#lev 2
algebra
BT math
#lev 3
trignometry
BT math
#lev 3
literature
BT _top
#lev 1
the way that every term gets a BT (that's the broader term, iykyk) and a #lev telling you how deep it's sitting in the hierarchy?? obsessed. ππ
notice how science and literature are both chilling at #lev 1 with BT _top, because they were the top-level entries in the input. and dynamics, algebra, and trignometry all get #lev 3 because they're the deepest babies. πΈ the indentation in the source is what decides the level, so don't go messing with your spaces. π«Ά
π AUTHOR π
J.Joao Almeida, jj@di.uminho.pt β thank you for your service, king. π«‘β¨
π SEE ALSO π
go read it, bestie, it's giving foundational. π
and that's the whole page!! π¦ this beauty is from perl v5.34.0, dated 2022-06-09, living in the User Contributed Perl Documentation pages under TAX2THESAURUS(1p). mwah, go build some thesauri. ππ
π¦ where this page comes from
- debian bookworm: libbiblio-thesaurus-perl 0.43-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libbiblio-thesaurus-perl 0.43-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libbiblio-thesaurus-perl 0.43-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms