Description
Computes the Jaro-Winkler similarity between two strings. This metric is particularly effective for short strings like names and addresses. It gives more favorable ratings to strings that match from the beginning. Returns a value between 0 (no similarity) and 1 (exact match).Syntax
Parameters
Returns
Type: number (float) A similarity score between 0 and 1:1.0indicates an exact match0.0indicates no similarity- Higher values indicate greater similarity
Examples
Example 1: Name Matching
Example 2: Fuzzy Name Search
Example 3: Deduplication by Company Name
Notes
- Particularly effective for short strings (names, addresses)
- Gives higher weight to strings that match from the beginning
- Handles
nullvalues by returning appropriate default values - Case-sensitive comparison
- More forgiving than exact match but stricter than pure Jaro similarity
- Commonly used in record linkage and deduplication tasks
See Also
- text.levenshtein - Edit distance metric for string comparison
- sim.jaccard - Set-based similarity
Frequently Asked Questions
When should I use Jaro-Winkler vs Levenshtein?
When should I use Jaro-Winkler vs Levenshtein?
Use Jaro-Winkler for comparing short strings like names and addresses where prefix similarity matters. Use Levenshtein when you need an exact edit distance count.
Is the comparison case-sensitive?
Is the comparison case-sensitive?
Yes.
flex.text.jaroWinkler performs a case-sensitive comparison. Apply toLower() to both strings for case-insensitive matching.