mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
A new QgsStringUtils class has been added containing some common fuzzy matching algorithms, including Levenshtein edit distance and Soundex. These can be used for finding "similar" strings in a table. Expression functions for these algorithms have also been added to a new "Fuzzy Matching" group.
18 lines
635 B
Plaintext
18 lines
635 B
Plaintext
<h3>hamming_distance function</h3>
|
|
Returns the Hamming distance between two strings. This equates to the number of characters at
|
|
corresponding positions within the input strings where the characters are different. The input
|
|
strings must be the same length, and the comparison is case-sensitive.
|
|
|
|
<h4>Syntax</h4>
|
|
<pre>hamming_distance(string1,string2)</pre>
|
|
|
|
<h4>Arguments</h4>
|
|
string1 → a string<br />
|
|
string2 → a string<br />
|
|
|
|
<h4>Example</h4>
|
|
<pre> hamming_distance('abc','xec') → 2</pre><br />
|
|
<pre> hamming_distance('abc','ABc') → 2</pre><br />
|
|
<pre> hamming_distance(upper('abc'),upper('ABC')) → 0</pre>
|
|
|