scalgos
scalgos copied to clipboard
editDistance bug?
https://github.com/pathikrit/scalgos/blob/9e99f73b4241f42cc40a1fd890e72dbeda2df54f/src/main/scala/com/github/pathikrit/scalgos/DynamicProgramming.scala#L146 When call editDistance(List("c"),List("b"),2,1,5), the expected cost should be 3 (one deletion + one addition). Now it returns 2.
Probably it can be modified as below?
case (a, b) => (delete + f(a.tail, b)) min (insert + f(a.tail, a.head :: b)) min (replace + f(a.tail, b.tail))