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);
doc
fstdifference [--opts] a.fsa b.fsa out.fsa
  --connect: Trim output (def: true)
 

Examples

A:

difference1.jpg

B:

difference2.jpg

A - B:

difference3.jpg

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

Complexity

Same as Compose.

Caveats

Same as Compose.

-- MichaelRiley - 30 Jun 2007

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg difference1.jpg r2 r1 manage 9.3 K 2007-06-30 - 16:41 MichaelRiley  
JPEGjpg difference2.jpg r3 r2 r1 manage 7.7 K 2007-06-30 - 16:57 MichaelRiley  
JPEGjpg difference3.jpg r4 r3 r2 r1 manage 11.2 K 2007-06-30 - 16:58 MichaelRiley  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2018-04-27 - MichaelRiley
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback