It appears that you've defined "levenshtein_automata" as a method on your
DFA class, but you did not reference the class instance in your call by
prefixing "self". Instead, you're trying to call a globally defined function
named "levenshtein_automata" -- which because it is not defined, is throwing
a NameError.

Try changing line 145 to the below and see if that resolves the issue:

    lev = self.levenshtein_automata(word, k).to_dfa()  ######### line 145
##########
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to