Introduction¶
Todo
- explain how to use the library
- demonstrating in particular the various ways to build noise-tolerant FSA’s (silent transitions, default transitions, global and state max_noise),
- explaining the notion of token,
- explaining the role of finish(), and why a token on a final state may not immediately return a match;
- the structure of tokens (as returned by feed() and feed_all();
- some of the design choices of the library,
- especially why an empty sequence is never a match, even if the ‘start’ state is marked as terminal.
Bits and pieces¶
Overriding matches¶
The noise-torelant FSM below, fed with
ababab, will yieldaaaonly iffsa.allow_overrideis set to false, but it will yieldaaaandbbbif it is set to true. Note that, if fed withacaca, withfsa.allow_overrideset to true, it will yieldaaaandcca, where the lastaparticipates in both matches.
![]()
Note however that automata work in a greedy way, so the automaton above is fed with
ccaawill only yieldccaa, it will never yieldcca, regardless offsa.allow_override.