Skip to content

editDistance bug? #22

@zhaomingli007

Description

@zhaomingli007

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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions