Bo
d22b5b6ab5
refactor(suggest): extract magic numbers to named constants (#353)
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>
2026-01-11 18:49:01 -08:00
..
2026-01-11 18:37:01 -08:00
2026-01-09 22:08:12 -08:00
2026-01-08 12:36:54 -05:00
2026-01-08 12:36:54 -05:00
2026-01-11 18:47:49 -08:00
2026-01-10 01:20:32 -08:00
2026-01-10 01:07:01 -08:00
2026-01-10 01:07:01 -08:00
2026-01-10 22:46:51 -08:00
2026-01-09 22:07:35 -08:00
2026-01-11 18:33:34 -08:00
2026-01-10 16:29:54 -08:00
2026-01-09 14:11:09 -08:00
2026-01-09 22:23:44 -08:00
2026-01-10 23:55:52 -08:00
2026-01-09 22:31:55 -08:00
2026-01-11 00:03:40 -08:00
2026-01-09 21:52:30 -08:00
2026-01-08 12:48:03 -05:00
2026-01-11 18:33:34 -08:00
2026-01-09 22:31:55 -08:00
2026-01-11 18:33:34 -08:00
2026-01-08 12:48:03 -05:00
2026-01-10 12:30:14 -08:00
2026-01-09 21:57:11 -08:00
2026-01-08 20:25:01 -08:00
2026-01-09 22:46:06 -08:00
2026-01-11 18:49:01 -08:00
2026-01-09 22:31:55 -08:00
2026-01-11 00:01:17 -08:00
2026-01-10 23:27:50 -08:00
2026-01-09 14:11:09 -08:00
2026-01-09 22:46:06 -08:00
2026-01-09 22:46:06 -08:00
2026-01-09 22:02:34 -08:00
2026-01-09 18:14:17 -08:00
2026-01-10 22:47:38 -08:00
2026-01-09 21:57:11 -08:00