hfst-disjunct

Purpose

Disjunct (union, OR) two transducers.

Usage

The help message:

Usage: hfst-disjunct [OPTIONS...] [INFILE1 [INFILE2]]
Disjunct (union, OR) two transducers

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:
  -1, --input1=INFILE1   Read first input transducer from INFILE1
  -2, --input2=INFILE2   Read second input transducer from INFILE2
  -C, --do-not-convert   Do not allow transducers to be converted into the same type
  -o, --output=OUTFILE   Write results to OUTFILE

If OUTFILE, or either INFILE1 or INFILE2 is missing or -,
standard streams will be used.
INFILE1, INFILE2, or both, must be specified.
Format of result depends on format of INFILE1 and INFILE2;
both should have the same format.

The operation is applied pairwise for INFILE1 and INFILE2
that must have the same number of transducers.
If INFILE2 has only one transducer, the operation is applied for
each transducer in INFILE1 keeping the second transducer constant.
Harmonization:
  -H, --do-not-harmonize Do not harmonize symbols.
  -F, --harmonize-flags  Harmonize flag diacritics.


Examples:
  hfst-disjunct -o cat_or_dog.hfst cat.hfst dog.hfst

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

We create a transducer animals.hfst that accepts initially only the string "cat". Then we create three transducers, each accepting either "dog", "mouse" or "elephant" and disjunct them with the transducer animals.hfst. Finally we print the strings that the transducer animals.hfst recognizes. The commands below:

echo "cat" | hfst-strings2fst -f openfst-tropical > animals.hfst
for i in dog mouse elephant; do
  echo $i | hfst-strings2fst -f openfst-tropical | hfst-disjunct animals.hfst > TMP;
  mv TMP animals.hfst;
done
hfst-fst2strings animals.hfst

will print to the standard output:

cat
dog
mouse
elephant

-- ErikAxelson - 09 Jul 2008