Skip to content

Instantly share code, notes, and snippets.

[
{
"tags": [
"Japanese restaurants",
"Restaurant",
"Sushi",
"Bar",
"Food",
"Food & drink",
"Japanese restaurant"
[
{
"tags": [
"Others",
"Tech startups",
"Homes",
"Offices",
"Corporate office",
"Work",
"Services",
@mkscrg
mkscrg / gist:725879
Created December 2, 2010 19:18
A test Gist! (Some Python functions playing with deterministic finite automata.)
"""
Arguments are the parameters of a deterministic finite automaton:
q -- states (list of strings)
si -- input alphabet (list of characters)
de -- transition function ((index of q),(index of si) --> (index of q))
s -- start state (index of q)
f -- accept states (list of (index of q))
Returns a generator function which takes a string and generates successive
states (indices of q) as the DFA runs on the string.
"""