Expand description
The trigram library computes the similarity of strings, inspired by the similarity function in the Postgresql pg_trgm extension.
Structs§
Functions§
- find_
words_ iter - Iterates over fuzzy matches of one string against the words in another, such that the similarity is over some threshold, for example 0.3.
- similarity
- 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.