MCPcopy Create free account
hub / github.com/Effect-TS/effect / nameSimilarity

Function nameSimilarity

packages/tools/api-diff/src/Diff.ts:37–40  ·  view source on GitHub ↗
(left: string, right: string)

Source from the content-addressed store, hash-verified

35}
36
37const nameSimilarity = (left: string, right: string): number => {
38 const length = Math.max(left.length, right.length)
39 return length === 0 ? 1 : 1 - levenshtein(left.toLowerCase(), right.toLowerCase()) / length
40}
41
42const entityFeatureCache = new WeakMap<ApiEntity, ReadonlySet<string>>()
43

Callers 1

groupSimilarityFunction · 0.85

Calls 1

levenshteinFunction · 0.70

Tested by

no test coverage detected