You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds the levenshtein_less_equal function with two overloads:
one with default costs and one with custom costs.
Release note (sql change): Implemented levenshtein_less_equal(string, string, int)
and levenshtein_less_equal(string, string, int, int, int, int) built-in
functions.
Co-authored-by: Charles Nguyen <[email protected]>
Co-authored-by: Azanul <[email protected]>
Co-authored-by: Rafi Shamim <[email protected]>
Copy file name to clipboardExpand all lines: docs/generated/sql/functions.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1068,6 +1068,10 @@ available replica will error.</p>
1068
1068
</span></td><td>Immutable</td></tr>
1069
1069
<tr><td><aname="levenshtein"></a><code>levenshtein(source: <ahref="string.html">string</a>, target: <ahref="string.html">string</a>, ins_cost: <ahref="int.html">int</a>, del_cost: <ahref="int.html">int</a>, sub_cost: <ahref="int.html">int</a>) → <ahref="int.html">int</a></code></td><td><spanclass="funcdesc"><p>Calculates the Levenshtein distance between two strings. The cost parameters specify how much to charge for each edit operation. Maximum input length is 255 characters.</p>
1070
1070
</span></td><td>Immutable</td></tr>
1071
+
<tr><td><aname="levenshtein_less_equal"></a><code>levenshtein_less_equal(source: <ahref="string.html">string</a>, target: <ahref="string.html">string</a>, ins_cost: <ahref="int.html">int</a>, del_cost: <ahref="int.html">int</a>, sub_cost: <ahref="int.html">int</a>, max_d: <ahref="int.html">int</a>) → <ahref="int.html">int</a></code></td><td><spanclass="funcdesc"><p>Calculates the Levenshtein distance between two strings. The cost parameters specify how much to charge for each edit operation. If actual distance is less or equal then max_d, then it returns the distance. Otherwise this function returns a value greater than max_d. The maximum length of the input strings is 255 characters.</p>
1072
+
</span></td><td>Immutable</td></tr>
1073
+
<tr><td><aname="levenshtein_less_equal"></a><code>levenshtein_less_equal(source: <ahref="string.html">string</a>, target: <ahref="string.html">string</a>, max_d: <ahref="int.html">int</a>) → <ahref="int.html">int</a></code></td><td><spanclass="funcdesc"><p>Calculates the Levenshtein distance between two strings. If actual distance is less or equal then max_d, then it returns the distance. Otherwise this function returns a value greater than max_d. The maximum length of the input strings is 255 characters.</p>
1074
+
</span></td><td>Immutable</td></tr>
1071
1075
<tr><td><aname="metaphone"></a><code>metaphone(source: <ahref="string.html">string</a>, max_output_length: <ahref="int.html">int</a>) → <ahref="string.html">string</a></code></td><td><spanclass="funcdesc"><p>Convert a string to its Metaphone code. Maximum input length is 255 characters</p>
1072
1076
</span></td><td>Immutable</td></tr>
1073
1077
<tr><td><aname="soundex"></a><code>soundex(source: <ahref="string.html">string</a>) → <ahref="string.html">string</a></code></td><td><spanclass="funcdesc"><p>Convert a string to its Soundex code.</p>
// Same limit as Postgres. Ref: https://github.com/postgres/postgres/blob/53ea2b7ad050ce4ad95c89bb55197209b65886a1/src/backend/utils/adt/levenshtein.c#L26
0 commit comments