#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Session 38 — Diwan Vol 3 Batch Write Vol 3 pp.1-51 (PDF 775-825) Content: NOUNS organized by vowel pattern Sections: bilateral → trilateral → quadrilateral → quinquelateral Run: python3 Code_files/diwan_s38_vol3_batch.py """ import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__))) from uslap_handler import write_entry KITAB = "kitab al-asma vol.3" VOL = 3 def w(headword, gloss, page, section, wc="NOUN", nazm=False): data = { "headword": headword, "aa_gloss": gloss, "ms_page": page, "diwan_section": section, "word_class": wc, "kitab": KITAB, "volume": VOL, } if nazm: data["has_nazm"] = 1 try: r = write_entry(data, "WORD_DIWAN") return r.get("success", False) except Exception as e: print(f" ERR: {headword[:40]} — {e}") return False ok = fail = 0 def track(result): global ok, fail if result: ok += 1 else: fail += 1 # ─── pp.1-2: Opening entries ────────────────────────────────────────── track(w("yim (1)", "al-fida — ransom/redemption. waqa'a al-fida fi al-'aynayn", 1, "bab bilateral / (m)")) track(w("yim (2)", "al-afawiya — spices/aromatics", 1, "bab bilateral / (m)")) track(w("bin (1)", "al-furat — the Euphrates/sweet water", 1, "bab bilateral / (n)")) track(w("bin (2)", "fazin al-asad — lion's mane", 1, "bab bilateral / (n)")) track(w("NAZM: laghuz qurtash qaiy tuzlaqi", "nazm — verse about wind, storm and battle", 1, "bab bilateral / (n)", nazm=True)) # p.2 — kinship section track(w("GRAMMAR: bab fa'l wa-fu'l wa-fi'l musakkana al-hashw", "New section: nouns with quiescent middle letter. Organized by vowel pattern across bilateral and trilateral forms", 2, "bab fa'l musakkana — introduction", "GRAMMAR")) track(w("yizb al-malik", "al-shaykh al-hakim — the wise elder", 2, "bab fa'l musakkana / (b)")) track(w("yizb (2)", "dhawqabi al-wajh — cold-faced. idha wajadahu al-surud", 2, "bab fa'l musakkana / (b)")) track(w("yirt", "atlal wa-al-riy' wa-al-diman — ruins, remains and traces", 2, "bab fa'l musakkana / (t)")) track(w("yirt (2)", "al-jabal al-sald — the hard/barren mountain", 2, "bab fa'l musakkana / (t)")) track(w("yirkh", "akhu al-mar'a al-saghir — younger brother of the woman. Age-graded kinship: younger=yini, older=akhi (AA root A-KH-W), eldest=aka", 2, "bab fa'l musakkana / (j)")) track(w("yind (1)", "al-habl — rope. yaqa'u 'ala al-wahid wa-al-jam' (singular and plural same form)", 2, "bab fa'l musakkana / (d)")) # p.3 track(w("yind (2)", "ism ihda al-sittin al-almashi 'ashara bi-al-turkiyya: yindili", 3, "bab fa'l musakkana / (d)")) track(w("GRAMMAR: bab fa'l wa-fu'l wa-fi'l haraka al-mashri", "New section: nouns with voweled middle", 3, "bab fa'l haraka — introduction", "GRAMMAR")) track(w("yidat al-malik", "al-shay' alladhi la khayr fihi — the worthless thing", 3, "bab fa'l haraka / (t)")) track(w("yikat", "al-thabit min kull shay' — the firm/established from everything", 3, "bab fa'l haraka / (t)")) track(w("yikat (2)", "harf ya'ni: na'am — particle meaning: yes", 3, "bab fa'l haraka / (t)")) track(w("bikh (1)", "al-maqila min al-fisal — resting place of young camels", 3, "bab fa'l haraka / (j)")) track(w("bikh (2)", "al-hiqf — the sand dune", 3, "bab fa'l haraka / (j)")) track(w("bikh (3)", "'awdat kull — every return/cycle", 3, "bab fa'l haraka / (j)")) track(w("bikh (4)", "al-farsakh min al-ard — the parasang of land", 3, "bab fa'l haraka / (j)")) # pp.4-6: more bilateral/trilateral entries track(w("yish", "al-iman — faith/belief", 4, "bab fa'l haraka / (sh)")) track(w("yilk", "al-mulk — kingdom/sovereignty", 4, "bab fa'l haraka / (k)")) track(w("mush", "al-amana li-al-aqarib — the dowry/gift for relatives. Used in al-'urus (weddings)", 6, "bab fa'l haraka / (m)")) track(w("mush (2)", "al-risala bayn al-julun — the letter/message between people. Also: al-malik should not be called from this word mushishi because al-malik is greater", 6, "bab fa'l haraka / (m)")) track(w("'iysh", "al-fawaka — fruit. ism jami' (collective noun)", 6, "bab fa'l haraka / (m)")) # (gh) section track(w("yighigh", "al-imam — the leader. yastafidna shibil", 6, "bab fa'l haraka / (gh)")) track(w("yighigh (2)", "al-labn min kull shay' — milk/sap from everything", 6, "bab fa'l haraka / (gh)")) track(w("yughant", "al-hawtal — the rope/lasso. lugha kaghaz", 6, "bab fa'l haraka / (gh)")) track(w("yighigh (3)", "anna al-insan yajzimu ghayurah — that a person resolves/determines others", 6, "bab fa'l haraka / (gh)")) # pp.7-10 track(w("yash", "al-'umr — age/lifespan", 7, "bab fa'l haraka / (sh)")) track(w("yash (2)", "al-rutuba — moisture/wetness", 7, "bab fa'l haraka / (sh)")) track(w("yiz", "al-athar — trace/track", 8, "bab fa'l haraka / (z)")) track(w("yuz", "al-wajh — the face", 8, "bab fa'l haraka / (z)")) track(w("yuz (2)", "mi'a — hundred. al-'adad", 8, "bab fa'l haraka / (z)")) # pp.11-14 — trilateral continued track(w("yiqiq (1)", "al-fanbqu — the arrow/projectile. With proverb: awt nuqtalnuz yibas", 11, "bab thulathiyy / (q)")) track(w("bisiq", "al-maqnus — the known/designated", 11, "bab thulathiyy / (q)")) track(w("NAZM: yilki sayn allah al-kabira", "nazm — verse about brave man. Mentions sayn allah al-kabira wa-al-saghir (the great and small bounty of Allah)", 11, "bab thulathiyy / (q)", nazm=True)) track(w("yuqi", "al-tarz'a — the small path in the passage. wa-hiya tariq saghir fi al-mamazza", 11, "bab thulathiyy / (q)")) track(w("laqi", "al-dabiq — the sticky/adhesive", 11, "bab thulathiyy / (q)")) # pp.14-16 — proverbs and entries track(w("yibin", "al-qarin min tahabbub — companion from affection/love", 14, "bab thulathiyy / (n)")) track(w("yirin", "'azm al-kutub — greatness of books. wa-al-turkiyya fihi yaqul: yirin li-munsa libil li-munsur", 14, "bab thulathiyy / (n)")) track(w("yizal", "fata'at al-sabah — piece of morning/dawn fragment", 14, "bab thulathiyy / (n)")) track(w("yibin (2)", "al-abriq — the bright/lightning-like. With Turkic wisdom proverb", 14, "bab thulathiyy / (n)")) track(w("yiyin", "al-shakuma min al-turab — the dust-heap. yiyin az = the man near to brethren", 14, "bab thulathiyy / (n)")) track(w("yiqin", "al-qarib min kull shay' — the near/close from everything", 14, "bab thulathiyy / (n)")) track(w("yiqin az", "al-rajul al-qarib min al-ukhuwwa — the man close to brotherhood", 14, "bab thulathiyy / (n)")) # pp.16-18 — section transitions track(w("yilw", "al-siraj — the lamp. wa-yuqal li-al-siraj: yila", 16, "bab thulathiyy / (l)")) track(w("yuw", "harf wa-ma'nahu — particle meaning: and. Also: ayqat hadha al-kalam wa-hafiztuhu", 16, "bab thulathiyy / (m)")) track(w("yinasuq", "wa-ma'nahu: naya — meaning: a flute", 16, "bab thulathiyy / (n)")) track(w("GRAMMAR: wuqu' akhar — section on final patterns", "New sub-section: nouns ending in specific patterns. Opens with ya' entries", 16, "wuqu' akhar — introduction", "GRAMMAR")) track(w("biya", "ayat al-insan sha'ma — the verse/sign of the person's mark/brand", 16, "wuqu' akhar / (b)")) track(w("buwa", "al-tarzut — the stitch/suture. wa-huwa naqt bi-masirihi fi tukhaj", 16, "wuqu' akhar / (b)")) # p.18 — section headers track(w("GRAMMAR: bab fa'ali — new pattern section", "Section: fa'ali pattern nouns", 18, "bab fa'ali — introduction", "GRAMMAR")) track(w("yiji", "al-sab'a fi al-'adad — the seven in counting", 18, "bab fa'ali / (t)")) track(w("GRAMMAR: bab fu'al — new pattern section", "Section: fu'al pattern nouns", 18, "bab fu'al — introduction", "GRAMMAR")) track(w("yubagh", "al-mur'azzi — goat hair/mohair", 18, "bab fu'al / (b)")) track(w("GRAMMAR: bab fa'al fi harakatihi — new pattern section", "Section: fa'al nouns with their vowel movements", 18, "bab fa'al — introduction", "GRAMMAR")) track(w("yishut", "al-jawab — the answer/reply", 18, "bab fa'al / (t)")) track(w("yishut (2)", "al-mawd wa-al-naqsh — decoration and engraving", 18, "bab fa'al / (t)")) track(w("biyakh", "lugha fi yibakh — dialect form of yibakh", 18, "bab fa'al / (j)")) track(w("biyadh", "al-mask — the musk", 18, "bab fa'al / (d)")) track(w("yiladh", "huwa 'idhar al-farasi — the horse's halter/cheekpiece", 18, "bab fa'al / (d)")) # p.20 — continued track(w("shimuw", "al-lu'lu' — pearls. wa-bihi yusamma al-amahu (by it named the maid). With proverb", 21, "bab thulathiyy / (sh)")) track(w("binduw", "huwa tuwal wabr al-jamir 'ind al-maqshuk — long camel hair when combed", 21, "bab thulathiyy / (m)")) track(w("yinduws", "al-'aha — calamity/misfortune", 21, "bab thulathiyy / (m)")) track(w("bindi", "fisalat al-fisa' 'inda akl al-ta'am — hand-washing after eating food", 21, "bab thulathiyy / (m)")) track(w("tizi yibz", "al-aradi al-musayyada — the level/flat lands", 21, "bab thulathiyy / (r)")) track(w("yibinzu", "tul wabr al-jamir — length of camel hair. wa-al-dal ka-yuqal fi al-'arabiyya (sakandahu)", 21, "bab thulathiyy / (r)")) # p.24 — CRITICAL: anti-borrowing statement track(w("yigha", "ism qarij qunb — name of a town", 24, "bab thulathiyy / (gh)")) track(w("yilgha", "al-lakda al-farasi min al-turkiyya — the horse-kick, from Turkic", 24, "bab thulathiyy / (gh)")) track(w("GRAMMAR: Kashgari anti-borrowing statement", "Kashgari explicitly states: wa-laysa li-ahadin an yaqula inna al-turak akhadhat min al-furs — no one should say the Turks took from the Persians. la lahum akhwaj ila al-manzar min sa'ir al-hanaqi li-yakuna al-amtadh wa-al-naqsh fi biladihim akthar — they have no need to look to others, for crafts and engravings in their lands are more abundant", 24, "bab thulathiyy — anti-borrowing declaration", "GRAMMAR")) track(w("yizna", "ism dhawj — name of a spouse", 24, "bab thulathiyy / (n)")) track(w("yikna", "al-alwja — the almond", 24, "bab thulathiyy / (n)")) # pp.26-34: quadrilateral nouns track(w("GRAMMAR: hadhihi abwab al-ruba'iyy — quadrilateral nouns open", "Quadrilateral noun section opens. Pattern: fa'lal and variants", 26, "abwab al-ruba'iyy — introduction", "GRAMMAR")) track(w("sibnaf", "al-haniya wa-al-qirdha min al-sha'r wa-al-suf — the henna and monkey-like from hair and wool", 26, "abwab al-ruba'iyy / (t)")) track(w("sibnakh", "ibada saghira — small worship/prayer place", 26, "abwab al-ruba'iyy / (j)")) track(w("yughraz", "al-matar — rain. lugha: yughraz", 26, "abwab al-ruba'iyy / (d)")) track(w("NAZM: fandiy bak yughraz", "nazm — verse about rain and clouds descending. With proverb", 26, "abwab al-ruba'iyy / (d)", nazm=True)) track(w("yiqladuq", "ism amir ka-dha — name of a prince/commander. In origin: al-tashdid min kull shay'", 31, "abwab al-ruba'iyy / (q)")) track(w("yitnaq", "al-mutazrij al-mudawwaz min kull naw' — the mixed/compound from every type", 31, "abwab al-ruba'iyy / (q)")) track(w("yihnaqi", "alladhin min kull shay' — those of every kind", 31, "abwab al-ruba'iyy / (t)")) track(w("yindiq yikan", "shawla al-fuqadh — the matter of jurists", 31, "abwab al-ruba'iyy / (t)")) track(w("yindiq yikir", "al-ghariyubin — the strange/foreign ones", 31, "abwab al-ruba'iyy / (t)")) track(w("yindaf", "dhawqi al-faras 'adatan — the horse's usual temperament. With proverb: yibnak irsa kuzal", 31, "abwab al-ruba'iyy / (d)")) track(w("yibqi", "al-ashjan — sorrows/griefs", 31, "abwab al-ruba'iyy / (b)")) # p.34 — quadrilateral conclusion + quinquelateral opens track(w("bilaiqr", "ism yutlaqu 'ala dhulal al-muluk — name applied to agents of kings. lugha: amiz", 34, "abwab al-ruba'iyy / (r)")) track(w("yibitiq at", "aqras alladhi la yasra' — the horse that does not gallop. With proverb", 34, "abwab al-ruba'iyy / (q)")) track(w("yibshafur", "al-ukhrud — the furrow/groove", 34, "bab fa'alil / (gh)")) track(w("GRAMMAR: inqadat abwab al-ruba'iyy", "Quadrilateral noun section concluded", 34, "abwab al-ruba'iyy — conclusion", "GRAMMAR")) track(w("GRAMMAR: hadhihi abwab al-khumasiyy — quinquelateral nouns open", "Quinquelateral noun section opens. Pattern: fa'allal and variants", 34, "abwab al-khumasiyy — introduction", "GRAMMAR")) track(w("yibudhiq kasir ku", "jirat — neighbors", 34, "abwab al-khumasiyy / (gh)")) # pp.36-40: quinquelateral continued track(w("yimqalabaq", "manbit al-juz — walnut growing place", 36, "abwab al-khumasiyy / (m)")) track(w("yirqalaq", "al-nur wa-al-diya' — light and radiance", 36, "abwab al-khumasiyy / (r)")) track(w("yindaqaq az", "al-rajul al-mizan — the balanced/just man", 36, "abwab al-khumasiyy / (d)")) track(w("yiknaflak", "al-rabi' al-malbus al-quwwa — the strong-garmented spring", 36, "abwab al-khumasiyy / (k)")) track(w("yishkilak yimaj", "ikhtama al-musunda — the sealed/authorized", 36, "abwab al-khumasiyy / (sh)")) track(w("GRAMMAR: bab fa'malal fi harakatihi", "New pattern section within quinquelateral", 36, "bab fa'malal — introduction", "GRAMMAR")) # pp.40-46: verb entries begin track(w("al kashibi al nilm suruz yishnaql", "dhaka wa-dhaka al-kalam — this and that speech", 40, "bab fa'malal / (t)")) track(w("shukri yibrlak yizshnaql", "allah ta'ala khalaqa al-ardh — Allah Most High created the earth", 40, "bab fa'malal / (t)")) track(w("kan al-awni'gh yizshnaql", "al-ahtamshi hiya abadan — the sun forever its light and glory", 40, "bab fa'malal / (n)")) # pp.44-46 — more entries track(w("al yibkibi yibtadi", "as'ala awdhin min shaybuwr al-din — asked the elders of the religion", 44, "bab thulathiyy verbs / (b)")) track(w("al bakibi yishndi", "asala awdhin min shaybuwr — asked the elders", 44, "bab thulathiyy verbs / (b)")) track(w("al aghriz yibndi", "tawzi'a bi-al-aradi — distributed across the lands", 44, "bab thulathiyy verbs / (gh)")) track(w("NAZM: naghraz biyit shat awfin", "nazm — verse about property and wealth distribution. With proverb about travel and possessions", 44, "bab thulathiyy verbs", nazm=True)) # pp.46-51 — final entries in range track(w("al yibkbi yishndi (2)", "asala al-rijal — asked the men", 46, "bab thulathiyy verbs / (b)")) track(w("al rakh yishndi", "al-barr wa-al-sha'ir wa-al-duhn — wheat, barley and oil (a drink)", 46, "bab thulathiyy verbs / (r)")) track(w("al ani akhtanishi yishndi", "halama wa-aqishi — dreamed and awoke", 46, "bab thulathiyy verbs / (n)")) track(w("al tari'kh yishndi", "awlaba al-qursa — turned the disk/wheel", 46, "bab thulathiyy verbs / (t)")) track(w("azniq yishndi", "kharaja al-mihandis — the engineer/craftsman emerged. Also: ashbalaqu yishndi = qama'at al-silah (weapon manufacture)", 46, "bab thulathiyy verbs / (n)")) print(f"\n{'='*60}") print(f"VOL 3 BATCH COMPLETE") print(f"Total OK: {ok}") print(f"Total FAIL: {fail}")