diff options
| author | Teodor Sigaev | 2018-03-21 11:35:56 +0000 |
|---|---|---|
| committer | Teodor Sigaev | 2018-03-21 11:35:56 +0000 |
| commit | aea7c17e86e99a7ed4da489b3df2b5493b5e5e95 (patch) | |
| tree | 206592b16b906be4902efb59eb1bb02a7fa08eec /contrib | |
| parent | d652e3525b8ff988db717ed66c467b6fd78a32bc (diff) | |
Rework word_similarity documentation, make it close to actual algorithm.
word_similarity before claimed as returning similarity of closest word in
string, but, actually it returns similarity of substring. Also fix mistyped
comments.
Author: Alexander Korotkov
Review by: David Steele, Liudmila Mantrova
Discussionis:
https://www.postgresql.org/message-id/flat/CY4PR17MB13207ED8310F847CF117EED0D85A0@CY4PR17MB1320.namprd17.prod.outlook.com
https://www.postgresql.org/message-id/flat/f43b242d-000c-f4c8-cb8b-d37e9752cd93%40postgrespro.ru
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/pg_trgm/trgm_op.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pg_trgm/trgm_op.c b/contrib/pg_trgm/trgm_op.c index f7e96acc53c..306d60bd3bb 100644 --- a/contrib/pg_trgm/trgm_op.c +++ b/contrib/pg_trgm/trgm_op.c @@ -456,7 +456,7 @@ iterate_word_similarity(int *trg2indexes, lastpos[trgindex] = i; } - /* Adjust lower bound if this trigram is present in required substring */ + /* Adjust upper bound if this trigram is present in required substring */ if (found[trgindex]) { int prev_lower, @@ -473,7 +473,7 @@ iterate_word_similarity(int *trg2indexes, smlr_cur = CALCSML(count, ulen1, ulen2); - /* Also try to adjust upper bound for greater similarity */ + /* Also try to adjust lower bound for greater similarity */ tmp_count = count; tmp_ulen2 = ulen2; prev_lower = lower; |
