// Package scale holds exploration-test scoring helpers. package scale // ScoreMajority picks the most frequent answer key and maps to a label set. func ScoreMajority(answers map[string]string, labels map[string]string, defaultLabel string) (styleKey, label string) { counts := map[string]int{} for _, v := range answers { counts[v]++ } best, bestN := "", -1 for k, n := range counts { if n > bestN { best, bestN = k, n } } if best == "" { return "", defaultLabel } label = labels[best] if label == "" { label = defaultLabel } return best, label } // CommunicationLabels for communication-style scale. func CommunicationLabels() map[string]string { return map[string]string{ "A": "理性澄清型", "B": "感受连接型", "C": "节奏尊重型", } } // EmotionLabels for emotion-pattern scale. func EmotionLabels() map[string]string { return map[string]string{ "A": "觉察表达型", "B": "安抚稳定型", "C": "行动调节型", } }