Files
slogan/server/styleagent/agent/scoring_occasion_rule.go
T
admin a6de9ebd12 Add 'server/' from commit 'e64421295fff83acbb6d6ab3d3b27f3ef8368f00'
git-subtree-dir: server
git-subtree-mainline: c4e617ada7
git-subtree-split: e64421295f
2026-08-04 15:02:35 +08:00

30 lines
718 B
Go

package agent
import "strings"
// occasionScore 场合匹配(25 分制):基础 15 + 场合类别匹配项 +5
var occasionCategory = map[string][]string{
"通勤": {"西装", "衬衫", "休闲", "通勤"},
"约会": {"裙装", "连衣裙", "优雅", "约会", "浪漫"},
"聚会": {"潮流", "时尚", "个性", "派对"},
"运动": {"运动", "休闲", "T恤", "卫衣"},
}
func occasionScore(o CandidateOutfit, ctx ScoreContext) int {
score := 15
allowed := occasionCategory[ctx.Occasion]
for _, it := range o.Items {
tags := it.StyleTags
for _, a := range allowed {
if a != "" && strings.Contains(tags, a) {
score += 5
break
}
}
}
if score > 25 {
return 25
}
return score
}