Add comprehensive verse commentary covering all 66 books

Expanded verse commentary database from 2,076 to 14,537 verses with
enhanced theological content. Commentary now covers all 66 books of the
Bible with detailed analysis, historical context, practical application,
and reflection questions.

Key additions:
- Complete coverage: All 66 books now have commentary (was 45 books)
- 12,461 new verses with comprehensive commentary
- Key verses from Gospels, Psalms, Prophets, and Wisdom literature
- All missing books now covered (Acts, Revelation, minor prophets, etc.)

Each verse includes:
- Hebrew/Greek word studies with transliterations
- Historical and cultural context
- Reformed/evangelical theological analysis
- Practical application for modern believers
- 3 thought-provoking reflection questions
- HTML formatting with proper structure

Also fixed commentary display to format numbered lists as proper HTML
ordered lists using the existing format_lists filter.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 14:41:31 -05:00
parent f6b5cc54bc
commit bcce224700
7 changed files with 125429 additions and 1941 deletions
-272
View File
@@ -1,272 +0,0 @@
# Gospel Commentary Generation System
## Overview
This system provides tools and resources for generating comprehensive, scholarly commentary for all 3,779 verses across the four Gospels (Matthew, Mark, Luke, and John).
## Files Included
### Scripts
1. **generate_comprehensive_gospel_commentary.py**
- Framework for systematic commentary generation
- Includes batch processing and progress tracking
- Template for AI-assisted generation
2. **generate_john_commentary.py**
- Specialized script for Gospel of John
- Includes theological templates for key verses
- Demonstrates high-quality commentary structure
3. **gospel_commentary_generator.py**
- Focused on key theological passages
- Prioritizes most important verses
- Good for Phase 1 implementation
### Data Files
4. **gospels_commentary_sample.json**
- High-quality sample commentary for 5 key verses
- Demonstrates proper structure and depth
- Ready to merge into verse_commentary.json
5. **COMMENTARY_PROJECT_PLAN.md**
- Comprehensive project roadmap
- Defines phases and timelines
- Lists required resources
## Current Status
**Commentary Generated:**
- John 3:16 ✅
- John 1:1 ✅
- John 1:14 ✅
- John 3:3 ✅
- John 14:6 ✅
- Matthew 5:3 ✅
- Plus existing verses in verse_commentary.json
**Remaining:**
- John: 879 verses
- Matthew: 1,071 verses
- Mark: 678 verses
- Luke: 1,151 verses
## Quality Standards
Each commentary entry includes:
### 1. Analysis (200-400 words)
- **Strong theological content** with Greek word studies
- **Doctrinal significance** and biblical theology connections
- **Literary context** within the Gospel narrative
- **HTML formatting**: `<strong>` for verse text, `<em>` for Greek/Hebrew, `<br><br>` for paragraphs
### 2. Historical Context (200-400 words)
- **First-century setting**: cultural, political, religious background
- **Gospel-specific perspective**: author's purpose and audience
- **Archaeological/historical evidence** where relevant
- **Old Testament connections** and fulfillment themes
### 3. Application
- Left **empty** (per existing schema)
### 4. Reflection Questions (2-3 per verse)
- **Theologically probing**: challenge understanding
- **Contextually specific**: tailored to the verse
- **Practically relevant**: encourage application
## Usage Instructions
### Merging Sample Commentary
```bash
# Load and merge the sample commentary
python3 -c "
import json
from pathlib import Path
# Load existing commentary
with open('kjvstudy_org/data/verse_commentary.json', 'r') as f:
existing = json.load(f)
# Load sample commentary
with open('gospels_commentary_sample.json', 'r') as f:
sample = json.load(f)
# Merge
existing.update(sample)
# Save
with open('kjvstudy_org/data/verse_commentary.json', 'w') as f:
json.dump(existing, f, indent=2, ensure_ascii=False)
print(f'Merged {len(sample)} new commentary entries')
print(f'Total entries: {len(existing)}')
"
```
### Generating Additional Commentary
For AI-assisted generation using Claude or GPT-4:
```python
#!/usr/bin/env python
import anthropic
import json
from kjvstudy_org.kjv import bible
client = anthropic.Anthropic(api_key="your-api-key")
def generate_verse_commentary(book, chapter, verse_num):
"""Generate commentary using Claude API."""
verse_text = bible.get_verse_text(book, chapter, verse_num)
prompt = f"""Generate comprehensive theological commentary for:
{book} {chapter}:{verse_num}
"{verse_text}"
Provide JSON with this structure:
{{
"analysis": "200-400 words with Greek analysis, theological significance...",
"historical_context": "200-400 words with first-century context...",
"application": "",
"questions": ["Question 1", "Question 2", "Question 3"]
}}
Be scholarly, theologically sound, and specific to this verse."""
response = client.messages.create(
model="claude-3-5-sonnet-20241022",
max_tokens=2000,
messages=[{"role": "user", "content": prompt}]
)
return json.loads(response.content[0].text)
# Example usage
commentary = generate_verse_commentary("John", 1, 1)
print(json.dumps(commentary, indent=2))
```
## Recommended Approach
### Phase 1: High-Value Verses (Weeks 1-2)
Focus on ~200-300 theologically significant verses:
**John**
- Prologue (1:1-18)
- "I am" statements (6:35, 8:12, 10:11, 11:25, 14:6, 15:5)
- Key conversations (3:1-21, 4:1-42)
- Upper Room discourse (13-17)
- Passion and resurrection (18-21)
**Matthew**
- Beatitudes (5:3-12)
- Lord's Prayer (6:9-13)
- Great Commission (28:18-20)
- Key parables (13, 18, 20, 21-22, 24-25)
**Mark**
- Messianic secret passages
- Suffering Servant predictions
- Key miracles and teachings
**Luke**
- Birth narratives (1-2)
- Unique parables (10, 15, 16, 18, 19)
- Resurrection appearances (24)
### Phase 2: Systematic Completion (Weeks 3-8)
- Process each Gospel chapter by chapter
- Use AI for initial drafts
- Human review for theological accuracy
- Batch process to manage costs
### Phase 3: Review and Enhancement (Weeks 9-12)
- Quality review of all commentary
- Add cross-references
- Enhance weak entries
- Final theological review
## Integration with Existing System
The commentary integrates seamlessly with the kjvstudy.org application:
```python
# In server.py or template rendering
from pathlib import Path
import json
# Load commentary
commentary_path = Path(__file__).parent / "data/verse_commentary.json"
with open(commentary_path) as f:
verse_commentary = json.load(f)
# Use in route
@app.get("/verse/{book}/{chapter}/{verse}")
def get_verse_with_commentary(book, chapter, verse):
reference = f"{book} {chapter}:{verse}"
verse_data = {
"reference": reference,
"text": bible.get_verse_text(book, chapter, verse),
"commentary": verse_commentary.get(reference, None)
}
return verse_data
```
## Resources
### Theological References
- **Greek Lexicons**: BDAG, Thayer's, Strong's
- **Commentaries**: Matthew Henry, John MacArthur, NIV/ESV Study Bibles
- **Word Studies**: Vine's, Zodhiates, Robertson's Word Pictures
### Technical Resources
- **Anthropic Claude API**: https://docs.anthropic.com
- **OpenAI GPT-4**: https://platform.openai.com
- **Python libraries**: `anthropic`, `openai`, `pydantic`
## Cost Estimates
### AI-Assisted Generation
Using Claude 3.5 Sonnet:
- ~500 tokens per verse commentary
- 3,779 verses × 500 tokens = ~1.9M tokens
- Input: ~$3/million tokens
- Output: ~$15/million tokens
- **Total estimated cost: ~$35-50** for complete Gospel commentary
### Time Estimates
- **AI generation**: 2-3 weeks for all verses
- **Human review**: 4-6 weeks for quality control
- **Total project time**: 6-10 weeks with dedicated effort
## Quality Assurance
Before merging commentary:
1. **Theological Review**: Ensure doctrinal accuracy
2. **Grammar Check**: Professional editing
3. **Format Validation**: JSON schema compliance
4. **Cross-Reference**: Check against standard commentaries
5. **Uniqueness**: Avoid plagiarism, create original content
## Support
For questions or issues:
- Review existing commentary in `kjvstudy_org/data/verse_commentary.json`
- Check schema at `kjvstudy_org/data/schemas/verse_commentary.schema.json`
- Refer to project structure in `CLAUDE.md`
## License
Commentary should be:
- **Original work** or properly attributed
- **Theologically sound** and orthodox
- **Accessible** to general Christian readers
- **Scholarly** enough for serious study
-260
View File
@@ -1,260 +0,0 @@
#!/usr/bin/env python
"""
Comprehensive Gospel Commentary Generator
This script generates scholarly, verse-by-verse commentary for all four Gospels.
It processes verses systematically and generates high-quality theological analysis.
Total scope:
- John: 879 verses
- Matthew: 1,071 verses
- Mark: 678 verses
- Luke: 1,151 verses
- TOTAL: 3,779 verses
Due to the extensive scope, this script processes verses in batches and can be
run multiple times to gradually build complete commentary.
"""
import json
import sys
from pathlib import Path
from typing import Dict, List, Tuple
from kjvstudy_org.kjv import bible
def create_verse_commentary_prompt(book: str, chapter: int, verse_num: int, verse_text: str, context_verses: List[Tuple[int, str]] = None) -> str:
"""
Create a detailed prompt for generating verse commentary.
Args:
book: Gospel name
chapter: Chapter number
verse_num: Verse number
verse_text: The verse text
context_verses: Optional list of (verse_num, text) tuples for context
Returns:
Formatted prompt for commentary generation
"""
prompt = f"""Generate comprehensive theological commentary for this Gospel verse:
**Reference:** {book} {chapter}:{verse_num}
**Text:** {verse_text}
"""
if context_verses:
prompt += "**Surrounding Context:**\n"
for v_num, v_text in context_verses:
marker = ">>>" if v_num == verse_num else " "
prompt += f"{marker} {book} {chapter}:{v_num} - {v_text}\n"
prompt += "\n"
prompt += """Please provide a JSON response with the following structure:
{
"analysis": "Comprehensive theological analysis including:\n- Greek word studies for key terms\n- Theological significance\n- Connection to broader biblical themes\n- Doctrinal implications\n- Literary structure and context\nUse <strong> for emphasis and <em> for Greek/Hebrew terms. Use <br><br> for paragraph breaks.",
"historical_context": "Detailed historical and cultural background including:\n- First-century Palestinian context\n- Gospel-specific perspective and purpose\n- Relevant archaeological or historical information\n- Original audience considerations\n- Connection to Old Testament background\nUse <br><br> for paragraph breaks.",
"application": "",
"questions": [
"Thoughtful reflection question 1 that probes theological understanding",
"Thoughtful reflection question 2 that challenges contemporary assumptions",
"Thoughtful reflection question 3 that encourages practical application"
]
}
Guidelines:
1. Be scholarly but accessible
2. Focus on theological depth and accuracy
3. Include Greek word analysis where relevant
4. Connect to broader biblical theology
5. Be specific and concrete, not generic
6. Questions should be thought-provoking and specific to THIS verse
7. Leave "application" field empty (per schema)
8. Use HTML formatting: <strong>, <em>, <br><br> for structure
9. Ensure analysis and historical_context are substantive (200-400 words each)
10. Make it worthy of a quality study Bible
Respond ONLY with the JSON object, no additional text."""
return prompt
def get_verse_context(book: str, chapter: int, verse_num: int, context_size: int = 2) -> List[Tuple[int, str]]:
"""Get surrounding verses for context."""
verses = bible.get_verses_by_book_chapter(book, chapter)
context = []
for verse in verses:
if abs(verse.verse - verse_num) <= context_size:
context.append((verse.verse, verse.text))
return sorted(context, key=lambda x: x[0])
def generate_commentary_for_verse(book: str, chapter: int, verse_num: int) -> Dict:
"""
Generate commentary for a single verse.
This is a placeholder that would integrate with an AI model.
In production, this would call Claude API or similar.
"""
verse_text = bible.get_verse_text(book, chapter, verse_num)
if not verse_text:
return None
# Get context
context_verses = get_verse_context(book, chapter, verse_num, context_size=2)
# Create prompt
prompt = create_verse_commentary_prompt(book, chapter, verse_num, verse_text, context_verses)
# In production, this would call an AI API
# For now, return a template structure
commentary = {
"analysis": f"<strong>{verse_text}</strong><br><br>[AI-generated comprehensive theological analysis would appear here, including Greek word studies, theological significance, and doctrinal implications. This would be 200-400 words of scholarly content.]",
"historical_context": f"[AI-generated historical and cultural background would appear here, providing first-century context, Gospel-specific perspective, and relevant archaeological information. This would be 200-400 words of scholarly content.]",
"application": "",
"questions": [
f"How does {book} {chapter}:{verse_num} reveal the nature and mission of Jesus Christ?",
f"What theological or cultural assumptions does this verse challenge?",
f"How should this truth shape Christian discipleship today?"
]
}
return commentary
def generate_commentary_batch(book: str, start_chapter: int = 1, end_chapter: int = None, batch_size: int = 50) -> Dict:
"""
Generate commentary for a batch of verses.
Args:
book: Gospel name (John, Matthew, Mark, Luke)
start_chapter: Starting chapter
end_chapter: Ending chapter (None = all remaining)
batch_size: Number of verses to process (for rate limiting)
Returns:
Dictionary of commentary entries
"""
chapters = bible.get_chapters_for_book(book)
if end_chapter is None:
end_chapter = max(chapters)
commentary_dict = {}
verses_processed = 0
print(f"\nGenerating commentary for {book} chapters {start_chapter}-{end_chapter}")
print("=" * 70)
for chapter in range(start_chapter, end_chapter + 1):
if chapter not in chapters:
continue
verses = bible.get_verses_by_book_chapter(book, chapter)
print(f"\nChapter {chapter}: {len(verses)} verses")
for verse in verses:
if batch_size and verses_processed >= batch_size:
print(f"\nBatch limit reached ({batch_size} verses)")
return commentary_dict
reference = f"{book} {chapter}:{verse.verse}"
try:
commentary = generate_commentary_for_verse(book, chapter, verse.verse)
if commentary:
commentary_dict[reference] = commentary
verses_processed += 1
print(f"{reference}")
else:
print(f"{reference} - Could not generate")
except Exception as e:
print(f"{reference} - Error: {e}")
continue
print(f"\n{verses_processed} verses processed")
return commentary_dict
def merge_with_existing_commentary(new_commentary: Dict, output_path: Path = None) -> Dict:
"""Merge new commentary with existing commentary file."""
if output_path is None:
output_path = Path(__file__).parent / "kjvstudy_org/data/verse_commentary.json"
# Load existing
existing = {}
if output_path.exists():
with open(output_path, 'r', encoding='utf-8') as f:
existing = json.load(f)
# Merge (new commentary overwrites existing)
existing.update(new_commentary)
return existing
def save_commentary(commentary: Dict, output_path: Path = None):
"""Save commentary to JSON file."""
if output_path is None:
output_path = Path(__file__).parent / "kjvstudy_org/data/verse_commentary.json"
with open(output_path, 'w', encoding='utf-8') as f:
json.dump(commentary, f, indent=2, ensure_ascii=False)
print(f"\n{'=' * 70}")
print(f"Commentary saved to: {output_path}")
print(f"Total entries in file: {len(commentary)}")
print(f"{'=' * 70}")
def main():
"""Main function."""
print("=" * 70)
print("COMPREHENSIVE GOSPEL COMMENTARY GENERATOR")
print("=" * 70)
print("\nThis script generates verse-by-verse commentary for the Gospels.")
print("\nTotal scope:")
print(" - John: 879 verses (21 chapters)")
print(" - Matthew: 1,071 verses (28 chapters)")
print(" - Mark: 678 verses (16 chapters)")
print(" - Luke: 1,151 verses (24 chapters)")
print(" - TOTAL: 3,779 verses")
print("\nProcessing in batches to manage scope...")
# Start with John (as requested)
print("\n" + "=" * 70)
print("PHASE 1: Gospel of John")
print("=" * 70)
# Generate commentary for John
# For demonstration, limit to first 50 verses
# In production, remove batch_size limit or process in multiple runs
john_commentary = generate_commentary_batch("John", start_chapter=1, end_chapter=21, batch_size=None)
# Merge and save
all_commentary = merge_with_existing_commentary(john_commentary)
save_commentary(all_commentary)
print("\n" + "=" * 70)
print("NEXT STEPS:")
print("=" * 70)
print("\nTo complete all Gospels, run with these parameters:")
print(" - Matthew: generate_commentary_batch('Matthew', 1, 28)")
print(" - Mark: generate_commentary_batch('Mark', 1, 16)")
print(" - Luke: generate_commentary_batch('Luke', 1, 24)")
print("\nNote: This template provides the structure. For production-quality")
print("commentary, integrate with Claude API or theological databases.")
if __name__ == "__main__":
main()
-135
View File
@@ -1,135 +0,0 @@
#!/usr/bin/env python
"""
Generate comprehensive verse-by-verse commentary for the four Gospels.
This script creates detailed theological analysis for Matthew, Mark, Luke, and John.
"""
import json
from pathlib import Path
from kjvstudy_org.kjv import bible
def generate_verse_commentary(book: str, chapter: int, verse_num: int, verse_text: str) -> dict:
"""
Generate comprehensive commentary for a single verse.
Returns a dictionary with analysis, historical_context, application, and questions.
"""
reference = f"{book} {chapter}:{verse_num}"
# Generate detailed commentary based on the verse content and context
commentary = {
"analysis": generate_analysis(book, chapter, verse_num, verse_text),
"historical_context": generate_historical_context(book, chapter, verse_num, verse_text),
"application": generate_application(book, chapter, verse_num, verse_text),
"questions": generate_questions(book, chapter, verse_num, verse_text)
}
return commentary
def generate_analysis(book: str, chapter: int, verse_num: int, verse_text: str) -> str:
"""Generate theological analysis and explanation."""
# This is a template - in production, this would use AI or theological databases
reference = f"{book} {chapter}:{verse_num}"
# For key verses, provide in-depth analysis
# This template should be replaced with actual theological content
analysis = f"<strong>{verse_text}</strong> "
# Add contextual analysis based on the Gospel
if book == "John":
analysis += "In the Gospel of John, which emphasizes Jesus' divinity and His role as the eternal Word, this verse "
elif book == "Matthew":
analysis += "Matthew's Gospel, written primarily for a Jewish audience, presents Jesus as the Messiah. This verse "
elif book == "Mark":
analysis += "Mark's fast-paced Gospel emphasizes Jesus' actions and servanthood. This verse "
elif book == "Luke":
analysis += "Luke's carefully researched Gospel highlights Jesus' compassion for all people. This verse "
analysis += "contributes to the narrative by revealing important aspects of Jesus' ministry, teaching, or identity."
return analysis
def generate_historical_context(book: str, chapter: int, verse_num: int, verse_text: str) -> str:
"""Generate historical and cultural background."""
context = ""
# Add Gospel-specific historical background
if book == "John":
context = "John wrote his Gospel later than the Synoptics (likely 85-95 CE), addressing a community familiar with both Jewish and Hellenistic thought. "
elif book == "Matthew":
context = "Matthew wrote to Jewish Christians, emphasizing Jesus' fulfillment of Old Testament prophecy and His role as the Jewish Messiah. "
elif book == "Mark":
context = "Mark's Gospel, likely the earliest written (65-70 CE), was composed for Roman Christians facing persecution. "
elif book == "Luke":
context = "Luke, a physician and Paul's companion, wrote to Theophilus and a Gentile audience, providing careful historical detail. "
context += "This verse must be understood within first-century Palestinian Jewish culture, Roman occupation, and the religious context of Second Temple Judaism."
return context
def generate_application(book: str, chapter: int, verse_num: int, verse_text: str) -> str:
"""Generate practical application for modern readers."""
# Application should be left empty for JSON compatibility with existing format
return ""
def generate_questions(book: str, chapter: int, verse_num: int, verse_text: str) -> list:
"""Generate 2-3 thoughtful reflection questions."""
questions = [
f"How does this verse deepen your understanding of Jesus' ministry and mission?",
f"What specific aspects of this teaching challenge contemporary cultural assumptions?",
f"How can you apply the truth of this verse to your daily life and relationships?"
]
return questions
def main():
"""Generate commentary for all verses in the four Gospels."""
gospels = ["John", "Matthew", "Mark", "Luke"]
# Load existing commentary
commentary_file = Path(__file__).parent / "kjvstudy_org/data/verse_commentary.json"
with open(commentary_file, 'r') as f:
existing_commentary = json.load(f)
total_verses = 0
new_verses = 0
for gospel in gospels:
print(f"\nProcessing Gospel of {gospel}...")
chapters = bible.get_chapters_for_book(gospel)
for chapter in chapters:
verses = bible.get_verses_by_book_chapter(gospel, chapter)
print(f" Chapter {chapter}: {len(verses)} verses")
for verse in verses:
reference = f"{gospel} {chapter}:{verse.verse}"
total_verses += 1
# Skip if commentary already exists
if reference in existing_commentary:
continue
# Generate new commentary
commentary = generate_verse_commentary(
gospel,
chapter,
verse.verse,
verse.text
)
existing_commentary[reference] = commentary
new_verses += 1
print(f"\nTotal verses processed: {total_verses}")
print(f"New commentary entries: {new_verses}")
print(f"Total commentary entries: {len(existing_commentary)}")
# Save updated commentary
with open(commentary_file, 'w') as f:
json.dump(existing_commentary, f, indent=2, ensure_ascii=False)
print(f"\nCommentary saved to {commentary_file}")
if __name__ == "__main__":
main()
-279
View File
@@ -1,279 +0,0 @@
#!/usr/bin/env python
"""
Generate comprehensive commentary for the Gospel of John.
This script creates detailed, scholarly commentary for all 879 verses in John's Gospel.
It serves as a template for generating commentary for the other Gospels.
"""
import json
from pathlib import Path
from kjvstudy_org.kjv import bible
# Comprehensive commentary templates organized by chapter
# This would be expanded to cover all verses
JOHN_COMMENTARY_CONTENT = {
# John 1 - The Word Became Flesh
"John 1:1": {
"greek_analysis": "ἐν ἀρχῇ ἦν ὁ λόγος (en archē ēn ho logos) - In beginning was the Word",
"theological_themes": ["Deity of Christ", "Preexistence", "Creation", "Logos theology"],
"key_concepts": "The term 'Word' (Logos) has roots in both Jewish Wisdom literature and Greek philosophy, but John transforms it to refer specifically to Jesus as God's self-expression."
},
"John 1:14": {
"greek_analysis": "ὁ λόγος σὰρξ ἐγένετο (ho logos sarx egeneto) - The Word flesh became",
"theological_themes": ["Incarnation", "Deity and humanity of Christ", "Tabernacling presence"],
"key_concepts": "The verb 'became' (egeneto) indicates a real transformation - the eternal Word truly took on human flesh."
},
# John 3 - New Birth and Belief
"John 3:3": {
"greek_analysis": "γεννηθῇ ἄνωθεν (gennēthē anōthen) - born from above/again",
"theological_themes": ["Regeneration", "Kingdom of God", "Spiritual rebirth"],
"key_concepts": "The double meaning of anōthen (both 'again' and 'from above') creates intentional ambiguity - spiritual birth must come from God."
},
"John 3:16": {
"greek_analysis": "οὕτως γὰρ ἠγάπησεν ὁ θεὸς τὸν κόσμον (houtōs gar ēgapēsen ho theos ton kosmon)",
"theological_themes": ["Love of God", "Substitutionary atonement", "Universal scope of salvation", "Faith"],
"key_concepts": "The world (kosmos) that God loves is the same world that lies in darkness and opposes Him - this is the scandal of grace."
},
}
def generate_commentary_from_template(book: str, chapter: int, verse_num: int, verse_text: str, template: dict = None) -> dict:
"""
Generate rich commentary using templates and theological knowledge.
This function creates substantive commentary based on the verse content.
"""
reference = f"{book} {chapter}:{verse_num}"
# Build comprehensive analysis
analysis_parts = [f"<strong>{verse_text}</strong><br><br>"]
if template and "greek_analysis" in template:
analysis_parts.append(f"The Greek text reads: <em>{template['greek_analysis']}</em><br><br>")
# Add verse-specific theological content
# This is where deep theological analysis would go
analysis_parts.append(generate_theological_analysis(book, chapter, verse_num, verse_text, template))
analysis = "".join(analysis_parts)
# Generate historical context
historical_context = generate_historical_context(book, chapter, verse_num, verse_text, template)
# Generate questions
questions = generate_questions(book, chapter, verse_num, verse_text, template)
return {
"analysis": analysis,
"historical_context": historical_context,
"application": "",
"questions": questions
}
def generate_theological_analysis(book: str, chapter: int, verse_num: int, verse_text: str, template: dict = None) -> str:
"""Generate theological analysis based on verse content and themes."""
# This would include sophisticated theological analysis
# For now, providing structure that should be filled with actual content
analysis = []
# Identify key theological themes
themes = template.get("theological_themes", []) if template else []
if chapter == 1:
if verse_num == 1:
analysis.append("This opening verse establishes the most profound christological claim in Scripture: the absolute deity and eternal preexistence of Christ. ")
analysis.append("The phrase <em>en archē</em> (ἐν ἀρχῇ, 'in beginning') deliberately echoes Genesis 1:1, placing Christ at the very origin of creation. ")
analysis.append("The imperfect verb <em>ēn</em> (ἦν, 'was') indicates continuous existence - the Word did not come into being but eternally was.<br><br>")
analysis.append("The term <em>Logos</em> (λόγος, 'Word') is carefully chosen to communicate to both Jewish and Greek audiences. ")
analysis.append("For Greek readers, Logos represented divine reason and the organizing principle of the universe. ")
analysis.append("For Jewish readers familiar with the Old Testament, the Word represented God's creative power (Genesis 1) and personified Wisdom (Proverbs 8). ")
analysis.append("John identifies this Logos specifically as a person who was 'with God' (πρὸς τὸν θεόν, pros ton theon) yet simultaneously 'was God' (θεὸς ἦν ὁ λόγος, theos ēn ho logos). ")
analysis.append("This paradox establishes the foundation for Trinitarian theology: distinct persons in eternal communion, yet one divine essence.")
elif verse_num == 14:
analysis.append("The incarnation represents the central miracle of Christianity - God became human without ceasing to be God. ")
analysis.append("The verb <em>egeneto</em> (ἐγένετο, 'became') marks a decisive moment in history when the eternal Word took on human nature. ")
analysis.append("'Flesh' (<em>sarx</em>, σάρξ) emphasizes the full reality of the incarnation - Jesus was not merely a spiritual being appearing human, but truly possessed human nature with all its limitations (except sin).<br><br>")
analysis.append("The phrase 'dwelt among us' (<em>eskēnōsen en hēmin</em>, ἐσκήνωσεν ἐν ἡμῖν) literally means 'tabernacled among us,' ")
analysis.append("evoking the Old Testament tabernacle where God's glory dwelt among Israel. Jesus is the ultimate fulfillment of God's presence - ")
analysis.append("not a building but a person, Immanuel ('God with us'). His glory was not the overwhelming theophany of Sinai but the glory of grace and truth incarnate.")
elif chapter == 3:
if verse_num == 3:
analysis.append("Jesus' declaration to Nicodemus confronts religious achievement with the necessity of divine regeneration. ")
analysis.append("The term <em>anōthen</em> (ἄνωθεν) contains intentional ambiguity - it means both 'again' and 'from above.' ")
analysis.append("This double meaning emphasizes that spiritual birth must come from God, not human effort.<br><br>")
analysis.append("The present passive subjunctive <em>gennēthē</em> (γεννηθῇ, 'be born') indicates that new birth is something done to a person, not by a person. ")
analysis.append("No one can birth themselves physically; similarly, spiritual regeneration is God's sovereign work through the Holy Spirit. ")
analysis.append("This challenges both ancient and modern assumptions about religion being primarily about moral effort or intellectual assent.")
elif verse_num == 16:
analysis.append("This verse distills the entire gospel message into one comprehensive statement. ")
analysis.append("God's love (<em>ēgapēsen</em>, ἠγάπησεν) is not theoretical or sentimental but active and sacrificial - He 'gave' (<em>edōken</em>, ἔδωκεν) His Son. ")
analysis.append("The aorist tense indicates a definitive historical act at Calvary.<br><br>")
analysis.append("The scope is universal - 'the world' (<em>ton kosmon</em>, τὸν κόσμον) refers to fallen humanity in rebellion against God. ")
analysis.append("That God loves this hostile world demonstrates grace beyond human comprehension. ")
analysis.append("The purpose is salvation, not condemnation - 'that whoever believes' (<em>hina pas ho pisteuōn</em>, ἵνα πᾶς ὁ πιστεύων) makes eternal life available to all through faith. ")
analysis.append("The present participle 'believing' indicates ongoing trust, not mere intellectual assent.")
else:
# Generic analysis for verses without specific content
analysis.append("This verse contributes to John's overarching purpose of presenting Jesus as the Christ, the Son of God, ")
analysis.append("so that readers might believe and have life in His name (John 20:31). ")
analysis.append("It must be understood within the flow of John's carefully structured narrative and theological argument.")
return "".join(analysis)
def generate_historical_context(book: str, chapter: int, verse_num: int, verse_text: str, template: dict = None) -> str:
"""Generate historical and cultural context."""
context = []
# Gospel-specific introduction
context.append("The Gospel of John, likely written between 85-95 CE, represents the most theologically developed of the four Gospels. ")
context.append("Written to a community that included both Jewish and Gentile believers, John emphasizes Jesus' divine nature and presents ")
context.append("seven 'I am' statements, numerous signs, and extended discourses that reveal Jesus as the incarnate Son of God.<br><br>")
# Chapter-specific context
if chapter == 1:
context.append("The prologue (1:1-18) serves as the theological foundation for the entire Gospel, establishing Christ's deity, ")
context.append("preexistence, and incarnation before narrating His earthly ministry. ")
context.append("Unlike the Synoptic Gospels, John begins not with Jesus' birth but with His eternal existence as the divine Word. ")
context.append("This philosophical and theological opening would have resonated with both Jewish readers familiar with Wisdom literature ")
context.append("and Greek readers influenced by Stoic concepts of the Logos.")
elif chapter == 3:
context.append("Nicodemus, a Pharisee and member of the Sanhedrin, represents the religious elite of first-century Judaism. ")
context.append("His nighttime visit suggests either caution about being seen with Jesus or perhaps a desire for private, uninterrupted conversation. ")
context.append("As a teacher of Israel, Nicodemus would have been thoroughly educated in the Hebrew Scriptures, ")
context.append("yet Jesus' teaching about spiritual rebirth challenged everything he thought he understood about righteousness and the kingdom of God.<br><br>")
context.append("The concept of new birth would have been foreign to Jewish thinking, which emphasized covenant membership through physical descent from Abraham. ")
context.append("Jesus' teaching that spiritual birth was necessary regardless of ethnic heritage was revolutionary and would later become central ")
context.append("to Paul's Gentile mission and the early church's understanding of salvation.")
else:
context.append(f"Chapter {chapter} must be understood within the broader context of John's Gospel, ")
context.append("which presents Jesus' ministry through carefully selected signs and discourses designed to reveal His identity as the Messiah and Son of God. ")
context.append("Each episode builds John's cumulative case for faith in Christ as the source of eternal life.")
return "".join(context)
def generate_questions(book: str, chapter: int, verse_num: int, verse_text: str, template: dict = None) -> list:
"""Generate thoughtful reflection questions specific to the verse."""
# Create questions that probe the specific theological content of the verse
questions = []
if chapter == 1 and verse_num == 1:
questions = [
"How does understanding Christ as the eternal Logos change your perception of His authority and identity?",
"What are the implications of Christ's preexistence for the doctrine of creation and His relationship to the Father?",
"How does John's opening statement challenge both ancient and modern philosophical assumptions about the nature of ultimate reality?"
]
elif chapter == 1 and verse_num == 14:
questions = [
"How does the incarnation demonstrate both the depth of God's love and the seriousness of human sin?",
"What does it mean practically that Jesus 'tabernacled' among us, and how should this shape Christian community?",
"How does the balance of 'grace and truth' in Jesus challenge both legalistic and antinomian approaches to faith?"
]
elif chapter == 3 and verse_num == 3:
questions = [
"How does the necessity of being 'born again' challenge contemporary assumptions about spirituality and self-improvement?",
"What is the relationship between new birth and entrance into God's kingdom, and how does this affect our understanding of conversion?",
"In what ways might modern Christians, like Nicodemus, try to substitute religious activity for genuine spiritual regeneration?"
]
elif chapter == 3 and verse_num == 16:
questions = [
"How does the universal scope of God's love ('the world') challenge both religious exclusivism and universalism?",
"What is the relationship between God's love and His justice, and how does Christ's death satisfy both divine attributes?",
"How should understanding eternal life as a present reality (not just future hope) transform daily Christian living?"
]
else:
# Generic but thoughtful questions
questions = [
f"How does {book} {chapter}:{verse_num} reveal the character and mission of Jesus Christ?",
f"What theological or cultural assumptions does this verse challenge in both ancient and contemporary contexts?",
f"How should the truth revealed in this verse shape Christian thought, worship, and discipleship?"
]
return questions
def generate_all_john_commentary() -> dict:
"""Generate commentary for all verses in the Gospel of John."""
print("=" * 70)
print("GENERATING COMMENTARY FOR THE GOSPEL OF JOHN")
print("=" * 70)
print("\n879 verses across 21 chapters\n")
commentary_dict = {}
chapters = bible.get_chapters_for_book("John")
total_verses = 0
for chapter in chapters:
verses = bible.get_verses_by_book_chapter("John", chapter)
print(f"Chapter {chapter}: {len(verses)} verses")
for verse in verses:
reference = f"John {chapter}:{verse.verse}"
# Check if we have a template for this verse
template = JOHN_COMMENTARY_CONTENT.get(reference, None)
# Generate commentary
commentary = generate_commentary_from_template(
"John",
chapter,
verse.verse,
verse.text,
template
)
commentary_dict[reference] = commentary
total_verses += 1
print(f"\nTotal verses processed: {total_verses}")
return commentary_dict
def main():
"""Main execution function."""
# Generate John commentary
john_commentary = generate_all_john_commentary()
# Load existing commentary
commentary_file = Path(__file__).parent / "kjvstudy_org/data/verse_commentary.json"
with open(commentary_file, 'r', encoding='utf-8') as f:
existing_commentary = json.load(f)
# Merge
existing_commentary.update(john_commentary)
# Save
with open(commentary_file, 'w', encoding='utf-8') as f:
json.dump(existing_commentary, f, indent=2, ensure_ascii=False)
print(f"\n{'=' * 70}")
print(f"Commentary saved to {commentary_file}")
print(f"Total commentary entries: {len(existing_commentary)}")
print(f"John commentary entries: {len(john_commentary)}")
print(f"{'=' * 70}")
if __name__ == "__main__":
main()
-177
View File
@@ -1,177 +0,0 @@
#!/usr/bin/env python
"""
Generate comprehensive verse-by-verse commentary for key Gospel passages.
This script creates detailed theological analysis focusing on:
1. Major theological passages
2. Key teachings of Jesus
3. Miracle narratives
4. Passion and resurrection accounts
5. Unique material in each Gospel
Due to the extensive scope (3,779 verses), this focuses on generating high-quality
commentary for significant passages that can serve as templates for future expansion.
"""
import json
from pathlib import Path
from typing import Dict, List
# Key passages that deserve detailed commentary
KEY_GOSPEL_PASSAGES = {
"John": {
1: [1, 14, 29], # Prologue, Word became flesh, Behold the Lamb
3: [3, 5, 16], # Born again, Spirit, For God so loved
4: [24], # God is Spirit
6: [35, 48, 51], # I am the bread of life
8: [12, 32, 58], # Light of the world, Draw all men, Before Abraham was
10: [11, 14], # Good shepherd
11: [25, 35], # I am the resurrection, Jesus wept
13: [34], # New commandment
14: [6, 15, 16, 26, 27], # The way, if you love me, Helper, teach you, peace
15: [5, 13], # Vine and branches, greater love
16: [33], # I have overcome
17: [3, 17], # This is eternal life, sanctify
19: [30], # It is finished
20: [28, 31], # My Lord and my God, that you may believe
},
"Matthew": {
1: [21, 23], # Jesus saves, Emmanuel
3: [17], # This is my beloved Son
4: [4, 19], # Man shall not live by bread alone, fishers of men
5: [3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 16, 17, 44, 48], # Beatitudes and key teachings
6: [9, 10, 11, 12, 13, 19, 21, 24, 33], # Lord's Prayer and teachings
7: [7, 12, 21], # Ask seek knock, golden rule, not everyone
11: [28, 29], # Come unto me
16: [16, 18, 24, 26], # Peter's confession, build my church, deny himself
18: [3, 20], # Become like children, where two or three
22: [37, 38, 39], # Great commandment
24: [14, 35, 44], # Gospel preached, heaven and earth pass, be ready
26: [26, 28, 39, 41], # This is my body, blood, not my will, watch and pray
27: [46], # My God why have you forsaken me
28: [18, 19, 20], # All authority, Great Commission, I am with you
},
"Mark": {
1: [15, 17], # Repent and believe, fishers of men
2: [17], # Not the righteous but sinners
8: [34, 35, 36, 38], # Deny himself, lose life to save it
9: [23, 24], # All things possible, help my unbelief
10: [27, 45], # With God all things possible, ransom for many
12: [30, 31], # Great commandment
16: [15, 16], # Go into all the world
},
"Luke": {
1: [35, 37, 38, 46, 47], # Holy Spirit, nothing impossible, Mary's response, Magnificat
2: [10, 11, 14], # Good tidings, Savior born, Glory to God
4: [18, 19], # Anointed to preach, acceptable year
6: [27, 28, 31, 36, 37, 38], # Love enemies, golden rule, merciful, judge not, give
9: [23, 24], # Take up cross, lose life to save it
10: [27], # Love God and neighbor
11: [2, 3, 4, 9, 13], # Our Father, daily bread, forgive, ask seek knock, Holy Spirit
12: [15, 34, 48], # Beware covetousness, where treasure is, much given
15: [7, 10, 18, 20, 24], # Joy in heaven, prodigal son story
17: [33], # Lose life to preserve it
18: [13, 27], # God be merciful, impossible with men possible with God
19: [10], # Seek and save the lost
22: [19, 20, 42], # This is my body, new covenant, not my will
23: [34, 43, 46], # Father forgive, paradise, into your hands
24: [46, 47], # Suffer and rise, repentance and forgiveness
}
}
def create_comprehensive_commentary(book: str, chapter: int, verse: int, text: str) -> Dict:
"""
Create comprehensive commentary structure for a verse.
This function would ideally call an AI model or theological database
to generate detailed, scholarly commentary. For now, it provides
a template structure.
"""
reference = f"{book} {chapter}:{verse}"
# This is where you would integrate with Claude API or other
# theological resources to generate actual commentary
commentary = {
"analysis": f"<strong>{text}</strong><br><br>[Comprehensive theological analysis would be generated here, including Greek/Hebrew word studies, theological significance, and doctrinal implications.]",
"historical_context": "[Detailed historical and cultural background would be provided here, including first-century context, Gospel-specific perspective, and relevant archaeological/historical information.]",
"application": "", # Left empty per existing format
"questions": [
f"How does {reference} reveal the nature and character of Jesus Christ?",
f"What does this verse teach about the Gospel message and salvation?",
f"How should this truth transform the way believers think and live?"
]
}
return commentary
def generate_gospel_commentary() -> Dict:
"""
Generate commentary for key Gospel passages.
Returns a dictionary ready to be merged into verse_commentary.json.
"""
from kjvstudy_org.kjv import bible
commentary_dict = {}
for gospel, chapters in KEY_GOSPEL_PASSAGES.items():
print(f"\nProcessing {gospel}...")
for chapter_num, verses in chapters.items():
print(f" Chapter {chapter_num}...")
for verse_num in verses:
# Get the verse text
verse_text = bible.get_verse_text(gospel, chapter_num, verse_num)
if verse_text is None:
print(f" Warning: Could not find {gospel} {chapter_num}:{verse_num}")
continue
reference = f"{gospel} {chapter_num}:{verse_num}"
# Generate commentary
commentary = create_comprehensive_commentary(
gospel,
chapter_num,
verse_num,
verse_text
)
commentary_dict[reference] = commentary
print(f" Generated commentary for {reference}")
return commentary_dict
def save_commentary(commentary: Dict, output_file: str = None):
"""Save commentary to JSON file."""
if output_file is None:
output_file = Path(__file__).parent / "gospel_commentary_output.json"
with open(output_file, 'w', encoding='utf-8') as f:
json.dump(commentary, f, indent=2, ensure_ascii=False)
print(f"\nCommentary saved to {output_file}")
print(f"Total entries: {len(commentary)}")
def main():
"""Main function to generate and save Gospel commentary."""
print("=" * 70)
print("Gospel Commentary Generator")
print("=" * 70)
print("\nGenerating commentary for key Gospel passages...")
print("This focuses on theologically significant verses that can serve")
print("as templates for comprehensive commentary expansion.\n")
commentary = generate_gospel_commentary()
save_commentary(commentary)
print("\n" + "=" * 70)
print("Generation complete!")
print("=" * 70)
print("\nTo generate full commentary for all 3,779 Gospel verses,")
print("consider using an AI model with theological training or")
print("consulting biblical commentaries and theological resources.")
if __name__ == "__main__":
main()
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -380,21 +380,21 @@
{% if commentary.analysis %}
<div>
<h2>Analysis</h2>
<p>{{ commentary.analysis|safe }}</p>
<p>{{ commentary.analysis|format_lists|safe }}</p>
</div>
{% endif %}
{% if commentary.historical %}
<div>
<h2>Historical Context</h2>
<p>{{ commentary.historical|safe }}</p>
<p>{{ commentary.historical|format_lists|safe }}</p>
</div>
{% endif %}
{% if commentary.theological %}
<div>
<h2>Theological Significance</h2>
<p>{{ commentary.theological|safe }}</p>
<p>{{ commentary.theological|format_lists|safe }}</p>
</div>
{% endif %}