We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1b7388 commit 73fcff2Copy full SHA for 73fcff2
detector/scoring.go
@@ -23,17 +23,6 @@ var detectorWeights = map[string]float64{
23
24
const defaultWeight = 0.70
25
26
-// weightForPattern returns the weight for a detected pattern based on its type prefix.
27
-// Pattern types follow the format "category_subtype" (e.g. "role_injection_special_token").
28
-func weightForPattern(patternType string) float64 {
29
- for category, weight := range detectorWeights {
30
- if strings.HasPrefix(patternType, category) {
31
- return weight
32
- }
33
34
- return defaultWeight
35
-}
36
-
37
// computeWeightedScore replaces the old "max + 0.1 bonus" algorithm.
38
//
39
// Formula: final = min(Σ(score_i × weight_i), 1.0)
0 commit comments