TAX2THESAURUS(1p)

πŸ“¦
version 0.43 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble

πŸ’– 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