From dfea603cec181f95d1fab21631790b27c5844137 Mon Sep 17 00:00:00 2001 From: bharathrao Date: Sat, 31 Jan 2026 17:49:11 -0600 Subject: [PATCH 1/8] feat(wasm): Add nyap pratipadika and taddhitantas support to WASM bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `nyap` field to `PratipadikaArgs` struct to support feminine stems with nyāp pratyayas (ṭāp, ṅīp, etc.) in the WebAssembly API. Add `deriveTaddhitantas` method to support taddhita derivation, allowing proper derivation of stems like damana + matup → damanavat. Example usage: ```javascript // Feminine stems with nyap vidyut.deriveSubantas({ pratipadika: { nyap: 'nadI' }, linga: 'Stri', vibhakti: 'Prathama', vacana: 'Eka', }) // Returns: ['nadI'] // Taddhita derivation vidyut.deriveTaddhitantas({ pratipadika: { basic: 'damana' }, taddhita: 'matup', }) // Returns: ['damanavat'] ``` Co-Authored-By: Claude Opus 4.5 --- vidyut-prakriya/src/wasm.rs | 57 +++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/vidyut-prakriya/src/wasm.rs b/vidyut-prakriya/src/wasm.rs index 5809b25a..fadbf402 100644 --- a/vidyut-prakriya/src/wasm.rs +++ b/vidyut-prakriya/src/wasm.rs @@ -152,6 +152,7 @@ struct KrdantaArgs { #[derive(Serialize, Deserialize)] struct PratipadikaArgs { basic: Option, + nyap: Option, krdanta: Option, } @@ -173,6 +174,12 @@ struct TinantaArgs { pada: Option, } +#[derive(Serialize, Deserialize)] +struct TaddhitantaArgs { + pratipadika: PratipadikaArgs, + taddhita: Taddhita, +} + /// Shorthand for result type pub type Result = std::result::Result; @@ -212,10 +219,17 @@ impl SubantaArgs { let pratipadika = match self.pratipadika { PratipadikaArgs { basic: Some(basic), + nyap: None, krdanta: None, } => Pratipadika::basic(Slp1String::from(basic).expect("ok")), PratipadikaArgs { basic: None, + nyap: Some(nyap), + krdanta: None, + } => Pratipadika::nyap(Slp1String::from(nyap).expect("ok")), + PratipadikaArgs { + basic: None, + nyap: None, krdanta: Some(krt), } => Pratipadika::Krdanta(Box::new(krt.into_rust()?)), // TODO: improve error handling, remove placeholder @@ -245,6 +259,30 @@ impl TinantaArgs { } } +impl TaddhitantaArgs { + fn into_rust(self) -> Result { + let pratipadika = match self.pratipadika { + PratipadikaArgs { + basic: Some(basic), + nyap: None, + krdanta: None, + } => Pratipadika::basic(Slp1String::from(basic).expect("ok")), + PratipadikaArgs { + basic: None, + nyap: Some(nyap), + krdanta: None, + } => Pratipadika::nyap(Slp1String::from(nyap).expect("ok")), + PratipadikaArgs { + basic: None, + nyap: None, + krdanta: Some(krt), + } => Pratipadika::Krdanta(Box::new(krt.into_rust()?)), + _ => Pratipadika::basic(Slp1String::from("doza").expect("ok")), + }; + Ok(Taddhitanta::new(pratipadika, self.taddhita)) + } +} + /// WebAssembly API for vidyut-prakriya. /// /// Within reason, we have tried to mimic a native JavaScript API. At some point, we wish to @@ -343,4 +381,23 @@ impl Vidyut { } } } + + /// Wrapper for `Vyakarana::derive_taddhitantas`. + #[allow(non_snake_case)] + pub fn deriveTaddhitantas(&self, val: JsValue) -> JsValue { + let v = Vyakarana::new(); + let js_args: TaddhitantaArgs = serde_wasm_bindgen::from_value(val).unwrap(); + + match js_args.into_rust() { + Ok(args) => { + let prakriyas = v.derive_taddhitantas(&args); + let web_prakriyas = to_web_prakriyas(&prakriyas); + serde_wasm_bindgen::to_value(&web_prakriyas).expect("wasm") + } + Err(_) => { + error(&format!("[vidyut] Derivation error")); + serde_wasm_bindgen::to_value(&Vec::::new()).expect("wasm") + } + } + } } From 7043fdb87c6e1d53d5f2871449b446345629dbdd Mon Sep 17 00:00:00 2001 From: bharathrao Date: Sat, 31 Jan 2026 18:43:38 -0600 Subject: [PATCH 2/8] Add taddhitanta pratipadika support to WASM API Extends the PratipadikaArgs struct to support taddhitanta type, allowing proper declension of taddhita-derived stems (like -vat/-mat stems from matup). This enables stems like "amavat" (from ama + matup) to decline correctly to "amavAn" for Nom.M.S, following proper Sanskrit grammar rules. Co-Authored-By: Claude Opus 4.5 --- vidyut-prakriya/src/wasm.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/vidyut-prakriya/src/wasm.rs b/vidyut-prakriya/src/wasm.rs index fadbf402..f88b75ee 100644 --- a/vidyut-prakriya/src/wasm.rs +++ b/vidyut-prakriya/src/wasm.rs @@ -154,6 +154,13 @@ struct PratipadikaArgs { basic: Option, nyap: Option, krdanta: Option, + taddhitanta: Option, +} + +#[derive(Serialize, Deserialize)] +struct TaddhitantaArgsInner { + stem: String, + taddhita: Taddhita, } #[derive(Serialize, Deserialize)] @@ -221,17 +228,29 @@ impl SubantaArgs { basic: Some(basic), nyap: None, krdanta: None, + taddhitanta: None, } => Pratipadika::basic(Slp1String::from(basic).expect("ok")), PratipadikaArgs { basic: None, nyap: Some(nyap), krdanta: None, + taddhitanta: None, } => Pratipadika::nyap(Slp1String::from(nyap).expect("ok")), PratipadikaArgs { basic: None, nyap: None, krdanta: Some(krt), + taddhitanta: None, } => Pratipadika::Krdanta(Box::new(krt.into_rust()?)), + PratipadikaArgs { + basic: None, + nyap: None, + krdanta: None, + taddhitanta: Some(tad), + } => { + let base = Pratipadika::basic(Slp1String::from(tad.stem).expect("ok")); + Pratipadika::Taddhitanta(Box::new(Taddhitanta::new(base, tad.taddhita))) + } // TODO: improve error handling, remove placeholder _ => Pratipadika::basic(Slp1String::from("doza").expect("ok")), }; @@ -266,16 +285,19 @@ impl TaddhitantaArgs { basic: Some(basic), nyap: None, krdanta: None, + taddhitanta: None, } => Pratipadika::basic(Slp1String::from(basic).expect("ok")), PratipadikaArgs { basic: None, nyap: Some(nyap), krdanta: None, + taddhitanta: None, } => Pratipadika::nyap(Slp1String::from(nyap).expect("ok")), PratipadikaArgs { basic: None, nyap: None, krdanta: Some(krt), + taddhitanta: None, } => Pratipadika::Krdanta(Box::new(krt.into_rust()?)), _ => Pratipadika::basic(Slp1String::from("doza").expect("ok")), }; From a9c5caa21283bc6088e98055b7827f47094ca2fb Mon Sep 17 00:00:00 2001 From: bharathrao Date: Mon, 2 Feb 2026 20:27:25 -0600 Subject: [PATCH 3/8] Fix han+kvip lengthening --- vidyut-prakriya/src/angasya.rs | 2 +- vidyut-prakriya/tests/integration/kaumudi_11.rs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vidyut-prakriya/src/angasya.rs b/vidyut-prakriya/src/angasya.rs index a3ef7acf..56c8cff6 100644 --- a/vidyut-prakriya/src/angasya.rs +++ b/vidyut-prakriya/src/angasya.rs @@ -1053,7 +1053,7 @@ pub fn run_before_dvitva(p: &mut Prakriya, is_lun: bool, skip_at_agama: bool) -> } } else if n.first().is_san() && anga.has_u("tanu~^") { p.optional_run_at("6.4.17", i_anga, |t| t.set_upadha("A")); - } else if anga.has_antya(ANUNASIKA) && (n.first().is(K::kvip) || jhal_knit()) { + } else if anga.has_antya(ANUNASIKA) && !n.first().is(K::kvip) && jhal_knit() { if (anga.has_text("kzam") && n.last().has_lakara(Lit) && n.last().is_atmanepada()) || (anga.has_u("Dana~") && n.last().is_tin()) { diff --git a/vidyut-prakriya/tests/integration/kaumudi_11.rs b/vidyut-prakriya/tests/integration/kaumudi_11.rs index b2032719..703ed7c4 100644 --- a/vidyut-prakriya/tests/integration/kaumudi_11.rs +++ b/vidyut-prakriya/tests/integration/kaumudi_11.rs @@ -241,6 +241,12 @@ fn skip_sk_358() {} #[test] fn skip_sk_360() {} +#[test] +fn kvip_han_stem() { + let han = create_krdanta("han", &[], &d("ha\\na~", Adadi), Krt::kvip); + assert_has_sup_ss(&han, Pum, &["han"]); +} + #[ignore] #[test] fn sk_361() { From 43d56849ebddb767b6474bf59e791e07c5ee8344 Mon Sep 17 00:00:00 2001 From: bharathrao Date: Tue, 3 Feb 2026 13:44:07 -0600 Subject: [PATCH 4/8] Limit 6.4.15 exception to han --- vidyut-prakriya/src/angasya.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vidyut-prakriya/src/angasya.rs b/vidyut-prakriya/src/angasya.rs index 56c8cff6..27a0f22c 100644 --- a/vidyut-prakriya/src/angasya.rs +++ b/vidyut-prakriya/src/angasya.rs @@ -1053,7 +1053,10 @@ pub fn run_before_dvitva(p: &mut Prakriya, is_lun: bool, skip_at_agama: bool) -> } } else if n.first().is_san() && anga.has_u("tanu~^") { p.optional_run_at("6.4.17", i_anga, |t| t.set_upadha("A")); - } else if anga.has_antya(ANUNASIKA) && !n.first().is(K::kvip) && jhal_knit() { + } else if anga.has_antya(ANUNASIKA) + && (n.first().is(K::kvip) || jhal_knit()) + && !anga.has_text("han") + { if (anga.has_text("kzam") && n.last().has_lakara(Lit) && n.last().is_atmanepada()) || (anga.has_u("Dana~") && n.last().is_tin()) { From 936bde4df2888c247f85219ab04d86d0078e0408 Mon Sep 17 00:00:00 2001 From: bharathrao Date: Tue, 3 Feb 2026 16:16:00 -0600 Subject: [PATCH 5/8] Handle mat -> man vocative --- vidyut-prakriya/src/tripadi/pada_8_2.rs | 13 +++++++++++++ vidyut-prakriya/tests/integration/kaumudi_11.rs | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/vidyut-prakriya/src/tripadi/pada_8_2.rs b/vidyut-prakriya/src/tripadi/pada_8_2.rs index 11cf1188..865d6462 100644 --- a/vidyut-prakriya/src/tripadi/pada_8_2.rs +++ b/vidyut-prakriya/src/tripadi/pada_8_2.rs @@ -315,6 +315,19 @@ fn try_lopa_of_samyoganta_and_s(p: &mut Prakriya) { iter_terms(p, |p, i| { if p.is_pada(i) && p.has(i, |t| !t.is_empty()) { loop { + let ends_with_mat = p.view(0, i)?.text().ends_with("mat"); + if p.has_tag(PT::Sambodhana) && p.has_tag(PT::Ekavacana) { + if ends_with_mat { + // mAmat -> mAman (vocative singular) + p.run_at("8.2.23", i, |t| { + if t.has_text("at") { + t.set_text("an"); + } else { + t.find_and_replace_text("mat", "man"); + } + }); + } + } let view = p.view(0, i)?; if view .last() diff --git a/vidyut-prakriya/tests/integration/kaumudi_11.rs b/vidyut-prakriya/tests/integration/kaumudi_11.rs index 703ed7c4..0e0f8507 100644 --- a/vidyut-prakriya/tests/integration/kaumudi_11.rs +++ b/vidyut-prakriya/tests/integration/kaumudi_11.rs @@ -3,7 +3,7 @@ use test_utils::*; use vidyut_prakriya::args::Gana::*; use vidyut_prakriya::args::Lakara::*; use vidyut_prakriya::args::Linga::*; -use vidyut_prakriya::args::{BaseKrt as Krt, Gana}; +use vidyut_prakriya::args::{BaseKrt as Krt, Gana, Sanadi}; #[test] fn sk_324() { @@ -247,6 +247,13 @@ fn kvip_han_stem() { assert_has_sup_ss(&han, Pum, &["han"]); } +#[test] +fn satf_yanluk_mat_voc() { + let ma = d("mA\\", Adadi).with_sanadi(&[Sanadi::yaNluk]); + let mamat = krdanta(&[], &ma, Krt::Satf); + assert_has_sup_ss(&mamat, Pum, &["mAman"]); +} + #[ignore] #[test] fn sk_361() { From a265515eff41e7d76879b821864cc04e40605f86 Mon Sep 17 00:00:00 2001 From: bharathrao Date: Tue, 3 Feb 2026 16:21:52 -0600 Subject: [PATCH 6/8] Handle hat -> han vocative --- vidyut-prakriya/src/tripadi/pada_8_2.rs | 10 ++++++---- vidyut-prakriya/tests/integration/kaumudi_11.rs | 7 +++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/vidyut-prakriya/src/tripadi/pada_8_2.rs b/vidyut-prakriya/src/tripadi/pada_8_2.rs index 865d6462..b77f7f4f 100644 --- a/vidyut-prakriya/src/tripadi/pada_8_2.rs +++ b/vidyut-prakriya/src/tripadi/pada_8_2.rs @@ -315,14 +315,16 @@ fn try_lopa_of_samyoganta_and_s(p: &mut Prakriya) { iter_terms(p, |p, i| { if p.is_pada(i) && p.has(i, |t| !t.is_empty()) { loop { - let ends_with_mat = p.view(0, i)?.text().ends_with("mat"); + let text = p.view(0, i)?.text().to_string(); + let ends_with_mat = text.ends_with("mat"); + let ends_with_hat = text.ends_with("hat"); if p.has_tag(PT::Sambodhana) && p.has_tag(PT::Ekavacana) { - if ends_with_mat { - // mAmat -> mAman (vocative singular) + if ends_with_mat || ends_with_hat { + // mAmat -> mAman, mAmahat -> mAmahan (vocative singular) p.run_at("8.2.23", i, |t| { if t.has_text("at") { t.set_text("an"); - } else { + } else if ends_with_mat { t.find_and_replace_text("mat", "man"); } }); diff --git a/vidyut-prakriya/tests/integration/kaumudi_11.rs b/vidyut-prakriya/tests/integration/kaumudi_11.rs index 0e0f8507..3ab5f40c 100644 --- a/vidyut-prakriya/tests/integration/kaumudi_11.rs +++ b/vidyut-prakriya/tests/integration/kaumudi_11.rs @@ -254,6 +254,13 @@ fn satf_yanluk_mat_voc() { assert_has_sup_ss(&mamat, Pum, &["mAman"]); } +#[test] +fn satf_yanluk_hat_voc() { + let mah = d("ma\\ha~", Bhvadi).with_sanadi(&[Sanadi::yaNluk]); + let mamahat = krdanta(&[], &mah, Krt::Satf); + assert_has_sup_ss(&mamahat, Pum, &["mAmahan"]); +} + #[ignore] #[test] fn sk_361() { From f59f2bcf3a135a45b2fcb095f5164a2e0d2c679e Mon Sep 17 00:00:00 2001 From: bharathrao Date: Sat, 14 Feb 2026 19:43:42 -0600 Subject: [PATCH 7/8] Note varttika for han 6.4.15 exception --- vidyut-prakriya/src/angasya.rs | 12 +++++++----- vidyut-prakriya/tests/integration/regressions.rs | 11 +++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/vidyut-prakriya/src/angasya.rs b/vidyut-prakriya/src/angasya.rs index 27a0f22c..98fffb7a 100644 --- a/vidyut-prakriya/src/angasya.rs +++ b/vidyut-prakriya/src/angasya.rs @@ -1053,11 +1053,13 @@ pub fn run_before_dvitva(p: &mut Prakriya, is_lun: bool, skip_at_agama: bool) -> } } else if n.first().is_san() && anga.has_u("tanu~^") { p.optional_run_at("6.4.17", i_anga, |t| t.set_upadha("A")); - } else if anga.has_antya(ANUNASIKA) - && (n.first().is(K::kvip) || jhal_knit()) - && !anga.has_text("han") - { - if (anga.has_text("kzam") && n.last().has_lakara(Lit) && n.last().is_atmanepada()) + } else if anga.has_antya(ANUNASIKA) && (n.first().is(K::kvip) || jhal_knit()) { + if anga.has_text("han") { + // Varttika: block 6.4.15 dirgha for `han` (e.g. AN + han + kvip -> Ahan). + p.step(Varttika("6.4.15.1")); + } else if (anga.has_text("kzam") + && n.last().has_lakara(Lit) + && n.last().is_atmanepada()) || (anga.has_u("Dana~") && n.last().is_tin()) { // TODO: log samjna-purvaka-vidhir anityaH diff --git a/vidyut-prakriya/tests/integration/regressions.rs b/vidyut-prakriya/tests/integration/regressions.rs index 3e3b3b33..9e21a891 100644 --- a/vidyut-prakriya/tests/integration/regressions.rs +++ b/vidyut-prakriya/tests/integration/regressions.rs @@ -492,3 +492,14 @@ fn eka_dvi_as_sarvanama() { assert_has_sup_2p("tri", Napumsaka, &["trIRi"]); assert_has_sup_1p("tri", Napumsaka, &["trIRi"]); } + +// AN + han + kvip +// +// 6.4.15 would normally lengthen the upadha of an anunasika-final dhatu. +// But per varttika (modeled as 6.4.15.1 in the implementation), `han` is +// exempt here, so we expect Ahan (not AhAn). +#[test] +fn aa_han_kvip_dirgha() { + let han = d("ha\\na~", Adadi); + assert_has_krdanta(&["AN"], &han, Krt::kvip, &["Ahan"]); +} From 742097e920f3e8cb446195aec7c84dfb7fa475b7 Mon Sep 17 00:00:00 2001 From: bharathrao Date: Sun, 15 Feb 2026 13:34:51 -0600 Subject: [PATCH 8/8] Add enclitic outputs for asmad/yuzmad declensions --- vidyut-prakriya/src/angasya/subanta.rs | 64 +++++++++++++++++++ .../tests/integration/kashika_6_1.rs | 8 +-- .../tests/integration/kashika_7_1.rs | 35 +++++++--- .../tests/integration/kashika_7_2.rs | 32 +++++----- .../tests/integration/kaumudi_11.rs | 28 ++++---- 5 files changed, 125 insertions(+), 42 deletions(-) diff --git a/vidyut-prakriya/src/angasya/subanta.rs b/vidyut-prakriya/src/angasya/subanta.rs index aa7099cb..106b9897 100644 --- a/vidyut-prakriya/src/angasya/subanta.rs +++ b/vidyut-prakriya/src/angasya/subanta.rs @@ -558,6 +558,8 @@ fn try_anga_adesha_after_vibhakti_changes(p: &mut Prakriya) -> Option<()> { } if anga.has_text_in(&["yuzmad", "asmad"]) { + let is_asmad = anga.has_text("asmad"); + let is_yuzmad = anga.has_text("yuzmad"); let anadesha = !sup.last().has_tag(T::Adesha); if sup.has_adi(AC) && anadesha { @@ -612,6 +614,68 @@ fn try_anga_adesha_after_vibhakti_changes(p: &mut Prakriya) -> Option<()> { t.find_and_replace_text("asm", "ma"); }); } + + // Enclitic variants for dative/genitive pronouns. + let (i_sup_start, i_sup_end, is_v4, is_v6, is_ekavacana, is_dvivacana, is_bahuvacana) = { + let sup_view = p.pratyaya(i_sup)?; + let sup = sup_view.last(); + ( + sup_view.start(), + sup_view.end(), + sup.has_tag(T::V4), + sup.has_tag(T::V6), + sup.has_tag(T::Ekavacana), + sup.has_tag(T::Dvivacana), + sup.has_tag(T::Bahuvacana), + ) + }; + let is_dative_or_genitive = is_v4 || is_v6; + + let set_sup_text = |p: &mut Prakriya, text: &str| { + if text.is_empty() { + p.set(i_sup_start, op::luk); + } else { + p.set(i_sup_start, |t| t.set_text(text)); + } + for j in (i_sup_start + 1)..=i_sup_end { + p.set(j, op::luk); + } + }; + + if is_dative_or_genitive { + if is_ekavacana { + p.optional_run(Varttika("7.2.95.1"), |p| { + if is_asmad { + p.set(i, op::text("me")); + } else if is_yuzmad { + p.set(i, op::text("te")); + } + if is_v6 { + set_sup_text(p, "s"); + } else { + set_sup_text(p, ""); + } + }); + } else if is_dvivacana { + p.optional_run(Varttika("7.2.95.2"), |p| { + if is_asmad { + p.set(i, op::text("nO")); + } else if is_yuzmad { + p.set(i, op::text("vAm")); + } + set_sup_text(p, ""); + }); + } else if is_bahuvacana { + p.optional_run(Varttika("7.2.95.3"), |p| { + if is_asmad { + p.set(i, op::text("naH")); + } else if is_yuzmad { + p.set(i, op::text("vaH")); + } + set_sup_text(p, ""); + }); + } + } } else if anga.has_u("idam") && anga.has_antya('a') { if sup.last().has_tag_in(&[T::V1, T::V2]) { // imam diff --git a/vidyut-prakriya/tests/integration/kashika_6_1.rs b/vidyut-prakriya/tests/integration/kashika_6_1.rs index 6675cd05..3f65886b 100644 --- a/vidyut-prakriya/tests/integration/kashika_6_1.rs +++ b/vidyut-prakriya/tests/integration/kashika_6_1.rs @@ -1291,15 +1291,15 @@ fn sutra_6_1_199() { #[test] fn sutra_6_1_211() { let s = get_tester(); - s.assert_has_sup_6s("yuzmad", Pum, &["ta/va"]); - s.assert_has_sup_6s("asmad", Pum, &["ma/ma"]); + s.assert_has_sup_6s("yuzmad", Pum, &["ta/va", "te/"]); + s.assert_has_sup_6s("asmad", Pum, &["ma/ma", "me/"]); } #[test] fn sutra_6_1_212() { let s = get_tester(); - s.assert_has_sup_4s("yuzmad", Pum, &["tu/Byam"]); - s.assert_has_sup_4s("asmad", Pum, &["ma/hyam"]); + s.assert_has_sup_4s("yuzmad", Pum, &["tu/Byam", "te/"]); + s.assert_has_sup_4s("asmad", Pum, &["ma/hyam", "me/"]); } #[test] diff --git a/vidyut-prakriya/tests/integration/kashika_7_1.rs b/vidyut-prakriya/tests/integration/kashika_7_1.rs index 442ae973..55dc03ca 100644 --- a/vidyut-prakriya/tests/integration/kashika_7_1.rs +++ b/vidyut-prakriya/tests/integration/kashika_7_1.rs @@ -296,14 +296,14 @@ fn sutra_7_1_25() { #[test] fn sutra_7_1_27() { - assert_has_sup_6s("asmad", Pum, &["mama"]); - assert_has_sup_6s("yuzmad", Pum, &["tava"]); + assert_has_sup_6s("asmad", Pum, &["mama", "me"]); + assert_has_sup_6s("yuzmad", Pum, &["tava", "te"]); } #[test] fn sutra_7_1_28() { - assert_has_sup_4s("asmad", Pum, &["mahyam"]); - assert_has_sup_4s("yuzmad", Pum, &["tuByam"]); + assert_has_sup_4s("asmad", Pum, &["mahyam", "me"]); + assert_has_sup_4s("yuzmad", Pum, &["tuByam", "te"]); assert_has_sup_1s("yuzmad", Pum, &["tvam"]); assert_has_sup_1s("asmad", Pum, &["aham"]); @@ -325,8 +325,8 @@ fn sutra_7_1_29() { #[test] fn sutra_7_1_30() { - assert_has_sup_4p("asmad", Pum, &["asmaByam"]); - assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam"]); + assert_has_sup_4p("asmad", Pum, &["asmaByam", "naH"]); + assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam", "vaH"]); } #[test] @@ -343,8 +343,27 @@ fn sutra_7_1_32() { #[test] fn sutra_7_1_33() { - assert_has_sup_6p("asmad", Pum, &["asmAkam"]); - assert_has_sup_6p("yuzmad", Pum, &["yuzmAkam"]); + assert_has_sup_6p("asmad", Pum, &["asmAkam", "naH"]); + assert_has_sup_6p("yuzmad", Pum, &["yuzmAkam", "vaH"]); +} + +#[test] +fn pronoun_enclitics() { + // Enclitic variants for asmad/yuzmad in dative+genitive slots. + assert_has_sup_4s("asmad", Pum, &["mahyam", "me"]); + assert_has_sup_4s("yuzmad", Pum, &["tuByam", "te"]); + assert_has_sup_6s("asmad", Pum, &["mama", "me"]); + assert_has_sup_6s("yuzmad", Pum, &["tava", "te"]); + + assert_has_sup_4d("asmad", Pum, &["AvAByAm", "nO"]); + assert_has_sup_4d("yuzmad", Pum, &["yuvAByAm", "vAm"]); + assert_has_sup_6d("asmad", Pum, &["AvayoH", "nO"]); + assert_has_sup_6d("yuzmad", Pum, &["yuvayoH", "vAm"]); + + assert_has_sup_4p("asmad", Pum, &["asmaByam", "naH"]); + assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam", "vaH"]); + assert_has_sup_6p("asmad", Pum, &["asmAkam", "naH"]); + assert_has_sup_6p("yuzmad", Pum, &["yuzmAkam", "vaH"]); } #[test] diff --git a/vidyut-prakriya/tests/integration/kashika_7_2.rs b/vidyut-prakriya/tests/integration/kashika_7_2.rs index 7a6aec8e..be3f0aa1 100644 --- a/vidyut-prakriya/tests/integration/kashika_7_2.rs +++ b/vidyut-prakriya/tests/integration/kashika_7_2.rs @@ -1484,8 +1484,8 @@ fn sutra_7_2_88() { assert_has_sup_1d("yuzmad", Pum, &["yuvAm"]); assert_has_sup_1d("asmad", Pum, &["AvAm"]); - assert_has_sup_6d("yuzmad", Pum, &["yuvayoH"]); - assert_has_sup_6d("asmad", Pum, &["AvayoH"]); + assert_has_sup_6d("yuzmad", Pum, &["yuvayoH", "vAm"]); + assert_has_sup_6d("asmad", Pum, &["AvayoH", "nO"]); assert_has_sup_1s("yuzmad", Pum, &["tvam"]); assert_has_sup_1s("asmad", Pum, &["aham"]); assert_has_sup_1p("yuzmad", Pum, &["yUyam"]); @@ -1514,18 +1514,18 @@ fn sutra_7_2_90() { assert_has_sup_1s("asmad", Pum, &["aham"]); assert_has_sup_1p("yuzmad", Pum, &["yUyam"]); assert_has_sup_1p("asmad", Pum, &["vayam"]); - assert_has_sup_4s("yuzmad", Pum, &["tuByam"]); - assert_has_sup_4s("asmad", Pum, &["mahyam"]); - assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam"]); - assert_has_sup_4p("asmad", Pum, &["asmaByam"]); + assert_has_sup_4s("yuzmad", Pum, &["tuByam", "te"]); + assert_has_sup_4s("asmad", Pum, &["mahyam", "me"]); + assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam", "vaH"]); + assert_has_sup_4p("asmad", Pum, &["asmaByam", "naH"]); assert_has_sup_5s("yuzmad", Pum, &["tvat"]); assert_has_sup_5s("asmad", Pum, &["mat"]); assert_has_sup_5p("yuzmad", Pum, &["yuzmat"]); assert_has_sup_5p("asmad", Pum, &["asmat"]); - assert_has_sup_6s("yuzmad", Pum, &["tava"]); - assert_has_sup_6s("asmad", Pum, &["mama"]); - assert_has_sup_6p("yuzmad", Pum, &["yuzmAkam"]); - assert_has_sup_6p("asmad", Pum, &["asmAkam"]); + assert_has_sup_6s("yuzmad", Pum, &["tava", "te"]); + assert_has_sup_6s("asmad", Pum, &["mama", "me"]); + assert_has_sup_6p("yuzmad", Pum, &["yuzmAkam", "vaH"]); + assert_has_sup_6p("asmad", Pum, &["asmAkam", "naH"]); } #[test] @@ -1534,8 +1534,8 @@ fn sutra_7_2_92() { assert_has_sup_1d("asmad", Pum, &["AvAm"]); assert_has_sup_3d("yuzmad", Pum, &["yuvAByAm"]); assert_has_sup_3d("asmad", Pum, &["AvAByAm"]); - assert_has_sup_6d("yuzmad", Pum, &["yuvayoH"]); - assert_has_sup_6d("asmad", Pum, &["AvayoH"]); + assert_has_sup_6d("yuzmad", Pum, &["yuvayoH", "vAm"]); + assert_has_sup_6d("asmad", Pum, &["AvayoH", "nO"]); // TODO: others } @@ -1555,15 +1555,15 @@ fn sutra_7_2_94() { #[test] fn sutra_7_2_95() { - assert_has_sup_4s("yuzmad", Pum, &["tuByam"]); - assert_has_sup_4s("asmad", Pum, &["mahyam"]); + assert_has_sup_4s("yuzmad", Pum, &["tuByam", "te"]); + assert_has_sup_4s("asmad", Pum, &["mahyam", "me"]); // TODO: others } #[test] fn sutra_7_2_96() { - assert_has_sup_6s("yuzmad", Pum, &["tava"]); - assert_has_sup_6s("asmad", Pum, &["mama"]); + assert_has_sup_6s("yuzmad", Pum, &["tava", "te"]); + assert_has_sup_6s("asmad", Pum, &["mama", "me"]); // TODO: others } diff --git a/vidyut-prakriya/tests/integration/kaumudi_11.rs b/vidyut-prakriya/tests/integration/kaumudi_11.rs index 3ab5f40c..b465e698 100644 --- a/vidyut-prakriya/tests/integration/kaumudi_11.rs +++ b/vidyut-prakriya/tests/integration/kaumudi_11.rs @@ -411,22 +411,22 @@ fn sk_393() { #[test] fn sk_394() { - assert_has_sup_4s("yuzmad", Pum, &["tuByam"]); - assert_has_sup_4s("asmad", Pum, &["mahyam"]); + assert_has_sup_4s("yuzmad", Pum, &["tuByam", "te"]); + assert_has_sup_4s("asmad", Pum, &["mahyam", "me"]); - assert_has_sup_4s(karmadharaya("parama", "yuzmad"), Pum, &["paramatuByam"]); - assert_has_sup_4s(karmadharaya("parama", "asmad"), Pum, &["paramamahyam"]); - assert_has_sup_4s(karmadharaya("ati", "yuzmad"), Pum, &["atituByam"]); - assert_has_sup_4s(karmadharaya("ati", "asmad"), Pum, &["atimahyam"]); + assert_has_sup_4s(karmadharaya("parama", "yuzmad"), Pum, &["paramatuByam", "paramate"]); + assert_has_sup_4s(karmadharaya("parama", "asmad"), Pum, &["paramamahyam", "paramame"]); + assert_has_sup_4s(karmadharaya("ati", "yuzmad"), Pum, &["atituByam", "atite"]); + assert_has_sup_4s(karmadharaya("ati", "asmad"), Pum, &["atimahyam", "atime"]); - assert_has_sup_4d("yuzmad", Pum, &["yuvAByAm"]); - assert_has_sup_4d("asmad", Pum, &["AvAByAm"]); + assert_has_sup_4d("yuzmad", Pum, &["yuvAByAm", "vAm"]); + assert_has_sup_4d("asmad", Pum, &["AvAByAm", "nO"]); } #[test] fn sk_395() { - assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam"]); - assert_has_sup_4p("asmad", Pum, &["asmaByam"]); + assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam", "vaH"]); + assert_has_sup_4p("asmad", Pum, &["asmaByam", "naH"]); } #[test] @@ -448,10 +448,10 @@ fn skip_sk_398() {} #[test] fn sk_399() { - assert_has_sup_6s("yuzmad", Pum, &["tava"]); - assert_has_sup_6s("asmad", Pum, &["mama"]); - assert_has_sup_6d("yuzmad", Pum, &["yuvayoH"]); - assert_has_sup_6d("asmad", Pum, &["AvayoH"]); + assert_has_sup_6s("yuzmad", Pum, &["tava", "te"]); + assert_has_sup_6s("asmad", Pum, &["mama", "me"]); + assert_has_sup_6d("yuzmad", Pum, &["yuvayoH", "vAm"]); + assert_has_sup_6d("asmad", Pum, &["AvayoH", "nO"]); } #[test]