pub fn calculate_congruence(tone: &str, face: &str) -> (f32, String) {
let tone = tone.to_lowercase();
let face = face.to_lowercase();
if tone == face {
return (1.0, "MATCH: PERFECT".to_string());
}
let close_match = matches!(
(tone.as_str(), face.as_str()),
("calm", "neutral")
| ("neutral", "calm")
| ("happy", "surprise")
| ("surprise", "happy")
| ("sad", "fear")
| ("fear", "sad")
| ("angry", "disgust")
| ("disgust", "angry")
);
if close_match {
(0.8, "MATCH: CLOSE".to_string())
} else {
(0.3, "MISMATCH: DIVERGENT".to_string())
}
}