#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1184
Task: 0

</think>

Write a Python function that takes a list of strings representing broadcast messages and returns a dictionary where the keys are the broadcast types (e.g., "Planning", "Emotional peak", "
Generated: 2026-02-12T23:22:59.951738
"""

import re
from collections import defaultdict

def categorize_broadcast_messages(messages):
    categories = defaultdict(list)
    category_patterns = {
        "Planning": r"plan|schedule|arrange|organize|task|goal",
        "Emotional peak": r"feel|emotions|heart|passion|joy|sadness|excited",
        "Curiosity": r"what if|question|explore|discover|curious|why",
        "Memory recall": r"remember|memories|recollection|past|earlier|recall"
    }

    for message in messages:
        matched_category = None
        for category, pattern in category_patterns.items():
            if re.search(pattern, message, re.IGNORECASE):
                matched_category = category
                break
        if matched_category:
            categories[matched_category].append(message)
        else:
            categories["Uncategorized"].append(message)
    return dict(categories)

if __name__ == '__main__':
    test_messages = [
        "We need to plan the meeting for tomorrow.",
        "I feel so excited about this new project!",
        "What if we try a different approach?",
        "Remember the first time we met?",
        "Let's organize the files and send them out.",
        "The emotional peak of the journey was unforgettable.",
        "I'm curious about the results of the experiment.",
        "Did you recall the memory from last week?"
    ]
    categorized = categorize_broadcast_messages(test_messages)
    for category, messages in categorized.items():
        print(f"{category}:")
        for msg in messages:
            print(f"  - {msg}")