HFST-REGEXP2FST(1)
π¦ 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>
hfst-regexp2fsthome page:<https://github.com/hfst/hfst/wiki/Regexp2Fst>- 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. 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
- 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