TWiki> FST Web>FstQuickTour>ReverseDoc (revision 1)EditAttach



This operation reverses an FST. If A transduces string x to y with weight a, then the reverse of A transduces the reverse of x to the reverse of y with weight a.Reverse().

Typically, a = a.Reverse() and Arc = RevArc (e.g. for TropicalWeight or LogWeight). In general, e.g., when the weights only form a left or right semiring, the output arc type must match the input arc type except having the reversed Weight type.


template<class Arc, class RevArc>
void Reverse(const Fst<Arc> &ifst, MutableFst<RevArc> *ofst);
doc [bad link?]
fstreverse a.fst out.fst




Reverse of A:


fstreverse a.fst out.fst



  • Time: O(V + E)
  • Space: O(V + E)
where V = # of states and E = # of arcs.

-- MichaelRiley - 03 Jul 2007

Topic attachments
I Attachment History Action Size Date Who Comment
JPEGjpg reverse1.jpg r3 r2 r1 manage 14.3 K 2007-07-03 - 01:19 MichaelRiley  
JPEGjpg reverse2.jpg r3 r2 r1 manage 18.5 K 2007-07-03 - 01:19 MichaelRiley  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2007-07-03 - MichaelRiley
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback