We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please reference #5 for more details.
The text was updated successfully, but these errors were encountered:
@ddddxxx
Sorry, something went wrong.
The reason is that similarity func will return Inf if one of the input strings has zero length due to division by zero.
similarity
private func similarity(s1: String, s2: String) -> Double { let len = min(s1.count, s2.count) let diff = min(s1.distance(to: s2, insertionCost: 0), s1.distance(to: s2, deletionCost: 0)) return Double(len - diff) / Double(len) }
No branches or pull requests
Please reference #5 for more details.
The text was updated successfully, but these errors were encountered: