Skip to content

weightedRatioMany

weightedRatioMany(reference, candidates, minSimilarity?): number[]

Compute the weighted ratio from one reference string to many candidates.

Returns an array of similarity scores, one per candidate, in the same order as the input. If minSimilarity is provided, candidates scoring below the threshold return 0.0; a score equal to it is kept. Throws an InvalidArg error if minSimilarity is NaN.

Parameter Type
reference string
candidates readonly string[]
minSimilarity? number | null

number[]