From:             [EMAIL PROTECTED]
Operating system: 
PHP version:      4.0.4pl1
PHP Bug Type:     *Function Specific
Bug description:  bug in weighted Levenshtein distance function

In function:

   static int weighted_levdist

There is a block of code: 

   118          /* if we already used up one string, then
   119        the result is the length of the other */
   120          if(*s1=='\0') return strlen(s2);
   121          if(*s2=='\0') return strlen(s1);
This is correct for unweighted, but not weighted Levenshtein.

The value on line 120 should be multiplied by
cost_ins, and the value on line 121 should be multiplied
by cost_del.


Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to