|
case (a, b) => (delete + f(a, b.tail)) min (insert + f(a.tail, b)) min (replace + f(a.tail, b.tail)) |
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))
scalgos/src/main/scala/com/github/pathikrit/scalgos/DynamicProgramming.scala
Line 146 in 9e99f73
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?