  In this paper, we present a categorical approach to learning automata over
words, in the sense of the $L^*$-algorithm of Angluin. This yields a new
generic $L^*$-like algorithm which can be instantiated for learning
deterministic automata, automata weighted over fields, as well as subsequential
transducers. The generic nature of our algorithm is obtained by adopting an
approach in which automata are simply functors from a particular category
representing words to a "computation category". We establish that the
sufficient properties for yielding the existence of minimal automata (that were
disclosed in a previous paper), in combination with some additional hypotheses
relative to termination, ensure the correctness of our generic algorithm.

Formal Languages and Automata Theory