""" al-Athar al-Baqiya — Session 46 Batch 01 BnF Arabe 1489, ms_id=6 ABJAD-ROOTED science terms ONLY. Source: table headings and labels from genuine abjad computation pages. All terms read directly from MS images — zero weights. """ import sys, os sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import uslap_handler as h # ── Register MS ────────────────────────────────────────────────────── MS_REF = "BnF Arabe 1489 — al-Athar al-Baqiya 'an al-Qurun al-Khaliya" MS_NOTE = ( "al-Biruni al-Khwarizmi. 175 folios, 100% Arabic, zero Persian wrapper. " "BASMALLAH + Q20:114 verified. Genuine science pages use ABJAD notation. " "~15 pages king-list interpolation + ~5 pages festival interpolation identified and excluded. " "See Documentation/ATHAR_BAQIYA_INTERPOLATION_ANALYSIS.md" ) # ── Entries: abjad table headings/labels only ──────────────────────── entries = [ # (en_term, aa_word, root_id, root_letters, phonetic_chain, ms_pages, qur_refs, notes) # ── TABLE HEADINGS (جدول X) ── ( "AL-JADWAL (table — the computational grid instrument)", "الجَدْوَل / al-jadwal / PRESS+KNOCK+CONNECTION", "R666", "ج-د-ل", "j←ج(S02) → d←د(S19) → l←ل(S16)", "p.131,132,135,198,210", "Q16:124,Q18:54,Q29:46", f"جدول = table as scientific instrument. Heading on 5 abjad tables in MS. " f"Root ج-د-ل (29 Qur tokens). Letter lattice: PRESS+KNOCK+CONNECTION = structured access to data. {MS_REF}" ), ( "AL-ISTIQAMA (rectification — astronomical correction to true position)", "الاسْتِقَامَة / al-istiqama / STRIKE+ROUNDING+ENCLOSURE", "R355", "ق-و-م", "q←ق(S01) → w←و(S10) → m←م(S17)", "p.126,131", "Q41:6,Q41:30,Q46:13,Q72:16", f"جدول الاستقامة = Table of Rectification (p.131, full-page abjad grid). " f"Root ق-و-م (660 Qur tokens). istiqama = standing straight = correcting observed to true. {MS_REF}" ), ( "AL-KAYFIYYAT (qualities — astronomical modality classifications)", "الكَيْفِيَّات / al-kayfiyyat / TAP+CONTRACTION+SEPARATION", "R162", "ك-ي-ف", "k←ك(S20) → y←ي(S06) → f←ف(S07)", "p.132", "Q2:28,Q2:259,Q3:6,Q88:17", f"جدول الكيفيات = Table of Qualities (p.132, full-page abjad grid). " f"Root ك-ي-ف (83 Qur tokens). kayf = how = qualitative state of celestial configuration. {MS_REF}" ), ( "AL-TAWALI (ascendants — rising points of celestial bodies)", "الطَّوَالِع / al-tawali' / SEAL+CONNECTION+DEPTH", "R759", "ط-ل-ع", "t←ط(S04) → l←ل(S16) → '←ع(S14)", "p.119,120", "Q6:78,Q113:1,Q97:5", f"الطوالع السبعة = The Seven Ascendants (p.120, abjad grid). " f"Root ط-ل-ع (19 Qur tokens). tala'a = to rise = celestial body crossing horizon. {MS_REF}" ), # ── CALENDAR COMPUTATION LABELS ── ( "AL-SHUHUR (months — lunar time divisions in computation)", "الشُّهُور / al-shuhur / SPREADING+BREATH+MOVEMENT", "R815", "ش-ه-ر", "sh←ش(S05) → h←ه(S08) → r←ر(S15)", "p.135,210", "Q2:185,Q2:194,Q9:36", f"جدول دوس الشهور في السنة (p.135) + جدول الشهور (p.210) — both abjad. " f"Root ش-ه-ر (21 Qur tokens). Q9:36: twelve months in Allah's decree. {MS_REF}" ), ( "AL-TAMMA (complete — full year/month type in calendar computation)", "التَّامَّة / al-tamma / SNAP+ENCLOSURE+ENCLOSURE", "R775", "ت-م-م", "t←ت(S23) → m←م(S17) → m←م(S17)", "p.135", "Q2:233,Q7:142,Q28:27", f"تامة = complete year type, column label in جدول دوس الشهور (p.135, abjad). " f"Root ت-م-م (22 Qur tokens). tamm = to complete = full-length cycle. {MS_REF}" ), ( "AL-NAQISA (deficient — short year/month type in calendar computation)", "النَّاقِصَة / al-naqisa / CONTINUATION+STRIKE+HEAVY_STREAM", "R922", "ن-ق-ص", "n←ن(S18) → q←ق(S01) → s←ص(S13)", "p.135", "Q2:155,Q13:41,Q21:44", f"ناقصة = deficient year type, column label in جدول دوس الشهور (p.135, abjad). " f"Root ن-ق-ص (10 Qur tokens). naqs = to diminish = shortened cycle. {MS_REF}" ), ( "AL-SALKH (end-of-month — the month boundary in calendar tables)", "السَّلْخ / al-salkh / FLOW+CONNECTION+PASSAGE", "R447", "س-ل-خ", "s←س(S21) → l←ل(S16) → kh←خ(S11)", "p.200", "Q36:37", f"سلخ = end of month, column header in conversion table (p.200, abjad). " f"Root س-ل-خ (3 Qur tokens). Q36:37: naslakhu minhu al-nahar. {MS_REF}" ), ( "AL-USBU (week — seven-day cycle as computation unit)", "الأُسْبُوع / al-usbu' / FLOW+CLOSURE+DEPTH", "R677", "س-ب-ع", "s←س(S21) → b←ب(S09) → '←ع(S14)", "p.210", "Q2:196,Q7:54,Q12:43,Q65:12", f"أسبوع = week, label in جدول الشهور (p.210, abjad). " f"Root س-ب-ع (28 Qur tokens). sab' = seven = fundamental cycle unit. {MS_REF}" ), # ── COMPUTATION FRAMEWORK TERMS ── ( "AL-HISAB (computation — the act of quantitative reckoning)", "الحِسَاب / al-hisab / CONSTRICTION+FLOW+CLOSURE", "R582", "ح-س-ب", "h←ح(S03) → s←س(S21) → b←ب(S09)", "p.102,104,200,210", "Q2:202,Q3:19,Q6:62,Q13:21,Q13:41,Q14:41,Q38:26,Q40:17", f"حساب = computation, methodology term across abjad table zones. " f"Root ح-س-ب (109 Qur tokens). Q13:41: swift in reckoning. {MS_REF}" ), ( "AL-MIQDAR (magnitude — the measured quantity in astronomical tables)", "المِقْدَار / al-miqdar / STRIKE+KNOCK+MOVEMENT", "R194", "ق-د-ر", "q←ق(S01) → d←د(S19) → r←ر(S15)", "p.198", "Q13:8,Q15:21,Q25:2,Q34:11,Q54:49", f"جدول أحوال المقدار = Table of States of Magnitude (p.198, abjad). " f"Root ق-د-ر (132 Qur tokens). qadr = measure/decree = quantified magnitude. {MS_REF}" ), ( "AL-AHWAL (states — computational conditions in astronomical tables)", "الأَحْوَال / al-ahwal / CONSTRICTION+ROUNDING+CONNECTION", "R693", "ح-و-ل", "h←ح(S03) → w←و(S10) → l←ل(S16)", "p.198", "Q14:27,Q82:19", f"جدول أحوال المقدار = Table of States of Magnitude (p.198, abjad). " f"Root ح-و-ل (25 Qur tokens). hawl = turn/state = condition of computed variable. {MS_REF}" ), ( "AL-ADWAR (cycles — astronomical recurrence periods)", "الأَدْوَار / al-adwar / KNOCK+ROUNDING+MOVEMENT", "R594", "د-و-ر", "d←د(S19) → w←و(S10) → r←ر(S15)", "p.109", "Q21:33,Q36:40", f"القول على الأدوار = Discourse on Cycles (p.109, section heading). " f"Root د-و-ر (55 Qur tokens). dawr = cycle/revolution = repeating celestial period. {MS_REF}" ), # ── GEOMETRIC DIAGRAM TERMS ── ( "AL-SHAKL (figure — geometric construction for astronomical proof)", "الشَّكْل / al-shakl / SPREADING+TAP+CONNECTION", "R243", "ش-ك-ل", "sh←ش(S05) → k←ك(S20) → l←ل(S16)", "p.128,206,208", "Q6:99", f"شكل الدائرة = Figure of the Circle (p.206, 208 — geometric astronomical diagrams). " f"Root ش-ك-ل (2 Qur tokens). shakl = form/figure = geometric proof construction. {MS_REF}" ), # ── ADDITIONAL ABJAD TABLE LABELS ── ( "AL-ADAD (number — the counted quantity in abjad tables)", "العَدَد / al-'adad / DEPTH+KNOCK+KNOCK", "R107", "ع-د-د", "'←ع(S14) → d←د(S19) → d←د(S19)", "p.119", "Q9:36,Q10:5,Q18:11,Q72:28", f"عدد = number, in table heading اسماء السنوات وعدد الاهور (p.119, abjad). " f"Root ع-د-د (57 Qur tokens). Q9:36: the number of months with Allah is twelve. {MS_REF}" ), ( "AL-YAWM (day — the fundamental unit of time computation)", "اليَوْم / al-yawm / CONTRACTION+ROUNDING+ENCLOSURE", "R378", "ي-و-م", "y←ي(S06) → w←و(S10) → m←م(S17)", "p.200", "Q2:184,Q7:54,Q22:47,Q32:5,Q70:4", f"أيام = days, column header in conversion table (p.200, abjad cells). " f"Root ي-و-م (475 Qur tokens). yawm = day = base temporal unit in calendar computation. {MS_REF}" ), ( "AL-TABAQA (layer — computational level in astronomical analysis)", "الطَّبَقَة / al-tabaqa / SEAL+CLOSURE+STRIKE", "R295", "ط-ب-ق", "t←ط(S04) → b←ب(S09) → q←ق(S01)", "p.110", "Q67:3,Q71:15,Q84:19", f"طبقة = layer/level, in multi-level computation methodology (p.110). " f"Root ط-ب-ق (4 Qur tokens). Q84:19: layer upon layer. {MS_REF}" ), ( "AL-SANAWAT (years — solar time division in calendar computation)", "السَّنَوَات / al-sanawat / FLOW+CONTINUATION+ROUNDING", "R816", "س-ن-و", "s←س(S21) → n←ن(S18) → w←و(S10)", "p.119", "Q2:259,Q10:5,Q17:12,Q18:25,Q29:14", f"السنوات = years, in table heading اسماء السنوات (p.119, abjad). " f"Root س-ن-و (20 Qur tokens). Q10:5: to know the number of years and the reckoning. {MS_REF}" ), ] # ── Write entries ──────────────────────────────────────────────────── written = 0 failed = 0 for en_term, aa_word, root_id, root_letters, phonetic_chain, ms_pages, qur_refs, notes in entries: try: data = { 'en_term': en_term, 'aa_word': aa_word, 'root_id': root_id, 'root_letters': root_letters, 'phonetic_chain': phonetic_chain, 'source_form': 'AA_DIRECT', 'qur_refs': qur_refs, 'notes': notes, 'foundation_refs': f"MS: {MS_REF} | Pages: {ms_pages} | Notation: ABJAD", } result = h.write_entry(data, 'WORD_EN') if result.get('success'): written += 1 print(f" OK [{result.get('id')}] {en_term[:55]}") else: failed += 1 msg = result.get('message', str(result))[:80] print(f" FAIL {en_term[:45]} → {msg}") except Exception as e: failed += 1 print(f" ERR {en_term[:45]} → {e}") print(f"\n{'='*60}") print(f"WRITTEN: {written} | FAILED: {failed} | TOTAL: {len(entries)}") print(f"MS: {MS_REF}") print(f"All entries from ABJAD table pages only.")