Most sensory stimuli are temporal in structure. How action potentials encode the information incoming from sensory stimuli remains one of the central research questions in neuroscience. Although there is evidence that the precise timing of spikes represents information in spiking neuronal networks, information processing in spiking networks is still not fully understood. One feasible way to understand the working mechanism of a spiking network is to associate the structural connectivity of the network with the corresponding functional behaviour. This work demonstrates the structure-function mapping of spiking networks evolved (or handcrafted) for a temporal pattern recognition task. The task is to recognise a specific order of the input signals so that the Output neurone of the network spikes only for the correct placement and remains silent for all others. The minimal networks obtained for this task revealed the twofold importance of autapses in recognition; first, autapses simplify the switching among different network states. Second, autapses enable a network to maintain a network state, a form of memory. To show that the recognition task is accomplished by transitions between network states, we map the network states of a functional spiking neural network (SNN) onto the states of a finite-state transducer (FST, a formal model of computation that generates output symbols, here: spikes or no spikes at specific times, in response to input, here: a series of input signals). Finally, based on our understanding, we define rules for constructing the topology of a network handcrafted for recognising a subsequence of signals (pattern) in a particular order. The analysis of minimal networks recognising patterns of different lengths (two to six) revealed a positive correlation between the pattern length and the number of autaptic connections in the network. Furthermore, in agreement with the behaviour of neurones in the network, we were able to associate specific functional roles of locking, switching, and accepting to neurones.