octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #49375] pkg name similarity measurement is off


From: Rik
Subject: [Octave-bug-tracker] [bug #49375] pkg name similarity measurement is off / too simplistic
Date: Mon, 17 Oct 2016 21:47:06 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0

Update of bug #49375 (project octave):

                  Status:                    None => Confirmed              

    _______________________________________________________

Follow-up Comment #3:

Maybe a cost penalty based on 1 or 2 for each additional character?


    function d = fdist (x)
      len1 = length (name);
      len2 = length (x);
      if (len1 <= len2)
        #d = sum (abs (name(1:len1) - x(1:len1))) + sum (x(len1+1:end));
        d = sum (abs (name(1:len1) - x(1:len1))) + (len2 - len1);
      else
        #d = sum (abs (name(1:len2) - x(1:len2))) + sum (name(len2+1:end));
        d = sum (abs (name(1:len2) - x(1:len2))) + (len1 - len2);
      endif
    endfunction


This works for a single addition of a character.  But it still sucks if there
has been a repetition or deletion within the body of the name since after the
error all of the characters are mis-aligned.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49375>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]