#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Session 39 — Diwan Vol 3 Batch Write #15 Pages 221-232 (printed 223-234, PDF 995-1006) Content: Verb entries, greed proverb, MAJOR grammar on negative imperative dialects Run: python3 Code_files/diwan_s39_batch_15.py """ import sys, os sys.path.insert(0, os.path.join(os.path.dirname(__file__))) from uslap_handler import write_entry KITAB = "kitab dhawat al-thalatha" VOL = 3 def w(headword, gloss, page, section, wc="VERB", nazm=False, proverb=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 if proverb: data["has_proverb"] = 1 try: r = write_entry(data, "WORD_DIWAN") status = "OK" if r.get("success") else f"FAIL: {r.get('message', '')[:100]}" print(f" {status}: {headword[:60]}") 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 # ─── p.225: greed proverb, fat appearing ────────────────────────────── track(w("GRAMMAR: proverb — greed and contentment", "mathal: al-qasfama min yadihi wa-yuflit al-laabis. yudrab fi-man yatma fi shay wa-yuthbiq ma indahu. fa-yumar bi-imsaak al-mawjud wa-tark al-tam fi al-mafqud — keep what you have, stop coveting the lost", 225, "bab wa-naw fa'la — proverb", "GRAMMAR", proverb=True)) track(w("az yagh yilqadi", "lamiqa al-rajul al-samin wa-nahuuhu — man's fat/grease becoming visible", 225, "bab wa-naw fa'la / (f)")) # ─── p.230: MAJOR GRAMMAR — negative imperative across dialects ────── track(w("GRAMMAR: negative imperative — dialect comparison", "MAJOR GRAMMAR: negative command forms across dialects. qifjaaq wa-al-ghuzziyya: at tafr alik = la taqtasimu al-lahm. afkaa alik = la taqsadu al-bayt. hadha al-qiyaas al-mustaqim. illa anna al-turk tukhaalib bi-kaaf al-ghunna fi al-khitaab li-man huwa kabir sin — the correct rule, except Turks use nasalized kaf when addressing elders", 230, "bab wa-naw fa'la — negative imperative grammar", "GRAMMAR")) # ═══════════════════════════════════════════════════════════════════════ print(f"\n{'='*60}") print(f" BATCH 15 COMPLETE: {ok} OK, {fail} FAIL (total {ok+fail})") print(f"{'='*60}")