On Apr 12, 10:28 am, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Drew wrote:
> > On Apr 11, 11:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> >> Drew wrote:
> >>> def known_edits2(word):
> >>> return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in
> >>> NWORDS)
>
> >> This is th
Drew wrote:
> On Apr 11, 11:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
>> Drew wrote:
>>> def known_edits2(word):
>>> return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in
>>> NWORDS)
>>
>> This is the same as:
>>
>> result = set()
>> for e1 in edits1(word):
>>
On Apr 11, 11:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote:
> Drew wrote:
> > 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) i
Drew wrote:
> 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)
This is the same as:
result = set()
for
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 t