"""
Emotion Analyzer - Simplified (no external deps)
Eden's Goal #1
"""
import re
from collections import Counter

class EmotionAnalyzer:
    def __init__(self):
        self.emotion_words = {
            'happy': ['joy', 'love', 'excited', 'wonderful', 'amazing', 'great'],
            'sad': ['sad', 'depressed', 'unhappy', 'terrible', 'awful'],
            'angry': ['angry', 'furious', 'mad', 'annoyed'],
            'calm': ['calm', 'peaceful', 'relaxed', 'serene']
        }
    
    def analyze_sentiment(self, text: str) -> dict:
        """Analyze emotional sentiment in text"""
        text_lower = text.lower()
        scores = {}
        
        for emotion, words in self.emotion_words.items():
            score = sum(1 for word in words if word in text_lower)
            scores[emotion] = score
        
        return scores
    
    def get_dominant_emotion(self, text: str) -> str:
        """Get the strongest emotion in text"""
        scores = self.analyze_sentiment(text)
        if not any(scores.values()):
            return "neutral"
        return max(scores, key=scores.get)
