HFST-REWEIGHT(1)

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

✨ 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>


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