pub fn extract_emotion(text: &str) -> ExtractionResultExpand description
Extract emotional state from text using structural signals.
This replaces word-list-only valence detection. Instead of matching individual words, it detects:
- What event happened (achievement, error, fix, challenge, building)
- What speech act was used (question, imperative, contemplation)
- What context type the text is in (code, personal, philosophical)
- Whether this is a self-correction (positive structural signal)
Self-corrections override event detection: if the text contains a self-correction signal, the emotion is positive (learning/humility) regardless of negative words.