Skip to content

Latest commit

 

History

History
60 lines (40 loc) · 1.35 KB

File metadata and controls

60 lines (40 loc) · 1.35 KB

Difference

Description

This operation computes the difference between two FSAs. Only strings that are in the first automaton but not in second are retained in the result.

The first argument must be an acceptor; the second argument must be an unweighted, epsilon-free, deterministic acceptor. The output labels of the first acceptor or the input labels of the second acceptor must be sorted (or the FSTs otherwise support appropriate matchers).

Usage

template <class Arc>
void Difference(const Fst<Arc> &ifsa1, const Fst<Arc> &ifsa2, MutableFst<Arc> *ofsa);
template <class Arc> DifferenceFst<Arc>::
DifferenceFst(const Fst<Arc> &fsa1, const Fst<Arc> &fsa2);

DifferenceFst

fstdifference [--opts] a.fsa b.fsa out.fsa
  --connect: Trim output (def: true)

Examples

A:

Input FST A.

B:

Input FST B.

A - B:

Result of Difference(A, B).

Difference(A, B, &C);
DifferenceFst<Arc>(A, B);
fstdifference a.fsa b.fsa out.fsa

Complexity

Same as Compose.

Caveats

Same as Compose.