Extract 9 hardcoded scoring weights from similarity() into documented package-level constants: - ScoreExactMatch (1000) - identical string match - ScorePrefixWeight (20) - per-char prefix bonus - ScoreContainsFullWeight (15) - search term in candidate - ScoreSuffixWeight (10) - per-char suffix bonus - ScoreContainsPartialWeight (10) - candidate in search term - ScoreDistanceWeight (5) - Levenshtein close match - ScoreCommonCharsWeight (2) - shared character bonus - LengthDiffThreshold (5) - penalty trigger threshold - LengthDiffPenalty (2) - per-char length difference penalty No behavior change - same scores, now with godoc documentation. Closes: gt-kf7fw Co-authored-by: furiosa <gt@gastown.local>
5.9 KiB
5.9 KiB