Skip to main content

string_jaro_winkler

Functions

Calculate the Jaro-Winkler distance between two strings. Useful for sorting and fuzzy matching.

Counts the number of common characters at the beginning of each word up to a maximum of character_limit

string_jaro_winkler(first, second) ⇒ number

Calculate the Jaro-Winkler distance between two strings. Useful for sorting and fuzzy matching.

Kind: global function
Returns: number - similarity score, higher value means strings are more similar, between 0 and 1

ParamTypeDescription
firststringThe string to compare
secondstringThe string to compare with

Example

string_jaro_winkler("Hello", "Hello") === 1
string_jaro_winkler("apple", "orange") === 0.58
string_jaro_winkler("how are you?", "are you good?") === 0.74

getPrefix(a1, a2, character_limit) ⇒ number

Counts the number of common characters at the beginning of each word up to a maximum of character_limit

Kind: global function
Returns: number - number of matching characters from the start of the string, up to limit

ParamTypeDescription
a1stringThe first string to compare
a2stringThe second string to compare
character_limitnumber