Skip to content

Instantly share code, notes, and snippets.

@cigrainger
Last active December 31, 2015 12:29
Show Gist options
  • Select an option

  • Save cigrainger/7986886 to your computer and use it in GitHub Desktop.

Select an option

Save cigrainger/7986886 to your computer and use it in GitHub Desktop.
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