get N last transducers from an archive.


The help message:

Usage: hfst-tail [OPTIONS...] [INFILE]
Get last transducers from an archive

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
Archive options:
  -n, --n-last=[+]K   Print the last K transducers;
                      use +K to print transducers starting from the Kth

If OUTFILE or INFILE is missing or -, standard streams will be used.
Format of result depends on format of INFILE
K must be an integer, as parsed by strtoul base 10, and not 0.
if K is omitted, it defaults to +1 (all except the first)

Report bugs to <hfst-bugs@helsinki.fi> or directly to our bug tracker at:


We create three transducers that accept the strings "cat", "dog" and "mouse". Then we take two transducers from the end of the stream and print the strings that they recognize. Note that -- signifies the end of one transducer and the beginning of another one.

$ echo "cat
> dog
> mouse" | hfst-strings2fst -f foma | hfst-tail -n 2 | hfst-fst2strings

See also


-- ErikAxelson - 09 Jul 2008