Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite146e4d

Browse files
committed
Documentation improvement for pg_trgm
Documentation of word_similarity() and strict_word_similarity() functionscontains some vague wordings which could confuse users. This patch makesthose wordings more clear. word_similarity() was introduced in PostgreSQL 9.6,and corresponding part of documentation needs to be backpatched.Author: Bruce Momjian, Alexander KorotkovDiscussion:https://postgr.es/m/20180526165648.GB12510%40momjian.usBackpatch: 9.6, where word_similarity() was introduced
1 parente3eb8be commite146e4d

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎doc/src/sgml/pgtrgm.sgml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@
113113
<entry><type>real</type></entry>
114114
<entry>
115115
Same as <function>word_similarity(text, text)</function>, but forces
116-
extent boundaries to match word boundaries.
116+
extent boundaries to match word boundaries. Since we don't have
117+
cross-word trigrams, this function actually returns greatest similarity
118+
between first string and any continuous extent of words of the second
119+
string.
117120
</entry>
118121
</row>
119122
<row>
@@ -164,16 +167,16 @@
164167
This function returns a value that can be approximately understood as the
165168
greatest similarity between the first string and any substring of the second
166169
string. However, this function does not add padding to the boundaries of
167-
the extent. Thus,a whole word match gets a higher score than a match with
168-
a part ofthe word.
170+
the extent. Thus,the number of additional characters present in the
171+
second string is not considered, except forthemismatchedword boundry.
169172
</para>
170173

171174
<para>
172175
At the same time, <function>strict_word_similarity(text, text)</function>
173-
has to select an extent that matches word boundaries. In the example above,
176+
selects extent of words in the second string. In the example above,
174177
<function>strict_word_similarity(text, text)</function> would select the
175-
extent<literal>{" w"," wo","wor","ord","rds","ds "}</literal>,which
176-
corresponds to the whole word <literal>'words'</literal>.
178+
extentof single word <literal>'words'</literal>,whose set of trigrams is
179+
<literal>{" w"," wo","wor","ord","rds","ds "}</literal>
177180

178181
<programlisting>
179182
# SELECT strict_word_similarity('word', 'two words'), similarity('word', 'words');
@@ -186,9 +189,9 @@
186189

187190
<para>
188191
Thus, the <function>strict_word_similarity(text, text)</function> function
189-
is useful for findingsimilar subsets of whole words, while
192+
is useful for findingthe similarity to whole words, while
190193
<function>word_similarity(text, text)</function> is more suitable for
191-
searching similar parts of words.
194+
finding the similarity for parts of words.
192195
</para>
193196

194197
<table id="pgtrgm-op-table">

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp