daft.functions.jaro_similarity#
jaro_similarity #
jaro_similarity(left: Expression, right: Expression) -> Expression
Compute the Jaro similarity between two strings.
The Jaro similarity is a measure of similarity between two strings, based on matching characters and transpositions. Returns a value between 0.0 (no similarity) and 1.0 (identical strings).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
left | Expression | The left string expression to compare. | required |
right | Expression | The right string expression to compare against. | required |
Returns:
| Type | Description |
|---|---|
Expression | The Jaro similarity (0.0 to 1.0) for each pair of strings. Returns null when |
Expression | either input is null. |
Examples:
1 2 3 4 5 | |
╭────────┬──────────┬────────────────────╮
│ x ┆ y ┆ similarity │
│ --- ┆ --- ┆ --- │
│ String ┆ String ┆ Float64 │
╞════════╪══════════╪════════════════════╡
│ martha ┆ marhta ┆ 0.9444444444444445 │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ dwayne ┆ duane ┆ 0.8222222222222223 │
├╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┤
│ dixon ┆ dicksonx ┆ 0.7666666666666666 │
╰────────┴──────────┴────────────────────╯
(Showing first 3 of 3 rows) Source code in daft/functions/str.py
1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 | |