hfst-repeat

Purpose

Repeat a transducer from N to M times.

Usage

The help message:

Usage: hfst-repeat [OPTIONS...] [INFILE]
Repeat transducer

Common options:
  -h, --help             Print help message
  -V, --version          Print version info
  -v, --verbose          Print verbosely while processing
  -q, --quiet            Only print fatal erros and requested output
  -s, --silent           Alias of --quiet
Input/Output options:
  -i, --input=INFILE     Read input transducer from INFILE
  -o, --output=OUTFILE   Write output transducer to OUTFILE
Repetition options:
  -f, --from=FNUM   repeat at least FNUM times
  -t, --to=TNUM     repeat at most TNUM times

If OUTFILE or INFILE is missing or -, standard streams will be used.
Format of result depends on format of INFILE
FNUM and TNUM must be positive integers or infinities as parsed by strtod(3)
if FNUM is omitted it defaults to 0, if TNUM is omitted it defaults to Inf
FNUM must be less than TNUM

Report bugs to <hfst-bugs@helsinki.fi> or directly to our bug tracker at:
<https://sourceforge.net/tracker/?atid=1061990&group_id=224521&func=browse>

Examples

The command

echo "cat
> dog" | hfst-strings2fst -j -f openfst-tropical | hfst-repeat 

called with different parameters --from and --to will create transducers that accept the following strings:

--from --to strings accepted
0 1 "", "cat", "dog"
1 2 "cat", "catcat", "dog", "dogdog", "catdog", "dogcat"
1 3 "cat", "catcat", "catcatcat", "dog", "dogdog", "dogdogdog", "catdog", "dogcat", "catdogdog", "catdogcat", "dogcatcat", "dogcatdog", "catcatdog", "dogdogcat"

-- ErikAxelson - 09 Jul 2008