HFST-REWEIGHT(1)
β¨ hfst-reweight β NAME π
okay bestie so <pink>hfst-reweight</pink> does literally one thing: it reweights transducer weights simply. that's the whole elevator pitch. no cap. π
π¦ SYNOPSIS
hfst-reweight [OPTIONS...] [INFILE]
πΈ DESCRIPTION
Reweight transducer weights simply. iconic behaviour honestly β¨
π Common options:
-h,--helpβ prints the help message, for when you need a lil reminder π«Ά-V,--versionβ prints version info, so you know exactly what you're working with β-v,--verboseβ print verbosely while processing, it will narrate its entire life at you-q,--quietβ only print fatal errors and the output you actually requested π€«-s,--silentβ alias of--quiet, same energy, different letter π
π Input/Output options:
-i,--input=INFILEβ read the input transducer from INFILE-o,--output=OUTFILEβ write the output transducer to OUTFILE
π₯ Reweighting options:
-a,--addition=AVALβ add AVAL to matching weights-b,--multiplier=BVALβ multiply matching weights by BVAL-F,--function=FNAMEβ operate on matching weights with FNAME-l,--lower-bound=LVALβ match weights greater than LVAL-u,--upper-bound=UVALβ match weights less than UVAL-I,--input-symbol=ISYMβ match arcs with input symbol ISYM-O,--output-symbol=OSYMβ match arcs with output symbol OSYM-S,--symbol=SYMβ match arcs with input or output symbol SYM, or both-e,--end-states-onlyβ match end states only, no arcs-A,--arcs-onlyβ match arcs only, no end states-T,--tsv-file=TFILEβ read reweighting rules from TFILE
okay so if OUTFILE or INFILE is missing, or it's -, then standard streams get used instead. the format of the result depends on the format of INFILE, bestie. π
if AVAL, BVAL or FNAME get omitted, they default to the neutral elements of addition, multiplication, or the identity function respectively. if LVAL or UVAL are omitted, they default to the minimum and maximum values of the weight structure. if ISYM, OSYM or SYM are omitted, they default to a value that matches all arcs. and heads up β only one ISYM, OSYM and SYM can be given. that's the rule π
Float values are parsed with strtod(3) and integers with strtoul(3). the functions you're allowed to use for FNAME are <cmath> float functions with a parameter count of 1 and a matching return value: abs, acos, asin, ... sqrt, tan, tanh. slay π§
The precedence of operands follows the formula BVAL * FNAME(w) + AVAL. and that formula is applied iff: ((LVAL <= w) && (w <= UVAL)), where w is the weight of the arc, and (ISYM == i) && (OSYM == o) && ((SYM == i) || (SYM == o)) ^^ (end state && -e). yes it's a whole mouthful, i know, but it's giving exactly what it needs to give π
TFILE should contain lines with tab-separated pairs of SYM and AVAL or BVAL. AVAL values must be preceded by a + character, and BVAL should be given as plain digits. comment lines starting with # and empty lines are just ignored, no stress π
Weights are, by default, modified for all arcs and end states β unless you use the --end-states-only or --arcs-only option. pick your fighter β¨
π REPORTING BUGS
found a bug? report it to <hfst-bugs@helsinki.fi> or straight up to our bug tracker at: <https://github.com/hfst/hfst/issues>
- hfst-reweight home page:
<https://github.com/hfst/hfst/wiki/HfstReweight> - 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. (yes, all caps, they mean it π)
okay that's the whole page bestie, go reweight something and eat π«Ά
this has been the HFST crew, August 2018 β manual page HFST-REWEIGHT(1), brought to you by HFST. mwah π
π¦ 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