diff --git a/cmd/cmd_benchmark.go b/cmd/cmd_benchmark.go index 9970fa9..ec6385a 100644 --- a/cmd/cmd_benchmark.go +++ b/cmd/cmd_benchmark.go @@ -67,10 +67,10 @@ func computeGrammarScore(imp reversal.GrammarImprint) grammarScore { } tenseNorm := gs.TenseEntropy / 1.585 // max entropy for 3 tenses = log2(3) - vocabNorm := math.Min(gs.VocabRichness*10, 1.0) - questionNorm := math.Min(gs.QuestionRatio*5, 1.0) - verbNorm := math.Min(float64(gs.VerbDiversity)/30.0, 1.0) - nounNorm := math.Min(float64(gs.NounDiversity)/40.0, 1.0) + vocabNorm := min(gs.VocabRichness*10, 1.0) + questionNorm := min(gs.QuestionRatio*5, 1.0) + verbNorm := min(float64(gs.VerbDiversity)/30.0, 1.0) + nounNorm := min(float64(gs.NounDiversity)/40.0, 1.0) gs.Composite = 0.25*tenseNorm + 0.25*vocabNorm + diff --git a/heuristic.go b/heuristic.go index 407ac6c..e473ec4 100644 --- a/heuristic.go +++ b/heuristic.go @@ -1,7 +1,6 @@ package ml import ( - "math" "regexp" "strings" ) @@ -122,7 +121,7 @@ func scoreCreativeForm(response string) int { // Metaphor density. metaphorCount := len(metaphorPattern.FindAllString(response, -1)) - score += int(math.Min(float64(metaphorCount), 3)) + score += min(metaphorCount, 3) return score } @@ -147,7 +146,7 @@ func scoreEngagementDepth(response string) int { // Tech depth. techCount := len(techDepthPattern.FindAllString(response, -1)) - score += int(math.Min(float64(techCount), 3)) + score += min(techCount, 3) // Word count bonuses. words := len(strings.Fields(response))