Number of input and output field
| Number of input field |
: |
Two |
| Number of output field |
: |
One |
A measure of similarity between two strings. It returns a value in the interval [0.0, 1.0], where 0.0 indicates that the two strings are completely different and 1.0 indicates that they are identical.
This transformation function uses the Q-Gram distance to measure the similarity between two strings based on n-grams.
An n-gram is a contiguous sequence of n characters from a given text. For example, if n = 3, the n-grams for the phrase “good morning” are:
goo, ood, od_, d_m, _mo, mor, orn, rni, nin, ing.
Next, the frequency of each n-gram is calculated for both strings. These frequency vectors are then used to compute the distance using the Q-Gram formula, which is subsequently normalized to produce a similarity score.
The algorithm’s time complexity is
O(n)