matchCountToScore

open fun matchCountToScore(matchCount: Int): <Error class: unknown class>

Converts a match count to a similarity score between 0 and 1.

This default implementation uses an exponent of 0.4 to provide nonlinear scoring that is generous to partial matches while still giving diminishing returns. For example, matching 2 out of 15 keywords yields ~0.45 rather than 0.13, reflecting that even partial matches can be quite valuable.

The formula is: (matchCount / totalKeywords)^0.4

This approach aligns with information retrieval principles where early matches are most significant, but avoids being overly harsh on documents that match only a subset of keywords.

Return

a similarity score from 0.0 to 1.0

Parameters

matchCount

the number of keywords that matched