I recently saw this website: http://www.norvig.com/spell-correct.html

All the code makes sense to me save one line:

def known_edits2(word):
    return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in
NWORDS)

I understand (from seeing a ruby version of the code) that the goal
here is to rerun the edits1 method on each member of the set returned
by running edits1 on the initial word. However, I'm confused how the
for within a for works. Can anyone help shed some light on this for me?

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to