Skip to content

@technobuddha > library > String > Fuzzy Match

Function: fuzzyMatch()

ts
function fuzzyMatch(
   input: string, 
   comparedTo: string, 
   options: FuzzyMatchOptions): number;

Defined in: fuzzy-match.ts:31

Computes a fuzzy similarity score between two strings using a weighted combination of Levenshtein distance, Dice coefficient, and longest common substring metrics.

Parameters

ParameterTypeDescription
inputstringThe input string to compare.
comparedTostringThe string to compare against.
optionsFuzzyMatchOptionsOptional configuration for the comparison.

Returns

number

A similarity score between 0 and 1, where 1 indicates a perfect match.