TWiki> FST Web>FstQuickTour>IntersectDoc (revision 7)EditAttach



This operation computes the intersection (Hadamard product) of two FSAs. Only strings that are in both automata are retained in the result.

The two arguments must be acceptors. One of the arguments must be label-sorted (or otherwise support an appropriate matcher).The weights need to form a commutative semiring (valid for TropicalWeight and LogWeight for instance).

Versions of this operation (not all shown here) accept options that allow choosing the matcher, composition filter, state table and, when delayed, the caching behaviour used by intersection.


template <class Arc> 
void Intersect(const Fst<Arc> &ifsa1, const Fst<Arc> &ifsa2, MutableFst<Arc> *ofsa);
template <class Arc> IntersectFst<Arc>::
IntersectFst(const Fst<Arc> &fsa1, const Fst<Arc> &fsa2);
fstintersect [--opts] a.fsa b.fsa out.fsa
  --connect: Trim output (def: true)






A ∩ B:


Intersect(A, B, &C);
IntersectFst<Arc>(A, B);
fstintersect a.fsa b.fsa out.fsa


Same as Compose.


Same as Compose.

See Also

Composition Filters, Matchers, State Tables

-- MichaelRiley - 30 Jun 2007

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg intersect1.jpg r3 r2 r1 manage 11.0 K 2007-06-30 - 21:59 MichaelRiley  
JPEGjpg intersect2.jpg r2 r1 manage 10.4 K 2007-06-30 - 21:59 MichaelRiley  
JPEGjpg intersect3.jpg r2 r1 manage 13.9 K 2007-06-30 - 22:00 MichaelRiley  
Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r7 - 2014-04-23 - MichaelRiley
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback