LT-TRIM(1)

πŸ“¦
version 3.8.3 Β· 2 versions
  • 3.8.3 Β· debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 3.5.4 Β· ubuntu jammy
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ lt-trim β€” compiled dictionary trimmer for Apertium ✨

okay bestie, welcome to the lt-trim(1) page πŸ’– this one lives in the General Commands Manual section, and it's literally the glow-up artist for compiled dictionaries. no cap.


🌸 SYNOPSIS 🌸

lt-trim analyser_binary bidix_binary trimmed_analyser_binary

πŸ’… DESCRIPTION πŸ’…

so, lt-trim is the application responsible for trimming compiled dictionaries. that's its whole thing. it's giving βœ‚οΈβœ¨

here's the tea: the analyses (right-side when compiling lr) of analyser_binary get trimmed to the input side of bidix_binary (left-side when compiling lr, right-side when compiling rl), so that the only analyses kept are the ones that would pass through lt-proc(1) -b bidix_binary. like, if it can't make it through the bidix, it doesn't make it through trimming. periodt.

both compound tags ("<compound-only-L>", "<compound-R>") and join elements ("<j/>" in XML, "+" in the stream) and the group element ("<g/>" in XML, "#" in the stream) should be handled correctly β€” and yes, even combinations of + followed by # in monodix are handled. iconic behaviour honestly πŸ‘‘

now for the minor caveats, and bestie, please read these, i'm begging πŸ₯Ί:

  • if you have the capitalised lemma "Foo" in the monodix, but "foo" in the bidix, an analysis ^Foo<tag>$ would pass through bidix when doing lt-proc(1) -b, but will not make it through trimming. so make sure your lemmas have the same capitalisation in the different dictionaries. the vibe check is case-sensitivity, and it is not passing 😭
  • also, you should not have literal '+' or '#' in your lemmas. since lt-comp(1) doesn't escape these, lt-trim cannot know that they are different from "<j/>" or "<g/>", and you may get @-marked output this way. the workaround? you can analyse '+' or '#' by having the literal symbol in the "<l>" part and some other string (e.g., "plus") in the "<r>". slay.
🚨 and one more thing: you should not trim a generator unless you have a very simple translator pipeline, since the output of bidix seldom goes unchanged through transfer. i said what i said.

πŸŽ€ OPTIONS πŸŽ€

  • -s, --match-section β€” a section with this name (id@type) in the analyser will only be trimmed against a section with the same id in the bidix. (the default is to trim all sections of the analyser against all sections of the bidix.) using this option can some times speed up trimming considerably. for example, if you have some complicated regular expressions, try putting them in a
  <section id="regex" type="standard">

in both .dix files and passing "regex@standard" to --match-section. chef's kiss πŸ§‘β€πŸ³πŸ’‹

this argument may be used multiple times to specify multiple sections that must match by name. yes, stack them. go off.


πŸ¦‹ FILES πŸ¦‹

  • analyser_binary β€” the untrimmed analyser dictionary (a finite state transducer). the before pic πŸ“Έ
  • bidix_binary β€” the dictionary to use as trimmer (a finite state transducer). the scissors βœ‚οΈ
  • trimmed_analyser_binary β€” the trimmed analyser dictionary (a finite state transducer). the after pic ✨

🌈 SEE ALSO 🌈

apertium(1), apertium-tagger(1), lt-comp(1), lt-expand(1), lt-print(1), lt-proc(1)

go read those too, bestie, they're all in the group chat πŸ“±πŸ’¬


πŸ‘‘ AUTHOR πŸ‘‘

Copyright Β© 2005, 2006 Universitat d'Alacant / Universidad de Alicante.

this is free software. you may redistribute copies of it under the terms of the GNU General Public License: https://www.gnu.org/licenses/gpl.html.

free as in freedom, not free as in free samples at the mall πŸ’–


πŸ’€ BUGS πŸ’€

Many... lurking in the dark and waiting for you!

not me being dramatic but also not me being wrong πŸ™ˆ


and that's a wrap on the Apertium edition, dated February 7, 2014 β€” ty for coming to my ted talk, now go trim those dictionaries πŸ’…βœ¨πŸ«Ά