# Traces of the Suśrutasaṃhitā (2026-11-30)

A "traces" view (after Ben Fry's *Preservation of Favoured Traces*) of how the Nepalese
version of the *Suśrutasaṃhitā* relates to the vulgate (Ācārya 1938).

- `../index.html` + `../traces.json`: the page (https://sushrutaproject2.github.io/traces/). Locally, open it through a web server (it fetches the JSON),
  e.g. `python3 -m http.server` in the `traces` folder, then http://localhost:8000/
- `extract.py`: reads every unit with an `SS.*` xml:id from the eleven
  `provisional-edition_*_new.xml` files (NE) and the eleven `0?-*-vulgate-1938*.xml` files (V).
  Notes, labels, heads, apparatus readings, standOff are left out.
- `titles.py`: adhyāya names from the colophons / opening sentences.
- `align.py`: per adhyāya, letter-by-letter global alignment (edlib) of NE and V after
  orthographic folding, then diff-match-patch semantic cleanup; each word classed as
  kept / altered / added (vulgate) or dropped (Nepalese).

Rebuild (needs `pip install lxml edlib diff-match-patch`). Run all three in this folder:

    python3 extract.py /path/to/Sushrutasamhita_Saktumiva2 units.json
    python3 titles.py                        # writes titles.json
    python3 align.py units.json traces.json
    cp traces.json ../traces.json

Folding (applied to both texts alike): b→v; m→ṃ; ṅ ñ ṇ n before a consonant →ṃ;
s ś ṣ before k c ṭ t p →ḥ; geminate consonants single; ss/śś/ṣṣ single; aḥ→o; ḥ dropped;
avagraha, daṇḍas, digits and editorial "[cf. 1938 ed. …]" references removed;
short parenthesised alternatives in the vulgate removed.

Thresholds: a vulgate word is kept if all its letters align with the Nepalese text,
altered if at least half do, added otherwise; a Nepalese word is dropped if fewer than
half its letters align.

Result on 2026-11-30: 186 adhyāyas; 89,553 NE words, 104,938 V words;
55,163 kept, 13,570 altered, 36,205 added (35% of V), 20,820 dropped (23% of NE).
