Difference

Description

This operation computes the difference between two FSAs. Any string in the second automaton is removed from the first automaton.

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.

Usage

template <class Arc> 
void Difference(const Fst<Arc> &ifsa1, const Fst<Arc> &ifsa2, MutableFst<Arc> *ofsa);
doc [bad link?]
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  

This topic: FST > WebHome > FstQuickTour > DifferenceDoc
Topic revision: r1 - 2007-06-30 - 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