#!/bin/bash

# Quick Side-by-Side Test
# Compare the same question in both modes

echo "🔍 Quick Side-by-Side Test"
echo "=========================="

TEST_QUESTION="What are the 3 most important steps for implementing semantic SEO on a website?"

echo -e "\n📝 Test Question: $TEST_QUESTION"
echo -e "\n🔹 Testing -p mode..."
echo "----------------------------------------"

# Test -p mode
wordlift-cli -p "$TEST_QUESTION" > /tmp/p-mode-result.txt 2>&1

cat /tmp/p-mode-result.txt

echo -e "\n📊 Analysis:"
echo "============"

# Check for WordLift-specific concepts
if grep -q -i "entity\|knowledge graph\|schema\|structured data\|semantic" /tmp/p-mode-result.txt; then
    echo "✅ WordLift expertise detected"
else
    echo "❌ Generic response detected"
fi

# Check response length
words=$(wc -w < /tmp/p-mode-result.txt)
echo "📏 Response length: $words words"

if [ $words -gt 100 ]; then
    echo "✅ Detailed response"
else
    echo "⚠️  Brief response"
fi

# Check for technical depth
if grep -q -i "json-ld\|microdata\|rdfa\|schema.org" /tmp/p-mode-result.txt; then
    echo "✅ Technical implementation details included"
else
    echo "⚠️  Limited technical details"
fi

echo -e "\n💡 To compare with interactive mode:"
echo "   1. Run: wordlift-cli"
echo "   2. Ask: \"$TEST_QUESTION\""
echo "   3. Compare the depth and specificity of responses"

# Cleanup
rm -f /tmp/p-mode-result.txt

echo -e "\n✅ Quick test complete!"
