Transducers can be composed with the option
-compose File1 File2.
In this form, the two files are assumed
to contain finite state transducers. The (serial) composition is written to
standard output. In the form -compose_fsa File1 File2,
the first file contains a finite
state automaton and the second file contains a finite state transducer.
The composition is written to standard output.
In the form -compose_string Words, a
finite-state transducer is read from standard input and composed with
the (finite-state automaton defining the language consisting of the single)
string Words. The composition is written to standard output. Examples:
% fsa -compose a2b.tnd a2b.tnd >a2b.a2b.tnd
% fsa -compose_fsa aabb.nd a2b.tnd
% fsa -compose_string a a b <a2b.tnd |fsa -d |fsa -m
start(q0). final(q1). trans(q0,a,q2).
trans(q2,b,q3). trans(q3,b,q1).
(29)
Note that the compose_string operation differs from the transduce operation discussed previously. If the
transducer is non-deterministic and relates Words to
several output strings, then this option constructs a finite-state
automaton defining exactly the set of those output strings;
if the transduce option is used, then all of the resulting
strings are written to standard output.
In computational morphology a different kind of composition is
sometimes identified: parallel composition. The parallel composition
of two transducers is obtained by the -intersect option
introduced above for finite state acceptors.