Last active
December 31, 2015 12:29
-
-
Save cigrainger/7986886 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def fuzzynames(x): | |
| fn = [] | |
| for key in students.iterkeys(): | |
| fn.append(nltk.metrics.edit_distance(x, key)) | |
| if any(i > 5 for i in fn): | |
| while True: | |
| continue = raw_input("%s looks pretty close to %s. Are you sure this is a new student? " % (x,i)) | |
| if continue.strip() == 'y' or 'n': | |
| break | |
| if continue == 'y': | |
| return x | |
| elif continue == 'n': | |
| return 'quit' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment