[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Edit Distance at Wikipedia

Carlos

10/16/2006 10:40:00 AM

Minkoo wrote:

> Hi list.
>
> I read an article posted at Wikipedia about Levenshtein distance (aka edit
> distance).
> The location of the document is
> http://en.wikipedia.org/wiki/Levenshtei...
>
> In the document, a sample Ruby code goes like the following:
>
> class String
> def levenshtein(comparator)
[...]
> In the code, there's a parameter called comparator which seems to be
> used to
> decode given parameter. But, I can't understand what exactly the comparator
> is doing.

I didn't examine the code, but I'd guess... you want the L. distance
between two strings. One is self, and the other is the parameter named
"comparator".

Good luck.
--



1 Answer

Ken Bloom

10/16/2006 1:43:00 PM

0

On Mon, 16 Oct 2006 19:40:07 +0900, Carlos wrote:

> Minkoo wrote:
>
>> Hi list.
>>
>> I read an article posted at Wikipedia about Levenshtein distance (aka edit
>> distance).
>> The location of the document is
>> http://en.wikipedia.org/wiki/Levenshtei...
>>
>> In the document, a sample Ruby code goes like the following:
>>
>> class String
>> def levenshtein(comparator)
> [...]
>> In the code, there's a parameter called comparator which seems to be
>> used to
>> decode given parameter. But, I can't understand what exactly the comparator
>> is doing.
>
> I didn't examine the code, but I'd guess... you want the L. distance
> between two strings. One is self, and the other is the parameter named
> "comparator".

I have now renamed the variable to "other" for clarity.

--
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu...
I've added a signing subkey to my GPG key. Please update your keyring.