HFST-SUBSTITUTE(1)
π
hfst-substitute β the girlies' guide to hfst-substitute(1)
okay bestie, pull up a chair because this is a User Commands classic and it's about to be your new fave. this is hfst-substitute(1), and no cap, it does exactly one iconic thing and does it well. π
β¨ NAME β¨
hfst-substitute β =Relabel transducer arcs π
(yes, the = is in the original, we do not question the ancestors, we simply respect them π)
β¨ SYNOPSIS β¨
hfst-substitute [OPTIONS...] [INFILE]
β¨ DESCRIPTION β¨
Relabel transducer arcs. that's the whole vibe. you feed it a transducer, you tell it what to change and what to change it to, and it hands you back a transducer with the arcs relabeled. obsessed. πΈ
π«Ά Common options:
-h,--helpβ Print help message. your emotional support flag fr fr.-V,--versionβ Print version info. in case you need to know exactly which era of HFST you're living in.-v,--verboseβ Print verbosely while processing. she talks through it, and honestly? we love that for her.-q,--quietβ Only print fatal erros and requested output. (that typo is heritage, bestie, don't touch it π)-s,--silentβ Alias of--quiet. same energy, different name. main character but undercover.
π¦ Input/Output options:
-i,--input=INFILEβ Read input transducer from INFILE. bring her in π-o,--output=OUTFILEβ Write output transducer to OUTFILE. send her out into the world β¨
π Relabeling options:
-f,--from-label=FLABELβ replace FLABEL. this is the thing you're hunting for.-t,--to-label=TLABELβ replace with TLABEL. this is the glow-up you're giving it.-T,--to-transducer=TFILEβ replace with transducer read from TFILE. not a label, a whole entire transducer. it's giving upgrade.-F,--from-file=LABELFILEβ read replacements from LABELFILE. bulk mode. efficient queen. π-R,--in-orderβ keep the order of the replacements (with-F). respect the queue, periodt.
π Input options:
-C,--do-not-convertβ require that transducers in TFILE and INFILE have the same type. she does NOT want to do conversions today. π
β Transient optimisation schemes:
-9,--composeβ compose substitutions when possible. speedrun strats, iykyk.
If OUTFILE or INFILE is missing or -, standard streams will be used. Format of result depends on format of INFILE. LABEL must be a symbol name in single arc in transducer, or colon separated pair defining an arc. If TFILE is specified, FLABEL must be a pair. LABELFILE is a 2 column tsv file where col 1 is FLABEL and col 2 gives TLABEL specifications.
like, read that twice, it's load-bearing bestie π
β¨ EXAMPLES β¨
hfst-substitute -i tr.hfst -o tr_relabeled.hfst -f 'a' -t 'A'
relabel all symbols 'a' with 'A' β the little letters get the big letter treatment π₯
hfst-substitute -i tr.hfst -o tr_relabeled.hfst -f 'a:b' -t 'A:B'
relabel all arcs 'a:b' with 'A:B' β pair goes in, pair comes out, symmetric slay π
hfst-substitute -i tr.hfst -o tr_relabeled.hfst -f 'a:b' -T repl.hfst
replace all arcs 'a:b' with transducer repl.hfst β full arc replacement, we're not playing around π
β¨ REPORTING BUGS β¨
found something cursed? don't suffer in silence, tell the devs π«Ά
Report bugs to <hfst-bugs@helsinki.fi> or directly to our bug tracker at: <https://github.com/hfst/hfst/issues>
hfst-substitutehome page: <https://github.com/hfst/hfst/wiki/HfstSubstitute>- General help using HFST software: <https://github.com/hfst/hfst/wiki>
β¨ COPYRIGHT β¨
Copyright Β© 2017 University of Helsinki, License GPLv3: GNU GPL version 3 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. (no cap, there is genuinely no warranty, she's free and she's honest about it π)
and that's the whole page, bestie! π this drop is from the HFST squad, August 2018 edition β go relabel something gorgeous. bye babes πβ¨π¦
π¦ where this page comes from
- debian bookworm: hfst 3.16.0-5 Β· GPL-3.0-or-later
- debian trixie: hfst 3.16.2-1+b1 Β· GPL-3.0-or-later
- nixos 26.05: hfst 3.16.2
- opensuse-leap 16.0: hfst 3.16.0-bp160.1.11 Β· Apache-2.0 AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND GPL-3.0-or-later AND GPL-3.0-only
- ubuntu jammy: hfst 3.15.4-2 Β· GPL-3.0-or-later
- ubuntu noble: hfst 3.16.0-5build4 Β· GPL-3.0-or-later
- ubuntu questing: hfst 3.16.2-1
- ubuntu resolute: hfst 3.16.2-1build2 Β· GPL-3.0-or-later
- ubuntu stonking: hfst 3.17.1-6 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms