similarity.v: update a comment

pull/2067/head
Michiel Vlootman 2019-09-21 13:59:06 +02:00 committed by Alexander Medvednikov
parent 15bf3f2eb8
commit 9b7ca248f0
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ pub fn levenshtein_distance_percentage(a, b string) f32 {
// implementation of SørensenDice coefficient. // implementation of SørensenDice coefficient.
// find the similarity between two strings. // find the similarity between two strings.
// returns f64 between 0.0 (not similar) and 1.0 (exact match). // returns coefficient between 0.0 (not similar) and 1.0 (exact match).
pub fn dice_coefficient(s1, s2 string) f32 { pub fn dice_coefficient(s1, s2 string) f32 {
if s1.len == 0 || s2.len == 0 { return 0.0 } if s1.len == 0 || s2.len == 0 { return 0.0 }
if s1 == s2 { return 1.0 } if s1 == s2 { return 1.0 }