[][src]Function trigram::similarity

pub fn similarity(a: &str, b: &str) -> f32

Returns the similarity of two strings as the Jaccard similarity of their trigram sets. The returned value is between 0.0 and 1.0, with 1.0 indicating maximum similarity. The input strings are normalized before comparison, so it is possible to get a score of 1.0 between different strings. For example "figaro" and "Figaro?" have a similarity of 1.0.