Hebrew Poetry Analysis¶
Analysis of Biblical Hebrew poetry using the MACULA Hebrew WLC data, including cantillation accent-based cola splitting, parallel word pair detection, parallelism type classification, chiasm detection, acrostic detection, and meter analysis.
The Etnahta (U+0591) marks the primary A/B cola division; Zaqef/Revia may add a C-colon. Classic parallel word pairs (heavens/earth, mouth/lips, wisdom/knowledge) are detected automatically across the poetry books.
Sections:
- Verse Cola Analysis (print_verse_analysis)
- Parallel Word Pairs
- Parallelism Type Statistics
- Chiasm Detection
- Acrostic Detection
- Meter Analysis
import sys
sys.path.insert(0, '../../../src')
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
pd.set_option('display.max_rows', 60)
pd.set_option('display.max_columns', 20)
pd.set_option('display.width', 120)
print('Ready.')
1. Verse Cola Analysis¶
The poetry module splits Hebrew poetic verses into cola (half-lines) using
the cantillation accent system embedded in the Masoretic Text. The Etnahta
(U+0591) marks the primary A/B division; Zaqef/Revia may add a C-colon.
Classic parallel word pairs detected automatically: חׇכְמָה/דַּעַת (wisdom/knowledge), מֶלֶךְ/רָזַן (kings/rulers), פֶּה/שָׂפָה (mouth/lips), שָׁמַיִם/אָרֶץ (heavens/earth).
from bible_grammar import print_verse_analysis
# Psalm 19:2 — "The heavens declare the glory of God
# / and the firmament shows his handiwork"
print_verse_analysis('Psa', 19, 2)
# Proverbs 10:1 — classic antithetic parallelism
print_verse_analysis('Pro', 10, 1)
# Psalm 1:1 — three-colon staircase (walk/stand/sit)
print_verse_analysis('Psa', 1, 1)
2. Parallel Word Pairs¶
Parallel word pairs are the building blocks of Hebrew parallelism. Content words from the A-colon and B-colon are paired and aggregated across a book to identify the most formulaic pairings. Proverbs and Psalms have distinctive pair inventories.
from bible_grammar import print_book_pairs
# Most frequent A/B parallel word pairs in Proverbs
print_book_pairs('Pro', top_n=25, min_count=2)
# Most frequent parallel word pairs in Psalms
print_book_pairs('Psa', top_n=25, min_count=3)
3. Parallelism Type Statistics¶
Three main types of parallelism in Hebrew poetry:
- Synonymous — A and B say roughly the same thing
- Antithetic — A and B express contrasting ideas (dominant in Proverbs)
- Synthetic — B completes, specifies, or extends A
Proverbs is famous for its antithetic parallelism (righteous vs. wicked); Psalms leans more toward synonymous.
from bible_grammar import print_parallelism_stats
# Parallelism type distribution in Proverbs
print_parallelism_stats('Pro')
# Parallelism type distribution in Psalms
print_parallelism_stats('Psa')
# Compare parallelism profiles across the major poetry books
# (slow — scans all verses in each book)
# from bible_grammar import compare_poetry_books
# df = compare_poetry_books(['Psa', 'Pro', 'Job'])
# print(df.to_string())
print("Uncomment to compare all three books (takes ~1 min)")
4. Chiasm Detection¶
Identifies A B ... B' A' mirror structure across a verse range using lemma-level Jaccard similarity between mirrored verse pairs. Psalm 8 is often cited as a chiasm (A=v1, B=vv2-4, X=v5, B'=vv6-7, A'=vv8-9).
from bible_grammar import print_chiasm
# Psalm 8 — often cited as a chiasm
print_chiasm('Psa', 8, 1, 9)
# Psalm 23 — 6-verse chiasm candidate
print_chiasm('Psa', 23, 1, 6)
5. Acrostic Detection¶
Checks whether successive verses begin with successive Hebrew alphabet letters. Works for full acrostics (Lamentations 1–4, Psalm 25, 34, 111, 112, 145) and stanza acrostics (Psalm 119: 8 verses per letter = 22 stanzas × 8 = 176 verses).
from bible_grammar import print_acrostic
# Lamentations 1 — full 22-letter acrostic
print_acrostic('Lam', 1, 1, 22)
# Psalm 25 — another full acrostic
print_acrostic('Psa', 25, 1, 22)
# Psalm 119 — stanza acrostic: 8 verses per letter (22 stanzas x 8 = 176 verses)
print_acrostic('Psa', 119, 1, 176, stanza_size=8)
6. Meter Analysis¶
Estimates stress count per colon using content-word counting (heuristic qinah 3+2 detection). Syllable counts are based on vowel-point counting in the MT. The classic qinah meter (3+2) is the dirge pattern found throughout Lamentations.
from bible_grammar import print_verse_meter, print_meter_stats
# Lamentations 1:1 — the classic qinah 3+2 dirge pattern
print_verse_meter('Lam', 1, 1)
# Meter distribution across all of Lamentations
print_meter_stats('Lam')
# Meter distribution across Psalms (slow — scans all ~2461 verses)
# print_meter_stats('Psa')
print("Uncomment to analyze all Psalms meter (takes ~1 min)")