pg_trgm.similarity

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pg_trgm.similarity

PG Bug reporting form
The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/pgtrgm.html
Description:

https://www.postgresql.org/docs/12/pgtrgm.html states that "similarity(text,
text) real Returns a number that indicates how similar the two arguments
are. The range of the result is zero (indicating that the two strings are
completely dissimilar) to one (indicating that the two strings are
identical)."
The word identical is incorrect or at least misleading. It should say
"identical under trigram permutation" or the like.
Remark that the following two strings are not (strictly) identical, yet
their similarity() score is 1:
SELECT similarity('aaabaaa', 'aabaaa');

Moreover, a definition of the formula of computation of that function is
missing.

Sincerely,
Paul.