LT-TRIM(1)
β¨ 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 doinglt-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. sincelt-comp(1)doesn't escape these,lt-trimcannot 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 sameidin 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 π β¨π«Ά
π¦ where this page comes from
- debian bookworm: lttoolbox-dev 3.7.1-1+b2 Β· GPL-2.0-or-later
- debian trixie: lttoolbox-dev 3.8.0-2 Β· GPL-2.0-or-later
- nixos 26.05: lttoolbox 3.7.6
- nixpkgs unstable: lttoolbox 3.8.2
- opensuse-leap 16.0: lttoolbox 3.7.6-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: lttoolbox 3.7.6-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: lttoolbox 3.7.6-bp160.1.12 Β· GPL-2.0-or-later
- opensuse-leap 16.0: lttoolbox 3.7.6-bp160.1.12 Β· GPL-2.0-or-later
- ubuntu noble: lttoolbox-dev 3.7.6-1build1 Β· GPL-2.0-or-later
- ubuntu questing: lttoolbox-dev 3.8.2-1
- ubuntu resolute: lttoolbox-dev 3.8.2-1build2 Β· GPL-2.0-or-later
- ubuntu stonking: lttoolbox-dev 3.8.3-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms