File size: 36,616 Bytes
7cc8e29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Session 37 β€” Diwan Batch Write
MS pp.597-666 (pdf 601-670)

Sections:
  Zone 1 (pp.597-604): Quadrilateral qamaldi entries (continuation)
  Zone 2 (pp.604-608): 4-type grammar analysis of quadrilateral formation
  Zone 3 (pp.608-649): Quadrilateral entries by letter
  Zone 4 (pp.649-652): Conjugation paradigm + sound verb conclusion
  Zone 5 (pp.652-666): bab al-af'al min al-mahmuz (hamzated verbs)

Run: python3 Code_files/diwan_s37_batch.py
"""

import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__)))

from uslap_handler import write_entry

# ─── CONSTANTS ────────────────────────────────────────────────────────
KITAB_SALIM = "kitab al-af'al min al-salim"
KITAB_MAHMUZ = "kitab al-af'al min al-mahmuz"
VOL = 2

# ─── ZONE 1: QUADRILATERAL QAMALDI ENTRIES pp.597-604 ─────────────────
zone1 = [
    # p.597
    {"headword": "al shakardu", "aa_gloss": "ghusila β€” was bathed/washed", "ms_page": 597, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al shakardu (2)", "aa_gloss": "shabba β€” grew up on something; was nurtured", "ms_page": 597, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "sultan furlaqdi", "aa_gloss": "nasharaha β€” spread/unfolded the fabrics", "ms_page": 597, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al shakar furlaqdi", "aa_gloss": "tafaddaha β€” the sugar blossomed/opened", "ms_page": 597, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    # p.598
    {"headword": "khan bakka susin qurturdi", "aa_gloss": "amara bi-jam' al-jund β€” ordered gathering of soldiers", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ankur bir qurturdi", "aa_gloss": "kallafahu qashr β€” made peel bark/earth", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ankur qang qurturdi", "aa_gloss": "kallafahu hafr al-nahr β€” made dig river/trench", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "suyuk arik qusturdi", "aa_gloss": "aqaa'ahu β€” the drink caused vomiting", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "bak al az qun qusturdi", "aa_gloss": "aqabahu β€” the prince ordered pressing/punishment", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al alik tun qusturdi", "aa_gloss": "amara bi-taqsir thawbihi β€” ordered shortening garment", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ani bishra qaqturdi", "aa_gloss": "hammalahu al-qafz β€” made jump over his head", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ani birsha qalturdi", "aa_gloss": "sabaqahu fi al-dhahab β€” preceded in going", "ms_page": 598, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    # p.599
    {"headword": "al mundin namuq qalturdi", "aa_gloss": "hammala β€” made carry burden", "ms_page": 599, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ankur ish qalturdi", "aa_gloss": "ahmalahu al-haml β€” loaded with burden", "ms_page": 599, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ani udhub qun qunturdi", "aa_gloss": "daraba hatta kada an yahlika β€” beat until almost perishing", "ms_page": 599, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "yil suquq qunturdi", "aa_gloss": "amaja al-rih al-maa β€” wind churned the water", "ms_page": 599, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al mutti suqqa qunturdi", "aa_gloss": "rawwani min al-maa β€” made drink water. Originally with dal: qandadi", "ms_page": 599, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al aqinda qush qunduzdi", "aa_gloss": "awqa'a al-tair fi baytihi β€” made bird land in house", "ms_page": 599, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    # p.601
    {"headword": "yir qurghurdi", "aa_gloss": "yabisat β€” earth dried from lack of dew", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "az qurghurdi", "aa_gloss": "tala'a β€” emerged/appeared", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ani buwalishna qurghurdi", "aa_gloss": "adhaqa wabal amrihi β€” made taste consequences so he does not return", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al mundin qalirdi", "aa_gloss": "kada an yas'al β€” almost asked for something", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "alik yuzi qutirdi", "aa_gloss": "kada an yasmuja β€” face almost shriveled/clung", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ani suqidin kejinturdi", "aa_gloss": "amara bi-ighbarihi min al-maa β€” ordered fording the water", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al alik tun kanka kurturdi", "aa_gloss": "amara bi-tajfif thawbihi β€” ordered drying garment in sun", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al yib kurturdi", "aa_gloss": "amadda al-habl β€” extended/stretched the rope", "ms_page": 601, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    # p.602
    {"headword": "al ani alqa kurturdi", "aa_gloss": "amara an yuradda ilayhi β€” ordered returning to him", "ms_page": 602, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ankur batij kusturdi", "aa_gloss": "aqada fawqa β€” tied/knotted above", "ms_page": 602, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al kulturdi", "aa_gloss": "saghura β€” became small/insignificant", "ms_page": 602, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    # p.603
    {"headword": "az yahaluk kikjirdi", "aa_gloss": "hadda al-sikkina β€” sharpened knives one on another", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ini az kikjirdi", "aa_gloss": "aghra ahadahuma ala al-akhar β€” incited one against another", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al ra zin aldin kuntirdi", "aa_gloss": "dafanahu tahta al-ard β€” buried underground", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "az kulbisirdi", "aa_gloss": "tabassama β€” pretended to smile; smiled", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "at kadhikirdi", "aa_gloss": "jama'a al-faras β€” gathered the horses", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "az aqi kurkurdi", "aa_gloss": "fawwaqa al-sahm β€” nocked the arrow", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al alimni manka kurkurdi", "aa_gloss": "awqa'a al-muqatalata β€” caused fighting between two people", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "azlak kurkurdi", "aa_gloss": "tawajjaha al-zaman β€” season turned toward autumn", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al manka kalikirdi", "aa_gloss": "tamanna wa-kada an ya'tiya β€” yearned and almost came", "ms_page": 603, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    # p.604
    {"headword": "al aqi kunkurdi", "aa_gloss": "qawwama al-nabl β€” straightened arrows", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al yul kunkurdi", "aa_gloss": "hada ila al-tariq β€” guided to the road", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "bak u'ribini kunkurdi", "aa_gloss": "aqama al-salata β€” established prayer properly", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al manka at munduzdi", "aa_gloss": "asraja β€” saddled the horse", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al manka qilij munduzdi", "aa_gloss": "hammalani al-tanattuq bi-al-sayf β€” made gird the sword", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al aqmakik yaghma munduzdi", "aa_gloss": "sabagha al-khubz bi-al-samn β€” buttered the bread", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
    {"headword": "al aqmakik yaghma matirdi", "aa_gloss": "kada an yasbugha β€” almost buttered and dipped", "ms_page": 604, "diwan_section": "abwab al-ruba'iyy / qamaldi / (d)"},
]

# ─── ZONE 2: GRAMMAR MILESTONES pp.604-608 ────────────────────────────
zone2 = [
    {
        "headword": "GRAMMAR: 4-type quadrilateral formation analysis",
        "aa_gloss": "Kashgari identifies 4 types: (1) bilateral intransitive to transitive via ta-ra, e.g. burdi to burturdi. (2) trilateral transitive to double-agent via ta-ra β€” commander (amir) + doer (mubashir). (3) quadrilateral to quinquelateral. (4) nun-ra or kaf-ra extensions",
        "ms_page": 604, "word_class": "GRAMMAR",
        "diwan_section": "abwab al-ruba'iyy / qamaldi β€” quadrilateral formation grammar",
    },
    {
        "headword": "GRAMMAR: ra as sole causative morpheme",
        "aa_gloss": "al-ta wa-al-nun wa-al-kaf hunna lasna bi-amadiyyat li-al-af'al. innama al-madiyya al-ra faqat β€” ta, nun, kaf are NOT inherent to the verbs. The extension is ra alone. Proven by qush ujirdi (flew the bird) where only ra extends",
        "ms_page": 605, "word_class": "GRAMMAR",
        "diwan_section": "abwab al-ruba'iyy / qamaldi β€” causative morpheme grammar",
    },
    {
        "headword": "GRAMMAR: triple ra avoidance β€” epenthetic consonant rule",
        "aa_gloss": "When root-ra + causative-ra + imperfective-ra would cluster, root ra is replaced: by ta in al-kalima al-sulba (hard words), by nun in al-kalima al-ghaqiya (soft words), by kaf in al-kalima al-kafiya (still words) β€” hatta udhiba al-lafz (so pronunciation becomes pleasant)",
        "ms_page": 606, "word_class": "GRAMMAR",
        "diwan_section": "abwab al-ruba'iyy / qamaldi β€” epenthetic consonant grammar",
    },
    {
        "headword": "GRAMMAR: Type 2 β€” trilateral intransitive to quadrilateral transitive",
        "aa_gloss": "yiraldi (lived) to shukri burkurdi (Allah gave life). qurladi (was deterred) to qurghurdi (another deterred him). Intransitive trilateral enters quadrilateral bab for transitivity",
        "ms_page": 606, "word_class": "GRAMMAR",
        "diwan_section": "abwab al-ruba'iyy / qamaldi β€” quadrilateral formation grammar",
    },
]

# ─── ZONE 3: QUADRILATERAL ENTRIES BY LETTER pp.608-649 ───────────────
zone3 = [
    # p.608 β€” letter section entries begin
    {"headword": "qalduzdi baksuk", "aa_gloss": "khayyata β€” sewed/stitched", "ms_page": 608, "diwan_section": "abwab al-ruba'iyy / qamaldi / (a)"},
    {"headword": "al sankali bir qaldurdi", "aa_gloss": "taqallala al-akhar β€” diminished the other", "ms_page": 608, "diwan_section": "abwab al-ruba'iyy / qamaldi / (a)"},
    # p.609 β€” (b) section
    {"headword": "abil yurqush", "aa_gloss": "taqallala β€” diminished/decreased", "ms_page": 609, "diwan_section": "abwab al-ruba'iyy / qamaldi / (b)"},
    # p.633
    {"headword": "al aqi qunquladi", "aa_gloss": "qawwama β€” straightened along the ridge", "ms_page": 633, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.634
    {"headword": "al quqlanshdi", "aa_gloss": "tafazzaza β€” was scattered/alarmed", "ms_page": 634, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al qurlanshdi", "aa_gloss": "alqa ard jadida β€” brought forth new land", "ms_page": 634, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.635 β€” (z) section
    {"headword": "al atiquq yawiridshdi", "aa_gloss": "fajjara β€” dawn broke/light appeared", "ms_page": 635, "diwan_section": "abwab al-ruba'iyy / qamaldi / (z)"},
    {"headword": "al aniri marisddi", "aa_gloss": "anbata β€” sprouted/grew", "ms_page": 635, "diwan_section": "abwab al-ruba'iyy / qamaldi / (z)"},
    # p.636
    {"headword": "az baqlanshdi", "aa_gloss": "saqata β€” fell/dropped", "ms_page": 636, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al ani baqlanshdi", "aa_gloss": "asqatahu β€” made fall/dropped him", "ms_page": 636, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.637
    {"headword": "al biqlanshdi", "aa_gloss": "iltafata β€” turned around/looked back", "ms_page": 637, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al qurashlanshdi", "aa_gloss": "tafassaha β€” investigated/examined", "ms_page": 637, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "ghawi kidhranshdi", "aa_gloss": "dhallala β€” subdued/tamed the horsemen", "ms_page": 637, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.638
    {"headword": "al aniri marisddi (2)", "aa_gloss": "nabata β€” germinated/vegetated", "ms_page": 638, "diwan_section": "abwab al-ruba'iyy / qamaldi / (z)"},
    {"headword": "al az kirmashddi", "aa_gloss": "ighshabba β€” was wrathful", "ms_page": 638, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.639
    {"headword": "al taqlanshdi", "aa_gloss": "irtafa'a β€” was raised/elevated", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al qadarish taqlanshdi", "aa_gloss": "sharaqa β€” the horizon reddened (at dawn)", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al ani taqlanshdi", "aa_gloss": "iqtasa al-athar β€” followed the track/trace", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al at biqlanshdi", "aa_gloss": "ishlaqqa al-dunya β€” the world split open", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al balanshdi", "aa_gloss": "amsaka β€” held/grasped/restrained", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al mushtaku balanshdi", "aa_gloss": "imsak al-dunya β€” held/restrained the world", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az qamisht al-rajul", "aa_gloss": "qumisha β€” the man was whipped", "ms_page": 639, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.640
    {"headword": "al biqlanshdi alik", "aa_gloss": "suqita al-shay' β€” the thing fell/dropped", "ms_page": 640, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al ququm biqlanshdi", "aa_gloss": "nasajat β€” was woven/plaited", "ms_page": 640, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al arawat biqlanshdi", "aa_gloss": "talawwa β€” was twisted/coiled", "ms_page": 640, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al burqarlanshdi", "aa_gloss": "tawaffa β€” was consumed/exhausted", "ms_page": 640, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al manka balanshdi", "aa_gloss": "amsaka β€” grasped firmly", "ms_page": 640, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.641
    {"headword": "al ari manladi", "aa_gloss": "raji'a al-nasiyu β€” the forgotten returned", "ms_page": 641, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al aribas at tiranshdi", "aa_gloss": "tara'a β€” went far/distanced", "ms_page": 641, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al arik kirmashladi", "aa_gloss": "nasaba shay' li-al-ibadiyya β€” set up for worship(?); entered", "ms_page": 641, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al at manqazlandi", "aa_gloss": "qatala al-rajul bi-al-ushruf β€” killed the man by the cliff", "ms_page": 641, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al bani az al-qalandi", "aa_gloss": "faraqa al-rajul min β€” the man separated from", "ms_page": 641, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.642
    {"headword": "az barsaq qalnashdi", "aa_gloss": "farraqa β€” scattered/dispersed", "ms_page": 642, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al yarit ashitlanshdi", "aa_gloss": "khalata al-duhna wa-al-samn β€” mixed fat and butter", "ms_page": 642, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al birliqlanshdi waqtaha", "aa_gloss": "iddahara β€” was stored up", "ms_page": 642, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al bayit manqlanshdi", "aa_gloss": "aqbala al-rajul β€” the man approached", "ms_page": 642, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.643
    {"headword": "al arawani qirlanshdi", "aa_gloss": "fataha rajul min al-nasl β€” a man broke from the lineage", "ms_page": 643, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al akun tiqlanshdi", "aa_gloss": "sami'a al-sawt al-ladhiya β€” heard the sound that travels far", "ms_page": 643, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al quwraq aldanshdi", "aa_gloss": "iltaqa al-faris wa-al-azwaru β€” the horseman and companion met", "ms_page": 643, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al qurawat birmashlandhi", "aa_gloss": "taqawwat β€” was strengthened/reinforced", "ms_page": 643, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al qarzlanshdi", "aa_gloss": "inqasama al-ard β€” earth was divided", "ms_page": 643, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al mat qarzlanshdi", "aa_gloss": "fataha al-qisma wa-al-talij β€” opened division and snow", "ms_page": 643, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.644
    {"headword": "al yilar tazlanshdi", "aa_gloss": "inbasata al-naqiu β€” the pure one expanded", "ms_page": 644, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al buruntak qildanshdi", "aa_gloss": "amrata al-naql β€” commanded the transfer", "ms_page": 644, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al qalud taqlanshdi", "aa_gloss": "sharibat al-nasl al-asil β€” the pure lineage drank(?); consumed", "ms_page": 644, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al sulaq marqlanshdi", "aa_gloss": "qasara β€” shortened/curtailed", "ms_page": 644, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az aduwi burzlanshdi", "aa_gloss": "akhafa al-rajul β€” the man was frightened", "ms_page": 644, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al al-amir burzlanshdi", "aa_gloss": "fazzi'a al-amir β€” the prince was alarmed", "ms_page": 644, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.645
    {"headword": "al awit biqlanshdi", "aa_gloss": "iltawat al-qalla β€” the pot was overturned", "ms_page": 645, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al mirqash biqlanshdi", "aa_gloss": "aghraqa al-qidr β€” flooded/overflowed the pot", "ms_page": 645, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al at baqlanshdi", "aa_gloss": "saqata al-faras β€” the horse fell", "ms_page": 645, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az hazirlanshdi", "aa_gloss": "ista'adda β€” prepared/readied", "ms_page": 645, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al dawul biqlanshdi", "aa_gloss": "qulaqa al-qarab β€” the battle drum was struck", "ms_page": 645, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az biqlanshdi (3)", "aa_gloss": "iqsha'arra β€” shivered/trembled (from cold/fear)", "ms_page": 645, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.646
    {"headword": "al silkilurdi", "aa_gloss": "yukhallifu al-saghir wa-al-kabir β€” distinguishes small and large", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az darmanshdi", "aa_gloss": "ghashsha al-nasr β€” the eagle swooped", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az jikirlanshdi", "aa_gloss": "iqtada β€” followed/emulated", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az surzlanshdi", "aa_gloss": "daraba al-hadida β€” struck iron/forged", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al bari burzlanshdi", "aa_gloss": "ittaqa'a al-asad β€” the lion was afraid", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az shanka malqlanshdi", "aa_gloss": "mahaka β€” wiped/erased", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al sunqi murzlanshdi", "aa_gloss": "anhaqa β€” exhausted/wore out", "ms_page": 646, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.647
    {"headword": "al aqit shanqlanshdi", "aa_gloss": "akhla'a al-qurun β€” removed the horns(?); stripped", "ms_page": 647, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al shanqlanshdi (2)", "aa_gloss": "farriqa al-ard β€” divided/split the ground", "ms_page": 647, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al ana ala manqlanshdi", "aa_gloss": "shajja β€” struck/split the head", "ms_page": 647, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al manqlanshdi (2)", "aa_gloss": "asbaha al-rajul ablaqa β€” the man became piebald/mixed", "ms_page": 647, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al ali burqashniq shanqlanshdi", "aa_gloss": "allahu alladhi bahara β€” Allah who subdued", "ms_page": 647, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az qirwiq shanqlanshdi", "aa_gloss": "aqbala al-rajul β€” the man approached/arrived", "ms_page": 647, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.648
    {"headword": "al qawal quldanshdi", "aa_gloss": "masaha wudu'ahu β€” wiped ablution surfaces", "ms_page": 648, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al kalik turashdi", "aa_gloss": "kata'a β€” cut/severed", "ms_page": 648, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al malik shuqalamahia", "aa_gloss": "waqa'a al-rajul fi al-hazira β€” the man fell into the pen", "ms_page": 648, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az qushtanshdi", "aa_gloss": "salaqa β€” boiled/cooked", "ms_page": 648, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    {"headword": "al az quwaranshdi", "aa_gloss": "ajzala β€” gave generously", "ms_page": 648, "diwan_section": "abwab al-ruba'iyy / qamaldi"},
]

# ─── ZONE 4: CONJUGATION PARADIGM + SOUND VERB CONCLUSION pp.649-652 ──
zone4 = [
    # p.649 β€” nazm
    {"headword": "NAZM: quraqshil ba sumarika", "aa_gloss": "nazm β€” verse about horse and battle", "ms_page": 649, "word_class": "VERB", "has_nazm": 1,
     "diwan_section": "abwab al-ruba'iyy / qamaldi"},
    # p.651 β€” conjugation paradigm
    {
        "headword": "GRAMMAR: quadrilateral verb conjugation paradigm",
        "aa_gloss": "Full person/number paradigm: singular (man/san/al), plural (biz/siz/alar). Past, imperfective, and imperative forms shown systematically for quadrilateral verbs",
        "ms_page": 651, "word_class": "GRAMMAR",
        "diwan_section": "abwab al-ruba'iyy / qamaldi β€” conjugation grammar",
    },
    # p.652 β€” sound verb chapter conclusion
    {
        "headword": "GRAMMAR: sound verb chapter conclusion β€” inqadat al-af'al min al-sahih",
        "aa_gloss": "Sound verb section (kitab al-af'al min al-salim) formally concluded. All bilateral, trilateral, and quadrilateral sound verbs documented. Kashgari transitions to hamzated (mahmuz) verbs",
        "ms_page": 652, "word_class": "GRAMMAR",
        "diwan_section": "kitab al-af'al min al-salim β€” conclusion",
    },
]

# ─── ZONE 5: BAB AL-AF'AL MIN AL-MAHMUZ pp.652-666 ──────────────────
zone5 = [
    # p.652 β€” chapter opening
    {
        "headword": "GRAMMAR: bab al-af'al min al-mahmuz β€” hamzated verb chapter opens",
        "aa_gloss": "New chapter: verbs containing hamza or weak letters. Organized by letter sections. Reciprocal and mutual verb forms (-lash-/-nash-) prominent throughout",
        "ms_page": 652, "word_class": "GRAMMAR",
        "diwan_section": "bab al-af'al min al-mahmuz β€” introduction",
    },
    # p.652 β€” (w) section entries
    {"headword": "al ulaw wala quldashddi", "aa_gloss": "tasahabba β€” became companions/associated", "ms_page": 652, "diwan_section": "bab al-mahmuz / bilateral / (w)", "kitab": KITAB_MAHMUZ},
    {"headword": "al ulazuq danlashdi", "aa_gloss": "tasa'ala bi-al-sa'at β€” asked each other in hours", "ms_page": 652, "diwan_section": "bab al-mahmuz / bilateral / (w)", "kitab": KITAB_MAHMUZ},
    # p.656 β€” (n) section
    {"headword": "al az irmashddi", "aa_gloss": "taba'a β€” followed/tracked", "ms_page": 656, "diwan_section": "bab al-mahmuz / bilateral / (n)", "kitab": KITAB_MAHMUZ},
    # p.657
    {"headword": "al az bitiq biqlanshdi", "aa_gloss": "nazala al-rajul min β€” the man descended from", "ms_page": 657, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.658
    {"headword": "al alqa rimashdi", "aa_gloss": "innahu ladha ala allahu β€” he submitted to Allah", "ms_page": 658, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qarshashndi", "aa_gloss": "iktasaba β€” acquired/earned", "ms_page": 658, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.660 β€” (n) section continued
    {"headword": "al alqali biqlanshdi (n)", "aa_gloss": "atawwu'a β€” departed/left voluntarily", "ms_page": 660, "diwan_section": "bab al-mahmuz / bilateral / (n)", "kitab": KITAB_MAHMUZ},
    {"headword": "al alik birshanqdi", "aa_gloss": "salada al-asad β€” the lion roared", "ms_page": 660, "diwan_section": "bab al-mahmuz / bilateral / (n)", "kitab": KITAB_MAHMUZ},
    {"headword": "al az birshanqdi (2)", "aa_gloss": "naqala al-nasl al-asil β€” the noble lineage transferred", "ms_page": 660, "diwan_section": "bab al-mahmuz / bilateral / (n)", "kitab": KITAB_MAHMUZ},
    {"headword": "al bayiq taqlanshdi", "aa_gloss": "raghaba β€” yearned/desired", "ms_page": 660, "diwan_section": "bab al-mahmuz / bilateral / (n)", "kitab": KITAB_MAHMUZ},
    # p.661
    {"headword": "al sunqi biqlanshdi", "aa_gloss": "sara al-ra'i β€” the shepherd walked", "ms_page": 661, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al basni biqlanshdi", "aa_gloss": "sara al-ruzuq β€” the provisions walked/traveled", "ms_page": 661, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al jiqlanshdi", "aa_gloss": "waqa'a fi", "ms_page": 661, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al arikast taqlanshdi", "aa_gloss": "al-kitab al-ra'a al-maqhri β€” the book of the conquered reader", "ms_page": 661, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al furaq taqlanshdi", "aa_gloss": "allahu allahu li-hadha al-kharb β€” turned toward this battle", "ms_page": 661, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.662
    {"headword": "al burzu alik qirlanshdi", "aa_gloss": "mawruqa β€” leafed/blossomed", "ms_page": 662, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qiqlanshdi", "aa_gloss": "ibnu abin al-rajul β€” the man became important", "ms_page": 662, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al alawq birshanqdi", "aa_gloss": "shaqqa al-mahsur β€” split the besieged(?)", "ms_page": 662, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al min biqlanshdi", "aa_gloss": "salaha al-ard β€” the earth became fertile", "ms_page": 662, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al biqlanshdi (ard)", "aa_gloss": "sahanat al-ard min al-naqlama β€” earth calmed from earthquake", "ms_page": 662, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.663
    {"headword": "al taqal ba'rurma", "aa_gloss": "inqatala β€” was fought/battled", "ms_page": 663, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al al-raji bitiqlanshdi", "aa_gloss": "da'assa al-nasl β€” trod down/walked on", "ms_page": 663, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qarqlanshdi", "aa_gloss": "sara al-rajul ala β€” the man walked upon", "ms_page": 663, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az quraqlanshdi", "aa_gloss": "hada al-rajul ila β€” the man was guided", "ms_page": 663, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al qirdiqlanshdi wa-hadha al-asl", "aa_gloss": "quriqa β€” was drowned. Also qirdiqdi = same", "ms_page": 663, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.664
    {"headword": "al bayit qurzlanshdi", "aa_gloss": "shafa'a qushur β€” removed bark/skin", "ms_page": 664, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qazlanshdi", "aa_gloss": "allahu ta'ala qaddara β€” Allah measured/decreed", "ms_page": 664, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al ariq qurzaladi", "aa_gloss": "tari al-lahm β€” the flesh became fresh", "ms_page": 664, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qashlanshdi", "aa_gloss": "sara al-ard mundifat β€” earth became level", "ms_page": 664, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al ali'na az birmaqlanshdi", "aa_gloss": "mukhtalif al-dawra wa-al-sutur β€” different circuits and lines", "ms_page": 664, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al ataq kirmanshdi", "aa_gloss": "ittaqa allahu bi-ta'a β€” obeyed Allah in obedience", "ms_page": 664, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.665
    {"headword": "al az qushtanshdi", "aa_gloss": "sara quran β€” walked proudly/majestically", "ms_page": 665, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qalanddi", "aa_gloss": "sara al-iqil β€” the prudent one walked", "ms_page": 665, "diwan_section": "bab al-mahmuz / bilateral", "kitab": KITAB_MAHMUZ},
    # p.666 β€” (b) section begins
    {"headword": "al az awit biqlanshdi (b)", "aa_gloss": "innahu alyara al-rajul β€” he saw the man", "ms_page": 666, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    {"headword": "al aws bayit taqlanshdi (b)", "aa_gloss": "imtadda al-rajul wa-al-yad β€” the man and hand extended", "ms_page": 666, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    {"headword": "al alqa waqit baqlanshdi (b)", "aa_gloss": "la waqta wa-al-anyu β€” no time and no forbearance", "ms_page": 666, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    # p.667 β€” (b) continued
    {"headword": "al baqir qirqlanshdi", "aa_gloss": "awsada hawadith al-makan β€” reported the events of the place", "ms_page": 667, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    {"headword": "al bayit sirzlanshdi", "aa_gloss": "ib'ata al-fa'ur β€” sent forth the dawn", "ms_page": 667, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    {"headword": "al az shariq qalqlanshdi", "aa_gloss": "asta'anna bi-al-nadi β€” sought help from the caller", "ms_page": 667, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    {"headword": "al birza qurqlanshdi", "aa_gloss": "sana'a duwra β€” made a circuit", "ms_page": 667, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    {"headword": "al mirza qirqlanshdi", "aa_gloss": "mazza rudhya fihima β€” tasted what was in them", "ms_page": 667, "diwan_section": "bab al-mahmuz / bilateral / (b)", "kitab": KITAB_MAHMUZ},
    # p.668 β€” (d) section
    {"headword": "al az awayit qushtanshdi (d)", "aa_gloss": "fa la dhat al-rajul β€” the man went there/thither", "ms_page": 668, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al alad al biriqlanshdi", "aa_gloss": "iqtarina faltiyan β€” the youths were paired", "ms_page": 668, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al a'dawuq mirqlanshdi", "aa_gloss": "istafrasha al-ard β€” spread out on earth", "ms_page": 668, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al az alikm qushtanshdi", "aa_gloss": "innahu al-aqhi β€” he was the most knowledgeable", "ms_page": 668, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al az qad qurmanshdi", "aa_gloss": "allahu ma'a alayhi al-aqdam β€” Allah with him the steps", "ms_page": 668, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    # p.669 β€” continued
    {"headword": "al maliq biruq qushtanshdi", "aa_gloss": "allahumma hidha al-qawm β€” O Allah, this is the people", "ms_page": 669, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al az buriq taqlanshdi", "aa_gloss": "hajima al-shuja β€” the brave one attacked", "ms_page": 669, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al az dashlanshdi", "aa_gloss": "abin al-fa'ur wa-al-qamarin β€” son of dawn and moon", "ms_page": 669, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al bat taqlanshdi", "aa_gloss": "irtaqaba β€” watched/observed", "ms_page": 669, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al dawn qushtanshdi", "aa_gloss": "iddalaja al-rajul β€” the man walked at dawn", "ms_page": 669, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
    {"headword": "al sunqira musharqlanshdi", "aa_gloss": "ashraqa al-shams β€” the sun rose/shone", "ms_page": 669, "diwan_section": "bab al-mahmuz / bilateral / (d)", "kitab": KITAB_MAHMUZ},
]


def run_batch():
    """Execute the full batch write."""
    total = 0
    failed = 0
    zones = [
        ("Zone 1: Quadrilateral qamaldi pp.597-604", zone1),
        ("Zone 2: Grammar milestones pp.604-608", zone2),
        ("Zone 3: Quadrilateral by letter pp.608-649", zone3),
        ("Zone 4: Paradigm + conclusion pp.649-652", zone4),
        ("Zone 5: Hamzated verbs pp.652-666", zone5),
    ]

    for zone_name, entries in zones:
        print(f"\n{'='*60}")
        print(f"  {zone_name}")
        print(f"  {len(entries)} entries")
        print(f"{'='*60}")

        for entry in entries:
            data = {
                "headword": entry["headword"],
                "aa_gloss": entry["aa_gloss"],
                "volume": VOL,
                "kitab": entry.get("kitab", KITAB_SALIM),
                "ms_page": entry["ms_page"],
                "word_class": entry.get("word_class", "VERB"),
                "diwan_section": entry["diwan_section"],
                "has_nazm": entry.get("has_nazm", 0),
                "has_proverb": entry.get("has_proverb", 0),
            }

            result = write_entry(data, "WORD_DIWAN")
            total += 1

            if result["success"]:
                print(f"  OK [{result['id']}] {entry['headword'][:50]}")
            else:
                failed += 1
                print(f"  FAIL: {entry['headword'][:50]} β€” {result['message'][:80]}")

    print(f"\n{'='*60}")
    print(f"  BATCH COMPLETE: {total} attempted, {total - failed} written, {failed} failed")
    print(f"{'='*60}")


if __name__ == "__main__":
    run_batch()