HFST-REGEXP2FST(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-regexp2fst β€” HFST manual, section 1 πŸ¦‹

okay so. bestie. sit down, grab a boba, because we're about to talk about the absolute moment that is hfst-regexp2fst. it's giving compiler. it's giving transducers. it's giving everything. πŸ’…


✨ NAME ✨

hfst-regexp2fst β€” compile (weighted) regular expressions into transducer(s).

(the man page literally opens the description with a stray =, like =Compile, and ngl we are keeping that exactly as-is because it's iconic. no notes. 🫢)


πŸŽ€ SYNOPSIS πŸŽ€

hfst-regexp2fst [OPTIONS...] [INFILE]

like, that's it. that's the whole vibe. options, then optionally an input file. 😌


πŸ’– DESCRIPTION πŸ’–

So what does this bad boy actually do? It compiles (weighted) regular expressions into transducer(s). plural, bestie, TRANSDUCER(S). You hand it regexps, it hands you transducers. that's the whole relationship. πŸ’ž

Common options, coming right up:

  • -h, --help β€” print the help message, i.e. the "what even is this" button
  • -V, --version β€” print version info, for when you need receipts
  • -v, --verbose β€” print verbosely while processing, so it narrates its own life
  • -q, --quiet β€” only print fatal erros and requested output (yes, the typo is canon, we do not fix the canon)
  • -s, --silent β€” alias of --quiet, same energy, different name ✨

πŸ“₯ Input/Output options πŸ“€

  • -i, --input=INFILE β€” read input transducer from INFILE
  • -o, --output=OUTFILE β€” write output transducer to OUTFILE

πŸ“ String and format options πŸ“

  • -f, --format=FMT β€” write result in FMT format
  • -j, --disjunct β€” disjunct all regexps instead of transforming each regexp into a separate transducer (one big happy family instead of a bunch of little ones πŸ«‚)
  • -l, --line β€” input is line separated (this is the default, so if you say nothing, this is what you get)
  • -S, --semicolon β€” input is semicolon separated
  • -e, --epsilon=EPS β€” map EPS as zero, i.e. epsilon
  • -x, --xerox-composition=VALUE β€” whether flag diacritics are treated as ordinary symbols in composition (default is false)
  • -X, --xfst=VARIABLE β€” toggle xfst compatibility option VARIABLE

🌸 Harmonization and optimization options 🌸

  • -H, --do-not-harmonize β€” do not expand '?' symbols
  • -F, --harmonize-flags β€” harmonize flag diacritics
  • -E, --encode-weights β€” encode weights when minimizing (default is false)
  • -M, --do-not-minimize β€” determinize result instead of minimizing it

okay and here's the fine print, but make it fashion: πŸ’…

If OUTFILE or INFILE is missing or -, standard streams will be used. standard streams, bestie, she's flexible like that.

FMT must be one of the following: {foma, sfst, openfst-tropical, openfst-log}.

If EPS is not defined, the default representation of 0 is used.

*VALUE*s recognized are {true,ON,yes} and {false,OFF,no}.

Xfst variables are {flag-is-epsilon (default OFF)}.


πŸ”₯ EXAMPLES πŸ”₯

this is the part where it gets real. actual commands, actual vibes:

echo " {cat}:{dog} " | hfst-regexp2fst

β†’ create transducer {cat}:{dog} 🐱➑️🐢

echo " {cat}:{dog}::3 " | hfst-regexp2fst

β†’ same but with weight 3

echo " c:d a:o::3 t:g " | hfst-regexp2fst

β†’ same but with weight 3 in the middle

echo " cat ; dog ; "3" " | hfst-regexp2fst -S

β†’ create transducers "cat" and "dog" and "3"

see how the last one uses -S? semicolon separated. the semicolons are the moment. periodt. πŸ’…βœ¨


😭 REPORTING BUGS 😭

found a bug? first of all, relatable. second of all, report bugs to <hfst-bugs@helsinki.fi> or directly 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. (no cap. literally none. zero. the warranty does not exist. πŸ™ˆ)

and that's the whole page, bestie. this was brought to you by HFST, dated August 2018 β€” a vintage, a classic, a legend. go compile something gorgeous. πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from