1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

similarity.v: update a comment

This commit is contained in:
Michiel Vlootman 2019-09-21 13:59:06 +02:00 committed by Alexander Medvednikov
parent 15bf3f2eb8
commit 9b7ca248f0

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 }