From d1a03e25bc35ee1a2b557328e94cb308ade89b74 Mon Sep 17 00:00:00 2001 From: Arun Prasad Date: Tue, 10 Oct 2023 20:44:33 -0700 Subject: [PATCH] [prakriya] Add various Siddhanta Kaumudi tests These tests focus on prakaranas 43 to 52, which describe the ten dhatu gana. Much more work is necessary, but this is a substantial start, and it has already uncovered many errors that this commit fixes. --- vidyut-prakriya/Makefile | 14 +- vidyut-prakriya/data/dhatupatha.tsv | 8 +- .../scripts/check_rule_coverage.py | 9 + vidyut-prakriya/src/ac_sandhi.rs | 24 +- vidyut-prakriya/src/angasya.rs | 130 +- vidyut-prakriya/src/angasya/abhyasasya.rs | 22 +- vidyut-prakriya/src/angasya/asiddhavat.rs | 123 +- vidyut-prakriya/src/angasya/guna_vrddhi.rs | 37 +- vidyut-prakriya/src/ardhadhatuka.rs | 3 +- vidyut-prakriya/src/args.rs | 9 + vidyut-prakriya/src/args/krt.rs | 52 +- vidyut-prakriya/src/args/taddhita.rs | 53 +- vidyut-prakriya/src/ashtadhyayi.rs | 44 +- vidyut-prakriya/src/atidesha.rs | 16 +- vidyut-prakriya/src/atmanepada.rs | 3 +- vidyut-prakriya/src/dhatu_gana.rs | 2 + vidyut-prakriya/src/dhatu_karya.rs | 6 +- vidyut-prakriya/src/it_agama.rs | 758 ++- vidyut-prakriya/src/iterators.rs | 22 - vidyut-prakriya/src/krt/basic.rs | 1031 ++-- vidyut-prakriya/src/krt/unadi_sutras.rs | 128 +- vidyut-prakriya/src/krt/utils.rs | 135 +- vidyut-prakriya/src/lib.rs | 1 + vidyut-prakriya/src/misc.rs | 31 + vidyut-prakriya/src/operators.rs | 4 +- vidyut-prakriya/src/prakriya.rs | 5 + vidyut-prakriya/src/samprasarana.rs | 2 - vidyut-prakriya/src/sanadi.rs | 38 +- vidyut-prakriya/src/taddhita/gana.rs | 65 + .../src/taddhita/matvartha_prakarana.rs | 2 +- .../taddhita/nan_snan_adhikara_prakarana.rs | 2 +- .../src/taddhita/panchami_prakarana.rs | 2 +- vidyut-prakriya/src/taddhita/pragdivyatiya.rs | 2 +- vidyut-prakriya/src/taddhita/pragghitiya.rs | 2 +- vidyut-prakriya/src/taddhita/pragiviya.rs | 61 +- vidyut-prakriya/src/taddhita/pragvahatiya.rs | 2 +- vidyut-prakriya/src/taddhita/pragvatiya.rs | 2 +- vidyut-prakriya/src/taddhita/prakkritiya.rs | 2 +- .../src/taddhita/svarthika_prakarana.rs | 107 +- vidyut-prakriya/src/taddhita/utils.rs | 27 +- vidyut-prakriya/src/tag.rs | 2 + vidyut-prakriya/src/term.rs | 145 +- vidyut-prakriya/src/tripadi/pada_8_2.rs | 17 +- vidyut-prakriya/src/tripadi/pada_8_3.rs | 567 +- vidyut-prakriya/src/tripadi/pada_8_4.rs | 67 +- vidyut-prakriya/src/uttarapade.rs | 41 +- vidyut-prakriya/src/vikarana.rs | 32 +- vidyut-prakriya/test_utils/src/lib.rs | 180 +- .../tests/{pada_1_1.rs => kashika_1_1.rs} | 0 .../tests/{pada_1_2.rs => kashika_1_2.rs} | 21 +- .../tests/{pada_1_3.rs => kashika_1_3.rs} | 14 +- .../tests/{pada_1_4.rs => kashika_1_4.rs} | 0 .../tests/{pada_2_3.rs => kashika_2_3.rs} | 0 .../tests/{pada_2_4.rs => kashika_2_4.rs} | 25 +- .../tests/{pada_3_1.rs => kashika_3_1.rs} | 196 +- .../tests/{pada_3_2.rs => kashika_3_2.rs} | 1 - vidyut-prakriya/tests/kashika_3_3.rs | 632 +++ .../tests/{pada_3_4.rs => kashika_3_4.rs} | 0 .../tests/{pada_4_1.rs => kashika_4_1.rs} | 4 +- .../tests/{pada_4_2.rs => kashika_4_2.rs} | 6 +- .../tests/{pada_4_3.rs => kashika_4_3.rs} | 8 +- .../tests/{pada_4_4.rs => kashika_4_4.rs} | 4 +- .../tests/{pada_5_1.rs => kashika_5_1.rs} | 6 +- .../tests/{pada_5_2.rs => kashika_5_2.rs} | 2 +- .../tests/{pada_5_3.rs => kashika_5_3.rs} | 2 +- .../tests/{pada_5_4.rs => kashika_5_4.rs} | 28 + .../tests/{pada_6_1.rs => kashika_6_1.rs} | 11 +- .../tests/{pada_6_3.rs => kashika_6_3.rs} | 28 +- .../tests/{pada_6_4.rs => kashika_6_4.rs} | 137 +- .../tests/{pada_7_1.rs => kashika_7_1.rs} | 0 .../tests/{pada_7_2.rs => kashika_7_2.rs} | 4 +- .../tests/{pada_7_3.rs => kashika_7_3.rs} | 4 +- .../tests/{pada_7_4.rs => kashika_7_4.rs} | 41 +- .../tests/{pada_8_2.rs => kashika_8_2.rs} | 28 +- .../tests/{pada_8_3.rs => kashika_8_3.rs} | 57 +- .../tests/{pada_8_4.rs => kashika_8_4.rs} | 0 vidyut-prakriya/tests/kaumudi_11.rs | 183 + vidyut-prakriya/tests/kaumudi_43.rs | 4572 +++++++++++++++++ vidyut-prakriya/tests/kaumudi_44.rs | 977 ++++ vidyut-prakriya/tests/kaumudi_45.rs | 326 ++ vidyut-prakriya/tests/kaumudi_46.rs | 607 +++ vidyut-prakriya/tests/kaumudi_47.rs | 259 + vidyut-prakriya/tests/kaumudi_48.rs | 589 +++ vidyut-prakriya/tests/kaumudi_49.rs | 193 + vidyut-prakriya/tests/kaumudi_50.rs | 110 + vidyut-prakriya/tests/kaumudi_51.rs | 315 ++ vidyut-prakriya/tests/kaumudi_52.rs | 74 + vidyut-prakriya/tests/kaumudi_53.rs | 72 + vidyut-prakriya/tests/kaumudi_54.rs | 168 + vidyut-prakriya/tests/kaumudi_55.rs | 239 + vidyut-prakriya/tests/kaumudi_60.rs | 45 + vidyut-prakriya/tests/kaumudi_62.rs | 212 + .../tests/{unadi_sutras.rs => kaumudi_67.rs} | 84 +- vidyut-prakriya/tests/kaumudi_8.rs | 360 ++ vidyut-prakriya/tests/kaumudi_9.rs | 48 + vidyut-prakriya/tests/pada_3_3.rs | 159 - vidyut-prakriya/tests/regressions.rs | 63 - 97 files changed, 13108 insertions(+), 1843 deletions(-) create mode 100644 vidyut-prakriya/src/misc.rs rename vidyut-prakriya/tests/{pada_1_1.rs => kashika_1_1.rs} (100%) rename vidyut-prakriya/tests/{pada_1_2.rs => kashika_1_2.rs} (97%) rename vidyut-prakriya/tests/{pada_1_3.rs => kashika_1_3.rs} (97%) rename vidyut-prakriya/tests/{pada_1_4.rs => kashika_1_4.rs} (100%) rename vidyut-prakriya/tests/{pada_2_3.rs => kashika_2_3.rs} (100%) rename vidyut-prakriya/tests/{pada_2_4.rs => kashika_2_4.rs} (93%) rename vidyut-prakriya/tests/{pada_3_1.rs => kashika_3_1.rs} (79%) rename vidyut-prakriya/tests/{pada_3_2.rs => kashika_3_2.rs} (99%) create mode 100644 vidyut-prakriya/tests/kashika_3_3.rs rename vidyut-prakriya/tests/{pada_3_4.rs => kashika_3_4.rs} (100%) rename vidyut-prakriya/tests/{pada_4_1.rs => kashika_4_1.rs} (99%) rename vidyut-prakriya/tests/{pada_4_2.rs => kashika_4_2.rs} (98%) rename vidyut-prakriya/tests/{pada_4_3.rs => kashika_4_3.rs} (98%) rename vidyut-prakriya/tests/{pada_4_4.rs => kashika_4_4.rs} (99%) rename vidyut-prakriya/tests/{pada_5_1.rs => kashika_5_1.rs} (96%) rename vidyut-prakriya/tests/{pada_5_2.rs => kashika_5_2.rs} (98%) rename vidyut-prakriya/tests/{pada_5_3.rs => kashika_5_3.rs} (99%) rename vidyut-prakriya/tests/{pada_5_4.rs => kashika_5_4.rs} (76%) rename vidyut-prakriya/tests/{pada_6_1.rs => kashika_6_1.rs} (99%) rename vidyut-prakriya/tests/{pada_6_3.rs => kashika_6_3.rs} (79%) rename vidyut-prakriya/tests/{pada_6_4.rs => kashika_6_4.rs} (93%) rename vidyut-prakriya/tests/{pada_7_1.rs => kashika_7_1.rs} (100%) rename vidyut-prakriya/tests/{pada_7_2.rs => kashika_7_2.rs} (99%) rename vidyut-prakriya/tests/{pada_7_3.rs => kashika_7_3.rs} (99%) rename vidyut-prakriya/tests/{pada_7_4.rs => kashika_7_4.rs} (96%) rename vidyut-prakriya/tests/{pada_8_2.rs => kashika_8_2.rs} (96%) rename vidyut-prakriya/tests/{pada_8_3.rs => kashika_8_3.rs} (92%) rename vidyut-prakriya/tests/{pada_8_4.rs => kashika_8_4.rs} (100%) create mode 100644 vidyut-prakriya/tests/kaumudi_11.rs create mode 100644 vidyut-prakriya/tests/kaumudi_43.rs create mode 100644 vidyut-prakriya/tests/kaumudi_44.rs create mode 100644 vidyut-prakriya/tests/kaumudi_45.rs create mode 100644 vidyut-prakriya/tests/kaumudi_46.rs create mode 100644 vidyut-prakriya/tests/kaumudi_47.rs create mode 100644 vidyut-prakriya/tests/kaumudi_48.rs create mode 100644 vidyut-prakriya/tests/kaumudi_49.rs create mode 100644 vidyut-prakriya/tests/kaumudi_50.rs create mode 100644 vidyut-prakriya/tests/kaumudi_51.rs create mode 100644 vidyut-prakriya/tests/kaumudi_52.rs create mode 100644 vidyut-prakriya/tests/kaumudi_53.rs create mode 100644 vidyut-prakriya/tests/kaumudi_54.rs create mode 100644 vidyut-prakriya/tests/kaumudi_55.rs create mode 100644 vidyut-prakriya/tests/kaumudi_60.rs create mode 100644 vidyut-prakriya/tests/kaumudi_62.rs rename vidyut-prakriya/tests/{unadi_sutras.rs => kaumudi_67.rs} (85%) create mode 100644 vidyut-prakriya/tests/kaumudi_8.rs create mode 100644 vidyut-prakriya/tests/kaumudi_9.rs delete mode 100644 vidyut-prakriya/tests/pada_3_3.rs delete mode 100644 vidyut-prakriya/tests/regressions.rs diff --git a/vidyut-prakriya/Makefile b/vidyut-prakriya/Makefile index a67a88a..df0bac6 100644 --- a/vidyut-prakriya/Makefile +++ b/vidyut-prakriya/Makefile @@ -53,28 +53,28 @@ test_tinantas: cargo build --release ../target/release/test_tinantas \ --test-cases test-files/tinantas-basic-kartari.csv \ - --hash "cd93ffe7ac09925f21a26e23524e8a03aebffc2b1809c5480f4d3e70d7380281" + --hash "f8934f99631e811c333c41ddd4925229d2faab0dd875bc549bb38350319706db" ../target/release/test_tinantas \ --test-cases test-files/tinantas-nic-kartari.csv \ - --hash "409c5efa5dbcebba7375732a64867f7212ee43d3b112c8c8c494099158e68a0a" + --hash "5e173e6665872f205f8c6ca2addc166e221f0d435b800dee4360116d0a8af69b" ../target/release/test_tinantas \ --test-cases test-files/tinantas-san-kartari.csv \ - --hash "ec5acedd0e7a5ca478c9ede25ce69daa1f1acaeb7d161c1565e7c505cd843c55" + --hash "a4bce1c19d54ea2246429dbd345acaca24c380ac3b8c888ddb442e9d862af679" ../target/release/test_tinantas \ --test-cases test-files/tinantas-yan-kartari.csv \ - --hash "71cf9817679767971c06bcb806b61f91d29402f27f158837425e02a67a5c0a01" + --hash "b8c4b3cf7a7e5572af8a1290118f629fbf6812925fe6a41bf9ffadb47a658446" ../target/release/test_tinantas \ --test-cases test-files/tinantas-basic-karmani.csv \ - --hash "e3882dda3c9e1d82062fe12bf406bca99390f9a1bb6f4d58472e2dd19a2fdfef" + --hash "da0e4771bec284661bfd0f537734d44eb6e019e41a387e80dfaa80cf7dc27b03" test_krdantas: cargo build --release ../target/release/test_krdantas \ --test-cases test-files/krdantas-ktvA.csv \ - --hash "a93a988a918d89b73febece101e04cf7a2032671cddea61bb5a3a8b22108a2a9" + --hash "13cd3088b99eeea4d30d91e58f28ad07e9082e6f92f122ff64f4c367dd4ff36c" ../target/release/test_krdantas \ --test-cases test-files/krdantas-kta.csv \ - --hash "3aa1ced4d552d16109ee6ff1113469abc7eba19fd37a7a8bb94ba697746324fb" + --hash "650a4bc2e761f201389595785a5e6ab8a3023f657c58699aa269c01d28c75aae" test_subantas: cargo run --bin test_subantas -- \ diff --git a/vidyut-prakriya/data/dhatupatha.tsv b/vidyut-prakriya/data/dhatupatha.tsv index 3881b73..7c8d8d8 100644 --- a/vidyut-prakriya/data/dhatupatha.tsv +++ b/vidyut-prakriya/data/dhatupatha.tsv @@ -1684,10 +1684,10 @@ code dhatu artha 09.0004 mI\Y hiMsAyAm 09.0005 zi\Y banDane 09.0006 sku\Y ApravaRe -09.0007 sta\nBu~ roDane stamBane ca -09.0008 stu\nBu~ roDane nizkozaRe ca -09.0009 ska\nBu~ roDane stamBane ca -09.0010 sku\nBu~ roDane DAraRe ca +09.0007 stanBu~ roDane stamBane ca +09.0008 stunBu~ roDane nizkozaRe ca +09.0009 skanBu~ roDane stamBane ca +09.0010 skunBu~ roDane DAraRe ca 09.0011 yu\Y banDane 09.0012 knUY Sabde 09.0013 drUY hiMsAyAm diff --git a/vidyut-prakriya/scripts/check_rule_coverage.py b/vidyut-prakriya/scripts/check_rule_coverage.py index d141537..238a924 100755 --- a/vidyut-prakriya/scripts/check_rule_coverage.py +++ b/vidyut-prakriya/scripts/check_rule_coverage.py @@ -42,13 +42,22 @@ def print_legend(): tested_rules.add(m.group(1).replace('_', '.')) print_legend() +num_ok = 0 +num_untested = 0 +num_missing = 0 for rule in all_rules: status = None if rule in tested_rules: status = RULE_OK + num_ok += 1 elif rule in implemented_rules: status = RULE_UNTESTED + num_untested += 1 else: status = RULE_MISSING + num_missing += 1 print(f"{status}\t\t{rule}") print_legend() +print(f"Num tested : {num_ok}") +print(f"Num untested : {num_untested}") +print(f"Num missing : {num_missing}") diff --git a/vidyut-prakriya/src/ac_sandhi.rs b/vidyut-prakriya/src/ac_sandhi.rs index 9297392..65df1f0 100644 --- a/vidyut-prakriya/src/ac_sandhi.rs +++ b/vidyut-prakriya/src/ac_sandhi.rs @@ -57,9 +57,9 @@ pub fn try_lopo_vyor_vali(p: &mut Prakriya) { } fn try_ver_aprktasya(p: &mut Prakriya) -> Option<()> { - let i = p.find_last(T::Krt)?; - let krt = p.get(i)?; - if krt.has_text("v") { + let i = p.find_last(T::Pratyaya)?; + let last = p.get(i)?; + if last.has_text("v") { p.op_term("6.1.67", i, op::lopa); } @@ -143,7 +143,7 @@ pub fn apply_general_ac_sandhi(p: &mut Prakriya) { // upa + fcCati -> upArcCati xy_rule( p, - |x, y| x.has_tag(T::Upasarga) && x.has_antya(&*A) && y.is_dhatu() && y.has_adi('f'), + |x, y| x.is_upasarga() && x.has_antya(&*A) && y.is_dhatu() && y.has_adi('f'), |p, i, j| { p.set(i, |t| t.set_antya("")); p.set(j, |t| t.set_adi("Ar")); @@ -155,7 +155,7 @@ pub fn apply_general_ac_sandhi(p: &mut Prakriya) { xy_rule( p, |x, y| { - x.has_tag(T::Upasarga) + x.is_upasarga() && x.has_antya(&*A) && y.has_u_in(&["i\\R", "eDa~\\"]) && y.has_adi(&*EN) @@ -168,10 +168,19 @@ pub fn apply_general_ac_sandhi(p: &mut Prakriya) { }, ); + // HACK for KOnAti + xy_rule( + p, + |x, _| x.has_text("KaU"), + |p, i, _| { + p.op_term("6.1.89", i, |t| t.set_text("KO")); + }, + ); + // upa + elayati -> upelayati xy_rule( p, - |x, y| x.has_tag(T::Upasarga) && x.has_antya(&*A) && y.is_dhatu() && y.has_adi(&*EN), + |x, y| x.is_upasarga() && x.has_antya(&*A) && y.is_dhatu() && y.has_adi(&*EN), |p, i, _j| { p.set(i, |t| t.set_antya("")); p.step("6.1.94"); @@ -357,6 +366,9 @@ fn try_sut_kat_purva(p: &mut Prakriya) -> Option<()> { } else if prev.has_u("apa") { optional_add_sut("6.1.142", p, i_dhatu); } + } else if prev.has_u("pra") && dhatu.has_u("tunpa~") { + optional_add_sut("6.1.157", p, i_dhatu); + // TODO: implement others. } Some(()) } diff --git a/vidyut-prakriya/src/angasya.rs b/vidyut-prakriya/src/angasya.rs index 5f73a25..0b8f63b 100644 --- a/vidyut-prakriya/src/angasya.rs +++ b/vidyut-prakriya/src/angasya.rs @@ -33,7 +33,6 @@ use crate::sounds::{s, Set}; use crate::stem_gana; use crate::tag::Tag as T; use crate::term::Term; -use compact_str::CompactString; use lazy_static::lazy_static; lazy_static! { @@ -41,6 +40,7 @@ lazy_static! { static ref UK: Set = s("uk"); static ref DANTYA: Set = s("tu~ v"); static ref OSHTHYA: Set = s("pu~ v"); + static ref AA: Set = s("a"); static ref II: Set = s("i"); static ref FF: Set = s("f"); static ref IK: Set = s("ik"); @@ -434,7 +434,7 @@ fn try_pvadinam_hrasva(p: &mut Prakriya) -> Option<()> { let _n = p.get_if(i_n, |t| t.has_tag(T::Sit))?; let anga = p.get(i)?; - if anga.has_u_in(gana::PU_ADI) && (anga.has_gana(Svadi) || anga.has_gana(Kryadi)) { + if anga.has_u_in(gana::PU_ADI) && anga.has_gana(Kryadi) { // punAti, stfRAti, riRAti // All of these dhatus end in vowels. p.op_term("7.3.80", i, |t| { @@ -656,7 +656,7 @@ fn try_sarvadhatuke(p: &mut Prakriya) -> Option<()> { let anga = p.get(i_anga)?; let agama = p.get(i_agama)?; if anga.has_antya('a') && agama.has_text("yA") { - p.op_term("7.2.80", i_agama, op::text("Iy")); + p.op_term("7.2.80", i_agama, op::text("iy")); } } else { // TODO: not sure where to put this. Not lin. @@ -668,7 +668,7 @@ fn try_sarvadhatuke(p: &mut Prakriya) -> Option<()> { op::append_agama("7.2.80", p, i_anga, "mu~k"); } else if anga.has_antya('a') && sarva.has_adi('A') && sarva.has_tag(T::Nit) { // pacayAt --> pacet - p.op_term("7.2.81", i, op::adi("Iy")); + p.op_term("7.2.81", i, op::adi("iy")); } } @@ -677,17 +677,13 @@ fn try_sarvadhatuke(p: &mut Prakriya) -> Option<()> { /// (7.4.21 - 7.4.31) fn try_change_anga_before_y(p: &mut Prakriya) -> Option<()> { - p.debug("try_change"); let i = p.find_first_where(|t| t.is_dhatu() || t.is_pratipadika())?; let i_n = p.find_next_where(i, |t| !t.is_empty())?; let anga = p.get(i)?; let n = p.view(i_n)?; - let mut temp = CompactString::new(""); - temp.replace_range(.., &anga.text); - let akrt_sarva = !n.has_tag_in(&[T::Sarvadhatuka, T::Krt]); - let has_upasarga = i > 0 && p.has(i - 1, |t| t.has_tag(T::Upasarga)); + let has_upasarga = i > 0 && p.has(i - 1, |t| t.is_upasarga()); let yi_kniti = n.has_adi('y') && n.is_knit(); if anga.has_u("SIN") && n.has_tag(T::Sarvadhatuka) { @@ -732,51 +728,77 @@ fn try_change_anga_before_y(p: &mut Prakriya) -> Option<()> { // mantrIyati p.op_term("7.4.27", i, op::antya("rI")); } + } else if anga.has_u("ha\\na~") && n.has_u("yaN") { + p.op_optional("7.4.30.v1", op::t(i, op::text("GnI"))); } else if anga.has_u_in(&["GrA\\", "DmA\\"]) && n.has_u("yaN") { p.op_term("7.4.31", i, op::antya("I")); } else if n.has_adi('y') { let sub = al::to_dirgha(anga.antya()?)?; - if n.has_u("cvi") { - p.op_term("7.4.26", i, op::antya(&sub.to_string())); - } else if akrt_sarva && n.is_knit() { + if akrt_sarva && n.is_knit() { // suKAyate p.op_term("7.4.25", i, op::antya(&sub.to_string())); } } + let anga = p.get(i)?; + let n = p.get(i + 1)?; + if n.has_u("cvi~") { + if anga.has_antya(&*AA) { + p.op_term("7.4.32", i, op::antya("I")); + } else { + let sub = al::to_dirgha(anga.antya()?)?; + p.op_term("7.4.26", i, op::antya(&sub.to_string())); + } + } + Some(()) } -/// Runs rules that change the dhatu when a kit pratyaya starting with "t" follows. -fn try_dhatu_changes_for_ti_kiti(p: &mut Prakriya) -> Option<()> { - let i = p.find_last(T::Dhatu)?; +/// Runs rules that change one or more letters in the anga to a 't'. +fn try_anga_changes_to_t(p: &mut Prakriya, i_anga: usize) -> Option<()> { + let anga = p.get(i_anga)?; - let dhatu = p.get(i)?; - let next = p.get_if(i + 1, |t| t.has_adi('t') && t.has_tag(T::kit))?; + if anga.is_dhatu() { + let anga = p.get(i_anga)?; + let n = p.view(i_anga + 1)?; + if anga.has_antya('s') && n.has_adi('s') && n.last()?.is_ardhadhatuka() { + p.op_term("7.4.49", i_anga, op::antya("t")); + } - if dhatu.has_text_in(&["dyut", "mA", "sA", "sTA"]) { - let code = "7.4.40"; - if dhatu.has_text("dyut") { - p.op_term(code, i, op::upadha("i")); - } else { - p.op_term(code, i, op::antya("i")); + let anga = p.get(i_anga)?; + let next = p.get_if(i_anga + 1, |t| t.has_adi('t') && t.has_tag(T::kit))?; + if anga.has_text_in(&["dyut", "mA", "sA", "sTA"]) { + let code = "7.4.40"; + if anga.has_text("dyut") { + p.op_term(code, i_anga, op::upadha("i")); + } else { + p.op_term(code, i_anga, op::antya("i")); + } + } else if anga.has_text_in(&["SA", "CA"]) { + p.op_optional("7.4.41", op::t(i_anga, op::antya("i"))); + } else if anga.has_u("quDA\\Y") { + p.op_term("7.4.42", i_anga, op::text("hi")); + } else if anga.has_u("o~hA\\k") && next.has_u("ktvA") { + // Only `o~hA\\k`. ("jahāternideśāt jihīterna bhavati। hātvā" -- KV) + p.op_term("7.4.43", i_anga, op::text("hi")); + } else if anga.has_tag(T::Ghu) && anga.has_adi('d') { + if i_anga > 0 && p.has(i_anga - 1, |t| t.is_upasarga() && t.has_antya(&*AC)) { + p.op_term("7.4.47", i_anga, op::text("t")); + } else { + p.op_term("7.4.46", i_anga, op::text("dat")); + } + } + } else { + let next = p.get(i_anga + 1)?; + if anga.has_text("ap") && next.has_adi('B') { + p.op_term("7.4.48", i_anga, op::text("at")); } - } else if dhatu.has_text_in(&["SA", "CA"]) { - p.op_optional("7.4.41", op::t(i, op::antya("i"))); - } else if dhatu.has_u("quDA\\Y") { - p.op_term("7.4.42", i, op::text("hi")); - } else if dhatu.has_u("o~hA\\k") && next.has_u("ktvA") { - // Only `o~hA\\k`. ("jahāternideśāt jihīterna bhavati। hātvā" -- KV) - p.op_term("7.4.43", i, op::text("hi")); - } else if dhatu.has_tag(T::Ghu) && dhatu.has_adi('d') { - p.op_term("7.4.46", i, op::text("dat")); - } - // TODO: 7.4.47 + } Some(()) } -fn try_add_or_remove_nit(p: &mut Prakriya) -> Option<()> { +pub fn try_add_or_remove_nit(p: &mut Prakriya) -> Option<()> { let i = p.find_last(T::Pratyaya)?; if i == 0 { return None; @@ -786,9 +808,9 @@ fn try_add_or_remove_nit(p: &mut Prakriya) -> Option<()> { let anga = p.get(i_anga)?; let last = p.get(i)?; - if anga.has_text("go") && last.has_tag(T::Sarvanamasthana) { + if anga.has_text("go") && last.is_sarvanamasthana() { p.op_term("7.1.90", i, op::add_tag(T::Rit)); - } else if anga.has_antya('o') && last.has_tag(T::Sarvanamasthana) { + } else if anga.has_antya('o') && last.is_sarvanamasthana() { p.op_term("7.1.90.v1", i, op::add_tag(T::Rit)); } else if last.has_u("Ral") && last.has_tag(T::Uttama) { p.op_optional( @@ -797,10 +819,7 @@ fn try_add_or_remove_nit(p: &mut Prakriya) -> Option<()> { t.remove_tag(T::Rit); }), ); - } else if anga.has_text("saKi") - && last.has_tag(T::Sarvanamasthana) - && !last.has_tag(T::Sambuddhi) - { + } else if anga.has_text("saKi") && last.is_sarvanamasthana() && !last.has_tag(T::Sambuddhi) { p.op_term("7.1.92", i, op::add_tag(T::Rit)); } @@ -821,7 +840,7 @@ fn try_tas_asti_lopa(p: &mut Prakriya, i: usize) -> Option<()> { } else if n.has_adi('r') { // kartArO p.op_term("7.4.51", i, op::antya("")); - } else if n.has_adi('e') { + } else if n.has_adi('e') && !n.has_u("eS") { // kartAhe p.op_term("7.4.52", i, op::antya("h")); } @@ -846,18 +865,14 @@ fn unknown(p: &mut Prakriya, i: usize) -> Option<()> { } } - // HACK: check for "dhatu" to avoid processing "yAs"-Agama - // TODO: don't do this hack. - let anga = p.get(i)?; - let n = p.view(i + 1)?; - if anga.has_antya('s') && anga.is_dhatu() && n.has_adi('s') && n.has_tag(T::Ardhadhatuka) { - p.op_term("7.4.49", i, op::antya("t")); - } - Some(()) } -fn try_add_tuk_agama(p: &mut Prakriya) -> Option<()> { +/// Tries adding tuk-Agama for krt-pratyayas that are pit. +/// +/// Constraints: +/// - must follow guna, which can block this rule. +fn try_add_piti_krti_tuk(p: &mut Prakriya) -> Option<()> { for i in 0..p.terms().len() { let cur = p.get(i)?; if cur.is_hrasva() && p.has(i + 1, |t| t.has_all_tags(&[T::pit, T::Krt])) { @@ -866,6 +881,10 @@ fn try_add_tuk_agama(p: &mut Prakriya) -> Option<()> { } } + Some(()) +} + +fn try_add_tuk_agama(p: &mut Prakriya) -> Option<()> { char_rule(p, xy(|x, y| al::is_ac(x) && y == 'C'), |p, text, i| { // tena cicchidatuḥ, cicchiduḥ ityatra tukabhyāsasya grahaṇena na // gṛhyate iti halādiḥśeṣeṇa na nivartyate @@ -1582,8 +1601,6 @@ pub fn run_before_dvitva(p: &mut Prakriya) -> Option<()> { try_add_agama_before_ni(p); // tuk-Agama can block guna. try_add_tuk_agama(p); - // Rit-tva can block guna. - try_add_or_remove_nit(p); // num-Agama must come after asiddhavat rule 6.4.24, which causes na-lopa. // Exception: naS num-Agama, which is deleted in 6.4.32; @@ -1610,6 +1627,9 @@ pub fn run_before_dvitva(p: &mut Prakriya) -> Option<()> { asiddhavat::run_after_guna(p, i); } + // krti tuk-Agama can occur only after guna. + try_add_piti_krti_tuk(p); + // Must run before dvitva. try_cani_after_guna(p); @@ -1654,17 +1674,15 @@ pub fn run_after_dvitva(p: &mut Prakriya) -> Option<()> { // must apply before guna for knUy --> knopayati ac_sandhi::try_lopo_vyor_vali(p); - // try_add_or_remove_nit(p); for i in 0..p.terms().len() { unknown(p, i); try_tas_asti_lopa(p, i); try_didhi_vevi_lopa(p, i); + try_anga_changes_to_t(p, i); } - try_dhatu_changes_for_ti_kiti(p); - // Asiddhavat must run before cani for "Ner aniTi" asiddhavat::run_for_ni(p); diff --git a/vidyut-prakriya/src/angasya/abhyasasya.rs b/vidyut-prakriya/src/angasya/abhyasasya.rs index 9903de7..50e0ae6 100644 --- a/vidyut-prakriya/src/angasya/abhyasasya.rs +++ b/vidyut-prakriya/src/angasya/abhyasasya.rs @@ -213,6 +213,13 @@ pub fn run_for_sani_or_cani(p: &mut Prakriya) -> Option<()> { fn try_general_rules(p: &mut Prakriya, i: usize) -> Option<()> { let i_dhatu = i + 1; + let dhatu = p.get(i_dhatu)?; + if dhatu.has_u("zWivu~") { + p.op_optional(Rule::Kashika("6.1.64"), |p| { + p.set(i, |t| t.find_and_replace_text("zW", "zT")) + }); + } + let dhatu = p.get(i_dhatu)?; let last = p.terms().last()?; if dhatu.has_u("dyuta~\\") || dhatu.has_text("svAp") { @@ -230,7 +237,7 @@ fn try_general_rules(p: &mut Prakriya, i: usize) -> Option<()> { } let abhyasa = p.get(i)?; - if abhyasa.has_adi(&*SHAR) && abhyasa.get_at(1).map(|c| KHAY.contains(c)).unwrap_or(false) { + if abhyasa.has_adi(&*SHAR) && abhyasa.has_at(1, &*KHAY) { let abhyasa = &mut p.get_mut(i)?; let res = try_shar_purva(&abhyasa.text); if res != abhyasa.text { @@ -366,6 +373,11 @@ fn try_rules_for_slu(p: &mut Prakriya, i: usize) -> Option<()> { } else if dhatu.has_u_in(&["f\\", "pf", "pF"]) && dhatu.has_gana(Gana::Juhotyadi) { // iyarti, piparti (allowed by both `pf` and `pF`) p.op_term("7.4.77", i, op::antya("i")); + } else if dhatu.has_u("gA\\") && dhatu.has_gana(Gana::Juhotyadi) { + // jigAti + // (This is a chAndasa rule, but the SK applies it to derive jigAti from gA, which is a + // Vedic root.) + p.op_term("7.4.78", i, op::antya("i")); } Some(()) @@ -421,7 +433,9 @@ fn try_rules_for_yan(p: &mut Prakriya, i_abhyasa: usize) -> Option<()> { if dhatu.has_u_in(VANCU_SRANSU) { add_agama("7.4.84", p, i_dhatu, "nIk"); - } else if abhyasa.has_antya('a') && dhatu.has_antya(&*ANUNASIKA) { + } else if abhyasa.has_antya('a') && dhatu.has_antya(&*ANUNASIKA) && !dhatu.has_upadha('A') { + // Per commentaries, this rule applies only if the abhyasa ended with "A" before being shortened by 7.4.59. Here, we check for that condition by seeing if the dhatu has an A. + // Should treat as anusvAra per commentaries, otherwise we can't derive yaMyamyate. add_agama("7.4.85", p, i_dhatu, "Mu~k"); } else if dhatu.has_u_in(JAPA_JABHA) { @@ -434,7 +448,7 @@ fn try_rules_for_yan(p: &mut Prakriya, i_abhyasa: usize) -> Option<()> { p.set(i_dhatu, |t| t.set_text("daS")); } add_agama("7.4.86", p, i_dhatu, "nu~k"); - } else if dhatu.has_u_in(&["cara~", "Pala~"]) { + } else if dhatu.has_u_in(&["cara~", "Pala~", "YiPalA~"]) { add_agama("7.4.87", p, i_dhatu, "nu~k"); // Use `i_dhatu + 1` because 7.4.87 above shifted the index. @@ -445,7 +459,7 @@ fn try_rules_for_yan(p: &mut Prakriya, i_abhyasa: usize) -> Option<()> { } } else if dhatu.text.contains('f') { // varIvfScyate, ... - // (Check for "contains and not antya" to allow pfcC, vfSc, ...) + // (Check for "contains" and not "antya" to allow pfcC, vfSc, ...) let mut added = false; if is_yan_luk { added = optional_add_agama("7.4.91:ruk", p, i_dhatu, "ru~k"); diff --git a/vidyut-prakriya/src/angasya/asiddhavat.rs b/vidyut-prakriya/src/angasya/asiddhavat.rs index 7141aed..5e0900d 100644 --- a/vidyut-prakriya/src/angasya/asiddhavat.rs +++ b/vidyut-prakriya/src/angasya/asiddhavat.rs @@ -49,7 +49,7 @@ fn is_anekac(p: &Prakriya, i: usize) -> bool { for t in p.terms()[..=i].iter().rev() { // HACK to skip aw/Aw-Agama (a-gacchat) which should not be counted because it, too, is added // in the asiddhavat section. (6.4.71 - 6.4.72). - if t.has_tag(T::Upasarga) || (t.is_agama() && t.has_u_in(&["aw", "Aw"])) { + if t.is_upasarga() || (t.is_agama() && t.has_u_in(&["aw", "Aw"])) { continue; } @@ -88,20 +88,51 @@ fn is_samyogapurva(p: &Prakriya, i: usize) -> bool { false } -pub fn try_cinvat_for_bhave_and_karmani_prayoga(p: &mut Prakriya) -> Option<()> { - let i = p.find_last(T::Dhatu)?; - let i_n = i + 1; +/// Returns whether a term's aupadeshika form ends with a vowel, ignoring it letters. +/// +/// If the term doesn't have an aupadeshika form, return false +fn is_upadesha_ac_anta(t: &Term) -> bool { + if let Some(u) = &t.u { + let mut chars = u.chars().rev(); - let anga = p.get(i)?; + let mut x = chars.next(); + + // Skip afinal consonant by "hal antyam". + if x.map_or(false, |c| HAL.contains(c)) { + x = chars.next(); + } + + // Skip a final nasal vowel by "upadeSe 'j anunAsika iw". + if x.map_or(false, |c| c == '~') { + chars.next(); + x = chars.next(); + } + + // Skip accent marks. + if x.map_or(false, |c| c == '\\' || c == '^') { + x = chars.next(); + } + + if let Some(c) = x { + al::is_ac(c) + } else { + false + } + } else { + false + } +} + +pub fn try_cinvat_for_bhave_and_karmani_prayoga(p: &mut Prakriya) -> Option<()> { + let i_anga = p.find_last(T::Dhatu)?; + let i_n = p.find_next_where(i_anga, |t| !t.is_empty())?; + let anga = p.get(i_anga)?; let next = p.get(i_n)?; let sya_sic_siyut_tasi = next.has_u_in(&["sya", "si~c", "sIyu~w", "tAsi~"]); let bhavakarmanoh = p.any(&[T::Karmani, T::Bhave]); - let upadesha_ac = match &anga.u { - Some(x) => AC.contains(x.chars().last()?), - None => false, - }; - let hana_graha_drza = anga.has_u_in(&["han\\na~", "graha~^", "df\\Si~r"]); + let upadesha_ac = is_upadesha_ac_anta(anga); + let hana_graha_drza = anga.has_u_in(&["ha\\na~", "graha~^", "df\\Si~r"]); let ac_hana_graha_drza = upadesha_ac || hana_graha_drza; if sya_sic_siyut_tasi && bhavakarmanoh && ac_hana_graha_drza { @@ -140,8 +171,8 @@ fn run_for_kniti_ardhadhatuke_after_guna(p: &mut Prakriya, i: usize) -> Option<( // included in `n`. } else if aat && kniti_ardha { let ghu_ma = dhatu.has_tag(T::Ghu) - || dhatu.has_u_in(&["mA\\", "mA\\N", "me\\N"]) - || dhatu.has_text_in(&["sTA", "gA", "sA"]) + || dhatu.has_u_in(&["mA\\", "mA\\N", "me\\N", "zo\\"]) + || dhatu.has_text_in(&["sTA", "gA"]) || dhatu.has_u("o~hA\\k") || (dhatu.has_u("pA\\") && dhatu.has_gana(Gana::Bhvadi)); if n.has_adi(&*HAL) && ghu_ma && !dhatu.has_tag(T::FlagNaLopa) { @@ -216,6 +247,9 @@ fn try_run_kniti_for_dhatu(p: &mut Prakriya, i: usize) -> Option<()> { let next_is_hi = n.first()?.has_text("hi"); if anga.has_text_in(&["gam", "han", "jan", "Kan", "Gas"]) && n.has_adi(&*AC) && !n.has_u("aN") { p.op_term("6.4.98", i, op::upadha("")); + } else if anga.has_u("Basa~") { + // TODO: rule is chAndasa, but SK applies it generally? + p.op_term("6.4.100", i, op::upadha("")); } else if (anga.has_text("hu") || anga.has_antya(&*JHAL) || anga.has_u("SAsu~")) && next_is_hi { // HACK to allow SAsu~ so that we can derive SADi. p.op_term("6.4.101", n.start(), op::text("Di")); @@ -281,28 +315,30 @@ fn try_run_kniti_sarvadhatuke_for_shna_and_abhyasta(p: &mut Prakriya, i: usize) } else if anga.has_u("YiBI\\") && n_is_haladi { p.op_optional("6.4.115", op::t(i, op::antya("i"))); } else if anga.has_antya('A') { + let mut changed = false; if anga.has_u("o~hA\\k") && n_is_haladi { if n.has_adi('y') { p.op_term("6.4.118", i, op::antya("")); } else { - let mut run_116 = true; if n.last()?.has_text("hi") { - // Run 6.4.116 only if 6.4.117 was not run. - run_116 = !p.op_optional("6.4.117", op::t(i, op::antya("A"))); + changed = p.op_optional("6.4.117", op::t(i, op::antya("A"))); } - if run_116 { - p.op_optional("6.4.116", op::t(i, op::antya("i"))); + // Run 6.4.116 only if 6.4.117 was not run. + if !changed { + changed = p.op_optional("6.4.116", op::t(i, op::antya("i"))); } } } - // HACK to ignore SAsu~ so that we can derive SADi. let anga = p.get(i)?; - if anga.has_antya('A') && !anga.has_u("SAsu~") { - if !anga.has_tag(T::Ghu) && n_is_haladi { - p.op_term("6.4.113", i, op::antya("I")); - } else { - p.op_term("6.4.112", i, op::antya("")); + if !changed && !anga.has_tag(T::FlagNaLopa) { + // HACK to ignore SAsu~ so that we can derive SADi. + if anga.has_antya('A') && !anga.has_u("SAsu~") { + if !anga.has_tag(T::Ghu) && n_is_haladi { + p.op_term("6.4.113", i, op::antya("I")); + } else { + p.op_term("6.4.112", i, op::antya("")); + } } } } @@ -387,7 +423,7 @@ fn try_et_adesha_and_abhyasa_lopa_for_lit(p: &mut Prakriya, i: usize) -> Option< } else if dhatu.has_text("rAD") && dhatu.has_gana(Gana::Svadi) { // TODO: why svAdi? For now, just follow what ashtadhyayi.com does. p.op("6.4.123", op_et_abhyasa_lopa); - } else if dhatu.has_u("jF") || dhatu.has_text_in(&["Bram", "tras"]) { + } else if dhatu.has_u("jFz") || dhatu.has_text_in(&["Bram", "tras"]) { p.op_optional("6.4.124", op_et_abhyasa_lopa); } else if dhatu.has_u_in(gana::PHAN_ADI) { p.op_optional("6.4.125", op_et_abhyasa_lopa); @@ -438,19 +474,22 @@ fn try_ardhadhatuke(p: &mut Prakriya, i: usize) -> Option<()> { return None; } - let halah = |p: &Prakriya, i| { + let is_halah = |p: &Prakriya, i| { if p.has(i, |t| t.text.len() >= 3) { p.has(i, |t| t.has_at(t.text.len() - 3, &*HAL)) - } else if p.has(i, |t| t.text.len() == 2) { - i > 0 && p.has(i - 1, |t| t.has_antya(&*HAL)) } else { - false + let i_prev = p.find_prev_where(i, |t| !t.is_empty()); + if let Some(i_prev) = i_prev { + p.has(i_prev, |t| t.has_antya(&*HAL)) + } else { + false + } } }; if anga.has_text("Brasj") { p.op_optional("6.4.47", op::t(i, op::text("Barj"))); - } else if anga.text.ends_with("ya") && halah(p, i) { + } else if anga.text.ends_with("ya") && is_halah(p, i) { p.op("6.4.49", |p| { p.set(i, op::antya("")); p.set(i, op::antya("")); @@ -520,7 +559,7 @@ fn try_upadha_nalopa(p: &mut Prakriya, i: usize) -> Option<()> { // daSati p.op_term("6.4.25", i, op::upadha("")); } else if anga.has_text("syand") && n.has_u("GaY") { - p.op_optional("6.4.28", op::t(i, op::upadha(""))); + p.op_optional("6.4.28", op::nipatana("syada")); } else if anga.has_u("SAsu~") { if n.last()?.has_text("hi") { // SAs + hi -> SAhi (-> SADi) @@ -569,7 +608,6 @@ fn try_antya_nalopa(p: &mut Prakriya, i: usize) -> Option<()> { "6.4.43", op::t(i, |t| { t.set_antya("A"); - t.add_tag(T::FlagNaLopa); }), ); } @@ -605,6 +643,24 @@ fn try_antya_nalopa(p: &mut Prakriya, i: usize) -> Option<()> { } } + // Mark changed results with the tag "FlagNaLopa" so that we can avoid later asiddhavat rules. + // + // For example, consider these two rules: + // + // - 6.4.43 janasanaKanAM saYJaloH (jan -> jaA -> jA) + // - 6.4.113 I halyaGoH (mimA + ta -> mimI + ta) + // + // Here, applying 6.4.43 should not then allow 6.4.113. + // + // Other solutions we considered: + // + // - Reordering the rules might also work. But broadly, these na-lopa rules must run before + // guna, whereas dvitva can occur after guna. Reordering seems hackier and harder to read + // than simply using the na-lopa flag. + // + // - Using a separate data space for asiddhavat rules might work as well. But doing so + // complicates our use of the other `angasya` code, which constantly enters and exits the + // `asiddhavat` space. let anga = p.get_mut(i)?; if old_antya != anga.antya()? { anga.add_tag(T::FlagNaLopa); @@ -651,7 +707,6 @@ pub fn run_before_guna(p: &mut Prakriya, i: usize) -> Option<()> { try_upadha_nalopa(p, i); try_antya_nalopa(p, i); - try_ardhadhatuke(p, i); let j = p.find_next_where(i, |t| !t.is_empty())?; @@ -714,7 +769,7 @@ fn run_for_final_i_or_u(p: &mut Prakriya, i: usize) -> Option<()> { let j = p.find_next_where(i, |t| !t.is_empty())?; let n = p.view(j)?; - if !anga.has_antya(&*I_U) || !n.has_adi(&*AC) || anga.has_tag(T::Upasarga) { + if !anga.has_antya(&*I_U) || !n.has_adi(&*AC) || anga.is_upasarga() { return None; } @@ -817,7 +872,7 @@ pub fn run_for_ni(p: &mut Prakriya) -> Option<()> { } else if n.has_tag(T::Nistha) && iti { // corita, kArita, ... p.op_term("6.4.52", i_ni, op::antya("")); - } else if !iti { + } else if !iti || n.has_tag(T::Cinvat) { // Apply ac_sandhi before lopa, since later rules depend on this // being done (e.g. cayyAt) // TODO: implement this excluding "ni" from the sandhi rules. diff --git a/vidyut-prakriya/src/angasya/guna_vrddhi.rs b/vidyut-prakriya/src/angasya/guna_vrddhi.rs index 673c6a0..940dbba 100644 --- a/vidyut-prakriya/src/angasya/guna_vrddhi.rs +++ b/vidyut-prakriya/src/angasya/guna_vrddhi.rs @@ -31,7 +31,10 @@ fn can_use_guna_or_vrddhi_opt(p: &Prakriya, i_anga: usize) -> Option { if anga.has_tag_in(&[T::FlagAtLopa, T::FlagGunaApavada]) { Some(false) - } else if p.has(i_anga + 1, |t| t.is_dhatu() && t.is_empty()) && n.has_tag(T::Ardhadhatuka) { + } else if p.has(i_anga + 1, |t| { + t.is_dhatu() && t.is_empty() && t.has_tag(T::FlagAtLopa) + }) && n.has_tag(T::Ardhadhatuka) + { // 1.1.4 na DAtulopa ArDaDAtuke Some(false) } else if n.is_knit() { @@ -108,7 +111,8 @@ fn try_taddhita_vrddhi(p: &mut Prakriya, i: usize) -> Option<()> { /// Taddhita rules: 7.2.117 - 7.3.31 fn try_nnit_vrddhi(p: &mut Prakriya, i: usize) -> Option<()> { let anga = p.get(i)?; - let n = p.view(i + 1)?; + let i_next = p.find_next_where(i, |t| !t.is_empty())?; + let n = p.view(i_next)?; if !n.has_tag_in(&[T::Yit, T::Rit]) || !can_use_guna_or_vrddhi(p, i) { // Allow RiN even though it is Nit. Without this check, RiN will be excluded by @@ -121,14 +125,16 @@ fn try_nnit_vrddhi(p: &mut Prakriya, i: usize) -> Option<()> { let is_cin = n.has_u("ciR") || n.has_tag(T::Cinvat); let is_cin_krt = is_cin || n.has_tag(T::Krt); let has_udatta = !anga.has_tag(T::Anudatta); - let is_acham = || { - anga.has_u("camu~") + + let is_aacam_adi = { + let is_aacam = anga.has_u("camu~") && anga.has_gana(Gana::Bhvadi) - && i > 0 - && p.has(i - 1, |t| t.has_u("AN")) + && p.find_prev_where(i, |t| t.is_upasarga() && t.has_u("AN")) + .is_some(); + is_aacam || anga.has_u_in(&["kamu~\\", "wuvama~"]) }; - if is_cin_krt && has_udatta && anga.has_antya('m') && !is_acham() { + if is_cin_krt && has_udatta && anga.has_antya('m') && !is_aacam_adi { p.step("7.3.34"); } else if is_cin_krt && anga.has_text_in(&["jan", "vaD"]) { // ajani, avaDi, ... @@ -150,6 +156,11 @@ fn try_nnit_vrddhi(p: &mut Prakriya, i: usize) -> Option<()> { p.op_term("7.2.115", i, op::antya(sub)); } } else if anga.has_upadha('a') { + if anga.has_u_in(&["kamu~\\", "wuvama~"]) { + // akAmi, avAmi + p.step("7.3.34.v1") + } + // pAcayati p.op_term("7.2.116", i, op::upadha("A")); } @@ -190,6 +201,9 @@ fn try_guna_adesha(p: &mut Prakriya, i: usize) -> Option<()> { let piti_sarvadhatuke = n.all(&[T::pit, T::Sarvadhatuka]); let is_ik = anga.has_antya(&*IK); + let anga = p.get_if(i, |t| !t.is_agama() && !t.has_tag(T::FlagGunaApavada))?; + let n = p.view(j)?; + if anga.has_u_in(&["Divi~", "kfvi~"]) { // Per commentary on 3.1.81, these roots don't take guna. } else if anga.has_text("mid") && n.has_tag(T::Sit) { @@ -206,8 +220,6 @@ fn try_guna_adesha(p: &mut Prakriya, i: usize) -> Option<()> { // HACK: check for absence of `Nit` on first term to prevent tfnhyAt -> tfRihyAt p.op_term("7.3.92", i, op::mit("i")); } else if is_sarva_ardha { - let anga = p.get(i)?; - let n = p.view(j)?; let can_use_guna = can_use_guna_or_vrddhi(p, i); // Exceptions @@ -228,7 +240,12 @@ fn try_guna_adesha(p: &mut Prakriya, i: usize) -> Option<()> { // If vrddhi is declined, UrRu will take guna by 7.3.84 below. p.op_optional("7.3.90", op::t(i, op::antya(sub))); } - } else if p.get(i + 1)?.has_tag(T::Luk) { + } else if p.get(i + 1)?.has_tag(T::Luk) && !anga.has_tag(T::Abhyasta) { + // Why check for abhyasta? + // + // > na abhyastasya ityetadiha anuvartate, yoyoti, roroti ityevamādyartham. + // + // -- KV on 7.3.89. p.op_term("7.3.89", i, op::antya(sub)); }; } diff --git a/vidyut-prakriya/src/ardhadhatuka.rs b/vidyut-prakriya/src/ardhadhatuka.rs index 3a59e77..52899df 100644 --- a/vidyut-prakriya/src/ardhadhatuka.rs +++ b/vidyut-prakriya/src/ardhadhatuka.rs @@ -220,7 +220,8 @@ fn dhatu_adesha_after_vikarana(p: &mut Prakriya) -> Option<()> { } if p.has(i + 1, |t| t.has_u("yaN")) && p.has(i + 2, |t| t.has_u("ac")) { - p.op_term("2.4.74", i + 1, op::lopa); + p.op_term("2.4.74", i + 1, op::luk); + p.set(i + 1, |t| t.add_tag(T::FlagAtLopa)); } Some(()) diff --git a/vidyut-prakriya/src/args.rs b/vidyut-prakriya/src/args.rs index 46f8753..7340783 100644 --- a/vidyut-prakriya/src/args.rs +++ b/vidyut-prakriya/src/args.rs @@ -22,3 +22,12 @@ pub use krt::*; pub use sup::*; pub use taddhita::*; pub use tin::*; + +/// Models a semantic condition that applies to the prakriya. +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum Artha { + /// A semantic condition for a krdanta derivation. + Krt(KrtArtha), + /// A semantic condition for a taddhitanta derivation. + Taddhita(TaddhitaArtha), +} diff --git a/vidyut-prakriya/src/args/krt.rs b/vidyut-prakriya/src/args/krt.rs index 0d1f35a..0a2a385 100644 --- a/vidyut-prakriya/src/args/krt.rs +++ b/vidyut-prakriya/src/args/krt.rs @@ -19,6 +19,8 @@ pub enum Krt { aR, /// -at (jarat) atfn, + /// -aTu (vepaTu). Allowed only for dhatus that are `qvit`. + aTuc, /// -ani ani, /// -anIya (gamanIya, BavanIya, ...) @@ -161,8 +163,6 @@ pub enum Krt { tfn, /// -Taka (gATaka) Takan, - /// -Tu (vepaTu). Allowed only for dhatus that are `qvit`. - aTuc, /// -na naN, /// -naj @@ -285,6 +285,7 @@ enum_boilerplate!(Krt, { ac => "ac", aR => "aR", atfn => "atf~n", + aTuc => "aTuc", ani => "ani", anIyar => "anIyar", ap => "ap", @@ -355,7 +356,6 @@ enum_boilerplate!(Krt, { tfc => "tfc", tfn => "tfn", Takan => "Takan", - aTuc => "aTuc", naN => "naN", najiN => "naji~N", nan => "nan", @@ -419,6 +419,26 @@ enum_boilerplate!(Krt, { Anuk => "Anuk", }); +/// Models the meaning of a krt-pratyaya. +/// +/// krts are often available only in specific senses. A given krta might be allowed in one sense +/// but blocked in another. To model and test this behavior, we use the enum below. +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] +pub enum KrtArtha { + /// Agent. (3.4.67) + Karta, + /// Existence. (3.3.18) + Bhava, + /// Having a habit, nature, or skill. + TacchilaTaddharmaTatsadhukara, + /// Designation. (3.3.118) + Samjna, + /// Solidity. (3.3.77) + Murti, + /// Location. (3.3.78) + Desha, +} + impl Krt { /// Returns whether the krt suffix is an ArdhadhAtuka suffix. /// @@ -430,12 +450,6 @@ impl Krt { } } -/// The information required to derive a krdanta in the grammar. -pub struct KrdantaArgs { - krt: Krt, - upapada: Option, -} - /// An upapada (dependent word) for a krdanta derivation. #[derive(Clone, Debug, Hash, Eq, PartialEq)] pub enum Upapada { @@ -473,6 +487,13 @@ impl Upapada { } } +/// The information required to derive a krdanta in the grammar. +pub struct KrdantaArgs { + krt: Krt, + artha: Option, + upapada: Option, +} + impl KrdantaArgs { /// The krt pratyaya to use in the derivation. pub fn krt(&self) -> Krt { @@ -484,6 +505,11 @@ impl KrdantaArgs { &self.upapada } + /// The artha condition to use in the derivation. If not set, any artha is allowed. + pub fn artha(&self) -> Option { + self.artha + } + /// Returns a new builder for this struct. pub fn builder() -> KrdantaArgsBuilder { KrdantaArgsBuilder::default() @@ -495,6 +521,7 @@ impl KrdantaArgs { pub struct KrdantaArgsBuilder { krt: Option, upapada: Option, + artha: Option, } impl KrdantaArgsBuilder { @@ -510,6 +537,12 @@ impl KrdantaArgsBuilder { self } + /// Sets the upapada to use in the derivation. + pub fn artha(&mut self, artha: KrtArtha) -> &mut Self { + self.artha = Some(artha); + self + } + /// Converts the arguments in this builder into a `TinantaArgs` struct. /// /// `build()` will fail if any args are missing. @@ -520,6 +553,7 @@ impl KrdantaArgsBuilder { _ => return Err(Error::missing_required_field("krt")), }, upapada: self.upapada.as_ref().cloned(), + artha: self.artha, }) } } diff --git a/vidyut-prakriya/src/args/taddhita.rs b/vidyut-prakriya/src/args/taddhita.rs index aafa34f..7b7c545 100644 --- a/vidyut-prakriya/src/args/taddhita.rs +++ b/vidyut-prakriya/src/args/taddhita.rs @@ -73,6 +73,8 @@ pub enum Taddhita { Gas, /// -Ayana cPaY, + /// -- + cvi, /// -Iya Ca, /// -Iya, @@ -109,6 +111,8 @@ pub enum Taddhita { Wan, /// -ika Wap, + /// -pa + qupac, /// -mat qmatup, /// -vala @@ -120,6 +124,8 @@ pub enum Taddhita { /// -eyaka QakaY, /// -eya + Qa, + /// -eya QaY, /// -eyin Qinuk, @@ -151,6 +157,8 @@ pub enum Taddhita { tyap, /// -tra tral, + /// -trA + trA, /// -tva tva, /// -Tam @@ -229,6 +237,8 @@ pub enum Taddhita { Sa, /// -Sas Sas, + /// -tra + zwarac, /// -ika zWac, /// -ika @@ -279,6 +289,7 @@ enum_boilerplate!(Taddhita, { Gan => "Gan", Gas => "Gas", cPaY => "cPaY", + cvi => "cvi~", Ca => "Ca", CaR => "CaR", Cas => "Cas", @@ -297,11 +308,13 @@ enum_boilerplate!(Taddhita, { WaY => "WaY", Wan => "Wan", Wap => "Wap", + qupac => "qupac", qmatup => "qmatu~p", qvalac => "qvalac", qvun => "qvu~n", Qak => "Qak", QakaY => "QakaY", + Qa => "Qa", QaY => "QaY", Qinuk => "Qinu~k", Qrak => "Qrak", @@ -318,6 +331,7 @@ enum_boilerplate!(Taddhita, { tyak => "tyak", tyap => "tyap", tral => "tral", + trA => "trA", tva => "tva", Tamu => "Tamu~", Tyan => "Tyan", @@ -357,6 +371,7 @@ enum_boilerplate!(Taddhita, { vyan => "vyan", Sa => "Sa", Sas => "Sas", + zwarac => "zwarac", zWac => "zWac", zWan => "zWan", zWal => "zWal", @@ -372,7 +387,7 @@ enum_boilerplate!(Taddhita, { /// Generally, taddhitas are available only in specific senses. A given taddhita might be allowed /// in one sense but blocked in another. To model and test this behavior, we use the enum below. #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] -pub enum Artha { +pub enum TaddhitaArtha { /// Descendant. (4.1.92) TasyaApatyam, /// Patronymic lineage. (4.1.98) @@ -514,15 +529,39 @@ pub enum Artha { TadAsyaAstiAsmin, /// Words meaning direction, location, or time. (5.3.27) DigDeshaKala, + /// Not known. (5.3.73) + Ajnate, + /// Contempt. (5.3.75) + Kutsite, + /// TODO + Anukampayam, + /// Slenderness. (5.3.91) + Tanutve, + /// Derision. (5.3.95) + Avakshepane, + /// TODO + Alpe, + /// TODO + Hrasve, + /// TODO + IvePratikrtau, + /// TODO + Svarthe, + /// TODO + Matsye, + /// TODO + KriyaAbhyavrttiGanana, /// Expressing manner. (5.4.3) PrakaraVacane, /// What one is made of. (5.4.21) TatPrakrtaVacane, /// For the sake of which. (5.4.24) Tadarthye, + /// Becoming what one was not. (5.4.50) + AbhutaTadbhava, } -impl Artha { +impl TaddhitaArtha { /// Returns whether `self` is either identical to `other` or falls under `other` as a subtype. pub fn is_type_of(&self, parent: Self) -> bool { match self { @@ -535,7 +574,7 @@ impl Artha { /// The information required to derive a taddhitanta in the grammar. pub struct TaddhitantaArgs { taddhita: Taddhita, - artha: Option, + artha: Option, } impl TaddhitantaArgs { @@ -545,7 +584,7 @@ impl TaddhitantaArgs { } /// The artha condition to use in the derivation. If not set, any artha is allowed. - pub fn artha(&self) -> Option { + pub fn artha(&self) -> Option { self.artha } @@ -559,7 +598,7 @@ impl TaddhitantaArgs { #[derive(Clone, Default, Hash, Eq, PartialEq)] pub struct TaddhitantaArgsBuilder { taddhita: Option, - artha: Option, + artha: Option, } impl TaddhitantaArgsBuilder { @@ -570,7 +609,7 @@ impl TaddhitantaArgsBuilder { } /// Sets the artha to use in the derivation. - pub fn artha(&mut self, val: Artha) -> &mut Self { + pub fn artha(&mut self, val: TaddhitaArtha) -> &mut Self { self.artha = Some(val); self } @@ -595,7 +634,7 @@ mod tests { #[test] fn artha_includes() { - use Artha::*; + use TaddhitaArtha::*; // Child relationship --> true assert!(Gotra.is_type_of(TasyaApatyam)); // Equality --> true diff --git a/vidyut-prakriya/src/ashtadhyayi.rs b/vidyut-prakriya/src/ashtadhyayi.rs index 89a224b..593fddc 100644 --- a/vidyut-prakriya/src/ashtadhyayi.rs +++ b/vidyut-prakriya/src/ashtadhyayi.rs @@ -9,8 +9,8 @@ use crate::angasya; use crate::ardhadhatuka; use crate::args::Upapada; use crate::args::{ - Dhatu, KrdantaArgs, Krt, Lakara, Linga, Pratipadika, Prayoga, SubantaArgs, TaddhitantaArgs, - TinantaArgs, + Artha, Dhatu, KrdantaArgs, Krt, Lakara, Linga, Pratipadika, Prayoga, SubantaArgs, + TaddhitantaArgs, TinantaArgs, }; use crate::atidesha; use crate::atmanepada; @@ -21,6 +21,7 @@ use crate::it_agama; use crate::krt; use crate::la_karya; use crate::linganushasanam; +use crate::misc; use crate::prakriya::Prakriya; use crate::prakriya_stack::PrakriyaStack; use crate::pratipadika_karya; @@ -119,6 +120,8 @@ fn run_various_dhatu_tasks(p: &mut Prakriya) { } fn run_rules(p: &mut Prakriya, lakara: Option, is_ardhadhatuka: bool) -> Result<()> { + misc::run_pad_adi(p); + p.debug("==== Tin-siddhi ===="); // Do lit-siddhi and AzIrlin-siddhi first to support the valAdi vArttika for aj -> vi. let is_lit_or_ashirlin = matches!(lakara, Some(Lakara::Lit) | Some(Lakara::AshirLin)); @@ -140,6 +143,11 @@ fn run_rules(p: &mut Prakriya, lakara: Option, is_ardhadhatuka: bool) -> } } + // Constraints: + // - should run before atidesha rules because of Rittva. + // - should also run for subantas. + angasya::try_add_or_remove_nit(p); + p.debug("==== Dhatu tasks ===="); run_various_dhatu_tasks(p); @@ -175,6 +183,7 @@ fn run_rules(p: &mut Prakriya, lakara: Option, is_ardhadhatuka: bool) -> p.debug("==== After dvitva ===="); angasya::run_after_dvitva(p); + uttarapade::run_after_guna(p); ac_sandhi::try_sup_sandhi_after_angasya(p); ac_sandhi::run_common(p); @@ -234,6 +243,11 @@ fn derive_subanta( fn derive_krdanta(mut prakriya: Prakriya, dhatu: &Dhatu, args: &KrdantaArgs) -> Result { let p = &mut prakriya; + // If defined, set the meaning condition that this prakriya must follow. + if let Some(artha) = args.artha() { + p.set_artha(Artha::Krt(artha)); + } + if let Some(upa) = args.upapada() { let mut upapada = Term::make_upadesha(upa.text()); upapada.add_tag(Tag::Pratipadika); @@ -278,7 +292,7 @@ fn derive_taddhitanta( // If defined, set the meaning condition that this prakriya must follow. if let Some(artha) = args.artha() { - p.set_artha(artha); + p.set_artha(Artha::Taddhita(artha)); } // Begin the derivation. @@ -345,20 +359,24 @@ pub struct Ashtadhyayi { // Options we hope to add in the future: // - `nlp_mode` -- if set, preserve the final `s` and `r` of a pada, since these are important // to preserve for certain NLP use cases. - // - `chandasa` -- if set, also generate chaandasa forms. // - `svara` -- if set, enable accent rules. // - `extended` -- if set, enable rare rules that are less useful, such as 8.4.48 (aco // rahAbhyAM dve), which creates words like *kAryyate*, *brahmmA*, etc. // - `disable` -- if set, disable the rules provided. To implement this, we should make // `Prakriya::step` private and add a check statement in `Prakriya::op`. log_steps: bool, + // If set, also generate chaandasa forms. + is_chandasa: bool, } // TODO: better error handling. impl Ashtadhyayi { /// Creates a basic interface with sane defaults. pub fn new() -> Self { - Ashtadhyayi { log_steps: true } + Ashtadhyayi { + log_steps: true, + is_chandasa: false, + } } /// Returns a builder that exposes configuration options for how the engine runs rules and @@ -399,7 +417,11 @@ impl Ashtadhyayi { // TODO: to avoid wasting time on deriving words that we'll just throw out, push this // further into `derive_tinanta`. if let Some(pada) = args.pada() { - prakriyas.retain(|p| p.has_tag(pada.as_tag())); + use crate::args::Pada; + prakriyas.retain(|p| match pada { + Pada::Parasmai => p.has_tag(pada.as_tag()) && !p.has_tag(Tag::AmAtmanepada), + Pada::Atmane => p.has_tag_in(&[pada.as_tag(), Tag::AmAtmanepada]), + }); } prakriyas @@ -517,6 +539,16 @@ impl AshtadhyayiBuilder { self } + /// *(default: folse)* Controls whether or not to allow rules marked "chandasi," "mantre," etc.. + /// + /// - If `true`, each `Prakriya` will have access to chAndasa rules. + /// + /// - If `false`, each `Prakriya` will use a standard ruleset. + pub fn is_chandasa(mut self, value: bool) -> Self { + self.a.is_chandasa = value; + self + } + /// Creates an `Ashtadhyayi` struct. pub fn build(self) -> Ashtadhyayi { self.a diff --git a/vidyut-prakriya/src/atidesha.rs b/vidyut-prakriya/src/atidesha.rs index 10448dc..626d9fd 100644 --- a/vidyut-prakriya/src/atidesha.rs +++ b/vidyut-prakriya/src/atidesha.rs @@ -68,10 +68,10 @@ impl<'a> AtideshaPrakriya<'a> { /// Tries rules that add `Nit` to a term. fn try_add_nit(p: &mut Prakriya, i: usize) -> Option<()> { - let mut wrap = AtideshaPrakriya::new(p); + let mut ap = AtideshaPrakriya::new(p); - let cur = wrap.p.get(i)?; - let n = wrap.p.view(i + 1)?; + let cur = ap.p.get(i)?; + let n = ap.p.view(i + 1)?; let apit = !n.has_tag(T::pit); let iti = n.first()?.is_it_agama(); @@ -79,7 +79,7 @@ fn try_add_nit(p: &mut Prakriya, i: usize) -> Option<()> { let i_n = n.end(); if gan_kutadi && !n.has_tag_in(&[T::Rit, T::Yit]) { - wrap.add_nit("1.2.1", i_n); + ap.add_nit("1.2.1", i_n); } else if cur.has_u("vyaca~") && n.last()?.is_krt() && !n.has_tag_in(&[T::Rit, T::Yit]) @@ -87,14 +87,14 @@ fn try_add_nit(p: &mut Prakriya, i: usize) -> Option<()> { { // vyaceḥ kuṭāditvamanasīti tu neha pravartate, anasīti paryudāsena kṛnmātraviṣayatvāt // -- SK 655 - wrap.add_nit("1.2.1.v1", i_n); + ap.add_nit("1.2.1.v1", i_n); } else if cur.has_u_in(&["o~vijI~\\", "o~vijI~"]) && iti { // Just for these `vij` dhatus, according to the Kashika. - wrap.add_nit("1.2.2", i_n); + ap.add_nit("1.2.2", i_n); } else if cur.has_text("UrRu") && iti { - wrap.optional_add_nit("1.2.3", i_n); + ap.optional_add_nit("1.2.3", i_n); } else if n.has_tag(T::Sarvadhatuka) && apit { - wrap.add_nit("1.2.4", i_n); + ap.add_nit("1.2.4", i_n); } Some(()) diff --git a/vidyut-prakriya/src/atmanepada.rs b/vidyut-prakriya/src/atmanepada.rs index fffbd5c..63a6f54 100644 --- a/vidyut-prakriya/src/atmanepada.rs +++ b/vidyut-prakriya/src/atmanepada.rs @@ -23,6 +23,7 @@ const GAMY_RCCHI: &[(&str, Gana)] = &[ ("pra\\Ca~", Gana::Tudadi), ("svf", Gana::Bhvadi), ("f\\", Gana::Bhvadi), + ("f\\", Gana::Juhotyadi), ("Sru\\", Gana::Bhvadi), ("vida~", Gana::Adadi), ]; @@ -122,7 +123,7 @@ pub fn run(p: &mut Prakriya) -> Option<()> { // Exclude "san" per 1.3.62. // TODO: handle this better. let i = p.find_last_where(|t| t.is_dhatu() && !t.has_u("san"))?; - let has_upasargas = p.find_prev_where(i, |t| t.has_tag(T::Upasarga)).is_some(); + let has_upasargas = p.find_prev_where(i, |t| t.is_upasarga()).is_some(); if p.is_bhave_or_karmani() { p.op("1.3.13", op_atmanepada); diff --git a/vidyut-prakriya/src/dhatu_gana.rs b/vidyut-prakriya/src/dhatu_gana.rs index c0889a0..4a5b0f5 100644 --- a/vidyut-prakriya/src/dhatu_gana.rs +++ b/vidyut-prakriya/src/dhatu_gana.rs @@ -69,6 +69,8 @@ pub const GHAT_ADI: &[&str] = &[ "yama~", "sKadi~\\r", "svana~", + // TODO: why include PaR here? + "PaRa~", ]; /// Dhatus that are `mit` per DP.10.0493. diff --git a/vidyut-prakriya/src/dhatu_karya.rs b/vidyut-prakriya/src/dhatu_karya.rs index 8d26533..23fa5a8 100644 --- a/vidyut-prakriya/src/dhatu_karya.rs +++ b/vidyut-prakriya/src/dhatu_karya.rs @@ -45,7 +45,7 @@ fn try_run_bhvadi_gana_sutras(p: &mut Prakriya) -> Option<()> { let dhatu = p.get(i)?; let is_bhvadi = dhatu.has_gana(Gana::Bhvadi); - let has_upasarga = p.find_prev_where(i, |t| t.has_tag(T::Upasarga)).is_some(); + let has_upasarga = p.find_prev_where(i, |t| t.is_upasarga()).is_some(); // Exceptions to the general mittva rules below. let mut is_mit_blocked = false; @@ -156,6 +156,10 @@ fn try_satva_and_natva(p: &mut Prakriya, i: usize) -> Option<()> { t.add_tag(T::FlagAdeshadi); t.set_adi("n"); }); + } else if dhatu.has_u("DraRa~") { + p.op_term(Rule::Kaumudi("2318"), i, |t| { + t.set_text("Dran"); + }); } Some(()) diff --git a/vidyut-prakriya/src/it_agama.rs b/vidyut-prakriya/src/it_agama.rs index 68ca7e4..00b509e 100644 --- a/vidyut-prakriya/src/it_agama.rs +++ b/vidyut-prakriya/src/it_agama.rs @@ -34,7 +34,7 @@ use crate::operators as op; use crate::prakriya::{Code, Prakriya}; use crate::sounds::{s, Set}; use crate::tag::Tag as T; -use crate::term::Term; +use crate::term::{Term, TermView}; use lazy_static::lazy_static; lazy_static! { @@ -73,40 +73,68 @@ fn is_ever_vet(anga: &Term) -> bool { /// A wrapper for `Prakriya` that allows at most one it-Agama rule to be added to the derivation. /// If the calling code tries to add a second rule, that rule will be ignored. In the future, we /// should assert that a rule is never added twice. +#[derive(Debug)] struct ItPrakriya<'a> { p: &'a mut Prakriya, - added: bool, + i_anga: usize, + i_next: usize, + done: bool, } + impl<'a> ItPrakriya<'a> { - fn new(p: &'a mut Prakriya) -> Self { - ItPrakriya { p, added: false } + fn new(p: &'a mut Prakriya, i_anga: usize, i_next: usize) -> Self { + ItPrakriya { + p, + i_anga, + i_next, + done: false, + } + } + + /// Returns the anga after which we might add iw-Agama. + fn anga(&self) -> &Term { + self.p.get(self.i_anga).expect("present") + } + + /// Returns the view before which we might add iw-Agama. + fn next(&self) -> TermView { + self.p.view(self.i_next).expect("present") } - fn has_upasarga_in(&self, i: usize, values: &[&str]) -> bool { - if i == 0 { + /// Returns whether the term before the anga has an upasarga with one of the given values. + fn has_upasarga_in(&self, values: &[&str]) -> bool { + if self.i_anga == 0 { false } else { - self.p.has(i - 1, |t| t.has_text_in(values)) + self.p.has(self.i_anga - 1, |t| { + t.has_text_in(values) && t.is_upasarga() + }) } } - /// Inserts it-Agama at index i and prevents further rules. - fn set(&mut self, rule: Code, i: usize) { - if !self.added { + /// Inserts it-Agama and prevents further rules. + fn try_add(&mut self, rule: Code) { + self.add_with(rule, |_| {}) + } + + /// Inserts it-Agama and prevents further rules. + fn add_with(&mut self, rule: Code, func: impl Fn(&mut Prakriya)) { + if !self.done { let agama = Term::make_agama("iw"); - self.p.insert_before(i, agama); + self.p.insert_before(self.i_next, agama); + func(self.p); self.p.step(rule); - it_samjna::run(self.p, i).ok(); + + it_samjna::run(self.p, self.i_next).ok(); } - self.added = true; + self.done = true; } - /// Optionally inserts it-Agama at index i. - /// Returns whether the rule was applied. - fn optional_set(&mut self, rule: Code, i: usize) -> bool { - if !self.added { + /// Optionally inserts it-Agama and returns whether the rule was applied. + fn optional_try_add(&mut self, rule: Code) -> bool { + if !self.done { if self.p.is_allowed(rule) { - self.set(rule, i); + self.try_add(rule); true } else { self.p.decline(rule); @@ -118,18 +146,18 @@ impl<'a> ItPrakriya<'a> { } // Blocks it-Agama and prevents further rules. - fn anit(&mut self, rule: Code) { - if !self.added { + fn try_block(&mut self, rule: Code) { + if !self.done { self.p.step(rule); } - self.added = true; + self.done = true; } // Optionally blocks it-Agama. - fn optional_anit(&mut self, rule: Code) { - if !self.added { + fn optional_try_block(&mut self, rule: Code) { + if !self.done { if self.p.is_allowed(rule) { - self.anit(rule); + self.try_block(rule); } else { self.p.decline(rule); } @@ -137,442 +165,399 @@ impl<'a> ItPrakriya<'a> { } } -/// Runs general rules that prevent iT-Agama. +/// Runs rules that lengthen the iṭ-Agama. /// -/// (7.2.8 - 7.2.34) -fn try_general_anit(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - - let dhatu = wrap.p.get(i)?; - let n = wrap.p.get(i_n)?; - - let ti_tu_tra = &[ - "ti", "tu", "tra", "ta", "Ta", "si", "su", "sara", "ka", "sa", - ]; - - let is_uk = dhatu.has_antya(&*UK); - let sri_uk = dhatu.has_text("Sri") || is_uk; - let krti = n.has_tag(T::Krt); - - if krti && n.has_adi(&*VASH) { - wrap.anit("7.2.8"); - } else if krti && n.has_text_in(ti_tu_tra) && !n.has_u("kta") { - // dIpti, saktu, pattra, pota, kAzWa, kukzi, ikzu, akzara, Salka, vatsa, ... - // NOTE: exclude kta: - // - // > auṇādikasya eva taśabdasya grahaṇam iṣyate, na punaḥ ktasya - // -- Kashika Vrtti - wrap.anit("7.2.9"); - } else if (is_hacky_eka_ac(dhatu) || dhatu.has_text("UrRu")) && sri_uk && n.has_tag(T::kit) { - // Include UrRu: - // > ūrṇotestu vācya ūrṇorṇuvadbhāvo yaṅprasiddhiḥ prayojanam - // -- Kashikavrtti - wrap.anit("7.2.11"); - } else if n.has_u("san") && (dhatu.has_u_in(&["graha~^", "guhU~^"]) || is_uk) { - // Exclude "Sri" and "yu" because they are mentioned explicitly in 7.2.49. - wrap.anit("7.2.12"); - } else if n.is_nistha() { - if dhatu.has_text("Svi") || dhatu.has_tag(T::Idit) { - wrap.anit("7.2.14"); - } else if is_ever_vet(dhatu) { - wrap.anit("7.2.15"); - } else if dhatu.has_u_in(&["ruza~", "ama~", "YitvarA~\\", "svana~"]) - || (dhatu.has_u("Guzi~r") && wrap.has_upasarga_in(i, &["sam"])) - { - let dhatu = wrap.p.get(i)?; - let code = "7.2.28"; - if dhatu.has_u("YitvarA~\\") { - wrap.optional_set(code, i_n); - } else { - wrap.optional_anit(code); - } - } - - let dhatu = wrap.p.get(i)?; - if dhatu.has_tag(T::Adit) { - let mut can_run = true; - // TODO: Adikarmani. - if wrap.p.any(&[T::Bhave]) { - can_run = wrap.p.op_optional("7.2.17", |_| {}); - } - if can_run { - wrap.anit("7.2.16"); - } - } else if dhatu.has_u("arda~") { - if wrap.has_upasarga_in(i, &["sam", "ni", "vi"]) { - wrap.anit("7.2.24"); - } else if wrap.has_upasarga_in(i, &["aBi"]) { - wrap.optional_anit("7.2.25"); - } - } - // skipped: 7.2.18 - 23. +/// (7.2.37 - 7.2.40) +fn try_lengthen_it_agama(p: &mut Prakriya, i: usize) -> Option<()> { + if i == 0 { + return None; } - // TODO: 7.2.18 - 7.2.34 - Some(()) -} + let dhatu = p.get(i - 1)?; + let n = p.view(i)?; -/// Runs rules that add optional it for san. -fn try_it_rules_for_san(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - if !wrap.p.has(i_n, |t| t.has_u("san")) { + let last = p.terms().last()?; + if last.has_lakshana("li~w") { return None; } - let anga = wrap.p.get(i)?; - let rdhu_adi = &[ - "fD", "Brasj", "danB", "Sri", "svf", "yu", "UrRu", "Bar", "jYap", - ]; - if anga.text.ends_with("iv") - || anga.has_text_in(rdhu_adi) - || anga.has_u_in(&["zaRu~^", "zaRa~"]) - { - // didevizati, dudyUzati; - // ardiDizati, Irtsati; - // biBrajjizati, biBrakzati, biBarjjizati, biBarkzati - if !wrap.optional_set("7.2.49", i_n) { - wrap.anit("7.2.49"); + if dhatu.has_text("grah") { + if !n.has_tag(T::Cinvat) { + p.op_term("7.2.37", i, op::text("I")); + p.step("cinvat"); } - } else if anga.has_u_in(&["tanu~^", "patx~", "daridrA"]) { - // titanizati, titaMsati, titAMsati, ... - if !wrap.optional_set("7.2.49.v1", i_n) { - wrap.anit("7.2.49.v1"); + } else if dhatu.has_antya('F') || dhatu.has_text("vf") { + if last.has_lakshana("li~N") { + p.step("7.2.39"); + } else if n.slice().iter().any(|t| t.has_u("si~c")) && last.is_parasmaipada() { + p.step("7.2.40"); + } else { + p.op_optional("7.2.38", op::t(i, op::text("I"))); } } Some(()) } -/// Runs it rules specific to a following ktvA or nisthA pratyaya. -/// -/// 7.2.50 - 7.2.56 -fn try_it_rules_for_ktva_and_nistha(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - - let anga = wrap.p.get(i)?; - let n = wrap.p.view(i_n)?; - let ktvi = n.last()?.has_u("ktvA"); - - if !(ktvi || n.has_tag(T::Nistha)) { +fn run_valadau_ardhadhatuke_before_attva_for_term(ip: &mut ItPrakriya) -> Option<()> { + let anga = ip.anga(); + let n = ip.next(); + if !(n.has_adi(&*VAL) && n.has_tag(T::Ardhadhatuka)) { return None; } - if anga.has_text("kliS") { - // kliSitvA, klizwvA - wrap.optional_set("7.2.50", i_n); - // kliS is Udit, so even if this option is declined, it could be accepted later by 7.2.44. - // So for derivational clarity, block 7.2.44. - wrap.added = true; - } else if anga.has_u("pUN") { - // pUtvA, pavitvA - wrap.optional_set("7.2.51", i_n); - } else if anga.has_u("va\\sa~") || anga.has_text("kzuD") { - // uzitvA, kzuDitvA - // Match specifically on "va\\sa~" from bhU-gana because "vasa~\" from ad-gana will get it - // by the normal rules. - wrap.set("7.2.52", i_n); - } else if anga.has_text("anc") { - // aYcita, akta - wrap.optional_set("7.2.53", i_n); - } else if anga.has_text("luB") { - // lubDvA, luBitvA - wrap.optional_set("7.2.54", i_n); - } else if ktvi && anga.has_text_in(&["jF", "vrasc"]) { - // jaritvA, jarItvA, vraScitvA - wrap.set("7.2.55", i_n); - } else if ktvi && anga.has_tag(T::udit) { - // SamitvA, SAntvA, ... - wrap.optional_anit("7.2.56"); - } - Some(()) -} - -/// Runs iT rules specific to kvasu~ pratyaya. -fn try_rules_for_kvasu(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - let n = wrap.p.view(i_n)?; - - if !n.has_u("kvasu~") { - return None; - } - - let anga = wrap.p.get(i)?; - if anga.has_text_in(&["gam", "han", "vid", "viS"]) { - wrap.optional_set("7.2.68", i_n); - } else if anga.has_text("dfS") { - wrap.optional_set("7.2.68.v1", i_n); - } - - let anga = wrap.p.get(i)?; - - // Per the kashikavrtti, the condition is "kṛtadvirvacanānāṃ dhātūnām ekācām" -- if the dhatu - // *would have* one vowel after dvirvacana and all of the usual procedures there. - - // Dhatus that start with vowels (Adivas, ASivas, ...) - let is_ac_adi = anga.has_adi(&*AC); - // Dhatus that will start with vowels due to kit-samprasarana (Ucivas, Ijivas, ...). - // NOTE: keep this in sync with the `samprasarana` module. - let will_be_ac_adi = anga.has_u_in(&[ - "va\\ca~", - "ya\\ja~^", - "quva\\pa~^", - "va\\ha~^", - "va\\sa~", - "ve\\Y", - "vye\\Y", - "vada~", - ]); - // Dhatus that undergo ettva-abhyAsalopa (pecivas, Sekivas, ...) - let will_be_eka_ac = is_ac_adi || will_be_ac_adi; - - let code = "7.2.67"; - if will_be_eka_ac || anga.has_antya('A') || anga.has_text("Gas") { - wrap.set(code, i_n); - } else { - wrap.anit(code); - } - - None -} - -/// Runs iT rules specific to liT. Returns whether the iT-Agama procedure is complete. -fn try_rules_for_lit(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - let n = wrap.p.view(i_n)?; + let ktvi = n.last()?.has_u("ktvA"); - if !n.has_lakshana("li~w") { - return None; - } + if n.has_u("kvasu~") { + let anga = ip.anga(); + if anga.has_text_in(&["gam", "han", "vid", "viS"]) { + ip.optional_try_add("7.2.68"); + } else if anga.has_text("dfS") { + ip.optional_try_add("7.2.68.v1"); + } - let anga = wrap.p.get(i)?; - - // Rule 7.2.61 ("acas tAsvat ...") conditions on whether tAs would receive it-Agama. Estimate - // this by reproducing other it rules. - let rule_7_2_10 = anga.has_tag(T::Anudatta) && is_hacky_eka_ac(anga); - let is_anit_for_tas = rule_7_2_10; - - // These rules are always aniT. - if anga.has_text_in(&["kf", "sf", "Bf", "vf", "stu", "dru", "sru", "Sru"]) { - wrap.anit("7.2.13"); - } else if (anga.has_antya(&*AC) || anga.text.contains('a')) && n.has_u("Tal") && is_anit_for_tas - { - // Concise summary of rules: - // - The roots in 7.2.13 are aniT. All others are seT by valAdi (7.2.35). - // - However, there are the following exceptions for Tal: - // - roots ending in `f` (except `f`) are aniT. - // - roots ending in a vowel and roots with a middle 'a' are veT. - // - other roots listed in rules explicitly (e.g. in 7.2.66) - let code = if anga.has_antya(&*AC) { - Some("7.2.61") - } else if !anga.has_u("vayi~") { - // quick HACK to prevent *uvayTa. - Some("7.2.62") + let anga = ip.anga(); + + // Per the kashikavrtti, the condition is "kṛtadvirvacanānāṃ dhātūnām ekācām" -- if the dhatu + // *would have* one vowel after dvirvacana and all of the usual procedures there. + + // Dhatus that start with vowels (Adivas, ASivas, ...) + let is_ac_adi = anga.has_adi(&*AC); + // Dhatus that will start with vowels due to kit-samprasarana (Ucivas, Ijivas, ...). + // NOTE: keep this in sync with the `samprasarana` module. + let will_be_ac_adi = anga.has_u_in(&[ + "va\\ca~", + "ya\\ja~^", + "quva\\pa~^", + "va\\ha~^", + "va\\sa~", + "ve\\Y", + "vye\\Y", + "vada~", + ]); + // Dhatus that undergo ettva-abhyAsalopa (pecivas, Sekivas, ...) + let will_be_eka_ac = is_ac_adi || will_be_ac_adi; + + let code = "7.2.67"; + if will_be_eka_ac || anga.has_antya('A') || anga.has_text("Gas") { + ip.try_add(code); } else { - None - }; - - if let Some(code) = code { - // The last root is "vyeY" per siddhAntakaumudI. - if anga.has_u_in(&["a\\da~", "f\\", "vye\\Y"]) { - wrap.set("7.2.66", i_n); - } else if !anga.has_antya('f') { - // 7.2.63 Rto bhAradvAjasya - // In Bharadvaja's opinion, rule 7.2.61 applies only for final R. So for all - // other roots, this condition is optional: - if wrap.p.is_allowed(code) { - wrap.set(code, i_n); + ip.try_block(code); + } + } else if n.has_lakshana("li~w") { + if is_generally_vet(anga) { + // Per SK, 7.2.44 allows iw-Agama here. + ip.optional_try_add("7.2.44"); + ip.done = true; + } + + let anga = ip.anga(); + let n = ip.next(); + // These rules are always aniT. + if anga.has_text_in(&["kf", "sf", "Bf", "vf", "stu", "dru", "sru", "Sru"]) { + ip.try_block("7.2.13"); + } else if n.has_u("Tal") { + // Rule 7.2.61 ("acas tAsvat ...") conditions on whether tAs would receive it-Agama. + // Estimate this by reproducing other it rules. + let rule_7_2_10 = anga.has_tag(T::Anudatta) && is_hacky_eka_ac(anga); + let is_anit_for_tas = rule_7_2_10; + + if (anga.has_antya(&*AC) || anga.text.contains('a')) && is_anit_for_tas { + // Concise summary of rules: + // - The roots in 7.2.13 are aniT. All others are seT by valAdi (7.2.35). + // - However, there are the following exceptions for Tal: + // - roots ending in `f` (except `f`) are aniT. + // - roots ending in a vowel and roots with a middle 'a' are veT. + // - other roots listed in rules explicitly (e.g. in 7.2.66) + let code = if anga.has_antya(&*AC) { + Some("7.2.61") + } else if !anga.has_u("vayi~") { + // quick HACK to prevent *uvayTa. + Some("7.2.62") } else { - wrap.p.decline(code); - wrap.anit(code); + None + }; + + if let Some(code) = code { + // The last root is "vyeY" per siddhAntakaumudI. + if anga.has_u_in(&["a\\da~", "f\\", "vye\\Y"]) { + ip.try_add("7.2.66"); + } else if !anga.has_antya('f') { + // 7.2.63 Rto bhAradvAjasya + // In Bharadvaja's opinion, rule 7.2.61 applies only for final R. So for all + // other roots, this condition is optional: + if ip.p.is_allowed(code) { + ip.try_add(code); + } else { + ip.p.decline(code); + ip.try_block(code); + } + } else { + ip.try_block(code); + } } - } else { - wrap.anit(code); + } else if anga.has_text_in(&["sfj", "dfS"]) { + // By default, these will be seT. So the option allows aniT. + ip.optional_try_block("7.2.65"); } } - } else if anga.has_text_in(&["sfj", "dfS"]) && n.has_u("Tal") { - // By default, these will be seT. So the option allows aniT. - wrap.optional_anit("7.2.65"); - } - if !wrap.added { - // The effect of 7.2.13 is that all other roots are considerd `sew` by - // default. - wrap.p.step("7.2.13"); - let n = wrap.p.view(i + 1)?; - if n.has_adi(&*VAL) { - wrap.set("7.2.35", i_n); + if !ip.done { + // The effect of 7.2.13 is that all other roots are considerd `sew` by + // default. + ip.p.step("7.2.13"); + let n = ip.next(); + if n.has_adi(&*VAL) { + ip.try_add("7.2.35"); + } } - } - - Some(()) -} - -/// Runs iT rules that condition on a following ArdhadhAtuka suffix. -/// -/// (7.2.35 - 7.2.36 and 7.2.41 - 7.2.75) -fn try_ardhadhatuke_1(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let n = wrap.p.view(i + 1)?; - if !n.has_tag(T::Ardhadhatuka) { - return None; - } - - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - let anga = wrap.p.get(i)?; - - // Special cases - if n.has_u("sya") { + } else if n.has_u("sya") { if anga.has_antya('f') || anga.has_text("han") { - wrap.set("7.2.70", i_n); + ip.try_add("7.2.70"); } } else if n.has_u("si~c") { if anga.has_text("anj") { - wrap.set("7.2.71", i_n); - } else if wrap.p.terms().last()?.has_tag(T::Parasmaipada) { + ip.try_add("7.2.71"); + } else if ip.p.terms().last()?.has_tag(T::Parasmaipada) { if anga.has_u_in(&["zwu\\Y", "zu\\Y", "DUY"]) { - wrap.set("7.2.72", i_n); + ip.try_add("7.2.72"); } else if anga.has_text_in(&["yam", "ram", "nam"]) { - wrap.p.set(i, |t| t.text += "s"); - wrap.set("7.2.73", i_n); + let i_anga = ip.i_anga; + ip.add_with("7.2.73", |p| p.set(i_anga, |t| t.text += "s")); } else if anga.has_antya('A') { // Handle this after running Attva. See `run_after_attva` for details. return None; } } } else if n.has_u("san") { - if anga.has_u_in(&["zmi\\N", "pUN", "f\\", "anjU~", "aSU~\\"]) { - wrap.set("7.2.74", i_n); + let rdhu_adi = &[ + "fD", "Brasj", "danB", "Sri", "svf", "yu", "UrRu", "Bar", "jYap", + ]; + if anga.text.ends_with("iv") + || anga.has_text_in(rdhu_adi) + || anga.has_u_in(&["zaRu~^", "zaRa~"]) + { + // didevizati, dudyUzati; + // ardiDizati, Irtsati; + // biBrajjizati, biBrakzati, biBarjjizati, biBarkzati + if !ip.optional_try_add("7.2.49") { + ip.try_block("7.2.49"); + } + } else if anga.has_u_in(&["tanu~^", "patx~", "daridrA"]) { + // titanizati, titaMsati, titAMsati, ... + if !ip.optional_try_add("7.2.49.v1") { + ip.try_block("7.2.49.v1"); + } + } else if anga.has_u_in(&["zmi\\N", "pUN", "f\\", "anjU~", "aSU~\\"]) { + ip.try_add("7.2.74"); } else if anga.has_u_in(&["kF", "gF", "df\\N", "Df\\N", "pra\\Ca~"]) { // cikarizati, jigarizati, didarizate, diDarizate, papracCizati - wrap.set("7.2.75", i_n); + ip.try_add("7.2.75"); + } + } else if ktvi || n.last()?.is_nistha() { + if anga.has_text("kliS") { + // kliSitvA, klizwvA + ip.optional_try_add("7.2.50"); + // kliS is Udit, so even if this option is declined, it could be accepted later by 7.2.44. + // So for derivational clarity, block 7.2.44. + ip.done = true; + } else if anga.has_u("pUN") { + // pUtvA, pavitvA + ip.optional_try_add("7.2.51"); + } else if anga.has_u("va\\sa~") || anga.has_text("kzuD") { + // uzitvA, kzuDitvA + // Match specifically on "va\\sa~" from bhU-gana because "vasa~\" from ad-gana will get it + // by the normal rules. + ip.try_add("7.2.52"); + } else if anga.has_text("anc") { + // aYcita, akta + ip.optional_try_add("7.2.53"); + } else if anga.has_text("luB") { + // lubDvA, luBitvA + ip.optional_try_add("7.2.54"); + } else if ktvi && anga.has_text_in(&["jF", "vrasc"]) { + // jaritvA, jarItvA, vraScitvA + ip.try_add("7.2.55"); + } else if ktvi && anga.has_tag(T::udit) { + // SamitvA, SAntvA, ... + ip.optional_try_block("7.2.56"); } } - try_it_rules_for_san(wrap, i); - try_it_rules_for_ktva_and_nistha(wrap, i); + let anga = ip.anga(); + let n = ip.p.get(ip.i_next).expect("ok"); - Some(()) -} + let ti_tu_tra = &[ + "ti", "tu", "tra", "ta", "Ta", "si", "su", "sara", "ka", "sa", + ]; -fn try_ardhadhatuke_2(wrap: &mut ItPrakriya, i: usize) -> Option<()> { - let n = wrap.p.view(i + 1)?; - if !n.has_tag(T::Ardhadhatuka) { - return None; + let is_uk = anga.has_antya(&*UK); + let sri_uk = anga.has_text("Sri") || is_uk; + let krti = n.is_krt(); + + if krti && n.has_adi(&*VASH) { + ip.try_block("7.2.8"); + } else if krti && n.has_text_in(ti_tu_tra) && !n.has_u("kta") { + // dIpti, saktu, pattra, pota, kAzWa, kukzi, ikzu, akzara, Salka, vatsa, ... + // NOTE: exclude kta: + // + // > auṇādikasya eva taśabdasya grahaṇam iṣyate, na punaḥ ktasya + // -- Kashika Vrtti + ip.try_block("7.2.9"); + } else if (is_hacky_eka_ac(anga) || anga.has_text("UrRu")) && sri_uk && n.has_tag(T::kit) { + // Include UrRu: + // > ūrṇotestu vācya ūrṇorṇuvadbhāvo yaṅprasiddhiḥ prayojanam + // -- Kashikavrtti + ip.try_block("7.2.11"); + } else if n.has_u("san") && (anga.has_u_in(&["graha~^", "guhU~^"]) || is_uk) { + // Exclude "Sri" and "yu" because they are mentioned explicitly in 7.2.49. + ip.try_block("7.2.12"); + } else if n.is_nistha() { + if anga.has_text("Svi") || anga.has_tag(T::Idit) { + ip.try_block("7.2.14"); + } else if is_ever_vet(anga) { + ip.try_block("7.2.15"); + } else if anga.has_u_in(&["ruza~", "ama~", "YitvarA~\\", "svana~"]) + || (anga.has_u("Guzi~r") && ip.has_upasarga_in(&["sam"])) + { + let dhatu = ip.anga(); + let code = "7.2.28"; + if dhatu.has_u("YitvarA~\\") { + ip.optional_try_add(code); + } else { + ip.optional_try_block(code); + } + } + + let anga = ip.anga(); + if anga.has_tag(T::Adit) { + let mut can_run = true; + // TODO: Adikarmani. + if ip.p.any(&[T::Bhave]) { + can_run = ip.p.op_optional("7.2.17", |_| {}); + } + if can_run { + ip.try_block("7.2.16"); + } + } else if anga.has_u("arda~") { + if ip.has_upasarga_in(&["sam", "ni", "vi"]) { + ip.try_block("7.2.24"); + } else if ip.has_upasarga_in(&["aBi"]) { + ip.optional_try_block("7.2.25"); + } + } + // skipped: 7.2.18 - 23. } - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - let anga = wrap.p.get(i)?; - let n = wrap.p.view(i + 1)?; - let has_parasmaipada = wrap.p.has_tag(T::Parasmaipada); + let anga = ip.anga(); + let n = ip.next(); + let has_parasmaipada = ip.p.has_tag(T::Parasmaipada); let se = n.has_adi('s'); let krta_crta = &["kft", "cft", "Cfd", "tfd", "nft"]; let ishu_saha = &["izu~", "zaha~\\", "luBa~", "ruza~", "riza~"]; - if wrap.added { + if ip.done { // Do nothing } else if anga.has_u_in(gana::RADH_ADI) && n.has_adi(&*VAL) { // All of these roots are in scope for 7.2.10 (aniT). // So, this option allows seT. - wrap.optional_set("7.2.45", i_n); - } else if anga.has_u("kuza~") - && i > 0 - && wrap.p.has(i - 1, |t| t.is_upasarga() && t.has_u("nir")) - { + ip.optional_try_add("7.2.45"); + } else if anga.has_u("kuza~") && ip.has_upasarga_in(&["nir"]) { if n.has_tag(T::Nistha) { - wrap.set("7.2.47", i_n); + ip.try_add("7.2.47"); } else { - wrap.optional_anit("7.2.46"); + ip.optional_try_block("7.2.46"); } } else if anga.has_u_in(ishu_saha) && n.has_adi('t') { - wrap.optional_anit("7.2.48"); + ip.optional_try_block("7.2.48"); } else if anga.has_text_in(krta_crta) && se && !n.has_u("si~c") { - wrap.optional_anit("7.2.57"); + ip.optional_try_block("7.2.57"); } else if anga.has_text("gam") && has_parasmaipada && se { // gamizyati - wrap.set("7.2.58", i_n); + ip.try_add("7.2.58"); } else if anga.has_u_in(gana::VRT_ADI) && anga.has_gana(Bhvadi) && has_parasmaipada && se { // vartsyati (vfd), vartsyati (vfD), Sftsyati, syantsyati - wrap.anit("7.2.59"); + ip.try_block("7.2.59"); } else if anga.has_u("kfpU~\\") && has_parasmaipada && (se || n.has_u("tAsi~")) { // kalpsyati, kalpizyate (but not kalpizyati) - wrap.anit("7.2.60"); + ip.try_block("7.2.60"); } else if anga.has_text_in(&["snu", "kram"]) && n.has_adi(&*VAL) { // prasnozIzwa, prakraMsIzwa - if wrap.p.has_tag(T::Atmanepada) { - wrap.anit("7.2.36"); + if ip.p.has_tag(T::Atmanepada) { + ip.try_block("7.2.36"); } } // Optional rules (Udit and others) - let anga = wrap.p.get(i)?; - let n = wrap.p.view(i + 1)?; - let last = wrap.p.terms().last()?; - if n.has_adi(&*VAL) && !wrap.added { + let anga = ip.anga(); + let n = ip.next(); + let last = ip.p.terms().last()?; + if n.has_adi(&*VAL) && !ip.done { if is_generally_vet(anga) { // Synchronize choice of "it" with the choice of lun-vikarana in 3.1.45: // - if lun and using ksa, must use anit. // - if lun and not using ksa, must use set. // - otherwise, vet. - if wrap.p.has_tag(T::FlagHasAnitKsa) { - wrap.anit("7.2.44"); - } else if wrap.p.has_tag(T::FlagHagSetSic) { + if ip.p.has_tag(T::FlagHasAnitKsa) { + ip.try_block("7.2.44"); + } else if ip.p.has_tag(T::FlagHagSetSic) { // Do nothing; the control flow will fall through and pick up 7.2.35 further below. } else { - wrap.optional_anit("7.2.44") + ip.optional_try_block("7.2.44") } } else if (n.has_lakshana("li~N") || n.has_u("si~c")) && last.is_atmanepada() { let vft = anga.has_text("vf") || anga.has_antya('F'); if vft && n.has_tag(T::Ardhadhatuka) { // By default, all of these roots are seT. // So, the option allows anit. - wrap.optional_anit("7.2.42"); + ip.optional_try_block("7.2.42"); } else if anga.has_antya('f') && anga.is_samyogadi() { if anga.has_tag(T::Anudatta) { // For anit roots, optional seT. - wrap.optional_set("7.2.43", i_n); + ip.optional_try_add("7.2.43"); } else { // For seT roots, optional aniT. - wrap.optional_anit("7.2.43"); + ip.optional_try_block("7.2.43"); } } // TODO } } - let anga = wrap.p.get(i)?; - let n = wrap.p.view(i + 1)?; - if wrap.added { + // Base cases + let anga = ip.anga(); + let n = ip.next(); + if ip.done { // Do nothing } else if anga.has_tag(T::Anudatta) && is_hacky_eka_ac(anga) && !n.has_lakshana("li~w") { // 7.2.10 is a niyama to the general rule, which applies only to // ArdhadhAtuka suffixes. So we add a check for ArdhadhAtukatva here. // // Any li~w root not explictly included in 7.2.13 is also iT. - wrap.anit("7.2.10"); - } else if n.has_adi(&*VAL) && n.has_tag(T::Ardhadhatuka) { - wrap.set("7.2.35", i_n); + ip.try_block("7.2.10"); + } else { + ip.try_add("7.2.35"); } Some(()) } -/// Runs rules that introduce iw-Agama and aw-Agama before a sArvadhAtuka-pratyaya. -/// (7.2.76 - 7.2.78) -fn try_sarvadhatuke(p: &mut Prakriya, i: usize) -> Option<()> { - let anga = p.get(i)?; - let i_n = p.find_next_where(i, |t| !t.is_empty())?; - let n = p.view(i_n)?; - let tin = n.last()?; - +fn run_sarvadhatuke_for_term(ip: &mut ItPrakriya) -> Option<()> { + let n = ip.next(); if !(n.has_adi(&*VAL) && n.has_tag(T::Sarvadhatuka)) { return None; } + let anga = ip.anga(); + let i_n = ip.i_next; + let tin = n.last()?; + let rudh_adi = &["rudi~r", "Yizva\\pa~", "Svasa~", "ana~", "jakza~"]; let is_aprkta = n.slice().iter().map(|t| t.text.len()).sum::() == 1; if anga.has_u("a\\da~") && is_aprkta { - p.op("7.3.100", |p| op::insert_agama_before(p, i_n, "aw")); - it_samjna::run(p, i_n).ok()?; + ip.p.op("7.3.100", |p| op::insert_agama_before(p, i_n, "aw")); + it_samjna::run(ip.p, i_n).expect("ok"); } else if anga.has_u_in(rudh_adi) { // First, check if we should use It-agama instead. // @@ -585,88 +570,38 @@ fn try_sarvadhatuke(p: &mut Prakriya, i: usize) -> Option<()> { // - possible aprkta --> It agama in the rule below. let is_pit = n.has_tag(T::pit) && !n.has_tag(T::Nit); if n.has_adi(&*HAL) && n.has_tag(T::Sarvadhatuka) && is_pit && is_aprkta { - let use_at = p.op_optional("7.3.99", |p| op::insert_agama_before(p, i_n, "aw")); + let use_at = + ip.p.op_optional("7.3.99", |p| op::insert_agama_before(p, i_n, "aw")); if !use_at { - p.op("7.3.98", |p| op::insert_agama_before(p, i_n, "Iw")); + ip.p.op("7.3.98", |p| op::insert_agama_before(p, i_n, "Iw")); } - it_samjna::run(p, i_n).ok()?; + it_samjna::run(ip.p, i_n).ok()?; } else { // roditi, svapiti, Svasiti, aniti, jakziti - let mut wrap = ItPrakriya::new(p); - wrap.set("7.2.76", i_n); + ip.try_add("7.2.76"); } } else if anga.has_text("IS") && n.has_adi('s') { // ISize, ISizva - let mut wrap = ItPrakriya::new(p); - wrap.set("7.2.77", i_n); - } else if anga.has_text_in(&["Iq", "jan", "IS"]) - && (n.has_adi('s') || (tin.has_u("Dvam") && !tin.has_lakshana("la~N"))) - { + ip.try_add("7.2.77"); + } else if anga.has_text_in(&["Iq", "jan", "IS"]) && tin.has_text_in(&["se", "Dve"]) { // IqiDve, janiDve // // See kAshika on 7.2.78 for inclusion of IS here. // > "kṛtaṭeretvasya grahaṇāt laṅi dhvami na bhavitavyamiṭā" // - kashika on why laN is excluded. - let mut wrap = ItPrakriya::new(p); - wrap.set("7.2.78", i_n); - } - - Some(()) -} - -/// Runs rules that lengthen the iṭ-Agama. -/// -/// (7.2.37 - 7.2.40) -fn try_lengthen_it_agama(p: &mut Prakriya, i: usize) -> Option<()> { - if i == 0 { - return None; - } - - let dhatu = p.get(i - 1)?; - let n = p.view(i)?; - - let last = p.terms().last()?; - if last.has_lakshana("li~w") { - return None; - } - - if dhatu.has_text("grah") { - if !n.has_tag(T::Cinvat) { - p.op_term("7.2.37", i, op::text("I")); - p.step("cinvat"); - } - } else if dhatu.has_antya('F') || dhatu.has_text("vf") { - if last.has_lakshana("li~N") { - p.step("7.2.39"); - } else if n.slice().iter().any(|t| t.has_u("si~c")) && last.is_parasmaipada() { - p.step("7.2.40"); - } else { - p.op_optional("7.2.38", op::t(i, op::text("I"))); - } + ip.try_add("7.2.78"); } Some(()) } -fn run_before_attva_for_term(wrap: &mut ItPrakriya, i: usize) { - try_rules_for_kvasu(wrap, i); - try_rules_for_lit(wrap, i); - let ok = try_ardhadhatuke_1(wrap, i); - try_general_anit(wrap, i); - if ok.is_some() { - try_ardhadhatuke_2(wrap, i); - } - try_sarvadhatuke(wrap.p, i); -} - pub fn run_before_attva(p: &mut Prakriya) -> Option<()> { // The abhyasa might come second, so match on it specifically. - let mut wrap = ItPrakriya::new(p); - let n = wrap.p.terms().len(); + let n = p.terms().len(); debug_assert!(n > 0); for i in (0..n - 1).rev() { - let cur = wrap.p.get(i)?; + let cur = p.get(i)?; if cur.has_tag_in(&[T::Dhatu, T::Abhyasa]) { // Mark this term as "done" with it-Agama rules so that we don't try adding it back later @@ -677,14 +612,19 @@ pub fn run_before_attva(p: &mut Prakriya) -> Option<()> { // Skip it-Agama rules for Ji-pratyaya, which at this point hasn't been replaced. // But when it is replaced, it will always start with a vowel. - let i_n = wrap.p.find_next_where(i, |t| !t.is_empty())?; - if wrap.p.has(i_n, |t| t.has_u("Ji")) { + let i_n = p.find_next_where(i, |t| !t.is_empty())?; + if p.has(i_n, |t| t.has_u("Ji")) { continue; } - wrap.p.set(i, |t| t.add_tag(T::FlagIttva)); + // Add the `Ittva` tag so that we can skip this term next time. + p.set(i, |t| t.add_tag(T::FlagIttva)); - run_before_attva_for_term(&mut wrap, i); + if p.view(i_n).is_some() { + let mut ip = ItPrakriya::new(p, i, i_n); + run_valadau_ardhadhatuke_before_attva_for_term(&mut ip); + run_sarvadhatuke_for_term(&mut ip); + } } } diff --git a/vidyut-prakriya/src/iterators.rs b/vidyut-prakriya/src/iterators.rs index f6a8b03..028b51c 100644 --- a/vidyut-prakriya/src/iterators.rs +++ b/vidyut-prakriya/src/iterators.rs @@ -22,25 +22,3 @@ pub fn xy_rule( } Some(()) } - -pub fn xy_rule_rev( - p: &mut Prakriya, - filter: impl Fn(&Term, &Term) -> bool, - op: impl Fn(&mut Prakriya, usize, usize), -) -> Option<()> { - let n = p.terms().len(); - for j in (0..n).rev() { - let y = p.get(j)?; - if y.is_empty() { - continue; - } - - let i = p.find_prev_where(j, |t| !t.is_empty())?; - let x = p.get(i)?; - - if filter(x, y) { - op(p, i, j); - } - } - Some(()) -} diff --git a/vidyut-prakriya/src/krt/basic.rs b/vidyut-prakriya/src/krt/basic.rs index c26724b..cd2ca77 100644 --- a/vidyut-prakriya/src/krt/basic.rs +++ b/vidyut-prakriya/src/krt/basic.rs @@ -55,13 +55,11 @@ are true: - There is a rule that allows the given `krt`. - There is no rule that has blocked the given `krt`. - -The main functions here are `try_add_krt` and `try_add_krt_for_tacchila_etc`, which each have their -own control flow. For details, please see the docs for those functions. */ use crate::args::Gana; use crate::args::Krt; +use crate::args::KrtArtha::*; use crate::args::Taddhita; use crate::dhatu_gana as gana; use crate::it_samjna; @@ -76,14 +74,402 @@ use lazy_static::lazy_static; lazy_static! { static ref AC: Set = s("ac"); + static ref II: Set = s("i"); static ref IK: Set = s("ik"); + static ref UU: Set = s("u"); static ref PU: Set = s("pu~"); static ref HAL: Set = s("hal"); static ref EMPTY_TERM: Term = Term::make_text(""); } -fn is_nandi_grahi_pacadi(p: &KrtPrakriya, i: usize) -> bool { - let dhatu = p.get(i).expect("should be present"); +/// Tries to add various pratyayas that are just "a." +fn try_add_various_pratyayas(kp: &mut KrtPrakriya) { + use Krt::*; + + let upapada = kp.upapada(); + let upasarge = upapada.map(|t| t.is_upasarga()).unwrap_or(false); + + // "Kartari" comes from 3.4.67 and applies to all krt-pratyayas if not otherwise specified. + kp.with_context(Karta, |_| {}); + + // In this section, we ignore rule 3.1.94, which allows multiple pratyayas to optionally apply: + // + // > ṇvulaiva siddhe vuñvidhānaṃ jñāpanārthaṃ, tācchīlikeṣu vā'sarūpanyāyena tṛjādayo na bhavantīti + // > -- Kashika vrtti on 3.2.146 + // + // > tacchīlādiṣu vā'sarūpavidhirnāstīti। tenālaṅkārakaḥ, nirākartetyādīnāṃ tacchīlādiṣu sādhutvaṃ + // > na bhavati॥ + // > -- Nyasa on 3.2.146 + // + // Therefore, the pratyayas in this section are blocking: for a given dhatu, exactly one of these + // pratyayas can be used. + // + // That said, there are some minor exceptions here and there where multiple pratyayas can apply. + kp.with_context(TacchilaTaddharmaTatsadhukara, |kp| { + let dhatu = kp.dhatu(); + let i_dhatu = kp.i_dhatu; + + let has_prefix_and_text = |x, y| kp.has_upapada(x) && dhatu.has_text(y); + let last = kp.p.terms().last().expect("present"); + let has_nic = last.has_u("Ric"); + let has_yan = last.has_u("yaN"); + let has_san = last.has_u("san"); + + if has_prefix_and_text("alam", "kf") + || (kp.has_prefixes(&["nis", "A"]) && dhatu.has_text("kf")) + || has_prefix_and_text("pra", "jan") + || has_prefix_and_text("ud", "pac") + || has_prefix_and_text("ud", "pat") + || has_prefix_and_text("ud", "mad") + || dhatu.has_text("ruc") + || has_prefix_and_text("apa", "trap") + || dhatu.has_text_in(&["vft", "vfD", "sah", "car"]) + { + kp.try_add("3.2.136", izRuc); + } else if dhatu.has_text_in(&["glE", "ji", "sTA", "BU"]) { + kp.try_add("3.2.139", ksnu); + } else if dhatu.has_text_in(&["tras", "gfD", "Dfz", "kzip"]) { + kp.try_add("3.2.140", knu); + } else if dhatu.has_u_in(gana::SHAM_ADI) { + kp.try_add("3.2.141", GinuR); + } else if has_prefix_and_text("sam", "pfc") + || has_prefix_and_text("anu", "ruD") + || has_prefix_and_text("A", "yam") + || has_prefix_and_text("A", "yas") + || has_prefix_and_text("pari", "sf") + || has_prefix_and_text("sam", "sfj") + || has_prefix_and_text("pari", "dev") + || has_prefix_and_text("sam", "jvar") + || has_prefix_and_text("pari", "kzip") + || has_prefix_and_text("pari", "raw") + || has_prefix_and_text("pari", "vad") + || has_prefix_and_text("pari", "dah") + || has_prefix_and_text("pari", "muh") + || dhatu.has_text_in(&["duz", "dviz", "druh", "duh", "yuj"]) + || has_prefix_and_text("A", "krIq") + || has_prefix_and_text("vi", "vij") + || dhatu.has_text_in(&["tyaj", "ranj", "Baj"]) + || has_prefix_and_text("ati", "car") + || has_prefix_and_text("apa", "car") + || has_prefix_and_text("A", "muz") + || (kp.has_prefixes(&["aBi", "A"]) && dhatu.has_text("han")) + { + kp.try_add("3.2.142", GinuR); + } else if kp.has_upapada("vi") && dhatu.has_text_in(&["kaz", "las", "katT", "sranB"]) { + kp.try_add("3.2.143", GinuR); + } else if kp.has_upapada_in(&["vi", "apa"]) && dhatu.has_text("laz") { + kp.try_add("3.2.144", GinuR); + } else if kp.has_upapada("pra") + && dhatu.has_u_in(&["lapa~", "sf\\", "dru\\", "maTe~", "vada~", "va\\sa~"]) + { + kp.try_add("3.2.145", GinuR); + } + + // Break the `if` chain so that pari-kzip and pari-raw can match again here. + let dhatu = kp.dhatu(); + let has_prefix_and_text = |x, y| kp.has_upapada(x) && dhatu.has_text(y); + if dhatu.has_text_in(&["nind", "hins", "kliS", "KAd"]) + || (has_prefix_and_text("vi", "naS") && has_nic) + || has_prefix_and_text("pari", "kzip") + || has_prefix_and_text("pari", "raw") + || (has_prefix_and_text("pari", "vad") && has_nic) + || (kp.has_prefixes(&["vi", "A"]) && dhatu.has_text("BAz")) + // TODO: not in dhatupatha -- how does the prakriya start? + || dhatu.has_text("asUy") + { + kp.try_add("3.2.146", vuY); + } else if upasarge && dhatu.has_text_in(&["div", "kruS"]) { + kp.try_add("3.2.147", vuY); + } else if dhatu.has_text_in(&[ + "laz", "pat", "pad", "sTA", "BU", "vfz", "han", "kam", "gam", "SF", + ]) { + kp.try_add("3.2.154", ukaY); + } else if dhatu.has_text_in(&["jalp", "Bikz", "kuww", "lunw", "vf"]) { + kp.try_add("3.2.154", zAkan); + } else if dhatu.has_u_in(&["spfha", "gfha", "pata", "daya~\\"]) { + // Per kashika, first 3 are curAdi. + kp.try_add("3.2.158", Aluc); + // TODO: others + } else if dhatu.has_text_in(&["sf", "Gas", "ad"]) { + kp.try_add("3.2.160", kmarac); + } else if dhatu.has_text_in(&["Banj", "BAs", "mid"]) { + kp.try_add("3.2.161", Gurac); + } else if (dhatu.has_u("vida~") && dhatu.has_gana(Gana::Adadi)) + || dhatu.has_text_in(&["Bid", "Cid"]) + { + // Per commentaries, allow only this specific `vid`. + kp.try_add("3.2.162", kurac); + } else if dhatu.has_u("i\\R") || dhatu.has_text_in(&["naS", "ji", "sf"]) { + kp.try_add("3.2.163", kvarap); + } else if dhatu.has_text("jAgf") { + kp.try_add("3.2.165", Uka); + } else if dhatu.has_text_in(&["yaj", "jap", "daS"]) && has_yan { + kp.try_add("3.2.166", Uka); + } else if dhatu.has_text_in(&["nam", "kanp", "smi", "jas", "kam", "hins", "dIp"]) { + kp.try_add("3.2.167", ra); + } else if has_san || has_prefix_and_text("A", "Sans") || dhatu.has_text("Bikz") { + kp.try_add("3.2.168", u); + } else if dhatu.has_text_in(&["svap", "tfz"]) { + kp.try_add("3.2.172", najiN); + } else if dhatu.has_text_in(&["Sf", "vand"]) { + kp.try_add("3.2.173", Aru); + } else if dhatu.has_text("BI") { + if kp.krt == kruka { + kp.try_add("3.2.174.v1", kruka); + } else if kp.krt == kru { + kp.try_add("3.2.174", kru); + } else { + kp.try_add("3.2.174", klukan); + } + } else if dhatu.has_text_in(&["sTA", "IS", "BAs", "pis", "kas"]) { + kp.try_add("3.2.175", varac); + } else if i_dhatu > 0 && kp.p.has(i_dhatu - 1, |t| t.has_text("yA")) && has_yan { + // yAyAvara + kp.try_add("3.2.176", varac); + } else if dhatu.has_text_in(&["BrAj", "BAs", "Durv", "dyut", "Urj", "pF", "ju"]) { + // TODO: grAva-stut + kp.try_add("3.2.177", kvip); + } else if dhatu.has_text_in(&["yuj", "Cid", "Bid"]) { + // anyebhyo 'pi dRzyate -- so, include what the commentators mention. + kp.try_add("3.2.178", kvip); + } + + if !kp.had_match { + kp.try_add("3.2.135", tfn); + } + }); + + kp.with_context(Bhava, |kp| { + let dhatu = kp.dhatu(); + let i_dhatu = kp.i_dhatu; + if dhatu.has_text_in(&["pad", "ruj", "viS", "spfS"]) { + // pAda, roga, veSa, sparSa + kp.try_add("3.3.16", GaY); + } else if !upasarge && dhatu.has_text("sf") { + // sAra + kp.try_add("3.3.17", GaY); + } else if dhatu.has_u("i\\N") { + // aDyAya + kp.try_add("3.3.21", GaY); + } else if kp.has_upapada("AN") && dhatu.has_u_in(&["ru", "plu\\N"]) { + // ArAva, Arava, AplAva, Aplava + // (block 3.3.22) + kp.optional_try_add("3.3.50", GaY); + } else if upasarge && dhatu.has_u("ru") { + // saMrAva, uparAva + kp.try_add("3.3.22", GaY); + } else if kp.has_upapada("sam") && dhatu.has_u_in(&["yu", "dru\\", "du\\"]) { + // samyAva, sandrAva, sandAva + kp.try_add("3.3.23", GaY); + } else if !upasarge && dhatu.has_u_in(&["SriY", "RI\\Y", "BU"]) { + // SRAya, nAya, BAva + kp.try_add("3.3.24", GaY); + } else if kp.has_upapada("vi") && dhatu.has_u_in(&["wukzu", "Sru\\"]) { + // vikzAva, viSrAva + kp.try_add("3.3.25", GaY); + } else if kp.has_upapada_in(&["ava", "ud"]) && dhatu.has_u("RI\\Y") { + // avanAya, unnAya + kp.try_add("3.3.26", GaY); + } else if kp.has_upapada("pra") && dhatu.has_u_in(&["dru\\", "zwu\\Y", "sru\\"]) { + // pradrAva, prastAva, prasrAva + kp.try_add("3.3.27", GaY); + } else if (kp.has_upapada("nir") && dhatu.has_u_in(&["pUY", "pUN"])) + || (kp.has_upapada("aBi") && dhatu.has_u("lUY")) + { + // nizpAva, aBilAva, ... + // "pū iti pūṅpūñoḥ sāmānyena grahaṇam" (KV) + kp.try_add("3.3.28", GaY); + } else if kp.has_upapada_in(&["ud", "ni"]) && dhatu.has_u("gF") { + // "gṝ śabde, gṝ nigaraṇe, dvayorapi grahaṇam" (KV) + kp.try_add("3.3.29", GaY); + } else if kp.has_upapada_in(&["ud", "ni"]) + && dhatu.has_u("kF") + && dhatu.has_gana(Gana::Tudadi) + { + // utkAra, utkara + // "vikṣepārthasya kiratergrahaṇaṃ, na hiṃsārthasya" (KV) + kp.try_artha_add("3.3.30", GaY); + } else if kp.has_upapada("sam") && dhatu.has_u("zwu\\Y") { + // saMstAva, saMstava + kp.try_artha_add("3.3.31", GaY); + } else if dhatu.has_u("stFY") { + if kp.has_upapada("pra") { + // prastAra, prastara + kp.try_artha_add("3.3.32", GaY); + } else if kp.has_upapada("vi") { + // vistAra, vistara + kp.try_artha_add("3.3.33", GaY); + // vizwAra + kp.try_artha_add("3.3.34", GaY); + } + } else if dhatu.has_u("graha~^") { + // Collect all "grah" rules here, mainly for 3.3.45 + 3.3.51. + if kp.has_upapada("ud") { + // udgrAha + kp.try_add("3.3.35", GaY); + } + if kp.has_upapada("sam") { + // saNgrAha + kp.try_artha_add("3.3.36", GaY); + } + if kp.has_upapada_in(&["ava", "ni"]) { + // avagrAha, nigrAha + kp.try_artha_add("3.3.45", GaY); + } + if kp.has_upapada("pra") { + // pragrAha + kp.try_artha_add("3.3.46", GaY); + } + if kp.has_upapada("pari") { + // parigrAha + kp.try_artha_add("3.3.47", GaY); + } + } else if (kp.has_upapada("pari") && dhatu.has_u("RI\\Y")) + || (kp.has_upapada("ni") && dhatu.has_u("i\\R")) + { + // parinAya, nyAya + kp.try_artha_add("3.3.37", GaY); + } else if kp.has_upapada("pari") && dhatu.has_u("i\\R") { + kp.try_artha_add("3.3.38", GaY); + } else if kp.has_upapada_in(&["vi", "upa"]) && dhatu.has_u("SIN") { + kp.try_artha_add("3.3.39", GaY); + } else if dhatu.has_u("ci\\Y") { + if !kp.try_artha_add("3.3.40", GaY) { + kp.try_artha_add_with("3.3.41", GaY, |p| p.set(i_dhatu, op::adi("k"))); + kp.try_artha_add_with("3.3.42", GaY, |p| p.set(i_dhatu, op::adi("k"))); + } + } else if kp.has_upapada("ni") && dhatu.has_u_in(&["vfN", "vfY"]) { + // nIvAra + // "vṛ iti vṛṅvṛñoḥ sāmānyena grahaṇam" (KV) + kp.try_artha_add("3.3.48", GaY); + } else if kp.has_upapada("ud") && dhatu.has_u_in(&["SriY", "yu", "pUY", "dru\\"]) { + // ucCrAya, udyAva, utpAva, uddrAva + kp.try_add("3.3.49", GaY); + } + + // TODO: vibhasha + let dhatu = kp.dhatu(); + if kp.had_match { + } else if dhatu.has_u("graha~^") { + if kp.has_upapada("ava") { + kp.try_artha_add("3.3.51", GaY); + } + if kp.has_upapada("pra") { + kp.try_artha_add("3.3.52", GaY); + kp.try_artha_add("3.3.53", GaY); + } + } else if kp.has_upapada("pra") && dhatu.has_u("vfY") { + // pravAra, pravara + kp.optional_try_add("3.3.54", GaY); + } else if kp.has_upapada("pari") && dhatu.has_u("BU") { + // pariBAva, pariBava + kp.optional_try_add("3.3.55", GaY); + } + + let dhatu = kp.dhatu(); + if kp.had_match { + // Skip. + } else if dhatu.has_u_in(&["graha~^", "vfY", "df", "ga\\mx~"]) + || (kp.has_upapada_in(&["nir", "nis"]) && dhatu.has_u("ci\\Y")) + { + kp.try_add("3.3.58", ap); + } else if upasarge && dhatu.has_u("a\\da~") { + if kp.has_upapada("ni") { + // nyAda, niGasa + kp.optional_try_add("3.3.60", Ra); + } + // viGasa, praGasa + kp.try_add("3.3.59", ap); + } else if !upasarge && dhatu.has_u_in(&["vya\\Da~", "japa~"]) { + // vyaDa, japa + kp.try_add("3.3.61", ap); + } else if !upasarge && dhatu.has_u_in(&["svana~", "hase~"]) { + // svana, svAna, hasa, hAsa + kp.optional_try_add("3.3.62", ap); + } else if kp.has_upapada_in(&["sam", "upa", "ni", "vi"]) && dhatu.has_u("ya\\ma~") { + // saMyAma, saMyama, ... + kp.optional_try_add("3.3.63", ap); + } else if kp.has_upapada("ni") && dhatu.has_u_in(&["gada~", "Rada~", "paWa~", "svana~"]) { + // nigada, nigAda, ... + kp.optional_try_add("3.3.64", ap); + } else if dhatu.has_u("kvaRa~") { + // kvaRa + kp.optional_try_add("3.3.65", ap); + } else if dhatu.has_u("paRa~\\") { + // paRa + kp.try_artha_add("3.3.66", ap); + } else if !upasarge && dhatu.has_u("madI~") { + kp.try_add("3.3.67", ap); + } else if kp.has_upapada_in(&["sam", "ud"]) && dhatu.has_u("aja~") { + // samaja, udaja + kp.try_artha_add("3.3.69", ap); + } else if kp.has_upapada("upa") && dhatu.has_u("sf\\") { + // upasara + // (The KV's examples all use upa-.) + kp.try_artha_add("3.3.71", ap); + } else if dhatu.has_u("hve\\Y") { + if kp.has_upapada_in(&["ni", "aBi", "upa", "vi"]) { + // nihava, aBihava, upahava, vihava + kp.try_add_with("3.3.72", ap, |p| p.set(i_dhatu, op::text("hu"))); + } else if kp.has_upapada("AN") { + // Ahava + kp.try_artha_add_with("3.3.73", ap, |p| p.set(i_dhatu, op::text("hu"))); + } else if !upasarge { + // hava + kp.try_add_with("3.3.75", ap, |p| p.set(i_dhatu, op::text("hu"))); + } + } else if dhatu.has_u("ha\\na~") { + if !upasarge { + kp.try_add_with("3.3.76", ap, |p| p.set(i_dhatu, op::text("vaD"))); + } + } + + // Base cases + let dhatu = kp.dhatu(); + if kp.had_match { + } else if dhatu.has_antya(&*II) { + // caya, ... + kp.try_add("3.3.56", ac); + } else if dhatu.has_antya('F') || dhatu.has_antya(&*UU) { + // kara, yava, ... + kp.try_add("3.3.57", ap); + } else { + kp.try_add("3.3.18", GaY); + } + }); + + let i_dhatu = kp.i_dhatu; + let dhatu = kp.dhatu(); + let is_han = dhatu.has_u("ha\\na~"); + kp.with_context(Murti, |kp| { + if is_han { + kp.try_artha_add_with("3.3.77", ap, |p| p.set(i_dhatu, op::text("Gan"))); + } + }); + kp.with_context(Desha, |kp| { + if is_han && kp.has_upapada("antar") { + kp.try_artha_add_with("3.3.78", ap, |p| p.set(i_dhatu, op::text("Gan"))); + } + }); + + kp.with_context(Samjna, |kp| { + let dhatu = kp.dhatu(); + if kp.has_upapada("ava") && dhatu.has_u_in(&["tF", "stFY"]) { + kp.try_add("3.3.120", GaY); + } else if dhatu.has_u("Kanu~^") { + kp.optional_try_add("3.3.125", Ga); + } + + // Base case + let dhatu = kp.dhatu(); + if dhatu.has_antya(&*HAL) { + kp.try_add("3.3.121", GaY); + } + }) +} + +fn is_nandi_grahi_pacadi(kp: &KrtPrakriya) -> bool { + let dhatu = kp.dhatu(); // TODO: add the others. const NAND_ADI: &[&str] = &["nand", "jalp", "ram", "dfp"]; @@ -130,130 +516,132 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { // For convenience below, wrap `Prakriya` in a new `KrtPrakriya` type that contains `krt` and // records whether or not any of these rules were applied. - let mut wrap = KrtPrakriya::new(p, krt); - let i_dhatu = wrap.p.find_first_where(|t| t.is_dhatu())?; - let dhatu = wrap.get(i_dhatu)?; + let mut kp = KrtPrakriya::new(p, krt); + try_add_various_pratyayas(&mut kp); - let upapada = match wrap.p.get_if(0, |t| t.has_tag(T::Pratipadika)) { + let i_dhatu = kp.p.find_first_where(|t| t.is_dhatu())?; + let dhatu = kp.dhatu(); + + let upapada = match kp.p.get_if(0, |t| t.has_tag(T::Pratipadika)) { Some(t) => t, None => &EMPTY_TERM, }; - let nau = wrap.p.has(i_dhatu + 1, |t| t.has_u("Ric")); - let upasarge = i_dhatu > 0 && wrap.p.has(i_dhatu - 1, |t| t.is_upasarga()); + let nau = kp.p.has(i_dhatu + 1, |t| t.has_u("Ric")); + let upasarge = i_dhatu > 0 && kp.p.has(i_dhatu - 1, |t| t.is_upasarga()); match krt { aR | ka | ac | wa | wak => { if upapada.has_text_in(&["kzema", "priya", "madre"]) && dhatu.has_u("qukf\\Y") { // Also repeated for khac below. - wrap.try_add("3.2.44", aR); + kp.try_add("3.2.44", aR); } else if dhatu.has_u_in(&["hve\\Y", "ve\\Y", "mA\\N"]) { - wrap.try_add("3.2.2", aR); + kp.try_add("3.2.2", aR); } else if dhatu.has_u("zWA\\") { // Also 3.2.77 - wrap.try_add("3.2.4", ka); + kp.try_add("3.2.4", ka); } else if dhatu.has_u("KyAY") { // gosaNKya - wrap.try_add("3.2.7", ka); + kp.try_add("3.2.7", ka); } else if !upasarge && dhatu.has_u("gE\\") { // for pA, see 3.2.8.v1 below. - wrap.try_add("3.2.8", wak); + kp.try_add("3.2.8", wak); } else if upapada.has_text_in(&["surA", "SIDu"]) && !upasarge && dhatu.has_u("pA\\") && dhatu.has_gana(Gana::Bhvadi) { - wrap.try_add("3.2.8.v1", wak); + kp.try_add("3.2.8.v1", wak); } else if dhatu.has_u("hf\\Y") { - if wrap.has_upasarga(i_dhatu, "AN") { + if kp.has_upapada("AN") { // tAcCIlye - wrap.optional_try_add("3.2.11", ac); + kp.optional_try_add("3.2.11", ac); } else { // an-udyamane, vayasi - wrap.optional_try_add("3.2.9", ac); + kp.optional_try_add("3.2.9", ac); } } else if dhatu.has_u("graha~^") { if upapada.has_text_in(&[ "Sakti", "lANgala", "aNkuSa", "yazwi", "tomara", "Gawa", "GaWI", "Danus", ]) { - wrap.try_add("3.2.9.v1", ac); + kp.try_add("3.2.9.v1", ac); } else if upapada.has_text("sUtra") { // dhAri-arthe - wrap.optional_try_add("3.2.9.v2", ac); + kp.optional_try_add("3.2.9.v2", ac); } } else if !upasarge && dhatu.has_antya('A') { - wrap.try_add("3.2.3", ka); - } else if wrap.has_upasarga_dhatu(i_dhatu, "pari", "mfjU~") - || wrap.has_upasarga_dhatu(i_dhatu, "apa", "Ru\\da~^") + kp.try_add("3.2.3", ka); + } else if kp.has_upasarga_dhatu(i_dhatu, "pari", "mfjU~") + || kp.has_upasarga_dhatu(i_dhatu, "apa", "Ru\\da~^") { - wrap.try_add("3.2.5", ka); - } else if wrap.has_upasarga(i_dhatu, "pra") && dhatu.has_u_in(&["qudA\\Y", "jYA\\"]) { - wrap.try_add("3.2.6", ka); - } else if wrap.has_upasarga(i_dhatu, "AN") && dhatu.has_u("hf\\Y") { - wrap.try_add("3.2.11", ac); + kp.try_add("3.2.5", ka); + } else if kp.has_upapada("pra") && dhatu.has_u_in(&["qudA\\Y", "jYA\\"]) { + kp.try_add("3.2.6", ka); + } else if kp.has_upapada("AN") && dhatu.has_u("hf\\Y") { + kp.try_add("3.2.11", ac); } else if dhatu.has_u("arha~") { - wrap.try_add("3.2.12", ac); + kp.try_add("3.2.12", ac); } else if upapada.has_text("Sam") { - wrap.try_add("3.2.14", ac); + kp.try_add("3.2.14", ac); } else if dhatu.has_u("SIN") { - wrap.try_add("3.2.15", ac); + kp.try_add("3.2.15", ac); } else if dhatu.has_u("cara~") { if upapada.has_text_in(&["BikzA", "senA", "AdAya"]) { - wrap.try_add("3.2.17", wa); + kp.try_add("3.2.17", wa); } else { - wrap.try_add("3.2.16", wa); + kp.try_add("3.2.16", wa); } } else if dhatu.has_u("sf\\") { if upapada.has_text_in(&["puraH", "agrataH", "agre"]) { - wrap.try_add("3.2.18", wa); + kp.try_add("3.2.18", wa); } else if upapada.has_text("pUrva") { - wrap.try_add("3.2.19", wa); + kp.try_add("3.2.19", wa); } } else if dhatu.has_u("qukf\\Y") { if upapada.has_text_in(&DIVA_ADI) || upapada.has_tag(T::Sankhya) { - wrap.try_add("3.2.21", wa); + kp.try_add("3.2.21", wa); } else if upapada.has_text("karman") { - wrap.optional_try_add("3.2.22", wa); + kp.optional_try_add("3.2.22", wa); } else if upapada.has_text_in(&[ "Sabda", "Sloka", "kalaha", "gATA", "vEra", "cAwu", "sUtra", "mantra", "pada", ]) { - wrap.p.step("3.2.23"); + kp.p.step("3.2.23"); } else { - wrap.try_add("3.2.20", wa); + kp.try_add("3.2.20", wa); } } else if dhatu.has_u("ha\\na~") { if upapada.has_text_in(&["jAyA", "pati"]) { // Sense is "lakshane". - wrap.optional_try_add("3.2.52", krt); + kp.optional_try_add("3.2.52", krt); } else if upapada.has_text_in(&["hastin", "kapAwa"]) { // Sense is "shaktau". - wrap.optional_try_add("3.2.54", krt); + kp.optional_try_add("3.2.54", krt); } else if upapada.has_text_in(&["pARi", "tAqa"]) && krt == ka { let sub = if upapada.has_text("pARi") { "pARiGa" } else { "tAqaGa" }; - wrap.optional_do_nipatana("3.2.55", sub); + kp.optional_do_nipatana("3.2.55", sub); } else { // Sense is "a-manuSya-kartrke". - wrap.optional_try_add("3.2.53", krt); + kp.optional_try_add("3.2.53", krt); } } // (base case) - if !wrap.has_krt { + if !kp.has_krt { // kumBakAra, ... - wrap.try_add("3.2.1", aR); + kp.try_add("3.2.1", aR); } } in_ => { if upapada.has_text_in(&["stamba", "Sakft"]) && dhatu.has_u("qukf\\Y") { - wrap.try_add("3.2.24", krt); + kp.try_add("3.2.24", krt); } else if dhatu.has_u("hf\\Y") { if upapada.has_text_in(&["dfti", "nATa"]) { - wrap.try_add("3.2.25", krt); + kp.try_add("3.2.25", krt); } } else if (upapada.has_text("Pala") && dhatu.has_u("graha~^")) || (upapada.has_text("Atman") && dhatu.has_u("quBf\\Y")) @@ -263,7 +651,7 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { } else { "AtmamBari" }; - wrap.do_nipatana("3.2.26", sub); + kp.do_nipatana("3.2.26", sub); } } KaS => { @@ -272,30 +660,30 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { let dhma = dhatu.has_u("DmA\\"); let dhe = dhatu.has_u("De\\w"); if dhatu.has_text("ej") && nau { - wrap.try_add("3.2.28", krt); + kp.try_add("3.2.28", krt); } else if (nasika && (dhma || dhe)) || (stana && dhe) { - wrap.try_add("3.2.29", krt); + kp.try_add("3.2.29", krt); } else if (dhma || dhe) && upapada.has_text_in(&["nAqI", "muzwi"]) { - wrap.try_add("3.2.30", krt); + kp.try_add("3.2.30", krt); } else if upapada.has_text("kUla") - && wrap.has_upasarga(i_dhatu, "ud") + && kp.has_upapada("ud") && dhatu.has_u_in(&["ru\\jo~", "va\\ha~^"]) { - wrap.try_add("3.2.31", krt); + kp.try_add("3.2.31", krt); } else if upapada.has_text_in(&["vaha", "aBra"]) && dhatu.has_u("li\\ha~^") { - wrap.try_add("3.2.32", krt); + kp.try_add("3.2.32", krt); } else if dhatu.has_u("qupa\\ca~^z") { if upapada.has_text_in(&["mita", "naKa"]) { - wrap.try_add("3.2.34", krt); + kp.try_add("3.2.34", krt); } else { - wrap.try_add("3.2.33", krt); + kp.try_add("3.2.33", krt); } } else if upapada.has_text_in(&["viDu", "arus"]) && dhatu.has_u("tu\\da~^") { - wrap.try_add("3.2.35", krt); + kp.try_add("3.2.35", krt); } else if (upapada.has_text("asUrya") && dhatu.has_u("df\\Si~r")) || (upapada.has_text("lalAwa") && dhatu.has_u("ta\\pa~")) { - wrap.try_add("3.2.36", krt); + kp.try_add("3.2.36", krt); } else if (upapada.has_text("ugra") && dhatu.has_u("df\\Si~r")) || (upapada.has_text("irA") && dhatu.has_u("madI~")) || (upapada.has_text("pARi") && dhatu.has_u("DmA\\")) @@ -307,35 +695,35 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { } else { "pARinDama" }; - wrap.do_nipatana("3.2.37", sub); + kp.do_nipatana("3.2.37", sub); } else if dhatu.has_u("ma\\na~\\") { - wrap.try_add("3.2.83", krt); + kp.try_add("3.2.83", krt); } } Kac => { if upapada.has_text_in(&["priya", "vaSa"]) && dhatu.has_u("vada~") { - wrap.try_add("3.2.38", krt); + kp.try_add("3.2.38", krt); } else if upapada.has_text_in(&["dvizat", "para"]) && dhatu.has_text("tAp") && nau { - wrap.try_add("3.2.39", krt); + kp.try_add("3.2.39", krt); } else if upapada.has_text("vAc") && dhatu.has_text("yam") { - wrap.try_add("3.2.40", krt); + kp.try_add("3.2.40", krt); } else if upapada.has_text_in(&["pur", "sarva"]) && ((dhatu.has_text("dAr") && nau) || dhatu.has_text("sah")) { - wrap.try_add("3.2.41", krt); + kp.try_add("3.2.41", krt); } else if upapada.has_text_in(&["sarva", "kUla", "aBra", "karIza"]) && dhatu.has_text("kaz") { - wrap.try_add("3.2.42", krt); + kp.try_add("3.2.42", krt); } else if dhatu.has_u("qukf\\Y") { if upapada.has_text_in(&["meGa", "fti", "Baya"]) { - wrap.try_add("3.2.43", krt); + kp.try_add("3.2.43", krt); } else if upapada.has_text_in(&["kzema", "priya", "madra"]) { - wrap.try_add("3.2.44", krt); + kp.try_add("3.2.44", krt); } } else if upapada.has_text("ASita") && dhatu.has_u("BU") { - wrap.try_add("3.2.45", krt); + kp.try_add("3.2.45", krt); } } @@ -344,78 +732,78 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { if upapada.has_text_in(&[ "anta", "atyanta", "aDvan", "dUra", "pAra", "sarva", "ananta", ]) { - wrap.try_add("3.2.48", krt); + kp.try_add("3.2.48", krt); } } else if dhatu.has_u("ha\\na~") { - if upapada.has_text_in(&["kleSa", "tamas"]) && wrap.has_upasarga(i_dhatu, "apa") { - wrap.try_add("3.2.50", krt); + if upapada.has_text_in(&["kleSa", "tamas"]) && kp.has_upapada("apa") { + kp.try_add("3.2.50", krt); } else { - wrap.try_add("3.2.49", krt); + kp.try_add("3.2.49", krt); } } else if dhatu.has_u("janI~\\") { // TODO: upapada - wrap.try_add("3.2.97", krt); + kp.try_add("3.2.97", krt); } } Rini => { if upapada.has_text_in(&["kumAra", "Sirza"]) && dhatu.has_u("ha\\na~") { - wrap.try_add("3.2.51", krt); + kp.try_add("3.2.51", krt); } else if upapada.has_text("vrata") { - wrap.try_add("3.2.80", krt); + kp.try_add("3.2.80", krt); } else if dhatu.has_u("ma\\na~\\") { - wrap.try_add("3.2.82", krt); + kp.try_add("3.2.82", krt); } else if dhatu.has_u("ya\\ja~^") { - wrap.try_add("3.2.85", krt); + kp.try_add("3.2.85", krt); } else if dhatu.has_u("ha\\na~") { - wrap.try_add("3.2.86", krt); + kp.try_add("3.2.86", krt); } else { - wrap.try_add("3.2.78", krt); + kp.try_add("3.2.78", krt); } } Kyun => { if upapada.has_text_in(&ADHYA_ADI) && dhatu.has_u("qukf\\Y") { - wrap.try_add("3.2.56", krt); + kp.try_add("3.2.56", krt); } } KizRuc | KukaY => { if upapada.has_text_in(&ADHYA_ADI) && dhatu.has_u("BU") { - wrap.try_add("3.2.57", krt); + kp.try_add("3.2.57", krt); } } kvin | kaY => { if upapada.has_text_in(TYAD_ADI) && dhatu.has_u("df\\Si~r") { - wrap.try_add("3.2.60", krt); + kp.try_add("3.2.60", krt); } else if krt == kvin { if !upapada.has_text("udaka") && dhatu.has_text("spfS") { - wrap.try_add("3.2.58", kvin); + kp.try_add("3.2.58", kvin); } else { let code = "3.2.59"; if upapada.has_text("ftu") && dhatu.has_u("ya\\ja~^") { - wrap.do_nipatana(code, "ftvij"); + kp.do_nipatana(code, "ftvij"); } else if dhatu.has_u("YiDfzA~") { - wrap.do_nipatana(code, "daDfz"); + kp.do_nipatana(code, "daDfz"); } else if dhatu.has_u("sf\\ja~") { - wrap.do_nipatana(code, "sraj"); + kp.do_nipatana(code, "sraj"); } else if dhatu.has_u("di\\Sa~^") { - wrap.do_nipatana(code, "diS"); - } else if wrap.has_upasarga(i_dhatu, "ud") && dhatu.has_u("zRi\\ha~") { - wrap.do_nipatana(code, "uzRih"); + kp.do_nipatana(code, "diS"); + } else if kp.has_upapada("ud") && dhatu.has_u("zRi\\ha~") { + kp.do_nipatana(code, "uzRih"); } else if dhatu.has_u("ancu~") { - wrap.p.op_term(code, i_dhatu, |t| { + kp.p.op_term(code, i_dhatu, |t| { t.set_text("aYc"); t.add_tag(T::Krt); }); // HACK: update bookkeeping here. - wrap.has_krt = true; - wrap.tried = true; + kp.has_krt = true; + kp.had_match = true; } else if dhatu.has_u("yu\\ji~^r") { - wrap.do_nipatana(code, "yuj"); + kp.do_nipatana(code, "yuj"); } else if dhatu.has_u("krunca~") { - wrap.do_nipatana(code, "kruYc"); + kp.do_nipatana(code, "kruYc"); } } } @@ -424,17 +812,17 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { viw => { if dhatu.has_u("a\\da~") { if upapada.has_text("kravya") { - wrap.try_add("3.2.69", krt); + kp.try_add("3.2.69", krt); } else if !upapada.has_text("anna") { - wrap.try_add("3.2.68", krt); + kp.try_add("3.2.68", krt); } } } kap => { if dhatu.has_u("du\\ha~^") { - wrap.try_add_with("3.2.70", krt, |p, i| { - p.set(i, |t| t.set_antya("G")); + kp.try_add_with("3.2.70", krt, |p| { + p.set(i_dhatu, |t| t.set_antya("G")); }); } } @@ -442,203 +830,44 @@ fn try_add_upapada_krt(p: &mut Prakriya, krt: Krt) -> Option { kvip => { if dhatu.has_u("ha\\na~") { if upapada.has_text_in(&["brahman", "BrURa", "vftra"]) { - wrap.try_add("3.2.87", krt); + kp.try_add("3.2.87", krt); } } else if dhatu.has_u("zWA\\") { - wrap.try_add("3.2.77", krt); + kp.try_add("3.2.77", krt); } else if upapada.has_text("soma") && dhatu.has_u("zu\\Y") { - wrap.try_add("3.2.90", krt); + kp.try_add("3.2.90", krt); } else if upapada.has_text("agni") && dhatu.has_u("ci\\Y") { - wrap.try_add("3.2.91", krt); + kp.try_add("3.2.91", krt); } else { - wrap.try_add("3.2.76", krt); + kp.try_add("3.2.76", krt); } } ini => { - if wrap.has_upasarga(i_dhatu, "vi") && dhatu.has_u("qukrI\\Y") { + if kp.has_upapada("vi") && dhatu.has_u("qukrI\\Y") { if upapada.has_text("DAnya") { - wrap.p.step(Rule::Kashika("3.2.93")); + kp.p.step(Rule::Kashika("3.2.93")); } else { - wrap.try_add("3.2.93", krt); + kp.try_add("3.2.93", krt); } } } kvanip => { if dhatu.has_u("df\\Si~r") { - wrap.try_add("3.2.94", krt); + kp.try_add("3.2.94", krt); } else if dhatu.has_u_in(&["qukf\\Y", "yu\\Da~\\"]) { if upapada.has_text("rAjan") { - wrap.try_add("3.2.95", krt); + kp.try_add("3.2.95", krt); } else if upapada.has_text("saha") { - wrap.try_add("3.2.96", krt); + kp.try_add("3.2.96", krt); } } } _ => {} } - Some(wrap.has_krt) -} - -/// Runs rules that try to add `krt` in one of three specific senses. (3.2.134 - 3.2.179) -/// -/// The three senses of these pratyayas are: -/// - tacchIla (nature) -/// - taddharma (duty) -/// - tatsAdhukAra (ability) -/// -/// -/// ### Control flow -/// -/// In this section, we ignore rule 3.1.94, which allows multiple pratyayas to optionally apply: -/// -/// > ṇvulaiva siddhe vuñvidhānaṃ jñāpanārthaṃ, tācchīlikeṣu vā'sarūpanyāyena tṛjādayo na bhavantīti -/// > -- Kashika vrtti on 3.2.146 -/// -/// > tacchīlādiṣu vā'sarūpavidhirnāstīti। tenālaṅkārakaḥ, nirākartetyādīnāṃ tacchīlādiṣu sādhutvaṃ -/// > na bhavati॥ -/// > -- Nyasa on 3.2.146 -/// -/// Therefore, the pratyayas in this section are blocking: for a given dhatu, exactly one of these -/// pratyayas can be used. -/// -/// That said, there are some minor exceptions here and there where multiple pratyayas can apply. -fn try_add_krt_for_tacchila_etc(p: &mut KrtPrakriya, i: usize, krt: Krt) -> Option<()> { - use Krt as K; - - // `i` is the index of the last item called dhatu. - let dhatu = p.get(i)?; - - let prev = if i > 0 { p.get(i - 1) } else { None }; - let upasarge = prev.map_or(false, |t| t.has_tag(T::Upasarga)); - - let has_prefix_and_text = |x, y| p.has_prefix(x) && dhatu.has_text(y); - let has_nic = p.p.terms().last()?.has_u("Ric"); - let has_yan = p.p.terms().last()?.has_u("yaN"); - let has_san = p.p.terms().last()?.has_u("san"); - - if has_prefix_and_text("alam", "kf") - || (p.has_prefixes(&["nis", "A"]) && dhatu.has_text("kf")) - || has_prefix_and_text("pra", "jan") - || has_prefix_and_text("ud", "pac") - || has_prefix_and_text("ud", "pat") - || has_prefix_and_text("ud", "mad") - || dhatu.has_text("ruc") - || has_prefix_and_text("apa", "trap") - || dhatu.has_text_in(&["vft", "vfD", "sah", "car"]) - { - p.try_add("3.2.136", K::izRuc); - } else if dhatu.has_text_in(&["glE", "ji", "sTA", "BU"]) { - p.try_add("3.2.139", K::ksnu); - } else if dhatu.has_text_in(&["tras", "gfD", "Dfz", "kzip"]) { - p.try_add("3.2.140", K::knu); - } else if dhatu.has_u_in(gana::SHAM_ADI) { - p.try_add("3.2.141", K::GinuR); - } else if has_prefix_and_text("sam", "pfc") - || has_prefix_and_text("anu", "ruD") - || has_prefix_and_text("A", "yam") - || has_prefix_and_text("A", "yas") - || has_prefix_and_text("pari", "sf") - || has_prefix_and_text("sam", "sfj") - || has_prefix_and_text("pari", "dev") - || has_prefix_and_text("sam", "jvar") - || has_prefix_and_text("pari", "kzip") - || has_prefix_and_text("pari", "raw") - || has_prefix_and_text("pari", "vad") - || has_prefix_and_text("pari", "dah") - || has_prefix_and_text("pari", "muh") - || dhatu.has_text_in(&["duz", "dviz", "druh", "duh", "yuj"]) - || has_prefix_and_text("A", "krIq") - || has_prefix_and_text("vi", "vij") - || dhatu.has_text_in(&["tyaj", "ranj", "Baj"]) - || has_prefix_and_text("ati", "car") - || has_prefix_and_text("apa", "car") - || has_prefix_and_text("A", "muz") - || (p.has_prefixes(&["aBi", "A"]) && dhatu.has_text("han")) - { - p.try_add("3.2.142", K::GinuR); - } else if p.has_prefix("vi") && dhatu.has_text_in(&["kaz", "las", "katT", "sranB"]) { - p.try_add("3.2.143", K::GinuR); - } else if p.has_prefix_in(&["vi", "apa"]) && dhatu.has_text("laz") { - p.try_add("3.2.144", K::GinuR); - } else if p.has_prefix("pra") - && dhatu.has_u_in(&["lapa~", "sf\\", "dru\\", "maTe~", "vada~", "va\\sa~"]) - { - p.try_add("3.2.145", K::GinuR); - } - - // Break the `if` chain so that pari-kzip and pari-raw can match again here. - let dhatu = p.get(i)?; - let has_prefix_and_text = |x, y| p.has_prefix(x) && dhatu.has_text(y); - if dhatu.has_text_in(&["nind", "hins", "kliS", "KAd"]) - || (has_prefix_and_text("vi", "naS") && has_nic) - || has_prefix_and_text("pari", "kzip") - || has_prefix_and_text("pari", "raw") - || (has_prefix_and_text("pari", "vad") && has_nic) - || (p.has_prefixes(&["vi", "A"]) && dhatu.has_text("BAz")) - // TODO: not in dhatupatha -- how does the prakriya start? - || dhatu.has_text("asUy") - { - p.try_add("3.2.146", K::vuY); - } else if upasarge && dhatu.has_text_in(&["div", "kruS"]) { - p.try_add("3.2.147", K::vuY); - } else if dhatu.has_text_in(&[ - "laz", "pat", "pad", "sTA", "BU", "vfz", "han", "kam", "gam", "SF", - ]) { - p.try_add("3.2.154", K::ukaY); - } else if dhatu.has_text_in(&["jalp", "Bikz", "kuww", "lunw", "vf"]) { - p.try_add("3.2.154", K::zAkan); - } else if dhatu.has_text_in(&["sf", "Gas", "ad"]) { - p.try_add("3.2.160", K::kmarac); - } else if dhatu.has_text_in(&["Banj", "BAs", "mid"]) { - p.try_add("3.2.161", K::Gurac); - } else if (dhatu.has_u("vida~") && dhatu.has_gana(Gana::Adadi)) - || dhatu.has_text_in(&["Bid", "Cid"]) - { - // Per commentaries, allow only this specific `vid`. - p.try_add("3.2.162", K::kurac); - } else if dhatu.has_u("i\\R") || dhatu.has_text_in(&["naS", "ji", "sf"]) { - p.try_add("3.2.163", krt); - } else if dhatu.has_text("jAgf") { - p.try_add("3.2.165", K::Uka); - } else if dhatu.has_text_in(&["yaj", "jap", "daS"]) && has_yan { - p.try_add("3.2.166", K::Uka); - } else if dhatu.has_text_in(&["nam", "kanp", "smi", "jas", "kam", "hins", "dIp"]) { - p.try_add("3.2.167", K::ra); - } else if has_san || has_prefix_and_text("A", "Sans") || dhatu.has_text("Bikz") { - p.try_add("3.2.168", K::u); - } else if dhatu.has_text_in(&["svap", "tfz"]) { - p.try_add("3.2.172", K::najiN); - } else if dhatu.has_text_in(&["Sf", "vand"]) { - p.try_add("3.2.173", K::Aru); - } else if dhatu.has_text("BI") { - if krt == K::kruka { - p.try_add("3.2.174.v1", K::kruka); - } else if krt == K::kru { - p.try_add("3.2.174", K::kru); - } else { - p.try_add("3.2.174", K::klukan); - } - } else if dhatu.has_text_in(&["sTA", "IS", "BAs", "pis", "kas"]) { - p.try_add("3.2.175", K::varac); - } else if i > 0 && p.p.has(i - 1, |t| t.has_text("yA")) && has_yan { - // yAyAvara - p.try_add("3.2.176", K::varac); - } else if dhatu.has_text_in(&["BrAj", "BAs", "Durv", "dyut", "Urj", "pF", "ju"]) { - // TODO: grAva-stut - p.try_add("3.2.177", K::kvip); - } else if dhatu.has_text_in(&["yuj", "Cid", "Bid"]) { - // anyebhyo 'pi dRzyate -- so, include what the commentators mention. - p.try_add("3.2.178", K::kvip); - } - - if !p.tried { - p.try_add("3.2.135", K::tfn); - } - - Some(()) + Some(kp.has_krt) } /// Runs rules that try to add the given `krt` suffix to the dhatu. (3.1.91 - 3.4.76) @@ -676,29 +905,29 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { let prev = if i > 0 { p.get(i - 1) } else { None }; // Pre-calculate some common properties. - let upasarge = prev.map_or(false, |t| t.has_tag(T::Upasarga)); + let upasarge = prev.map_or(false, |t| t.is_upasarga()); let supi = prev.map_or(false, |t| t.has_tag(T::Sup)); // For convenience below, wrap `Prakriya` in a new `KrtPrakriya` type that contains `krt` and // records whether or not any of these rules were applied. - let mut wrap = KrtPrakriya::new(p, krt); - let dhatu = wrap.get(i)?; + let mut kp = KrtPrakriya::new(p, krt); + let dhatu = kp.dhatu(); + let i_dhatu = kp.i_dhatu; match krt { // ------------------------------------------ // krtyAH // ------------------------------------------ K::tavyat | K::tavya | K::anIyar => { - let added = wrap.try_add("3.1.96", krt); - if added && krt == K::tavyat && wrap.get(i)?.has_u("va\\sa~") { + let added = kp.try_add("3.1.96", krt); + if added && krt == K::tavyat && kp.dhatu().has_u("va\\sa~") { // vAstavya - wrap.p - .op_optional("3.1.96.v1", op::t(i + 1, |t| t.add_tag(T::Rit))); + kp.p.op_optional("3.1.96.v1", op::t(i + 1, |t| t.add_tag(T::Rit))); } } K::kelimar => { - wrap.try_add("3.1.96.v2", krt); + kp.try_add("3.1.96.v2", krt); } // "ya" (3.1.97 - 3.1.132) @@ -714,93 +943,95 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { let mut skip_3_1_110 = false; // Specific rules (optional) - let dhatu = wrap.get(i)?; + let dhatu = kp.dhatu(); if dhatu.has_u("fca~") { // ṛdupadhādapi ṛcerata eva nipātanāt ṇyat bhavati - wrap.try_add("7.3.66", K::Ryat); - } else if dhatu.has_u("quBf\\Y") { - wrap.optional_try_add("3.1.112", K::kyap); + kp.try_add("7.3.66", K::Ryat); + } else if dhatu.has_text("Bf") { + kp.optional_try_add("3.1.112", K::kyap); } else if dhatu.has_u_in(&["qukf\\Y", "vfzu~"]) { if dhatu.has_text("kf") { - wrap.optional_try_add("3.1.120", K::kyap); + kp.optional_try_add("3.1.120", K::kyap); } else { // This rule makes rule 3.1.110 optional for vfz. - skip_3_1_110 = wrap.p.op_optional("3.1.120", |_| {}); + skip_3_1_110 = kp.p.op_optional("3.1.120", |_| {}); } } else if dhatu.has_text("mfj") { // This rule makes rule 3.1.110 optional for mfj. - skip_3_1_110 = wrap.p.op_optional("3.1.113", |_| {}); + skip_3_1_110 = kp.p.op_optional("3.1.113", |_| {}); } // Specific rules (required) - let dhatu = wrap.get(i)?; + let dhatu = kp.dhatu(); + let mut avashyaka_blocked = false; if dhatu.has_u_in(&["Sa\\kx~", "zaha~\\"]) { - wrap.try_add("3.1.99", K::yat); + kp.try_add("3.1.99", K::yat); } else if dhatu.has_u_in(&["gada~", "madI~", "cara~", "ya\\ma~"]) && !upasarge { - wrap.try_add("3.1.100", K::yat); - } else if dhatu.has_u("cara~") && i > 0 && wrap.get(i - 1)?.has_u("AN") { - wrap.optional_try_add("3.1.100.v1", K::yat); + kp.try_add("3.1.100", K::yat); + } else if dhatu.has_u("cara~") && kp.has_upapada("AN") { + kp.optional_try_add("3.1.100.v1", K::yat); } else if !upasarge && dhatu.has_text("vad") && supi { - wrap.try_add("3.1.106", K::yat); - wrap.try_add("3.1.106", K::kyap); + kp.try_add("3.1.106", K::yat); + kp.try_add("3.1.106", K::kyap); } else if !upasarge && supi && dhatu.has_u("BU") { // The condition here is bhAve, but per the kashika, it is always bhAve per 3.4.70, // so it is effectively nitya. - wrap.try_add("3.1.107", K::kyap); + kp.try_add("3.1.107", K::kyap); } else if !upasarge && supi && dhatu.has_u("ha\\na~") { - wrap.try_add_with("3.1.108", K::kyap, |p, i| { - p.set(i, |t| t.set_antya("t")); + kp.try_add_with("3.1.108", K::kyap, |p| { + p.set(i_dhatu, |t| t.set_antya("t")); }); - } else if dhatu.has_u("i\\R") || dhatu.has_text_in(&["stu", "SAs", "vf", "df", "juz"]) { - wrap.try_add("3.1.109", K::kyap); + } else if dhatu.has_u_in(&["i\\R", "zwu\\Y", "SAsu~", "vfY", "df", "juzI~\\"]) { + kp.try_add("3.1.109", K::kyap); + avashyaka_blocked = true; } else if dhatu.has_upadha('f') && !dhatu.has_text_in(&["kfp", "cft"]) && !skip_3_1_110 { - wrap.try_add("3.1.110", K::kyap); + kp.try_add("3.1.110", K::kyap); } else if dhatu.has_text("Kan") { - wrap.try_add_with("3.1.111", K::kyap, |p, i| { - p.set(i, |t| t.set_antya("I")); + kp.try_add_with("3.1.111", K::kyap, |p| { + p.set(i_dhatu, |t| t.set_antya("I")); }); - } else if (wrap.has_prefix("A") && dhatu.has_text("su")) || dhatu.has_text_in(vapi_rapi) + } else if (kp.has_upapada("A") && dhatu.has_text("su")) || dhatu.has_text_in(vapi_rapi) { - wrap.try_add("3.1.126", K::Ryat); + kp.try_add("3.1.126", K::Ryat); } // General rules (optional) - let dhatu = wrap.get(i)?; - if dhatu.has_antya('u') || dhatu.has_antya('U') { - wrap.optional_try_add("3.1.125", K::Ryat); + let dhatu = kp.dhatu(); + if (dhatu.has_antya('u') || dhatu.has_antya('U')) && !avashyaka_blocked { + kp.optional_try_add("3.1.125", K::Ryat); } else if dhatu.has_u("ha\\na~") { - wrap.optional_try_add_with("3.1.97.v2", K::yat, |p, i| { - p.set(i, |t| t.set_text("vaD")); + kp.optional_try_add_with("3.1.97.v2", K::yat, |p| { + p.set(i_dhatu, |t| t.set_text("vaD")); }); } // General rules (obligatory) - let dhatu = wrap.get(i)?; - if !wrap.tried { + let dhatu = kp.dhatu_end(); + if !kp.had_match { if dhatu.has_upadha('a') && dhatu.has_antya(&*PU) { // Sapya, laBya, japya - wrap.try_add("3.1.98", K::yat); + kp.try_add("3.1.98", K::yat); } else if dhatu.has_u_in(&["taka~", "Sasu~\\", "cate~^", "yatI~\\", "janI~\\"]) { - wrap.try_add("3.1.97.v1", K::yat); + kp.try_add("3.1.97.v1", K::yat); } else if dhatu.has_antya('f') || dhatu.has_antya('F') || dhatu.has_antya(&*HAL) { - wrap.try_add("3.1.124", K::Ryat); + kp.try_add("3.1.124", K::Ryat); } else if dhatu.has_antya(&*AC) { - wrap.try_add("3.1.97", K::yat); + kp.try_add("3.1.97", K::yat); } } } K::Rvul | K::tfc => { - wrap.try_add("3.1.133", krt); + kp.try_add("3.1.133", krt); } K::lyu | K::Rini => { - if is_nandi_grahi_pacadi(&wrap, i) { - wrap.try_add("3.1.134", krt); + if is_nandi_grahi_pacadi(&kp) { + kp.try_add("3.1.134", krt); } else if krt == K::Rini { // TODO: supi - wrap.try_add("3.2.78", krt); + kp.try_add("3.2.78", krt); } } @@ -808,56 +1039,58 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { K::ac | K::Sa | K::ka | K::Ra => { // These are all bhvAdi dhAtus, so also check for `Bhvadi` to avoid other dhatus. let pa_ghra = &["pA\\", "GrA\\", "DmA\\", "De\\w", "df\\Si~r"]; + let dhatu = kp.dhatu_end(); if upasarge && dhatu.has_u_in(pa_ghra) && dhatu.has_gana(Gana::Bhvadi) { - wrap.try_add("3.1.137", K::Sa); + kp.try_add("3.1.137", K::Sa); } else if dhatu.has_u_in(&[ "li\\pa~^", "vi\\dx~^", "pF", "vida~", "cita~", "sAti", "zaha~\\", ]) { - wrap.try_add("3.1.138", K::Sa); + kp.try_add("3.1.138", K::Sa); } else if dhatu.has_upadha(&*IK) || dhatu.has_u_in(&["JYA\\", "prI\\Y", "kF"]) { // vikzipa, viliKa, buDa - wrap.try_add("3.1.135", K::ka); + kp.try_add("3.1.135", K::ka); } else if upasarge && dhatu.has_antya('A') { - wrap.try_add("3.1.136", K::ka); + kp.try_add("3.1.136", K::ka); } else if krt == K::ac { // ajvidhiḥ sarvadhātubhyaḥ paṭhyante ca pacādayaḥ। aṇbādhanārtham eva // syāt sidhyanti śvapacādayaḥ। - wrap.try_add(Rule::Kashika("3.1.134"), K::ac); + kp.try_add(Rule::Kashika("3.1.134"), K::ac); } else if dhatu.has_u_in(&["wudu\\", "RI\\Y"]) && !upasarge { - wrap.try_add("3.1.142", K::Ra); + kp.try_add("3.1.142", K::Ra); } else if dhatu.has_u("graha~^") { - wrap.try_add("3.1.144", K::ka); + kp.optional_try_add("3.1.143", K::aR); + kp.optional_try_add("3.1.144", K::ka); } } K::zvun | K::vun => { if dhatu.has_text_in(&["nft", "Kan", "ranj"]) { - wrap.try_add_with("3.1.145", K::zvun, |p, i| { - if p.has(i, |t| t.has_text("ranj")) { + kp.try_add_with("3.1.145", K::zvun, |p| { + if p.has(i_dhatu, |t| t.has_text("ranj")) { // per kashika - p.set(i, |t| t.set_upadha("")); + p.set(i_dhatu, |t| t.set_upadha("")); } }); } else if dhatu.has_text_in(&["pru", "sf", "lU"]) { - wrap.try_add("3.1.149", K::vun); + kp.try_add("3.1.149", K::vun); } // Allowed for all dhatus in the sense of ASIH. - wrap.try_add("3.1.150", K::vun); + kp.try_add("3.1.150", K::vun); } K::Takan => { if dhatu.has_text("gE") { - wrap.try_add("3.1.146", krt); + kp.try_add("3.1.146", krt); } } K::Ryuw => { if dhatu.has_text("gE") { - wrap.try_add("3.1.146", krt); + kp.try_add("3.1.146", krt); } else if dhatu.has_text("hA") { - wrap.try_add("3.1.148", krt); + kp.try_add("3.1.148", krt); } } @@ -874,49 +1107,49 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { let skip = (dhatu.has_text("sU") && !dhatu.has_gana(Gana::Adadi)) || (dhatu.has_text("vid") && dhatu.has_tag(T::xdit)); if !skip { - wrap.try_add("3.2.61", krt); + kp.try_add("3.2.61", krt); } } else { - wrap.try_add("3.2.76", krt); + kp.try_add("3.2.76", krt); } } K::Rvi => { if dhatu.has_u("Ba\\ja~^") { - wrap.try_add("3.2.62", krt); + kp.try_add("3.2.62", krt); } } K::manin | K::kvanip | K::vanip | K::vic => { let code = "3.2.75"; if krt == K::manin && dhatu.has_text("Bas") { - wrap.try_add(code, krt); + kp.try_add(code, krt); } else if krt == K::vic && dhatu.has_text("riz") { - wrap.try_add(code, krt); + kp.try_add(code, krt); } } K::kta | K::ktavatu => { if dhatu.has_tag(T::YIt) { - wrap.try_add("3.2.187", Krt::kta); + kp.try_add("3.2.187", Krt::kta); } - wrap.try_add("3.2.102", krt); + kp.try_add("3.2.102", krt); - if wrap.has_krt { - let i_last = wrap.p.terms().len() - 1; - wrap.p.op_term("1.1.26", i_last, op::add_tag(T::Nistha)); + if kp.has_krt { + let i_last = kp.p.terms().len() - 1; + kp.p.op_term("1.1.26", i_last, op::add_tag(T::Nistha)); } } K::Nvanip => { if dhatu.has_u("zu\\Y") || dhatu.has_text("yaj") { - wrap.try_add("3.2.103", krt); + kp.try_add("3.2.103", krt); } } K::atfn => { if dhatu.has_text("jF") { - wrap.try_add("3.2.104", krt); + kp.try_add("3.2.104", krt); } } @@ -938,12 +1171,12 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { // > kavayastu bahulaṃ prayuñjate । taṃ tasthivāṃsaṃ nagaropakaṇṭhe iti । śreyāṃsi // > sarvāṇyadhijagmuṣaste ityādi ॥ // -- Siddhanta Kaumudi on 3.2.107. - if !wrap.has_krt { - let i_la = wrap.p.terms().len() - 1; + if !kp.has_krt { + let i_la = kp.p.terms().len() - 1; if krt == K::kvasu && dhatu.has_text_in(&["sad", "vas", "Sru"]) { - wrap.try_replace_lakara("3.2.108", i_la, krt); + kp.try_replace_lakara("3.2.108", i_la, krt); } else { - wrap.try_replace_lakara("3.2.107", i_la, krt); + kp.try_replace_lakara("3.2.107", i_la, krt); } } } @@ -952,9 +1185,9 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { // TODO: 3.3.130 - 3.2.133 K::Satf | K::SAnac => { let has_pada_match = match krt { - K::Satf => wrap.p.has_tag(T::Parasmaipada), + K::Satf => kp.p.has_tag(T::Parasmaipada), // taṅānāv ātmanepadam (1.4.100) - K::SAnac => wrap.p.has_tag(T::Atmanepada), + K::SAnac => kp.p.has_tag(T::Atmanepada), _ => false, }; @@ -972,19 +1205,19 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { */ // 3.2.125 and 3.2.126 define other semantics conditions for Satf and SAnac. - if has_pada_match && !wrap.has_krt { - let i_la = wrap.p.terms().len() - 1; - wrap.try_replace_lakara("3.2.128", i_la, krt); - wrap.p.op_term("3.2.127", i_la, op::add_tag(T::Sat)); + if has_pada_match && !kp.has_krt { + let i_la = kp.p.terms().len() - 1; + kp.try_replace_lakara("3.2.128", i_la, krt); + kp.p.op_term("3.2.127", i_la, op::add_tag(T::Sat)); } } // These are treated separately from SAnac because they are not `Lat` replacements. K::SAnan | K::cAnaS => { if dhatu.has_text_in(&["pU", "yaj"]) { - wrap.try_add("3.2.128", K::SAnan); + kp.try_add("3.2.128", K::SAnan); } else { - wrap.try_add("3.2.129", K::cAnaS); + kp.try_add("3.2.129", K::cAnaS); } } @@ -993,8 +1226,8 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { // The normal control flow resumes from 3.2.180 onward. K::qu => { - if wrap.has_prefix_in(&["vi", "pra", "sam"]) && dhatu.has_text("BU") { - wrap.try_add("3.2.180", krt); + if kp.has_upapada_in(&["vi", "pra", "sam"]) && dhatu.has_text("BU") { + kp.try_add("3.2.180", krt); } } @@ -1015,76 +1248,54 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { "Ra\\ha~^", ]; if dhatu.has_u("De\\w") { - wrap.try_add("3.2.181", krt); + kp.try_add("3.2.181", krt); } else if dhatu.has_u_in(DAP_ADI) { - wrap.try_add("3.2.182", krt); + kp.try_add("3.2.182", krt); } else if dhatu.has_text("pU") { - wrap.try_add("3.2.183", krt); + kp.try_add("3.2.183", krt); } } K::itra => { if dhatu.has_text_in(&["f", "lU", "DU", "sU", "Kan", "sah", "car"]) { - wrap.try_add("3.2.184", krt); + kp.try_add("3.2.184", krt); } else if dhatu.has_text("pU") { // Also allowed by 3.2.186. - wrap.try_add("3.2.185", krt); + kp.try_add("3.2.185", krt); } } K::tumun => { - wrap.try_add("3.3.10", krt); - } - - K::GaY => { - if wrap.has_prefix("ava") && dhatu.has_u_in(&["tF", "stFY"]) { - wrap.try_add("3.3.120", K::GaY); - } else { - // TODO: move with other a-pratyayas? - let dhatu = wrap.get(i)?; - if dhatu.has_text_in(&["pad", "ruj", "viS", "spfS"]) { - wrap.try_add("3.3.16", K::GaY); - } else if dhatu.has_text("sf") { - wrap.try_add("3.3.17", K::GaY); - } else { - wrap.try_add("3.3.18", K::GaY); - } - } - } - - K::ap => { - if dhatu.has_u("aja~") && i > 0 && wrap.p.has(i - 1, |t| t.has_u_in(&["sam", "ud"])) { - wrap.try_add("3.3.69", krt); - } + kp.try_add("3.3.10", krt); } K::ktri => { if dhatu.has_tag(T::qvit) { - if wrap.try_add("3.3.88", krt) { + if kp.try_add("3.3.88", krt) { // TODO: put this somewhere else? - wrap.p.op("4.4.20", |p| { + kp.p.op("4.4.20", |p| { p.push(Taddhita::map.to_term()); }); - it_samjna::run(wrap.p, i + 2).expect("should never fail"); + it_samjna::run(kp.p, i + 2).expect("should never fail"); } } } K::aTuc => { if dhatu.has_tag(T::wvit) { - wrap.try_add("3.3.89", krt); + kp.try_add("3.3.89", krt); } } K::naN => { if dhatu.has_text_in(&["yaj", "yAc", "yat", "viC", "praC", "rakz"]) { - wrap.try_add("3.3.90", krt); + kp.try_add("3.3.90", krt); } } K::nan => { if dhatu.has_u("Yizva\\pa~") { - wrap.try_add("3.3.91", krt); + kp.try_add("3.3.91", krt); } } @@ -1092,20 +1303,20 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { // striyAm // ------------------------------------------ K::ktin => { - wrap.try_add_with("3.3.94", krt, |p, _| p.add_tag(T::Stri)); + kp.try_add_with("3.3.94", krt, |p| p.add_tag(T::Stri)); } K::a => { - if wrap.p.has(i, |t| t.is_pratyaya()) { - wrap.try_add_with("3.3.102", krt, |p, _| p.add_tag(T::Stri)); + if kp.p.has(i, |t| t.is_pratyaya()) { + kp.try_add_with("3.3.102", krt, |p| p.add_tag(T::Stri)); } else if dhatu.is_guru() && dhatu.has_antya(&*HAL) { - wrap.try_add_with("3.3.103", krt, |p, _| p.add_tag(T::Stri)); + kp.try_add_with("3.3.103", krt, |p| p.add_tag(T::Stri)); } } K::yuc => { if dhatu.has_u_in(&["Ric", "Asa~\\", "SranTa~"]) { - wrap.try_add_with("3.3.107", krt, |p, _| p.add_tag(T::Stri)); + kp.try_add_with("3.3.107", krt, |p| p.add_tag(T::Stri)); } } @@ -1114,47 +1325,41 @@ fn try_add_krt(p: &mut Prakriya, krt: Krt) -> Option { K::ani => {} K::lyuw => { - wrap.try_add("3.3.115", krt); + kp.try_add("3.3.115", krt); } K::Ga => { - wrap.try_add("3.3.118", krt); + kp.try_add("3.3.118", krt); } K::Kal => { // TODO: restrict - wrap.try_add("3.3.126", krt); + kp.try_add("3.3.126", krt); } K::ktic => { - wrap.try_add("3.3.174", krt); + kp.try_add("3.3.174", krt); } K::kamul | K::Ramul => { if krt == K::kamul { - wrap.try_add("3.4.12", krt); + kp.try_add("3.4.12", krt); } else { // TODO: move this rule somewhere else? - wrap.try_add("3.4.22", krt); + kp.try_add("3.4.22", krt); } } K::kasun => { if dhatu.has_u_in(&["sf\\px~", "u~tfdi~^r"]) { - wrap.try_add("3.4.17", krt); + kp.try_add("3.4.17", krt); } } K::ktvA => { - wrap.try_add("3.4.21", krt); + kp.try_add("3.4.21", krt); } _ => (), } - // Exclude this from the `match` above because it contains `kvip`, which is also matched - // separately above. - if !wrap.has_krt { - try_add_krt_for_tacchila_etc(&mut wrap, i, krt); - } - - Some(wrap.has_krt) + Some(kp.has_krt) } /// Runs the rules that add a krt-pratyaya to a given dhatu. Returns whether a pratyaya was added. diff --git a/vidyut-prakriya/src/krt/unadi_sutras.rs b/vidyut-prakriya/src/krt/unadi_sutras.rs index 2dfa56e..9127401 100644 --- a/vidyut-prakriya/src/krt/unadi_sutras.rs +++ b/vidyut-prakriya/src/krt/unadi_sutras.rs @@ -54,13 +54,15 @@ pub fn try_add_unadi(p: &mut Prakriya, krt: Krt) -> Option { // Pre-calculate some common properties. let upasarge = prev.map_or(false, |t| t.is_upasarga()); let _supi = prev.map_or(false, |t| t.has_tag(T::Sup)); + let nau = p.has(i + 1, |t| t.has_u("Ric")); // For convenience below, wrap `Prakriya` in a new `KrtPrakriya` type that contains `krt` and // records whether or not any of these rules were applied. - let mut wrap = KrtPrakriya::new(p, krt); - let dhatu = wrap.get(i)?; + let mut kp = KrtPrakriya::new(p, krt); + let i_dhatu = kp.i_dhatu; + let dhatu = kp.dhatu(); - let has_upasarga = |text| i > 0 && wrap.p.has(i, |t| t.has_text(text)); + let has_upasarga = |text| i > 0 && kp.p.has(i, |t| t.has_text(text)); match krt { K::uR => { @@ -68,63 +70,70 @@ pub fn try_add_unadi(p: &mut Prakriya, krt: Krt) -> Option { "qukf\\Y", "vA\\", "pA\\", "ji\\", "qumi\\Y", "zvada~\\", "sA\\Da~", "aSU~\\", ]) { // kAru, vAyu, ... - wrap.try_add(Unadi("1.1"), krt); + kp.try_add(Unadi("1.1"), krt); } } K::YuR => { if dhatu.has_u("tF") { // tAlu - wrap.try_add_with(Unadi("1.5"), krt, |p, i| { - p.set(i, |t| t.set_antya("l")); + kp.try_add_with(Unadi("1.5"), krt, |p| { + p.set(i_dhatu, |t| t.set_antya("l")); }); } } K::wizac => { if dhatu.has_u_in(&["ava~", "maha~"]) { - wrap.try_add(Unadi("1.45"), krt); + kp.try_add(Unadi("1.45"), krt); } } K::tun => { if dhatu.has_u_in(&[ "zi\\Y", "tanu~^", "ga\\mx~", "masI~", "zaca~\\", "ava~", "quDA\\Y", "kru\\Sa~", ]) { - wrap.try_add(Unadi("1.69"), krt); + kp.try_add(Unadi("1.69"), krt); } } K::katu => { if dhatu.has_u("qukf\\Y") { // kratu - wrap.try_add(Unadi("1.77"), krt); + kp.try_add(Unadi("1.77"), krt); } } K::manin => { - wrap.try_add(Unadi("1.144"), krt); + kp.try_add(Unadi("1.144"), krt); } K::kTan => { if dhatu.has_u_in(&["ha\\na~", "kuza~", "RI\\Y", "ama~", "kASf~"]) { - wrap.try_add(Unadi("2.2"), krt); + kp.try_add(Unadi("2.2"), krt); } } K::isi => { if dhatu.has_u_in(&["arca~", "I~Suci~^r", "hu\\", "sf\\px~", "Cada~", "Carda~"]) { - wrap.try_add(Unadi("2.108"), krt); + kp.try_add(Unadi("2.108"), krt); // TODO: id-antaH api } } + K::itnuc => { + if dhatu.has_u_in(&["stana", "hfza~", "gada", "mada~", "spfha", "gfha"]) && nau { + // stanayitnu, ... + // TODO: popi? + kp.try_add(Unadi("3.29"), krt); + } + } K::kan => { if dhatu.has_u_in(&["i\\R", "YiBI\\", "kE\\", "pA\\", "Sala~", "ata~", "marca~"]) { - wrap.try_add(Unadi("3.43"), krt); + kp.try_add(Unadi("3.43"), krt); } } K::sa => { if dhatu.has_u_in(&["vF", "vFY", "tF", "vada~", "ha\\na~", "kamu~\\", "kaza~"]) { - wrap.try_add(Unadi("3.62"), krt); + kp.try_add(Unadi("3.62"), krt); } } K::sara => { if dhatu.has_u("aSU~\\") { // akzara - wrap.try_add(Unadi("3.70"), krt); + kp.try_add(Unadi("3.70"), krt); } } K::tan => { @@ -132,45 +141,50 @@ pub fn try_add_unadi(p: &mut Prakriya, krt: Krt) -> Option { "hase~", "mf\\N", "gF", "i\\R", "vA\\", "ama~", "damu~", "lUY", "pUY", "DurvI~", ]) { // hasta, ... - wrap.try_add(Unadi("3.86"), krt); + kp.try_add(Unadi("3.86"), krt); + } + } + K::Ayya => { + if dhatu.has_u_in(&["Sru\\", "dakza~\\", "spfha", "gfha"]) { + // hasta, ... + kp.try_add(Unadi("3.96"), krt); } } - K::Jac => { if dhatu.has_text_in(&["jF", "viS"]) { // jaranta, veSanta - wrap.try_add(Unadi("3.126"), krt); + kp.try_add(Unadi("3.126"), krt); } else if dhatu.has_text_in(&["ruh", "nand", "jIv"]) || (upasarge && has_upasarga("pra") && dhatu.has_text("an")) { - wrap.try_add_with(Unadi("3.127"), krt, |p, i| { - p.set(i + 1, |t| t.add_tag(T::zit)); + kp.try_add_with(Unadi("3.127"), krt, |p| { + p.set(i_dhatu + 1, |t| t.add_tag(T::zit)); }); // rohanta, nadanta ... } else if dhatu - .has_text_in(&["tF", "BU", "vah", "vas", "BAs", "sAD", "ganq", "manq", "ji"]) + .has_text_in(&["tF", "BU", "vah", "vas", "BAs", "sAD", "gaRq", "maRq", "ji"]) { // taranta, Bavanta, ... // TODO: nandayanta - wrap.try_add_with(Unadi("3.128"), krt, |p, i| { - p.set(i + 1, |t| t.add_tag(T::zit)); + kp.try_add_with(Unadi("3.128"), krt, |p| { + p.set(i_dhatu + 1, |t| t.add_tag(T::zit)); }); } } K::ksi => { if dhatu.has_u_in(&["pluza~", "kuza~", "Su\\za~"]) { - wrap.try_add(Unadi("3.155"), krt); + kp.try_add(Unadi("3.155"), krt); } else if dhatu.has_u("aSU~") { - wrap.try_add_with(Unadi("3.156"), krt, |p, i| { - p.set(i + 1, |t| t.add_tag(T::nit)) + kp.try_add_with(Unadi("3.156"), krt, |p| { + p.set(i_dhatu + 1, |t| t.add_tag(T::nit)) }); } } K::ksu => { if dhatu.has_u("izu~") { // ikzu - wrap.try_add(Unadi("3.157"), krt); + kp.try_add(Unadi("3.157"), krt); } } K::katnic @@ -190,100 +204,100 @@ pub fn try_add_unadi(p: &mut Prakriya, krt: Krt) -> Option { match krt { K::katnic if dhatu.has_u("f\\") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::yatuc if dhatu.has_u("tanu~^") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::alic if dhatu.has_u("anjU~") => { // aYjali - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::izWuc if dhatu.has_u("vana~") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::izWac if dhatu.has_u("anjU~") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } - K::isan if dhatu.has_u("f\\") && wrap.p.has(i + 2, |t| t.has_u("Ric")) => { + K::isan if dhatu.has_u("f\\") && kp.p.has(i + 2, |t| t.has_u("Ric")) => { // `i + 2` to skip pu~k (ar + p + i) - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::syan if dhatu.has_u("madI~") => { // matsya - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::iTin if dhatu.has_u("ata~") => { // atiTi - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::uli if dhatu.has_u("anga") => { // aNguli - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::asa if dhatu.has_u("ku\\") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } // TODO: kavaca? K::Asa if has_u("yu") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } K::Anuk if has_u("kfSa~") => { - wrap.try_add(code, krt); + kp.try_add(code, krt); } _ => (), }; } K::ini => { - let set_nit = |p: &mut Prakriya, i: usize| p.set(i + 1, |t| t.add_tag(T::Rit)); - let set_kit = |p: &mut Prakriya, i: usize| p.set(i + 1, |t| t.add_tag(T::kit)); + let set_nit = |p: &mut Prakriya| p.set(i_dhatu + 1, |t| t.add_tag(T::Rit)); + let set_kit = |p: &mut Prakriya| p.set(i_dhatu + 1, |t| t.add_tag(T::kit)); if dhatu.has_u("ga\\mx~") { - if wrap.has_upasarga(i, "AN") { - wrap.try_add_with(Unadi("4.7"), krt, set_nit); + if kp.has_upapada("AN") { + kp.try_add_with(Unadi("4.7"), krt, set_nit); } else { - wrap.try_add(Unadi("4.6"), krt); + kp.try_add(Unadi("4.6"), krt); } } else if dhatu.has_u("BU") { - wrap.try_add_with(Unadi("4.8"), krt, set_nit); + kp.try_add_with(Unadi("4.8"), krt, set_nit); } else if dhatu.has_u("zWA\\") { - if wrap.has_upasarga(i, "pra") { + if kp.has_upapada("pra") { // prasTAyin - wrap.try_add_with(Unadi("4.9"), krt, set_nit); + kp.try_add_with(Unadi("4.9"), krt, set_nit); } else { // paramezWin - wrap.try_add_with(Unadi("4.10"), krt, set_kit); + kp.try_add_with(Unadi("4.10"), krt, set_kit); } } else if dhatu.has_u("maTi~") { // maTin - wrap.try_add_with(Unadi("4.11"), krt, set_kit); + kp.try_add_with(Unadi("4.11"), krt, set_kit); } else if dhatu.has_u("patx~") { // paTin - wrap.try_add_with(Unadi("4.12"), krt, |p, i| p.set(i, |t| t.set_antya("T"))); + kp.try_add_with(Unadi("4.12"), krt, |p| p.set(i, |t| t.set_antya("T"))); } } K::kvinUnadi => { if dhatu.has_u_in(&["jF", "SFY", "stFY", "jAgf"]) { - wrap.try_add(Unadi("4.54"), krt); + kp.try_add(Unadi("4.54"), krt); } } K::zwran => { - wrap.try_add(Unadi("4.158"), krt); + kp.try_add(Unadi("4.158"), krt); } K::amac => { if dhatu.has_u("praTa~\\") { - wrap.try_add(Unadi("5.68"), krt); + kp.try_add(Unadi("5.68"), krt); } else if dhatu.has_u("cara~") { - wrap.try_add(Unadi("5.69"), krt); + kp.try_add(Unadi("5.69"), krt); } } K::alac if dhatu.has_u("magi~") => { // maNgala - wrap.try_add(Unadi("5.70"), krt); + kp.try_add(Unadi("5.70"), krt); } _ => (), } - Some(wrap.has_krt) + Some(kp.has_krt) } pub fn run(p: &mut Prakriya, krt: Krt) -> bool { diff --git a/vidyut-prakriya/src/krt/utils.rs b/vidyut-prakriya/src/krt/utils.rs index 7787361..254a6a4 100644 --- a/vidyut-prakriya/src/krt/utils.rs +++ b/vidyut-prakriya/src/krt/utils.rs @@ -1,4 +1,4 @@ -use crate::args::Krt; +use crate::args::{Artha, Krt, KrtArtha}; use crate::it_samjna; use crate::operators as op; use crate::prakriya::{Prakriya, Rule}; @@ -32,30 +32,88 @@ impl Krt { /// - records whether a `krt` pratyaya has been added or not, which simplifies the control flow for /// optional rules. pub struct KrtPrakriya<'a> { + /// The underlying prakriya. pub p: &'a mut Prakriya, + /// The first index of the dhatu. + pub i_dhatu: usize, + /// The krt-pratyaya that the caller wishes to add. pub krt: Krt, - pub tried: bool, + pub rule_artha: Option, + pub had_match: bool, pub has_krt: bool, } impl<'a> KrtPrakriya<'a> { /// Creates a new `KrtPrakriya` struct. pub fn new(p: &'a mut Prakriya, krt: Krt) -> Self { + let i_dhatu = p.find_first_where(|t| t.is_dhatu()).unwrap_or(0); KrtPrakriya { p, + i_dhatu, krt, - tried: false, + rule_artha: None, + had_match: false, has_krt: false, } } - /// Wraps `Prakriya::get`. - pub fn get(&self, i: usize) -> Option<&Term> { - self.p.get(i) + /// Returns a reference to the underlying dhatu for this prakriya. + pub fn dhatu(&self) -> &Term { + self.p.get(self.i_dhatu).expect("present") } - pub fn has_upasarga(&self, i_dhatu: usize, upa: &str) -> bool { - i_dhatu > 0 && self.p.has(i_dhatu - 1, |t| t.has_u(upa)) + /// Returns a reference to the last dhatu term for this prakriya. + pub fn dhatu_end(&self) -> &Term { + let i = self.p.find_last_where(|t| t.is_dhatu()).expect("present"); + self.p.get(i).expect("present") + } + + /// Returns a reference to the underlying upapada, if present. + pub fn upapada(&self) -> Option<&Term> { + if self.i_dhatu > 0 { + self.p.get(self.i_dhatu - 1) + } else { + None + } + } + + /// Returns whether the term before the dhatu has the given upapada. + pub fn has_upapada(&self, upadesha: &str) -> bool { + self.i_dhatu > 0 && self.p.has(self.i_dhatu - 1, |t| t.has_u(upadesha)) + } + + /// Returns whether the term before the dhatu has one of the given upapada values. + pub fn has_upapada_in(&self, upadeshas: &[&str]) -> bool { + self.i_dhatu > 0 && self.p.has(self.i_dhatu - 1, |t| t.has_u_in(upadeshas)) + } + + /// Runs the rules in `closure` under the meaning condition defined in `artha`. + /// + /// Calls to `with_context` can be nested. + pub fn with_context(&mut self, rule_artha: KrtArtha, closure: impl Fn(&mut Self)) { + // If the prakriya has a specific meaning condition, try these rules only if there's an + // artha match. + // + // Otherwise, allow any rule. + if let Some(Artha::Krt(prakriya_artha)) = self.p.artha() { + if prakriya_artha != rule_artha { + return; + } + } + + // Push the `closure` context. + let old_artha = self.rule_artha; + let old_match = self.had_match; + self.rule_artha = Some(rule_artha); + self.had_match = false; + + if !self.has_krt { + closure(self); + } + + // Pop the `closure` context. + self.rule_artha = old_artha; + self.had_match = old_match; } pub fn has_upasarga_dhatu(&self, i_dhatu: usize, upa: &str, dhatu: &str) -> bool { @@ -64,13 +122,6 @@ impl<'a> KrtPrakriya<'a> { && self.p.has(i_dhatu, |t| t.has_u(dhatu)) } - pub fn has_prefix(&self, value: &str) -> bool { - match self.p.find_last_where(|t| !t.is_dhatu()) { - Some(i) => self.p.terms()[i].has_text(value), - None => false, - } - } - pub fn has_prefixes(&self, values: &[&str; 2]) -> bool { match self.p.find_last_where(|t| !t.is_dhatu()) { Some(i) => { @@ -82,25 +133,18 @@ impl<'a> KrtPrakriya<'a> { } } - pub fn has_prefix_in(&self, values: &[&str]) -> bool { - match self.p.find_last_where(|t| !t.is_dhatu()) { - Some(i) => self.p.terms()[i].has_text_in(values), - None => false, - } - } - /// If there's a match, adds the given `krt` pratyaya. /// /// This method does nothing if a krt pratyaya has already been added. pub fn try_add(&mut self, rule: impl Into, krt: Krt) -> bool { - self.try_add_with(rule, krt, |_p, _i| {}) + self.try_add_with(rule, krt, |_| {}) } /// If there's a match, replace the `lakAra` of the dhatu. /// /// This method does nothing if a krt pratyaya has already been added. pub fn try_replace_lakara(&mut self, rule: impl Into, i_lakara: usize, krt: Krt) -> bool { - self.tried = true; + self.had_match = true; if self.krt == krt && !self.has_krt { op::adesha(rule, self.p, i_lakara, krt.as_str()); self.has_krt = true; @@ -112,12 +156,12 @@ impl<'a> KrtPrakriya<'a> { pub fn do_nipatana(&mut self, rule: impl Into, sub: &str) { self.p.op(rule, op::nipatana(sub)); - self.tried = true; + self.had_match = true; self.has_krt = true } pub fn optional_do_nipatana(&mut self, rule: impl Into, sub: &str) -> bool { - self.tried = true; + self.had_match = true; if self.p.op_optional(rule, op::nipatana(sub)) { self.has_krt = true; true @@ -133,17 +177,24 @@ impl<'a> KrtPrakriya<'a> { &mut self, rule: impl Into, krt: Krt, - func: impl Fn(&mut Prakriya, usize), + func: impl Fn(&mut Prakriya), ) -> bool { - self.tried = true; + let rule = rule.into(); + + self.had_match = true; if self.krt == krt && !self.has_krt { - let i_dhatu = self.p.terms().len() - 1; - self.p.op(rule.into(), |p| { + // Insert term with it-samjna-prakarana. + self.p.op(rule, |p| { p.push(krt.to_term()); - func(p, i_dhatu); + func(p); }); - it_samjna::run(self.p, i_dhatu + 1).expect("should never fail"); + let i_last = self.p.terms().len() - 1; + it_samjna::run(self.p, i_last).expect("should never fail"); + // update bookkeeping. + if let Some(a) = self.rule_artha { + self.p.set_artha(Artha::Krt(a)); + } self.has_krt = true; true } else { @@ -158,7 +209,7 @@ impl<'a> KrtPrakriya<'a> { &mut self, rule: impl Into + Copy, krt: Krt, - func: impl Fn(&mut Prakriya, usize), + func: impl Fn(&mut Prakriya), ) -> bool { if krt == self.krt && !self.has_krt { // TODO: resolve inconsistency with TaddhitaPratyaya::optional_try_add_with. @@ -176,6 +227,22 @@ impl<'a> KrtPrakriya<'a> { /// /// This method does nothing if a krt pratyaya has already been added. pub fn optional_try_add(&mut self, rule: impl Into + Copy, krt: Krt) -> bool { - self.optional_try_add_with(rule, krt, |_p, _i| {}) + self.optional_try_add_with(rule, krt, |_| {}) + } + + /// Like `optional` but indicates a specific choice of artha. Not sure how to use this yet, but + /// at some point we should model specific semantic choices as different from an ordinary + /// option. + pub fn try_artha_add(&mut self, rule: impl Into + Copy, krt: Krt) -> bool { + self.optional_try_add(rule, krt) + } + + pub fn try_artha_add_with( + &mut self, + rule: impl Into + Copy, + krt: Krt, + func: impl Fn(&mut Prakriya), + ) -> bool { + self.optional_try_add_with(rule, krt, func) } } diff --git a/vidyut-prakriya/src/lib.rs b/vidyut-prakriya/src/lib.rs index c53ca3c..83af2bc 100644 --- a/vidyut-prakriya/src/lib.rs +++ b/vidyut-prakriya/src/lib.rs @@ -52,6 +52,7 @@ mod it_samjna; mod krt; mod la_karya; mod linganushasanam; +mod misc; mod pratipadika_karya; mod samjna; mod samprasarana; diff --git a/vidyut-prakriya/src/misc.rs b/vidyut-prakriya/src/misc.rs new file mode 100644 index 0000000..2cdfc6b --- /dev/null +++ b/vidyut-prakriya/src/misc.rs @@ -0,0 +1,31 @@ +use crate::operators as op; +use crate::prakriya::Prakriya; + +/// Miscellaneous rules that we should put somewhere else. +const PADA_ADI: &[&str] = &[ + "pAda", "danta", "nAsikA", "mAsa", "yUza", "hfdaya", "niSA", "asfj", "dos", "yakft", "Sakft", + "udaka", "Asya", +]; + +const PAD_ADI: &[&str] = &[ + "pad", "dat", "nas", "mAs", "hfd", "niS", "asan", "yUzan", "dozan", "yakan", "Sakan", "udan", + "Asan", +]; + +pub fn run_pad_adi(p: &mut Prakriya) -> Option<()> { + let i_prati = p.find_first_where(|t| t.is_pratipadika())?; + let i_next = i_prati + 1; + let prati = p.get(i_prati)?; + let is_shas_prabhrti = p.has(i_next, |t| { + // HACK: exclude None, which is a placeholder form for upapada-krdantas. + t.is_vibhakti() && !t.has_u_in(&["su~", "O", "jas", "am", "Ow"]) && t.u != None + }); + + if is_shas_prabhrti { + if let Some(sub) = op::yatha(&prati.text, PADA_ADI, PAD_ADI) { + p.op_optional("6.1.63", op::t(i_prati, |t| t.set_text(sub))); + } + } + + Some(()) +} diff --git a/vidyut-prakriya/src/operators.rs b/vidyut-prakriya/src/operators.rs index e6ce7e3..7be9576 100644 --- a/vidyut-prakriya/src/operators.rs +++ b/vidyut-prakriya/src/operators.rs @@ -168,6 +168,7 @@ pub fn optional_adesha(rule: impl Into + Copy, p: &mut Prakriya, i: usize, } pub fn yatha<'a>(needle: &str, old: &[&'a str], new: &[&'a str]) -> Option<&'a str> { + debug_assert_eq!(old.len(), new.len()); for (i, o) in old.iter().enumerate() { if needle == *o { return Some(new[i]); @@ -177,7 +178,7 @@ pub fn yatha<'a>(needle: &str, old: &[&'a str], new: &[&'a str]) -> Option<&'a s } pub fn upadesha_yatha(p: &mut Prakriya, i: usize, old: &[&str], new: &[&str]) { - assert_eq!(old.len(), new.len()); + debug_assert_eq!(old.len(), new.len()); if let Some(t) = p.get_mut(i) { if t.u.is_some() { t.save_lakshana(); @@ -189,7 +190,6 @@ pub fn upadesha_yatha(p: &mut Prakriya, i: usize, old: &[&str], new: &[&str]) { return; } } - panic!("Should not have reached here {:?} {:?} {:?}", old, new, t.u); } } } diff --git a/vidyut-prakriya/src/prakriya.rs b/vidyut-prakriya/src/prakriya.rs index f134878..997aa1e 100644 --- a/vidyut-prakriya/src/prakriya.rs +++ b/vidyut-prakriya/src/prakriya.rs @@ -487,6 +487,11 @@ impl Prakriya { // Optional rules + /// Returns whether the prakriya allows chAndasa rules. + pub(crate) fn is_chandasi(&self) -> bool { + false + } + pub(crate) fn is_allowed(&mut self, r: impl Into) -> bool { let r = r.into(); for option in &self.config.rule_choices { diff --git a/vidyut-prakriya/src/samprasarana.rs b/vidyut-prakriya/src/samprasarana.rs index 9a82317..8405682 100644 --- a/vidyut-prakriya/src/samprasarana.rs +++ b/vidyut-prakriya/src/samprasarana.rs @@ -29,8 +29,6 @@ fn is_grahi_jya(t: &Term) -> bool { "o~vrascU~", "pra\\Ca~", "Bra\\sja~^", - // not sure how to handle "vay" root - "vaya~\\", ]) } diff --git a/vidyut-prakriya/src/sanadi.rs b/vidyut-prakriya/src/sanadi.rs index c4626e4..86619c3 100644 --- a/vidyut-prakriya/src/sanadi.rs +++ b/vidyut-prakriya/src/sanadi.rs @@ -30,10 +30,24 @@ fn add_sanadi(rule: Code, p: &mut Prakriya, i_dhatu: usize, upadesha: &str) { let i_pratyaya = i_dhatu + 1; p.op_term("3.1.32", i_pratyaya, op::add_tag(T::Dhatu)); - it_samjna::run(p, i_pratyaya).expect("ok") } +/// Optionally adds `upadesha` as a pratyaya after the dhatu at index `i_dhatu`. +fn optional_add_sanadi(rule: Code, p: &mut Prakriya, i_dhatu: usize, upadesha: &str) { + let added = p.op_optional(rule, |p| { + let mut pratyaya = Term::make_upadesha(upadesha); + pratyaya.add_tags(&[T::Pratyaya]); + p.insert_after(i_dhatu, pratyaya); + }); + + if added { + let i_pratyaya = i_dhatu + 1; + p.op_term("3.1.32", i_pratyaya, op::add_tag(T::Dhatu)); + it_samjna::run(p, i_pratyaya).expect("ok") + } +} + /// Runs rules that apply only if using yaN-pratyay with luk. fn run_rules_for_yan_luk(p: &mut Prakriya) -> Option<()> { use Rule::Dhatupatha as DP; @@ -41,7 +55,7 @@ fn run_rules_for_yan_luk(p: &mut Prakriya) -> Option<()> { let i_yan = p.find_last_where(|t| t.is_pratyaya() && t.has_u("yaN"))?; // Apply luk. - p.op_term("2.4.74", i_yan, op::lopa); + p.op_term("2.4.74", i_yan, op::luk); // "carkarItam ca" declares that yan-luk dhatus are part of ad-Adi gaNa. // As a result, we will see lopa of Sap-vikarana per 2.4.72. @@ -77,12 +91,12 @@ pub fn try_add_specific_sanadi_pratyayas(p: &mut Prakriya, is_ardhadhatuka: bool } else if dhatu.has_u_in(gana::KANDU_ADI) { add_sanadi("3.1.27", p, i, "yak"); } else if dhatu.has_u_in(AYADAYA) { - let mut add_pratyaya = true; + let mut can_add_pratyaya = true; let code = "3.1.31"; if is_ardhadhatuka { if p.is_allowed(code) { - add_pratyaya = false; + can_add_pratyaya = false; // TODO: not sure where to do this. if p.has(i, |t| t.has_u("fti")) { p.set(i, |t| t.set_text("ft")); @@ -93,10 +107,18 @@ pub fn try_add_specific_sanadi_pratyayas(p: &mut Prakriya, is_ardhadhatuka: bool } } - if add_pratyaya { + if can_add_pratyaya { let dhatu = p.get(i)?; if dhatu.has_u_in(&["gupU~", "DUpa~", "viCa~", "paRa~\\", "pana~\\"]) { - add_sanadi("3.1.28", p, i, "Aya"); + let code = "3.1.28"; + if dhatu.has_u("paRa~\\") { + // > stutyarthena paninā sāhacaryāt tadarthaḥ paṇiḥ pratyayamutpādayati na + // > vyavahārārthaḥ. śatasya paṇate. sahasrasaya paṇate + // -- KV on 3.1.28 + optional_add_sanadi(code, p, i, "Aya"); + } else { + add_sanadi(code, p, i, "Aya"); + } } else if dhatu.has_u("fti") { // ftIyate // @@ -131,9 +153,9 @@ pub fn try_add_general_sanadi_pratyaya(p: &mut Prakriya, sanadi: Sanadi) -> Opti if dhatu.has_text_in(&["lup", "sad", "car", "jap", "jaB", "dah", "daS", "gF"]) { add_sanadi("3.1.24", p, i, "yaN"); } else if (i > 0 && p.has(i - 1, |t| t.has_u_in(&["sUca", "sUtra", "mUtra"]))) - || dhatu.has_u_in(&["awa~", "f\\", "aSa~", "UrRuY"]) + || dhatu.has_u_in(&["awa~", "f\\", "aSa~", "aSU~\\", "UrRuY"]) { - add_sanadi("3.1.24.v1", p, i, "yaN"); + add_sanadi("3.1.22.v1", p, i, "yaN"); } else if f::is_eka_ac(dhatu) && dhatu.has_adi(&*HAL) { add_sanadi("3.1.22", p, i, "yaN"); } diff --git a/vidyut-prakriya/src/taddhita/gana.rs b/vidyut-prakriya/src/taddhita/gana.rs index ff993de..966b171 100644 --- a/vidyut-prakriya/src/taddhita/gana.rs +++ b/vidyut-prakriya/src/taddhita/gana.rs @@ -928,6 +928,71 @@ pub const PRTHU_ADI: &[&str] = &[ "svAdu", "hrasva", "dIrGa", "priya", "vfza", "fju", "kzipra", "kzupra", "kzudra", ]; +/// For 5.3.101. +pub const SHAKHA_ADI: &[&str] = &[ + "SAKA", "muKa", "jaGana", "SfNga", "meGa", "caraRa", "skanDa", "Siras", "uras", "agra", + "Sarana", +]; + +/// For 5.3.107. +pub const SHARKARA_ADI: &[&str] = &[ + "SarkarA", + "kapAlikA", + "pizwika", + "puRqarIka", + "Satapatra", + "goloman", + "gopucCa", + "narAcI ", + "nakulA", + "sikatA", +]; + +/// For 5.3.108. +pub const ANGULI_ADI: &[&str] = &[ + "aNguli", "Baruja", "baBru", "valgu", "maRqara", "maRqala", "Sazkula", "kapi", "udaSvit", + "goRI", "uras", "SiKara", "kuliSa", +]; + +/// For 5.3.117. (part 1) +pub const PARSHU_ADI: &[&str] = &[ + "parSu", + "asura", + "rakzas", + "bAhlIka", + "vayas", + "marut", + "daSArha", + "piSAca", + "viSAla", + "aSani", + "kArzApaRa", + "satvat", + "vasu", + "parSvAdiH", +]; + +/// For 5.3.116. +pub const DAMANI_ADI: &[&str] = &[ + "dAmanI", + "Olapi", + "AkidantI", + "kAkaranti", + "kAkadanti", + "Satruntapi", + "sArvaseni", + "bindu", + "mOYjAyana", + "ulaBa", + "sAvitrIputra", +]; + +/// For 5.3.117. (part 2) +pub const YAUDHEYA_ADI: &[&str] = &[ + "yODeya", "kOSeya", "krOSeya", "SOkreya", "SOBreya", "DArteya", "vArteya", "jAbAleya", + "trigarta", "Barata", "uSInara", +]; + /// For 5.4.3. pub const STHULA_ADI: &[&str] = &[ "sTUla", diff --git a/vidyut-prakriya/src/taddhita/matvartha_prakarana.rs b/vidyut-prakriya/src/taddhita/matvartha_prakarana.rs index 78f4017..f3b73c3 100644 --- a/vidyut-prakriya/src/taddhita/matvartha_prakarana.rs +++ b/vidyut-prakriya/src/taddhita/matvartha_prakarana.rs @@ -1,4 +1,4 @@ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita::*; use crate::taddhita::utils::TaddhitaPrakriya; diff --git a/vidyut-prakriya/src/taddhita/nan_snan_adhikara_prakarana.rs b/vidyut-prakriya/src/taddhita/nan_snan_adhikara_prakarana.rs index fe10c95..f69e1d5 100644 --- a/vidyut-prakriya/src/taddhita/nan_snan_adhikara_prakarana.rs +++ b/vidyut-prakriya/src/taddhita/nan_snan_adhikara_prakarana.rs @@ -1,4 +1,4 @@ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita::*; use crate::taddhita::gana; use crate::taddhita::utils::TaddhitaPrakriya; diff --git a/vidyut-prakriya/src/taddhita/panchami_prakarana.rs b/vidyut-prakriya/src/taddhita/panchami_prakarana.rs index 2638efc..f5c21ac 100644 --- a/vidyut-prakriya/src/taddhita/panchami_prakarana.rs +++ b/vidyut-prakriya/src/taddhita/panchami_prakarana.rs @@ -1,4 +1,4 @@ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita::*; use crate::taddhita::utils::TaddhitaPrakriya; diff --git a/vidyut-prakriya/src/taddhita/pragdivyatiya.rs b/vidyut-prakriya/src/taddhita/pragdivyatiya.rs index 6dbd24a..953eff2 100644 --- a/vidyut-prakriya/src/taddhita/pragdivyatiya.rs +++ b/vidyut-prakriya/src/taddhita/pragdivyatiya.rs @@ -3,9 +3,9 @@ Implements the taddhita rules in the "prAg dIvyato 'R" section of pada 4.1. (4.1.83 - 4.3.168) */ -use crate::args::Artha::*; use crate::args::Taddhita; use crate::args::Taddhita::*; +use crate::args::TaddhitaArtha::*; use crate::it_samjna; use crate::operators as op; use crate::sounds::{s, Set}; diff --git a/vidyut-prakriya/src/taddhita/pragghitiya.rs b/vidyut-prakriya/src/taddhita/pragghitiya.rs index ddde6ba..4d8b0f1 100644 --- a/vidyut-prakriya/src/taddhita/pragghitiya.rs +++ b/vidyut-prakriya/src/taddhita/pragghitiya.rs @@ -3,7 +3,7 @@ Implements the taddhita rules in the "prAg GitAd yat" section of pada 4.4. (4.4.75 - 4.4.144) */ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita; use crate::taddhita::utils::TaddhitaPrakriya; diff --git a/vidyut-prakriya/src/taddhita/pragiviya.rs b/vidyut-prakriya/src/taddhita/pragiviya.rs index d567b2b..8ed80d9 100644 --- a/vidyut-prakriya/src/taddhita/pragiviya.rs +++ b/vidyut-prakriya/src/taddhita/pragiviya.rs @@ -2,13 +2,23 @@ Implements the taddhita rules in the "prAg ivAt kaH" section of pada 5.3, as well as some rules immediately before it. -(5.3.70 - 5.3.86) +(5.3.27 - 5.3.95) */ -use crate::args::Artha::*; use crate::args::Taddhita::*; +use crate::args::TaddhitaArtha::*; use crate::taddhita::utils::TaddhitaPrakriya; use crate::tag::Tag; +fn try_base_cases(tp: &mut TaddhitaPrakriya, _rule: &'static str) { + let prati = tp.prati(); + if prati.is_sarvanama() { + // TODO: this is incorrect. + tp.try_add("5.3.71", akac); + } else { + tp.try_add("5.3.70", ka); + } +} + pub fn run(tp: &mut TaddhitaPrakriya) { tp.with_context(DigDeshaKala, |tp| { let prati = tp.prati(); @@ -44,8 +54,47 @@ pub fn run(tp: &mut TaddhitaPrakriya) { tp.try_add(code, deSya); tp.try_add(code, deSIyar); - let prati = tp.prati(); - if prati.is_sarvanama() { - tp.try_add("5.3.71", akac); - } + tp.with_context(Ajnate, |tp| { + try_base_cases(tp, "5.3.73"); + }); + + tp.with_context(Kutsite, |tp| { + tp.optional_try_add("5.3.75", kan); + try_base_cases(tp, "5.3.74"); + }); + + tp.with_context(Anukampayam, |tp| { + try_base_cases(tp, "5.3.76"); + }); + + tp.with_context(Alpe, |tp| { + try_base_cases(tp, "5.3.85"); + }); + + tp.with_context(Hrasve, |tp| { + let prati = tp.prati(); + if prati.has_text_in(&["kuwI", "SamI", "SuRqA"]) { + // kuwIra, SamIra, SuRqAra + tp.try_add("5.3.88", ra); + } else if prati.has_text("kutU") { + // kuwupa + tp.try_add("5.3.89", qupac); + } else if prati.has_text_in(&["kAsU", "goRI"]) { + // kAsUtarI, goRItarI + tp.try_add("5.3.90", zwarac); + } + tp.optional_try_add("5.3.87", kan); + try_base_cases(tp, "5.3.86"); + }); + + tp.with_context(Tanutve, |tp| { + let prati = tp.prati(); + if prati.has_text_in(&["vatsa", "ukzan", "aSva", "fzaBa"]) { + tp.try_add("5.3.91", zwarac); + } + }); + + tp.with_context(Avakshepane, |tp| { + tp.try_add("5.3.95", kan); + }); } diff --git a/vidyut-prakriya/src/taddhita/pragvahatiya.rs b/vidyut-prakriya/src/taddhita/pragvahatiya.rs index 19f7d9c..fd00b97 100644 --- a/vidyut-prakriya/src/taddhita/pragvahatiya.rs +++ b/vidyut-prakriya/src/taddhita/pragvahatiya.rs @@ -3,7 +3,7 @@ Implements the taddhita rules in the "prAg vahatez Wak" section of pada 4.4. (4.4.1 - 4.4.74) */ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita; use crate::operators as op; use crate::prakriya::Rule; diff --git a/vidyut-prakriya/src/taddhita/pragvatiya.rs b/vidyut-prakriya/src/taddhita/pragvatiya.rs index 0f4080a..e11ac99 100644 --- a/vidyut-prakriya/src/taddhita/pragvatiya.rs +++ b/vidyut-prakriya/src/taddhita/pragvatiya.rs @@ -3,7 +3,7 @@ Implements the taddhita rules in the "prAg vatez Wan" section of pada 5.1. (5.1.18 - 5.1.114) */ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita; use crate::taddhita::utils::TaddhitaPrakriya; use crate::tag::Tag as T; diff --git a/vidyut-prakriya/src/taddhita/prakkritiya.rs b/vidyut-prakriya/src/taddhita/prakkritiya.rs index c627043..313342d 100644 --- a/vidyut-prakriya/src/taddhita/prakkritiya.rs +++ b/vidyut-prakriya/src/taddhita/prakkritiya.rs @@ -3,7 +3,7 @@ Implements the taddhita rules in the "prAk krItAc CaH" section of pada 5.1. (5.1.1 - 5.1.17) */ -use crate::args::Artha::*; +use crate::args::TaddhitaArtha::*; use crate::args::Taddhita::*; use crate::taddhita::utils::TaddhitaPrakriya; diff --git a/vidyut-prakriya/src/taddhita/svarthika_prakarana.rs b/vidyut-prakriya/src/taddhita/svarthika_prakarana.rs index 5250959..cea8baf 100644 --- a/vidyut-prakriya/src/taddhita/svarthika_prakarana.rs +++ b/vidyut-prakriya/src/taddhita/svarthika_prakarana.rs @@ -1,5 +1,5 @@ -use crate::args::Artha::*; use crate::args::Taddhita::*; +use crate::args::TaddhitaArtha::*; use crate::taddhita::gana; use crate::taddhita::utils::TaddhitaPrakriya; use crate::tag::Tag as T; @@ -30,6 +30,50 @@ pub fn run(tp: &mut TaddhitaPrakriya) { let i_prati = tp.i_prati; + tp.with_context(IvePratikrtau, |tp| { + let prati = tp.prati(); + if prati.has_text("vasti") { + tp.try_add("5.3.101", QaY); + } else if prati.has_text("SilA") { + tp.try_add("5.3.102", Qa); + } else if prati.has_text_in(gana::SHAKHA_ADI) { + tp.try_add("5.3.103", yat); + } else if prati.has_text("kuSAgra") { + tp.try_add("5.3.105", Ca); + } else if prati.has_text_in(gana::SHARKARA_ADI) { + tp.try_add("5.3.107", aR); + } else if prati.has_text_in(gana::ANGULI_ADI) { + tp.try_add("5.3.108", Wak); + } else if prati.has_text("ekaSAlA") { + tp.optional_try_add("5.3.109", Wac); + } else if prati.has_text_in(&["karka", "lohita"]) { + tp.try_add("5.3.110", Ikak); + } else if tp.p.is_chandasi() && prati.has_text_in(&["pratna", "pUrva", "viSva", "ima"]) { + tp.try_add("5.3.111", TAl); + } else { + tp.try_add("5.3.96", kan); + } + }); + + tp.with_context(Svarthe, |tp| { + let prati = tp.prati(); + if prati.has_text_in(gana::DAMANI_ADI) { + // TODO: others + tp.try_add("5.3.116", Ca); + } else if prati.has_text_in(gana::PARSHU_ADI) || prati.has_text_in(gana::YAUDHEYA_ADI) { + let sub = if prati.has_text_in(gana::YAUDHEYA_ADI) { + aY + } else { + aR + }; + tp.try_add("5.3.117", sub); + } else if prati.has_text_in(&[ + "ABijita", "vEdaBfta", "SAlAvata", "SEKAvata", "SAmIvata", "SrOmata", + ]) { + tp.try_add("5.3.118", yaY); + } + }); + tp.with_context(PrakaraVacane, |tp| { let prati = tp.prati(); if prati.has_text_in(gana::STHULA_ADI) { @@ -39,25 +83,46 @@ pub fn run(tp: &mut TaddhitaPrakriya) { } }); - let prati = tp.prati(); - if prati.has_tag(T::Sankhya) { - if prati.has_u("eka") { - tp.try_add_with("5.4.19", suc, |p| p.set(i_prati, |t| t.set_text("sakft"))); - } else if prati.has_u_in(&["dvi", "tri", "catur"]) { - tp.try_add("5.4.18", suc); - } else { - tp.try_add("5.4.17", kftvasuc); + tp.with_context(Svarthe, |tp| { + let prati = tp.prati(); + if prati.has_text("anugAdin") { + tp.try_add("5.4.13", Wak); } - } + }); + + tp.with_context(Matsye, |tp| { + let prati = tp.prati(); + if prati.has_text("visArin") { + tp.try_add("5.4.16", aR); + } + }); + + tp.with_context(KriyaAbhyavrttiGanana, |tp| { + let prati = tp.prati(); + if prati.has_tag(T::Sankhya) { + if prati.has_u_in(&["dvi", "tri", "catur"]) { + tp.try_add("5.4.18", suc); + } else if prati.has_u("eka") { + tp.try_add_with("5.4.19", suc, |p| p.set(i_prati, |t| t.set_text("sakft"))); + } else if prati.has_u("bahu") { + tp.optional_try_add("5.4.20", DA); + } + if !tp.had_match { + tp.try_add("5.4.17", kftvasuc); + } + } + }); tp.with_context(TatPrakrtaVacane, |tp| { tp.try_add("5.4.21", mayaw); }); - let prati = tp.prati(); - if prati.has_u_in(&["ananta", "AvasaTa", "itiha", "Bezaja"]) { - tp.try_add("5.4.23", Yya); - } + tp.with_context(Svarthe, |tp| { + let prati = tp.prati(); + if prati.has_u_in(&["ananta", "AvasaTa", "itiha", "Bezaja"]) { + tp.try_add("5.4.23", Yya); + } + }); tp.with_context(Tadarthye, |tp| { let prati = tp.prati(); @@ -97,6 +162,20 @@ pub fn run(tp: &mut TaddhitaPrakriya) { tp.try_add("5.4.39", tikan); } + tp.with_context(AbhutaTadbhava, |tp| { + tp.optional_try_add("5.4.52", sAti); + tp.optional_try_add("5.4.55", trA); + + let prati = tp.prati(); + if prati.has_suffix_in(&["arus", "manas", "cakzus", "cetas", "rahas", "rajas"]) { + tp.try_add_with("5.4.51", cvi, |p| p.set(i_prati, |t| t.set_antya(""))); + } + + if !tp.had_match { + tp.try_add("5.4.50", cvi); + } + }); + // Condition is "sankhya" or ekavacana. So, just accept everything. tp.try_add("5.4.43", Sas); tp.try_add("5.4.44", tasi); diff --git a/vidyut-prakriya/src/taddhita/utils.rs b/vidyut-prakriya/src/taddhita/utils.rs index 6b4ffff..6a34b1e 100644 --- a/vidyut-prakriya/src/taddhita/utils.rs +++ b/vidyut-prakriya/src/taddhita/utils.rs @@ -1,5 +1,4 @@ -use crate::args::Artha; -use crate::args::Taddhita; +use crate::args::{Artha, Taddhita, TaddhitaArtha}; use crate::it_samjna; use crate::prakriya::{Prakriya, Rule}; use crate::tag::Tag as T; @@ -28,7 +27,7 @@ pub struct TaddhitaPrakriya<'a> { pub taddhita: Taddhita, /// If set, the meaning that the taddhita must have. pub i_prati: usize, - pub artha_context: Option, + pub rule_artha: Option, pub had_match: bool, pub has_taddhita: bool, } @@ -41,7 +40,7 @@ impl<'a> TaddhitaPrakriya<'a> { p, taddhita, i_prati, - artha_context: None, + rule_artha: None, had_match: false, has_taddhita: false, } @@ -54,8 +53,8 @@ impl<'a> TaddhitaPrakriya<'a> { /// Runs the rules in `closure` under the meaning condition defined in `artha`. /// /// Calls to `with_context` can be nested. - pub fn with_context(&mut self, artha: Artha, closure: impl Fn(&mut Self)) { - let has_artha_match = if let Some(prakriya_artha) = self.p.artha() { + pub fn with_context(&mut self, artha: TaddhitaArtha, closure: impl Fn(&mut Self)) { + let has_artha_match = if let Some(Artha::Taddhita(prakriya_artha)) = self.p.artha() { // The prakriya has an explicit artha, so the rule must have an artha that is // compatible with it, i.e. that is either the same type or a parent type. Both of // these conditions are checked in `is_type_of`. @@ -69,8 +68,8 @@ impl<'a> TaddhitaPrakriya<'a> { } // Initialize the starting conditions for `closure`. - let old_context = self.artha_context; - self.artha_context = Some(artha); + let old_context = self.rule_artha; + self.rule_artha = Some(artha); self.had_match = false; if !self.has_taddhita { @@ -78,7 +77,7 @@ impl<'a> TaddhitaPrakriya<'a> { } // Clean up state after `closure` completes. - self.artha_context = old_context; + self.rule_artha = old_context; self.had_match = false; } @@ -99,13 +98,15 @@ impl<'a> TaddhitaPrakriya<'a> { func: impl Fn(&mut Prakriya), ) -> bool { // If the prakriya requests a specific context, run only if that context is available. - if self.p.artha().is_some() && self.artha_context.is_none() { + if self.p.artha().is_some() && self.rule_artha.is_none() { return false; } let rule = rule.into(); let prati = &self.prati().text; - println!("Try: {rule:?} {prati} + {taddhita:?}"); + if cfg!(debug_assertions) { + println!("Try: {rule:?} {prati} + {taddhita:?}"); + } self.had_match = true; if taddhita == self.taddhita && !self.has_taddhita { @@ -113,8 +114,8 @@ impl<'a> TaddhitaPrakriya<'a> { p.push(taddhita.to_term()); func(p); }); - if let Some(a) = self.artha_context { - self.p.set_artha(a); + if let Some(a) = self.rule_artha { + self.p.set_artha(Artha::Taddhita(a)); } let i_last = self.p.terms().len() - 1; diff --git a/vidyut-prakriya/src/tag.rs b/vidyut-prakriya/src/tag.rs index b93ff41..e971e3a 100644 --- a/vidyut-prakriya/src/tag.rs +++ b/vidyut-prakriya/src/tag.rs @@ -151,6 +151,8 @@ pub enum Tag { Parasmaipada, Atmanepada, + AmAtmanepada, + // Artha (semantic conditions) Ashih, Sanartha, diff --git a/vidyut-prakriya/src/term.rs b/vidyut-prakriya/src/term.rs index 31a6770..24a5efb 100644 --- a/vidyut-prakriya/src/term.rs +++ b/vidyut-prakriya/src/term.rs @@ -193,11 +193,6 @@ impl Term { self.text.ends_with(suffix) } - /// Sets the dhatu's gana. - pub fn set_gana(&mut self, gana: Gana) { - self.gana = Some(gana); - } - /// Returns whether the term has the given dhatu gana. pub fn has_gana(&self, gana: Gana) -> bool { self.gana == Some(gana) @@ -216,8 +211,8 @@ impl Term { self.text.chars().filter(|c| AC.contains(*c)).count() } - // Tags and Samjnas - // ---------------- + // Tags + // ---- /// Returns whether the term has the given tag. pub fn has_tag(&self, tag: Tag) -> bool { @@ -245,21 +240,32 @@ impl Term { self.num_vowels() == 1 } - /// Returns whether the term could be called a `pada`. - pub fn is_pada(&self) -> bool { - // TODO: create and use `T::Pada` instead. - // TODO: avoid `Upasarga` hack. - self.has_tag_in(&[Tag::Pada, Tag::Tin, Tag::Sup, Tag::Upasarga]) + // Samjna properties + // ----------------- + + /// Returns whether the term is an abhyAsa. + pub fn is_abhyasa(&self) -> bool { + self.has_tag(Tag::Abhyasa) } - /// Returns whether the term has the `Pratyaya` samjna. - pub fn is_pratyaya(&self) -> bool { - self.has_tag(Tag::Pratyaya) + /// Returns whether the term is an abhyasta. + pub fn is_abhyasta(&self) -> bool { + self.has_tag(Tag::Abhyasta) } - /// Returns whether the term has the `Sup` samjna. - pub fn is_sup(&self) -> bool { - self.has_tag(Tag::Sup) + /// Returns whether the term is an Agama. + pub fn is_agama(&self) -> bool { + self.has_tag(Tag::Agama) + } + + /// Returns whether the term is an ardhadhatuka pratyaya. + pub fn is_ardhadhatuka(&self) -> bool { + self.has_tag(Tag::Ardhadhatuka) + } + + /// Returns whether the term has the `Atmanepada` samjna. + pub fn is_atmanepada(&self) -> bool { + self.has_tag(Tag::Atmanepada) } /// Returns whether the term has the `Avyaya` samjna. @@ -267,14 +273,19 @@ impl Term { self.has_tag(Tag::Avyaya) } - /// Returns whether the term has the `Sarvanama` samjna. - pub fn is_sarvanama(&self) -> bool { - self.has_tag(Tag::Sarvanama) + /// Returns whether the term has the `Dhatu` samjna. + pub fn is_dhatu(&self) -> bool { + self.has_tag(Tag::Dhatu) } - /// Returns whether the term has the `Vibhakti` samjna. - pub fn is_vibhakti(&self) -> bool { - self.has_tag(Tag::Vibhakti) + /// Returns whether the term is kit or Nit. + pub fn is_knit(&self) -> bool { + self.has_tag_in(&[Tag::kit, Tag::Nit]) + } + + /// Returns whether the term has the `Krt` samjna. + pub fn is_krt(&self) -> bool { + self.has_tag(Tag::Krt) } /// Returns whether the term is `Ric` or `RiN`. @@ -282,19 +293,21 @@ impl Term { self.has_u_in(&["Ric", "RiN"]) } - /// Returns whether the term has the `Krt` samjna. - pub fn is_krt(&self) -> bool { - self.has_tag(Tag::Krt) + /// Returns whether the term is a nistha. + pub fn is_nistha(&self) -> bool { + self.has_tag(Tag::Nistha) } - /// Returns whether the term has the `Taddhita` samjna. - pub fn is_taddhita(&self) -> bool { - self.has_tag(Tag::Taddhita) + /// Returns whether the term could be called a `pada`. + pub fn is_pada(&self) -> bool { + // TODO: create and use `T::Pada` instead. + // TODO: avoid `Upasarga` hack. + self.has_tag_in(&[Tag::Pada, Tag::Tin, Tag::Sup, Tag::Upasarga]) } - /// Returns whether the term has the `Dhatu` samjna. - pub fn is_dhatu(&self) -> bool { - self.has_tag(Tag::Dhatu) + /// Returns whether the term has the `Atmanepada` samjna. + pub fn is_parasmaipada(&self) -> bool { + self.has_tag(Tag::Parasmaipada) } /// Returns whether the term has the `Pratipadika` samjna. @@ -302,49 +315,44 @@ impl Term { self.has_tag(Tag::Pratipadika) } - /// Returns whether the term is an Agama. - pub fn is_agama(&self) -> bool { - self.has_tag(Tag::Agama) - } - - /// Returns whether the term is an upasarga. - pub fn is_upasarga(&self) -> bool { - self.has_tag(Tag::Upasarga) + /// Returns whether the term has the `Pratyaya` samjna. + pub fn is_pratyaya(&self) -> bool { + self.has_tag(Tag::Pratyaya) } - /// Returns whether the term is a nistha. - pub fn is_nistha(&self) -> bool { - self.has_tag(Tag::Nistha) + /// Returns whether the term has the `Sarvanama` samjna. + pub fn is_sarvanama(&self) -> bool { + self.has_tag(Tag::Sarvanama) } - /// Returns whether the term is an abhyAsa. - pub fn is_abhyasa(&self) -> bool { - self.has_tag(Tag::Abhyasa) + /// Returns whether the term has the `Sarvanamasthana` samjna. + pub fn is_sarvanamasthana(&self) -> bool { + self.has_tag(Tag::Sarvanamasthana) } - /// Returns whether the term is an abhyasta. - pub fn is_abhyasta(&self) -> bool { - self.has_tag(Tag::Abhyasta) + /// Returns whether the term has the `Sup` samjna. + pub fn is_sup(&self) -> bool { + self.has_tag(Tag::Sup) } - /// Returns whether the term is vrddha. - pub fn is_vrddha(&self) -> bool { - self.has_tag(Tag::Vrddha) + /// Returns whether the term has the `Taddhita` samjna. + pub fn is_taddhita(&self) -> bool { + self.has_tag(Tag::Taddhita) } - /// Returns whether the term has the `Atmanepada` samjna. - pub fn is_atmanepada(&self) -> bool { - self.has_tag(Tag::Atmanepada) + /// Returns whether the term is an upasarga. + pub fn is_upasarga(&self) -> bool { + self.has_tag(Tag::Upasarga) } - /// Returns whether the term has the `Atmanepada` samjna. - pub fn is_parasmaipada(&self) -> bool { - self.has_tag(Tag::Parasmaipada) + /// Returns whether the term has the `Vibhakti` samjna. + pub fn is_vibhakti(&self) -> bool { + self.has_tag(Tag::Vibhakti) } - /// Returns whether the term is kit or Nit. - pub fn is_knit(&self) -> bool { - self.has_tag_in(&[Tag::kit, Tag::Nit]) + /// Returns whether the term is vrddha. + pub fn is_vrddha(&self) -> bool { + self.has_tag(Tag::Vrddha) } /// Returns whether the term is apṛkta. @@ -436,6 +444,10 @@ impl Term { !self.is_laghu() } + pub fn sthanivat(&self) -> &CompactString { + &self.sthanivat + } + // Mutators // -------- @@ -481,16 +493,17 @@ impl Term { self.text.replace_range(.., s); } + /// Sets the dhatu's gana. + pub fn set_gana(&mut self, gana: Gana) { + self.gana = Some(gana); + } + pub fn find_and_replace_text(&mut self, needle: &str, sub: &str) { // Ugly, but it works let alloc = self.text.replace(needle, sub); self.text = CompactString::from(&alloc); } - pub fn sthanivat(&self) -> &CompactString { - &self.sthanivat - } - pub fn maybe_save_sthanivat(&mut self) { // sthani = srO, text = srAv if self.text.is_empty() { diff --git a/vidyut-prakriya/src/tripadi/pada_8_2.rs b/vidyut-prakriya/src/tripadi/pada_8_2.rs index 058cb2f..ba89018 100644 --- a/vidyut-prakriya/src/tripadi/pada_8_2.rs +++ b/vidyut-prakriya/src/tripadi/pada_8_2.rs @@ -121,7 +121,15 @@ fn try_change_r_to_l(p: &mut Prakriya) -> Option<()> { let y = p.get(j)?; if x.has_u_in(&["kfpU~\\", "kfpa~\\", "kfpa~"]) { - p.op("8.2.18", op::t(i, do_ra_la)); + p.op("8.2.18", |p| { + if let Some(t) = p.get_mut(i) { + do_ra_la(t); + } + if i > 0 && p.has(i - 1, |t| t.has_text("rI")) { + // For calIkxpyate + p.set(i - 1, |t| t.set_text("lI")); + } + }); } else if y.has_u("aya~\\") { if x.has_upadha('r') || x.has_antya('r') { p.op("8.2.19", op::t(i, do_ra_la)); @@ -150,7 +158,9 @@ fn try_lopa_of_samyoganta_and_s(p: &mut Prakriya) -> Option<()> { |p, _, i| { let t = get_at(p, i + 1).expect("valid"); // "ayamapi sica eva lopaḥ, tena iha na bhavati, somasut stotā, dṛṣṭsthānam iti" (KV) - if t.has_u("si~c") { + // But, also part of bapsati? + // TODO: clean up this rule + if t.has_u("si~c") || t.has_u("Basa~") { set_at(p, i + 1, ""); p.step("8.2.26"); true @@ -735,8 +745,9 @@ fn try_lengthen_dhatu_vowel(p: &mut Prakriya) -> Option<()> { }; let before_upadha = |t: &Term| t.text.chars().rev().nth(2); + // karotereva tatra grahaRAd ityAhuH (SK 2536) // TODO: bha - if dhatu.has_text_in(&["kur", "Cur"]) { + if dhatu.has_text("Cur") || (dhatu.has_text("kur") && dhatu.has_u("qukf\\Y")) { p.step("8.2.79"); } else if is_ik(dhatu.upadha()) && is_rv(dhatu.antya()) { let sub = al::to_dirgha(dhatu.upadha()?)?; diff --git a/vidyut-prakriya/src/tripadi/pada_8_3.rs b/vidyut-prakriya/src/tripadi/pada_8_3.rs index d230356..48dbbe5 100644 --- a/vidyut-prakriya/src/tripadi/pada_8_3.rs +++ b/vidyut-prakriya/src/tripadi/pada_8_3.rs @@ -1,7 +1,7 @@ use crate::args::Gana; use crate::char_view::{get_term_and_offset_indices, set_at, xy, CharPrakriya}; use crate::it_samjna; -use crate::iterators::{xy_rule, xy_rule_rev}; +use crate::iterators::xy_rule; use crate::operators as op; use crate::prakriya::Prakriya; use crate::sounds as al; @@ -94,11 +94,18 @@ fn try_ra_lopa(p: &mut Prakriya) -> Option<()> { /// Converts "m" and "n" to the anusvara when a consonant follows. /// /// Example: Sankate -> SaMkate -fn try_mn_to_anusvara(p: &mut Prakriya) { +fn try_mn_to_anusvara(p: &mut Prakriya) -> Option<()> { + // Disable certain sandhi changes if deriving a dhatu since we'll run these rules again when + // deriving the final word. + // + // Example: sam + cekrIya should not become saYcekrIya so that we can later derive + // samacekrIyata, etc. + let is_dhatu_prakriya = p.terms().last()?.is_dhatu(); + for i in 0..p.terms().len() { if p.has(i, |t| t.has_antya('m')) && p.is_pada(i) { if let Some(i_next) = p.find_next_where(i, |t| !t.is_empty()) { - if p.has(i_next, |t| t.has_adi(&*HAL)) { + if p.has(i_next, |t| t.has_adi(&*HAL)) && !is_dhatu_prakriya { p.op_term("8.3.23", i, |t| t.set_antya("M")); } } @@ -124,6 +131,8 @@ fn try_mn_to_anusvara(p: &mut Prakriya) { } }, ); + + Some(()) } fn try_add_dhut_agama(p: &mut Prakriya) { @@ -181,265 +190,356 @@ fn try_visarjaniyasya(p: &mut Prakriya) -> Option<()> { Some(()) } -/// Checks if there are any rules that block shatva. If such a rule exists, return it so that we -/// can mark it on the prakriya. -/// -/// (8.3.110 - 8.3.118) -fn try_get_shatva_niyama(p: &mut Prakriya, i: usize) -> Option { - // TODO: 8.3.114, 8.3.119 - - let t = p.get_if(i, |t| t.has_adi('s'))?; - - // Term is padAdi if it is at the beginning or if it follows a pada. - let is_padadi = || i == 0 || p.get(i - 1).expect("valid").is_pratyaya(); - let is_liti = || p.has(i + 1, |t| t.has_lakshana("li~w")); - - let ra_para = t.get_at(1).map(|x| x == 'r').unwrap_or(false); - - // TODO: savanAdi - if ra_para || t.has_u_in(&["sf\\px", "sf\\ja~", "sf\\ja~\\", "spf\\Sa~", "spfha"]) { - Some("8.3.110") - } else if (t.has_u("sAt") && t.is_pratyaya()) || is_padadi() { - Some("8.3.111") - } else if t.has_u("zi\\ca~^") && p.has(i + 1, |t| t.has_u("yaN")) { - Some("8.3.112") - } else if t.has_u_in(&["ziDa~", "ziDU~"]) - && i > 0 - && p.has(i - 1, |t| t.has_u_in(&["pari", "aBi"])) - && p.has(i + 1, |t| t.is_ni_pratyaya()) - { - // Based on commentary, this is only for abhi-sidh-nic and pari-sidh-nic - Some("8.3.113") - } else if t.has_text("saQ") { - // The rule says "soQ" but "soQ" appears only after 8.3.13, which itself can occur only - // fater - Some("8.3.115") - } else if p.has(i + 1, |t| t.has_u_in(&["sta\\nBu~", "zivu~", "zaha~\\"])) - && p.has(i + 2, |t| t.has_u("caN")) - { - // Per varttika, this is specifically for the abhyasa, not the dhatu. - Some("8.3.116") - } else if t.has_u("zu\\Y") && p.has(i + 1, |t| t.has_u_in(&["sya", "syan"])) { - Some("8.3.117") - } else if t.has_u("za\\dx~") && is_liti() { - Some("8.3.118") - } else if t.has_u("zva\\nja~\\") && is_liti() { - Some("8.3.118.v1") - } else { - None - } +#[derive(Debug)] +struct ShaPrakriya<'a> { + p: &'a mut Prakriya, + i_term: usize, + done: bool, } -/// A helper function for `try_shatva`. -/// -/// `j` is the index that might receive adesha. -fn run_shatva_rules_at_index(p: &mut Prakriya, i: usize, j: usize) -> Option<()> { - let _x = p.get(i)?; - let y = p.get(j)?; - debug_assert!(y.has_adi('s')); - - // Use `find_next_where` to find `san` because position of `san` is uncertain due to iw-Agama - // and ni-pratyaya. `z` is part of the rule. - let shan = p.find_next_where(j, |t| t.has_u("san") && t.has_adi('z')); - - if shan.is_some() { - let nau = p.has(j + 1, |t| t.is_ni_pratyaya()); - if y.has_u("zwu\\Y") || nau { - // Prefer `has_u_in` over `has_text_in` because `has_u_in` is more reliable and doesn't - // include sound changes. - // TODO: does this overgenerate? - if nau - && y.has_u_in(&[ - "YizvidA~\\", - "YizvidA~", - "zvi\\dA~", - "zvada~\\", - "zvada~", - "zaha~", - "zaha~\\", - ]) - { - p.step("8.3.62"); - } else { - // stu -> tuzwUsati - // siv -> sizevayizati - p.op_term("8.3.61", j, op::adi("z")); - } +impl<'a> ShaPrakriya<'a> { + fn new(p: &'a mut Prakriya, i_dhatu: usize) -> Self { + Self { + p, + i_term: i_dhatu, + done: false, } - } else { - if p.has(j, |t| t.has_u("sAti~")) { - // agnisAt ... - p.step("8.3.111") - } else if !p.has(j, |t| t.has_tag(T::FlagKeepSa)) { - // General case. - p.op_term("8.3.59", j, op::adi("z")); + } + + fn prev(&self) -> Option<&Term> { + let i_prev = self.p.find_prev_where(self.i_term, |t| !t.is_empty())?; + self.p.get(i_prev) + } + + /// Returns a reference to the current term. + fn term(&self) -> &Term { + self.p.get(self.i_term).expect("ok") + } + + fn has_upasarga_in(&self, text: &[&str]) -> bool { + self.i_term > 0 && self.p.has(self.i_term - 1, |t| t.has_text_in(text)) + } + + fn try_block(&mut self, rule: Code) { + if !self.done { + self.p.step(rule); + } + self.done = true; + } + + fn try_shatva(&mut self, rule: Code) { + if !self.done { + self.p.op_term(rule, self.i_term, |t| t.set_adi("z")); + } + self.done = true; + } + + fn try_run_with(&mut self, rule: Code, func: impl Fn(&mut Prakriya)) { + if !self.done { + self.p.op(rule, func); + } + self.done = true; + } + + fn optional_try_shatva(&mut self, rule: Code) -> bool { + if !self.done { + let done = self + .p + .op_optional(rule, op::t(self.i_term, |t| t.set_adi("z"))); + self.done = done; + done + } else { + false } } - Some(()) } -/// Runs rules that replace the initial "s" of a dhatu after certain upasargas. -/// -/// (8.3.63 - 8.3.77) -fn run_shatva_rules_after_upasarga(p: &mut Prakriya) -> Option<()> { - let i_dhatu = p.find_first(T::Dhatu)?; +fn run_shatva_rules_at_index(sp: &mut ShaPrakriya) -> Option<()> { + use Gana::*; - // Rules condition on the *last* upasarga, and we can ignore all others. - // + let i = sp.i_term; + let t = sp.term(); + + // Skip if not s-Adi. + // Also skip abhyasas since we handle these as part of the dhatu rules. + if !t.has_adi('s') || t.is_abhyasa() { + return None; + } + + // Various niyamas on shatva + // ------------------------- + let maybe_i_upasarga = sp.p.find_prev_where(sp.i_term, |t| t.is_upasarga()); + let inku = if let Some(i) = maybe_i_upasarga { + let upasarga = sp.p.get(i).expect("ok"); + upasarga.has_antya(&*IN_KU) + } else { + false + }; + + if t.has_at(1, 'r') || t.has_u_in(&["sf\\px", "sf\\ja~", "sf\\ja~\\", "spf\\Sa~", "spfha"]) { + // visfpa + // TODO: savanAdi + sp.try_block("8.3.110"); + } else if (t.has_u("sAt") && t.is_pratyaya()) || i == 0 { + // daDisAt, daDi siYcati + sp.try_block("8.3.111"); + } else if t.has_u("zi\\ca~^") && sp.p.has(i + 1, |t| t.has_u("yaN")) { + // aBisesicyate + sp.try_block("8.3.112"); + } else if t.has_u_in(&["ziDa~", "ziDU~"]) && sp.has_upasarga_in(&["pari", "aBi", "vi"]) { + // Based on commentary, this seems to apply only for abhi-sidh and + // pari-sidh. SK has vi-sidh. + sp.try_block("8.3.113"); + } else if t.has_text("saQ") { + // parisoQa, parisoQum, ... + // + // The rule says "soQ" but "soQ" appears only after rule 8.3.13, which itself can occur + // only after rule 8.4.41. + sp.try_block("8.3.115"); + } else if inku + && t.has_u_in(&["stanBu~", "zivu~", "zaha~\\"]) + && sp.p.has(i + 1, |t| t.has_u("caN")) + { + // paryatasTabat, paryazIsivat, ... + // + // Per varttika, this is specifically for the abhyasa, not the dhatu. + sp.try_block("8.3.116"); + } else if t.has_u("zu\\Y") && sp.p.has(i + 1, |t| t.has_u_in(&["sya", "san"])) { + // aBisozyati, ... + sp.try_block("8.3.117"); + } else if inku && sp.p.terms().last()?.has_lakshana("li~w") && sp.i_term > 0 { + let i_abhyasa = sp.i_term - 1; + let has_abhyasa = sp.p.has(i_abhyasa, |t| t.is_abhyasa() && !t.is_empty()); + if t.has_u("za\\dx~") && has_abhyasa { + // nizasAda, ... + sp.try_run_with("8.3.118", |p| p.set(i_abhyasa, |t| t.set_adi("z"))); + } else if t.has_u("zva\\nja~\\") && has_abhyasa { + // parizasvaje, ... + sp.try_run_with("8.3.118.v1", |p| p.set(i_abhyasa, |t| t.set_adi("z"))); + } + } + + // Rules that condition on an upasarga + // ----------------------------------- // In general, various terms might intervene between the upasarga and the dhatu. Examples: // // 1. an abhyAsa (upa-sa-sAra) // 2. aw-Agama (sam-a-smarat) // 3. suw-Agama (pari-z-karoti, pary-a-z-karot) - let i_upasarga = p.find_prev_where(i_dhatu, |t| t.has_tag(T::Upasarga))?; + // + // The terms here have three main sections: + // + // a. All terms -- no vyayAya + // b. Up to sita -- aw-vyavAya OK + // c. stha to sita -- abhyAsa-vyavAya and aw-vyavAya OK + + let term = sp.term(); + let maybe_i_upasarga = sp.p.find_prev_where(sp.i_term, |t| t.is_upasarga()); + if maybe_i_upasarga.is_some() { + let i_upasarga = maybe_i_upasarga?; + + // No gap between upasarga and dhatu. + let no_vyavaya = i_upasarga + 1 == sp.i_term; + // Gap between upasarga and dhatu is just an abhyasa. + let at_vyavaya = i_upasarga + 2 == sp.i_term + && sp.p.has(i_upasarga + 1, |t| t.is_agama() && t.has_u("aw")); + let abhyasa_vyavaya = + i_upasarga + 2 == sp.i_term && sp.p.has(i_upasarga + 1, |t| t.is_abhyasa()); + + // Check both upadesha and gana to avoid matching dhatus in other ganas. + const SU_TO_STUBH: &[(&str, Gana)] = &[ + ("zu\\Y", Svadi), + ("zU", Tudadi), + ("zo\\", Divadi), + ("zwu\\Y", Adadi), + ("zwuBu~\\", Bhvadi), + ]; + const SU_ADI: &[(&str, Gana)] = &[ + ("zu\\Y", Svadi), + ("zU", Tudadi), + ("zo\\", Divadi), + ("zwu\\Y", Adadi), + ("zwuBu~\\", Bhvadi), + ("zWA\\", Bhvadi), + // TODO: senaya -- but, not listed in our dhatupatha? + ("ziDa~", Bhvadi), + ("ziDU~", Bhvadi), + ("zi\\ca~^", Tudadi), + ("za\\nja~", Bhvadi), + ("zva\\nja~\\", Bhvadi), + ]; + const SEV_ADI: &[(&str, Gana)] = &[ + ("zevf~\\", Bhvadi), + // TODO: sita, saya + ("zivu~", Divadi), + ("zaha~\\", Bhvadi), + // TODO: suw-Agama + ("zwu\\Y", Adadi), + ("zva\\nja~\\", Bhvadi), + ]; + + let upasarga = sp.p.get(i_upasarga)?; + let inku = upasarga.has_antya(&*IN_KU); + let has_dhatu_in = |d: &Term, items: &[(&str, Gana)]| { + items.iter().any(|(u, g)| d.has_gana(*g) && d.has_u(u)) + }; - let dhatu = p.get(i_dhatu)?; - let upasarga = p.get(i_upasarga)?; - let inku = upasarga.has_antya(&*IN_KU); + // By 8.3.64, zatva also occurs for the abhyasa of dhatus starting with sthA in 8.3.65 and + // ending with 8.3.70 inclusive. + if no_vyavaya || at_vyavaya || abhyasa_vyavaya { + if has_dhatu_in(term, SEV_ADI) || term.has_u("su~w") { + // Rules 8.3.70 and 8.3.71 take priority over 8.3.65 so that we can handle `stu` correctly. + if upasarga.has_u_in(&["pari", "ni", "vi"]) { + // TODO: also exclude sita + let is_siv_adi = !term.has_u("zevf~\\"); + if is_siv_adi { + // "siv" follows "sita" which means we lose "at_vyavaya" and + // "abhyava_vyavaya". But 8.3.71 allows "at_vyavaya" again. + // + // The rule says "aw-vyavAye 'pi" but the KV heavily implies this is + // optional strictly for "aw" and mandatory otherwise. + if at_vyavaya { + sp.optional_try_shatva("8.3.71"); + sp.done = true; + } else if no_vyavaya { + sp.try_shatva("8.3.70"); + } + } else { + // Other terms (sev, sita) are allowed in any condition. + sp.try_shatva("8.3.70"); + } + } + } - // If the aw-Agama is used, it immediately follows the last upasarga. - let _has_aw_agama = if i_upasarga + 1 != i_dhatu { - p.has(i_upasarga + 1, |t| t.has_u("aw") && t.is_agama()) - } else { - false - }; - let i_abhyasa = p.find_next_where(i_upasarga, |t| t.is_abhyasa()); - - // Check both upadesha and gana to avoid matching dhatus in other ganas. - const ITEMS_8_3_65: &[(&str, Gana)] = &[ - ("zu\\Y", Gana::Svadi), - ("zU", Gana::Tudadi), - ("zo\\", Gana::Divadi), - ("zwu\\Y", Gana::Adadi), - ("zwuBu~\\", Gana::Bhvadi), - ("zWA\\", Gana::Bhvadi), - // TODO: senaya -- but, not listed in our dhatupatha? - ("ziDa~", Gana::Bhvadi), - ("ziDU~", Gana::Bhvadi), - ("zi\\ca~^", Gana::Tudadi), - ("za\\nja~", Gana::Bhvadi), - ("zva\\nja~\\", Gana::Bhvadi), - ]; - const STHA_INDEX: usize = 5; - assert!(ITEMS_8_3_65[STHA_INDEX].0 == "zWA\\"); - - const ITEMS_8_3_70: &[(&str, Gana)] = &[ - ("zevf~\\", Gana::Bhvadi), - // TODO: sita, saya - ("zivu~", Gana::Divadi), - ("zaha~\\", Gana::Bhvadi), - // TODO: suw-Agama - ("zwu\\Y", Gana::Adadi), - ("zva\\nja~\\", Gana::Bhvadi), - ]; - - let dhatu_in = - |d: &Term, items: &[(&str, Gana)]| items.iter().any(|(u, g)| d.has_gana(*g) && d.has_u(u)); - - let try_shatva_for_dhatu_and_abhyasa = |p: &mut Prakriya| { - if let Some(i_abhyasa) = i_abhyasa { - if p.has(i_abhyasa, |t| t.has_adi('s')) { - if let Some(rule) = try_get_shatva_niyama(p, i_abhyasa) { - p.step(rule) + // Avoid `else if` here so we can match svanj again (pratyazvaNkta) + let term = sp.term(); + let upasarga = sp.p.get(i_upasarga)?; + if inku && has_dhatu_in(term, SU_ADI) { + let is_stha_adi = !has_dhatu_in(term, SU_TO_STUBH); + if no_vyavaya || at_vyavaya || (abhyasa_vyavaya && is_stha_adi) { + sp.try_shatva("8.3.65"); + } + } else if inku && term.has_u("za\\dx~") { + let code = "8.3.66"; + if upasarga.has_u("prati") { + sp.try_block(code); } else { - p.set(i_abhyasa, op::adi("z")); + sp.try_shatva(code); + } + } else if term.has_u("stanBu~") { + if upasarga.has_u("ava") { + sp.optional_try_shatva("8.3.68"); + } else if inku { + // > aprateḥ ityetadiha na anuvartate, tena etadapi bhavati, pratiṣṭabhnāti, + // > prayaṣṭabhnāt, pratitaṣṭambha + // -- Kashika on 8.3.67 + sp.try_shatva("8.3.67"); } + } else if term.has_u("svana~") && upasarga.has_u_in(&["ava", "vi"]) { + // vizvanati, visvanati + sp.optional_try_shatva("8.3.69"); } - } - if p.has(i_dhatu, |t| t.has_adi('s')) { - if let Some(rule) = try_get_shatva_niyama(p, i_dhatu) { - p.step(rule) - } else { - p.set(i_dhatu, op::adi("z")); + let dhatu = sp.term(); + if sp.done && dhatu.has_adi('z') { + let i_abhyasa = sp.i_term - 1; + let is_stha_adi = !has_dhatu_in(dhatu, SU_TO_STUBH); + if sp.p.has(i_abhyasa, |t| t.is_abhyasa() && t.has_adi('s')) && is_stha_adi { + sp.p.op_term("8.3.64", i_abhyasa, |t| t.set_adi("z")); + } } } - }; - - // By 8.3.64, zatva also occurs for the abhyasa of dhatus starting with sthA in 8.3.65 and - // ending with 8.3.70 inclusive. - if dhatu_in(dhatu, ITEMS_8_3_70) { - // 8.3.70+71 take priority over 8.3.65 so that we can handle `stu` correctly. - if upasarga.has_u_in(&["pari", "ni", "vi"]) { - if !dhatu.has_u("zevf~\\") { - // TODO: also exclude sita, saya - p.op_optional("8.3.71", try_shatva_for_dhatu_and_abhyasa); - } else { - p.op("8.3.70", try_shatva_for_dhatu_and_abhyasa); + if no_vyavaya || at_vyavaya { + let dhatu = sp.term(); + let upasarga = sp.p.get(i_upasarga)?; + if upasarga.has_u_in(&["anu", "vi", "pari", "aBi", "ni"]) && dhatu.has_u("syandU~\\") { + sp.optional_try_shatva("8.3.72"); + sp.done = true; + } else if upasarga.has_u_in(&["vi", "pari"]) && dhatu.has_u("ska\\ndi~r") { + if upasarga.has_u("vi") { + if !sp.p.has(sp.i_term + 1, |t| t.is_nistha()) { + sp.optional_try_shatva("8.3.73"); + } + } else { + sp.optional_try_shatva("8.3.74"); + } + } else if upasarga.has_u_in(&["nis", "ni", "vi"]) + && dhatu.has_u_in(&["sPura~", "sPula~"]) + { + sp.optional_try_shatva("8.3.76"); + } else if upasarga.has_u("vi") && dhatu.has_u("skanBu~") { + sp.try_shatva("8.3.77"); } } - } else if inku && dhatu_in(dhatu, ITEMS_8_3_65) { - if i_abhyasa.is_some() && dhatu_in(dhatu, &ITEMS_8_3_65[STHA_INDEX..]) { - p.op("8.3.65", try_shatva_for_dhatu_and_abhyasa); - } else { - // TODO: remove guard. - if p.has(i_dhatu, |t| t.has_adi('s')) { - p.op_term("8.3.65", i_dhatu, op::adi("z")); - } + let term = sp.term(); + if term.has_tag(T::FlagAdeshadi) && !abhyasa_vyavaya { + sp.try_block("8.3.111"); } - } else if inku && dhatu.has_u("za\\dx~") { - let code = "8.3.66"; - if upasarga.has_u("prati") { - p.set(i_dhatu, |t| t.add_tag(T::FlagKeepSa)); - if let Some(i) = i_abhyasa { - p.set(i, |t| t.add_tag(T::FlagKeepSa)); + } + + // General rules + // ------------- + + let term_view = sp.p.view(sp.i_term)?; + let prev = sp.prev()?; + + let is_apadanta = !term_view.is_empty(); + // HACK: added Agama here. We should exclude it. + let adesha_pratyaya = term_view.has_tag_in(&[T::Pratyaya, T::FlagAdeshadi]); + if prev.has_antya(&*IN_KU) && is_apadanta && adesha_pratyaya && term_view.has_adi('s') { + let term = sp.term(); + // Use `find_next_where` to find `san` because position of `san` is uncertain due to iw-Agama + // and ni-pratyaya. `z` is part of the rule. + let shan = + sp.p.find_next_where(sp.i_term, |t| t.has_u("san") && t.has_adi('z')); + + if shan.is_some() { + let nau = sp.p.has(sp.i_term + 1, |t| t.is_ni_pratyaya()); + if term.has_u("zwu\\Y") || nau { + // Prefer `has_u_in` over `has_text_in` because `has_u_in` is more reliable and doesn't + // include sound changes. + // TODO: does this overgenerate? + if nau + && term.has_u_in(&[ + "YizvidA~\\", + "YizvidA~", + "zvi\\dA~", + "zvada~\\", + "zvada~", + "zaha~", + "zaha~\\", + ]) + { + sp.p.step("8.3.62"); + } else { + // stu -> tuzwUsati + // siv -> sizevayizati + sp.try_shatva("8.3.61"); + } } - p.step(code); } else { - p.op(code, try_shatva_for_dhatu_and_abhyasa); - } - } else if dhatu.has_u("sta\\nBu~") { - if upasarga.has_u("ava") { - p.op_optional("8.3.68", try_shatva_for_dhatu_and_abhyasa); - } else if inku { - // > aprateḥ ityetadiha na anuvartate, tena etadapi bhavati, pratiṣṭabhnāti, - // > prayaṣṭabhnāt, pratitaṣṭambha - // -- Kashika on 8.3.67 - p.op("8.3.67", try_shatva_for_dhatu_and_abhyasa); - } - } else if dhatu.has_u("svana~") && upasarga.has_u_in(&["ava", "vi"]) { - // vizvanati, visvanati - p.op_optional("8.3.69", try_shatva_for_dhatu_and_abhyasa); - } else if upasarga.has_u_in(&["anu", "vi", "pari", "aBi", "ni"]) && dhatu.has_u("syandU~\\") { - if !p.op_optional("8.3.72", op::t(i_dhatu, op::adi("z"))) { - p.set(i_dhatu, |t| t.add_tag(T::FlagKeepSa)); - } - } else if upasarga.has_u_in(&["vi", "pari"]) && dhatu.has_u("ska\\ndi~r") { - if upasarga.has_u("vi") { - if !p.has(i_dhatu + 1, |t| t.has_tag(T::Nistha)) { - p.op_optional("8.3.73", op::t(i_dhatu, op::adi("z"))); + if term.has_u("sAti~") { + // agnisAt ... + sp.try_block("8.3.111") + } else { + // General case. + sp.try_shatva("8.3.59"); } - } else { - // TODO: implement 8.3.75 - p.op_optional("8.3.74", op::t(i_dhatu, op::adi("z"))); } - } else if upasarga.has_u_in(&["nis", "ni", "vi"]) && dhatu.has_u_in(&["sPura~", "sPula~"]) { - p.op_optional("8.3.76", op::t(i_dhatu, op::adi("z"))); - } else if upasarga.has_u("vi") && dhatu.has_u("ska\\nBu~") { - p.op_term("8.3.77", i_dhatu, op::adi("z")); } + Some(()) } fn run_shatva_rules(p: &mut Prakriya) -> Option<()> { - // Run these rules first since they can block the general rule (8.3.59). - run_shatva_rules_after_upasarga(p); - // Iterate in reverse order so that we can produce `san` -> `zan`, which can then trigger // 8.3.61. - xy_rule_rev( - p, - |x, y| { - let apadanta = !y.text.is_empty(); - // HACK: don't include Agama. - let adesha_pratyaya = y.has_tag_in(&[T::Pratyaya, T::FlagAdeshadi, T::Agama]); - x.has_antya(&*IN_KU) && apadanta && adesha_pratyaya && y.has_adi('s') - }, - |p, i, j| { - run_shatva_rules_at_index(p, i, j); - }, - ); + for i in (0..p.terms().len()).rev() { + let mut sp = ShaPrakriya::new(p, i); + run_shatva_rules_at_index(&mut sp); + } + // HACK for ezaH if p.get(0)?.has_text("esa") && p.get(0)?.has_tag(T::Sarvanama) { p.op_term("8.3.59", 0, |t| t.set_text("eza")); @@ -480,9 +580,20 @@ fn try_murdhanya_for_dha_in_tinanta(p: &mut Prakriya) -> Option<()> { let shidhvam_lun_lit = p.get(i - 1)?.has_text("zI") || tin.has_lakshana_in(&["lu~N", "li~w"]); let i_anga = p.find_prev_where(i, |t| !t.is_empty() && !t.is_agama())?; - let anga = p.get(i_anga)?; + let allow_it_agama_as_in = if shidhvam_lun_lit && dha { + false // p.op_optional(Rule::Kaumudi("2258"), |_| {}) + } else { + false + }; + + let inah = if allow_it_agama_as_in { + p.find_prev_where(i, |t| t.is_it_agama()).is_some() + } else { + let anga = p.get(i_anga)?; + anga.has_antya(&*IN2) + }; - if anga.has_antya(&*IN2) && shidhvam_lun_lit && dha { + if inah && shidhvam_lun_lit && dha { if p.has(i_anga + 1, |t| t.is_it_agama()) { p.op_optional("8.3.79", op::t(i, op::adi("Q"))); } else { diff --git a/vidyut-prakriya/src/tripadi/pada_8_4.rs b/vidyut-prakriya/src/tripadi/pada_8_4.rs index f1f3dbb..5cd70f9 100644 --- a/vidyut-prakriya/src/tripadi/pada_8_4.rs +++ b/vidyut-prakriya/src/tripadi/pada_8_4.rs @@ -69,7 +69,7 @@ fn try_natva_for_span(cp: &mut CharPrakriya, i_rs: usize, i_n: usize) -> Option< let dhatu = cp.p.get(i)?; let next = cp.p.get(i + 1)?; if (dhatu.has_u("kzuBa~") && next.has_u_in(&["SnA", "SAnac"])) - || (dhatu.has_u("ska\\nBu~") && next.has_u_in(&["SnA", "Snu"])) + || (dhatu.has_u("skanBu~") && next.has_u_in(&["SnA", "Snu"])) || (dhatu.has_u("tfpa~") && next.has_u("Snu")) || (dhatu.has_u("nftI~") && next.has_u("yaN")) { @@ -92,7 +92,8 @@ fn try_natva_for_span(cp: &mut CharPrakriya, i_rs: usize, i_n: usize) -> Option< } else if i_n == cp.text.len() - 1 { // akurvan, caran, ... cp.p.step("8.4.37"); - } else if x.has_tag(T::Upasarga) { + } else if x.is_upasarga() || x.has_u("antar") { + // Allow "antar" per 1.4.65.v1. // Check !is_pratyaya to allow nirvAna -> nirvARa const GAD_ADI: &[(&str, Gana)] = &[ ("gada~", Gana::Bhvadi), @@ -133,11 +134,19 @@ fn try_natva_for_span(cp: &mut CharPrakriya, i_rs: usize, i_n: usize) -> Option< // prahiRoti cp.set_at(i_n, "R"); cp.p.step("8.4.15"); - } else if y.has_u("Ani") && y.has_lakshana("lo~w") { - // pravapARi - cp.set_at(i_n, "R"); - cp.p.step("8.4.16"); - } else if y.has_u("ni") { + } else if y.has_lakshana("lo~w") && y.has_u("ni") { + if x.has_u("dur") { + // TODO: extend + cp.p.step("1.4.60.v3"); + } else if x.has_u("antar") { + // TODO: extend + cp.p.step("1.4.65.v1"); + } else { + // pravapARi + cp.set_at(i_n, "R"); + cp.p.step("8.4.16"); + } + } else if y.is_upasarga() && y.has_u("ni") { if dhatu_in(dhatu, GAD_ADI) || dhatu.has_tag(T::Ghu) { cp.set_at(i_n, "R"); cp.p.step("8.4.17"); @@ -466,25 +475,33 @@ fn try_to_savarna(p: &mut Prakriya) { }, ); + for i in 1..p.terms().len() { + if p.has(i - 1, |t| t.is_upasarga() && t.has_u("ud")) + && p.has(i, |t| t.has_u_in(&["zWA\\", "zwaBi~\\"])) + { + p.op_term("8.4.61", i, |t| t.set_adi("t")); + } + } + char_rule(p, xy(|x, y| JHAY.contains(x) && y == 'h'), |p, text, i| { - p.op_optional("8.4.62", |p| { - let sub = match text.as_bytes().get(i).map(|x| *x as char) { - Some('k') => Some("G"), - Some('g') => Some("G"), - Some('c') => Some("J"), - Some('j') => Some("J"), - Some('w') => Some("Q"), - Some('q') => Some("Q"), - Some('t') => Some("D"), - Some('d') => Some("D"), - Some('p') => Some("B"), - Some('b') => Some("B"), - _ => None, - }; - if let Some(sub) = sub { - set_at(p, i + 1, sub) - } - }) + let sub = match text.as_bytes().get(i).map(|x| *x as char) { + Some('k') => Some("G"), + Some('g') => Some("G"), + Some('c') => Some("J"), + Some('j') => Some("J"), + Some('w') => Some("Q"), + Some('q') => Some("Q"), + Some('t') => Some("D"), + Some('d') => Some("D"), + Some('p') => Some("B"), + Some('b') => Some("B"), + _ => None, + }; + if let Some(sub) = sub { + p.op_optional("8.4.62", |p| set_at(p, i + 1, sub)) + } else { + false + } }); char_rule( diff --git a/vidyut-prakriya/src/uttarapade.rs b/vidyut-prakriya/src/uttarapade.rs index 5cd129c..42116c2 100644 --- a/vidyut-prakriya/src/uttarapade.rs +++ b/vidyut-prakriya/src/uttarapade.rs @@ -2,6 +2,7 @@ //! (*uttarpada*). For now, we keep those rule here. use crate::args::Artha; +use crate::args::TaddhitaArtha; use crate::operators as op; use crate::prakriya::Prakriya; use crate::sounds as al; @@ -12,11 +13,13 @@ use lazy_static::lazy_static; lazy_static! { static ref AA: Set = s("a"); + static ref IK: Set = s("ik"); static ref AC: Set = s("ac"); } /// Runs rules that apply when an uttarapada is present. pub fn run(p: &mut Prakriya) -> Option<()> { + p.debug("==== uttarapade ===="); let last = p.terms().last()?; if p.terms().len() == 2 @@ -36,7 +39,10 @@ pub fn run(p: &mut Prakriya) -> Option<()> { let purva = p.get(i_purva)?; let uttara = p.get(i_uttara)?; - if purva.has_text("pAda") && uttara.has_u("yat") && !p.has_artha(Artha::Tadarthye) { + if purva.has_text("pAda") + && uttara.has_u("yat") + && !p.has_artha(Artha::Taddhita(TaddhitaArtha::Tadarthye)) + { p.op_term("6.3.53", i_purva, |t| t.set_text("pad")); } @@ -44,7 +50,7 @@ pub fn run(p: &mut Prakriya) -> Option<()> { let uttara = p.get(i_uttara)?; if purva.is_sarvanama() && uttara.has_text_in(&["dfS"]) { p.op_term("6.3.91", i_purva, |t| t.set_antya("A")); - } else if !purva.is_avyaya() { + } else if !purva.is_avyaya() && p.find_last(T::Kit).is_some() { let ajanta = al::is_ac(purva.antya()?); let i_khit = p.find_last_where(|t| t.has_tag(T::Kit))?; debug_assert!(i_khit > 0); @@ -79,6 +85,37 @@ pub fn run(p: &mut Prakriya) -> Option<()> { }); } } + Some(()) +} + +pub fn run_after_guna(p: &mut Prakriya) -> Option<()> { + let i_purva = 0; + let i_uttara = p.find_next_where(i_purva, |t| !t.is_empty())?; + let purva = p.get(i_purva)?; + let uttara = p.get(i_uttara)?; + + if purva.is_upasarga() { + if p.has(i_uttara + 1, |t| t.has_u("GaY")) { + // rule is "bahulam" + if purva.has_u("ni") && uttara.has_u_in(&["vfN", "vfY"]) { + // nIvAra + p.op_term("6.3.122", i_purva, |t| t.set_antya("I")); + } + } else if purva.has_antya(&*IK) { + if uttara.has_text("kAS") && p.has(i_uttara + 1, |t| t.has_u("ac")) { + // nIkASa, vIkASa, anUkASa + let sub = al::to_dirgha(purva.antya()?)?; + p.op_term("6.3.123", i_purva, |t| t.set_antya(&sub.to_string())); + } else if uttara.has_tag(T::Ghu) && uttara.has_text("t") { + // nItta, vItta, parItta + let sub = al::to_dirgha(purva.antya()?)?; + p.op_term("6.3.124", i_purva, |t| t.set_antya(&sub.to_string())); + } + } + } else if uttara.has_text("citi") && p.has(i_uttara + 1, |t| t.has_u("kap")) { + // citIka + p.op_term("6.3.125", i_uttara, |t| t.set_antya("I")); + } Some(()) } diff --git a/vidyut-prakriya/src/vikarana.rs b/vidyut-prakriya/src/vikarana.rs index 528c092..02e9ced 100644 --- a/vidyut-prakriya/src/vikarana.rs +++ b/vidyut-prakriya/src/vikarana.rs @@ -78,13 +78,8 @@ fn maybe_replace_cli_with_ksa(p: &mut Prakriya, i: usize) -> Option<()> { return None; } - // The vArttika doesn't say this specifically, but the commentator examples - // imply that this holds only for parasmaipada. let sprs = &["spfS", "mfS", "kfz", "tfp", "dfp"]; - if xyz(p, i, |x, _, z| { - x.has_text_in(sprs) && z.has_tag(T::Parasmaipada) - }) { - // + if xyz(p, i, |x, _, _| x.has_text_in(sprs)) { if p.op_optional("3.1.44.v1", |p| op::upadesha_no_it(p, i + 1, "si~c")) { return None; } @@ -200,8 +195,13 @@ fn maybe_replace_cli_with_an(p: &mut Prakriya, i: usize) -> Option<()> { let tin = p.get(i + 2)?; let is_parasmai = tin.is_parasmaipada(); if has_cli(p, i) { - if dhatu.has_u_in(&["sf\\", "SAsu~", "f\\"]) { - // SAsu~\\ (ASAste) is not part of the rule. + if (dhatu.has_u("sf\\") && dhatu.has_gana(Juhotyadi)) + || (dhatu.has_u("f\\") && dhatu.has_gana(Juhotyadi)) + || dhatu.has_u_in(&["SAsu~"]) + { + // sf\\ (sarati) is not part of the rule. (SK) + // f\\ (fcCati) is not part of the rule. (SK) + // SAsu~\\ (ASAste) is not part of the rule. (KV) p.op("3.1.56", to_an); } else if is_parasmai && dhatu.has_tag(T::irit) { p.op_optional("3.1.57", to_an); @@ -235,6 +235,7 @@ fn maybe_replace_cli_with_cin(p: &mut Prakriya, i: usize) -> Option<()> { "dIpI~\\", "janI~\\", "buDa~", + "bu\\Da~\\", "pUrI~\\", "tAyf~\\", "o~pyAyI~\\", @@ -265,10 +266,11 @@ fn add_lun_vikarana(p: &mut Prakriya) { assert!(n >= 3); let i = n - 3; + // Check ciN first because rule 3.1.66 ("ciN bhAvakarmaNoH") blocks other vikaranas. + maybe_replace_cli_with_cin(p, i); maybe_replace_cli_with_ksa(p, i); maybe_replace_cli_with_can(p, i); maybe_replace_cli_with_an(p, i); - maybe_replace_cli_with_cin(p, i); maybe_replace_cli_with_sic(p, i); } @@ -293,7 +295,10 @@ fn add_kr_bhu_or_as_after_am_pratyaya(p: &mut Prakriya) { p.insert_before(i_tin, dhatu); if !p.is_bhave_or_karmani() { - p.remove_tag(T::Atmanepada); + if p.has_tag(T::Atmanepada) { + p.add_tag(T::AmAtmanepada); + p.remove_tag(T::Atmanepada); + } p.add_tag(T::Parasmaipada); } }); @@ -308,7 +313,10 @@ fn add_kr_bhu_or_as_after_am_pratyaya(p: &mut Prakriya) { p.insert_before(i_tin, dhatu); if !p.is_bhave_or_karmani() { - p.remove_tag(T::Atmanepada); + if p.has_tag(T::Atmanepada) { + p.add_tag(T::AmAtmanepada); + p.remove_tag(T::Atmanepada); + } p.add_tag(T::Parasmaipada); } }); @@ -418,7 +426,7 @@ fn add_sarvadhatuka_vikarana(p: &mut Prakriya) -> Option<()> { let has_upasarga = p.find_prev_where(i, |t| t.is_upasarga()).is_some(); // Optional cases - let stanbhu_stunbhu = ["sta\\nBu~", "stu\\nBu~", "ska\\nBu~", "sku\\nBu~", "sku\\Y"]; + let stanbhu_stunbhu = ["stanBu~", "stunBu~", "skanBu~", "skunBu~", "sku\\Y"]; let mut divadi_declined = false; if dhatu.has_text_in(&[ "BrAS", "BlAS", "Bram", "kram", "klam", "tras", "truw", "laz", diff --git a/vidyut-prakriya/test_utils/src/lib.rs b/vidyut-prakriya/test_utils/src/lib.rs index 27a4cad..634589a 100644 --- a/vidyut-prakriya/test_utils/src/lib.rs +++ b/vidyut-prakriya/test_utils/src/lib.rs @@ -6,7 +6,9 @@ manage the boilerplate required for these assertions. */ extern crate vidyut_prakriya; +use vidyut_prakriya::args::Antargana; use vidyut_prakriya::args::Vacana::*; +use vidyut_prakriya::args::Vibhakti::*; use vidyut_prakriya::args::*; use vidyut_prakriya::Ashtadhyayi; use vidyut_prakriya::Prakriya; @@ -23,7 +25,10 @@ fn sanitize_results(mut results: Vec) -> Vec { .into_iter() .filter(|p| { let text = p.text(); - !text.ends_with('d') && !text.ends_with('q') && !text.ends_with('g') + !text.ends_with('d') + && !text.ends_with('q') + && !text.ends_with('g') + && !text.ends_with('b') }) .collect() } @@ -41,11 +46,13 @@ fn derive_krdantas(dhatu: &Dhatu, args: KrdantaArgs) -> Vec { let mut results = a.derive_krdantas(dhatu, &args); results.sort_by_key(|p| p.text()); results.dedup_by_key(|p| p.text()); + // Allowed in pada sandhi, but noisy here. + results.retain(|p| !p.text().contains("cS")); results } /// Derives taddhitantas from the given initial conditions. -fn derive_taddhitantas(p: &Pratipadika, t: Taddhita, a: Option) -> Vec { +fn derive_taddhitantas(p: &Pratipadika, t: Taddhita, a: Option) -> Vec { let args = if let Some(a) = a { TaddhitantaArgs::builder() .taddhita(t) @@ -275,6 +282,10 @@ pub fn d(u: &str, g: Gana) -> Dhatu { Dhatu::new(u, g) } +pub fn d_kutadi(u: &str, g: Gana) -> Dhatu { + Dhatu::new(u, g).with_antargana(Some(Antargana::Kutadi)) +} + /// Marks a dhatu as taking san-pratyaya. pub fn san(dhatu: &Dhatu) -> Dhatu { dhatu.clone().with_sanadi(&[Sanadi::San]) @@ -290,6 +301,11 @@ pub fn nic(dhatu: &Dhatu) -> Dhatu { dhatu.clone().with_sanadi(&[Sanadi::Nic]) } +/// Marks a dhatu as taking san-pratyaya followed by Nic-pratyaya. +pub fn san_nic(dhatu: &Dhatu) -> Dhatu { + dhatu.clone().with_sanadi(&[Sanadi::San, Sanadi::Nic]) +} + /// Marks a dhatu as taking Nic-pratyaya followed by san-pratyaya. pub fn nic_san(dhatu: &Dhatu) -> Dhatu { dhatu.clone().with_sanadi(&[Sanadi::Nic, Sanadi::San]) @@ -392,6 +408,42 @@ pub fn assert_has_mahin(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: assert_has_atmane_tinanta(prefixes, dhatu, la, Purusha::Uttama, Bahu, expected); } +pub fn assert_has_ta_k(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Prathama, Eka, expected); +} + +pub fn assert_has_aataam_k(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Prathama, Dvi, expected); +} + +pub fn assert_has_jha_k(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Prathama, Bahu, expected); +} + +pub fn assert_has_thaas_k(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Madhyama, Eka, expected); +} + +pub fn assert_has_aathaam_karmani(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Madhyama, Dvi, expected); +} + +pub fn assert_has_dhvam_karmani(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Madhyama, Bahu, expected); +} + +pub fn assert_has_iw_k(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Uttama, Eka, expected); +} + +pub fn assert_has_vahi_karmani(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Uttama, Dvi, expected); +} + +pub fn assert_has_mahin_karmani(prefixes: &[&str], dhatu: &Dhatu, la: Lakara, expected: &[&str]) { + assert_has_karmani_tinanta(prefixes, dhatu, la, Purusha::Uttama, Bahu, expected); +} + // Tinanta helpers (based on lakara suffix) // ---------------------------------------- @@ -568,6 +620,30 @@ pub fn assert_has_krdanta(prefixes: &[&str], dhatu: &Dhatu, krt: Krt, expected: ); } +pub fn assert_has_artha_krdanta( + upapadas: &[&str], + dhatu: &Dhatu, + requested_artha: KrtArtha, + krt: Krt, + expected: &[&str], +) { + let args = KrdantaArgs::builder() + .krt(krt) + .artha(requested_artha) + .build() + .unwrap(); + let mut prakriyas = derive_krdantas(&dhatu.clone().with_prefixes(upapadas), args); + + prakriyas.retain(|p| { + if let Some(Artha::Krt(prakriya_artha)) = p.artha() { + requested_artha == prakriya_artha + } else { + false + } + }); + assert_padas(prakriyas, expected); +} + pub fn assert_has_upapada_krdanta( upapada: &str, prefixes: &[&str], @@ -613,14 +689,14 @@ pub fn assert_has_taddhitanta(prati: &Pratipadika, t: Taddhita, expected: &[&str pub fn assert_has_artha_taddhita( prati: &str, - requested_artha: Artha, + requested_artha: TaddhitaArtha, t: Taddhita, expected: &[&str], ) { let pratipadika = Pratipadika::new(prati); let mut prakriyas = derive_taddhitantas(&pratipadika, t, Some(requested_artha)); prakriyas.retain(|p| { - if let Some(prakriya_artha) = p.artha() { + if let Some(Artha::Taddhita(prakriya_artha)) = p.artha() { requested_artha.is_type_of(prakriya_artha) } else { false @@ -685,3 +761,99 @@ pub fn assert_has_subantas_raw( let actual: Vec<_> = results.into_iter().collect(); assert_padas(actual, expected); } + +pub fn assert_has_sup_1s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Prathama, Eka, &expected); +} + +pub fn assert_has_sup_1d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Prathama, Dvi, &expected); +} + +pub fn assert_has_sup_1p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Prathama, Bahu, &expected); +} + +pub fn assert_has_sup_2s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Dvitiya, Eka, &expected); +} + +pub fn assert_has_sup_2d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Dvitiya, Dvi, &expected); +} + +pub fn assert_has_sup_2p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Dvitiya, Bahu, &expected); +} + +pub fn assert_has_sup_3s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Trtiya, Eka, &expected); +} + +pub fn assert_has_sup_3d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Trtiya, Dvi, &expected); +} + +pub fn assert_has_sup_3p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Trtiya, Bahu, &expected); +} + +pub fn assert_has_sup_4s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Caturthi, Eka, &expected); +} + +pub fn assert_has_sup_4d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Caturthi, Dvi, &expected); +} + +pub fn assert_has_sup_4p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Caturthi, Bahu, &expected); +} + +pub fn assert_has_sup_5d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Caturthi, Dvi, &expected); +} + +pub fn assert_has_sup_5p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Caturthi, Bahu, &expected); +} + +pub fn assert_has_sup_5s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Panchami, Eka, &expected); +} + +pub fn assert_has_sup_6s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Sasthi, Eka, &expected); +} + +pub fn assert_has_sup_6d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Sasthi, Dvi, &expected); +} + +pub fn assert_has_sup_6p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Sasthi, Bahu, &expected); +} + +pub fn assert_has_sup_7s(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Saptami, Eka, &expected); +} + +pub fn assert_has_sup_7d(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Saptami, Dvi, &expected); +} + +pub fn assert_has_sup_7p(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Saptami, Bahu, &expected); +} + +pub fn assert_has_sup_ss(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Sambodhana, Eka, &expected); +} + +pub fn assert_has_sup_sd(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Sambodhana, Dvi, &expected); +} + +pub fn assert_has_sup_sp(prati: &str, linga: Linga, expected: &[&str]) { + assert_has_subantas(prati, linga, Sambodhana, Bahu, &expected); +} diff --git a/vidyut-prakriya/tests/pada_1_1.rs b/vidyut-prakriya/tests/kashika_1_1.rs similarity index 100% rename from vidyut-prakriya/tests/pada_1_1.rs rename to vidyut-prakriya/tests/kashika_1_1.rs diff --git a/vidyut-prakriya/tests/pada_1_2.rs b/vidyut-prakriya/tests/kashika_1_2.rs similarity index 97% rename from vidyut-prakriya/tests/pada_1_2.rs rename to vidyut-prakriya/tests/kashika_1_2.rs index d794ea6..27a137d 100644 --- a/vidyut-prakriya/tests/pada_1_2.rs +++ b/vidyut-prakriya/tests/kashika_1_2.rs @@ -111,23 +111,8 @@ fn sutra_1_2_6_v1() { assert_has_jhi(&[], &danbh, Lit, &["deBuH", "dadamBuH"]); let svaj = d("zva\\nja~\\", Bhvadi); - assert_has_ta( - &["pari"], - &svaj, - Lit, - &["parizasvaje", "parizasvaYje", "parisasvaje", "parisasvaYje"], - ); - assert_has_aataam( - &["pari"], - &svaj, - Lit, - &[ - "parizasvajAte", - "parizasvaYjAte", - "parisasvajAte", - "parisasvaYjAte", - ], - ); + assert_has_ta(&["pari"], &svaj, Lit, &["parizasvaje", "parizasvaYje"]); + assert_has_aataam(&["pari"], &svaj, Lit, &["parizasvajAte", "parizasvaYjAte"]); } #[test] @@ -213,7 +198,7 @@ fn sutra_1_2_11() { assert_has_ashirlin_a(&[], &budh, &["ButsIzwa"]); // sic assert_has_lun_a(&[], &bhid, &["aBitta"]); - assert_has_lun_a(&[], &budh, &["abudDa"]); + assert_has_lun_a(&[], &budh, &["abudDa", "aboDi"]); // ikaH let yaj = d("ya\\ja~^", Bhvadi); assert_has_ashirlin_a(&[], &yaj, &["yakzIzwa"]); diff --git a/vidyut-prakriya/tests/pada_1_3.rs b/vidyut-prakriya/tests/kashika_1_3.rs similarity index 97% rename from vidyut-prakriya/tests/pada_1_3.rs rename to vidyut-prakriya/tests/kashika_1_3.rs index 52bb0e9..43962f1 100644 --- a/vidyut-prakriya/tests/pada_1_3.rs +++ b/vidyut-prakriya/tests/kashika_1_3.rs @@ -120,6 +120,19 @@ fn sutra_1_3_8() { // assert_has_taddhitanta(&prati("vfkza"), T::kan, &["vfkzaka"]); } +#[test] +fn sutra_1_3_10() { + use vidyut_prakriya::args::TaddhitaArtha::*; + + // Example: 4.3.94 + assert_has_artha_taddhita("tUdI", AsyaNivasa, T::Qak, &["tOdeya"]); + assert_has_artha_taddhita("SAlAtura", AsyaNivasa, T::CaR, &["SAlAturIya"]); + assert_has_artha_taddhita("varmatI", AsyaNivasa, T::QaY, &["vArmateya"]); + assert_has_artha_taddhita("kUcavAra", AsyaNivasa, T::yak, &["kOcavArya"]); + + // TODO: others +} + #[test] fn sutra_1_3_12() { // anudAttet @@ -530,7 +543,6 @@ fn sutra_1_3_66() { assert_has_lat(&[], &bhuj, &["Bunakti", "BuNkte"]); } -#[ignore] #[test] fn sutra_1_3_68() { assert_has_lat( diff --git a/vidyut-prakriya/tests/pada_1_4.rs b/vidyut-prakriya/tests/kashika_1_4.rs similarity index 100% rename from vidyut-prakriya/tests/pada_1_4.rs rename to vidyut-prakriya/tests/kashika_1_4.rs diff --git a/vidyut-prakriya/tests/pada_2_3.rs b/vidyut-prakriya/tests/kashika_2_3.rs similarity index 100% rename from vidyut-prakriya/tests/pada_2_3.rs rename to vidyut-prakriya/tests/kashika_2_3.rs diff --git a/vidyut-prakriya/tests/pada_2_4.rs b/vidyut-prakriya/tests/kashika_2_4.rs similarity index 93% rename from vidyut-prakriya/tests/pada_2_4.rs rename to vidyut-prakriya/tests/kashika_2_4.rs index 0182f1e..531329c 100644 --- a/vidyut-prakriya/tests/pada_2_4.rs +++ b/vidyut-prakriya/tests/kashika_2_4.rs @@ -50,7 +50,6 @@ fn sutra_2_4_37_v1() { assert_has_krdanta(&["pra"], &ad, Krt::ac, &["praGasa"]); } -#[ignore] #[test] fn sutra_2_4_38() { let ad = d("a\\da~", Adadi); @@ -301,6 +300,30 @@ fn sutra_2_4_72() { assert_has_lat_p(&[], &d("dvi\\za~^", Adadi), &["dvezwi"]); } +#[ignore] +#[test] +fn sutra_2_4_74() { + let lu = d("lUY", Kryadi); + assert_has_krdanta(&[], &yan(&lu), Krt::ac, &["loluva"]); + + let pu = d("pUY", Kryadi); + assert_has_krdanta(&[], &yan(&pu), Krt::ac, &["popuva"]); + + // TODO: we currently create sanIsrasya, then luk --> sanIsras. + // Instead, we should perform luk earlier based on the pratyaya we want to use. + let srans = d("sransu~\\", Bhvadi); + assert_has_krdanta(&[], &yan(&srans), Krt::ac, &["sanIsraMsa"]); + + let dhvans = d("Dvansu~\\", Bhvadi); + assert_has_krdanta(&[], &yan(&dhvans), Krt::ac, &["danIDvaMsa"]); + + let lap = d("lapa~", Bhvadi); + assert_has_lat(&[], &yan_luk(&lap), &["lAlapIti", "lAlapti"]); + + let vad = d("vada~", Bhvadi); + assert_has_lat(&[], &yan_luk(&vad), &["vAvadIti", "vAvatti"]); +} + #[test] fn sutra_2_4_75() { assert_has_lat_p(&[], &d("hu\\", Juhotyadi), &["juhoti"]); diff --git a/vidyut-prakriya/tests/pada_3_1.rs b/vidyut-prakriya/tests/kashika_3_1.rs similarity index 79% rename from vidyut-prakriya/tests/pada_3_1.rs rename to vidyut-prakriya/tests/kashika_3_1.rs index 65c666f..c0af11e 100644 --- a/vidyut-prakriya/tests/pada_3_1.rs +++ b/vidyut-prakriya/tests/kashika_3_1.rs @@ -57,7 +57,6 @@ fn sutra_3_1_22() { assert_has_lat(&[], &yan(&d("dIpI~\\", Divadi)), &["dedIpyate"]); } -#[ignore] #[test] fn sutra_3_1_22_v1() { assert_has_lat(&[], &yan(&d("sUca", Curadi)), &["sosUcyate"]); @@ -104,11 +103,13 @@ fn sutra_3_1_26() { #[test] fn sutra_3_1_28() { + let pan = &d("paRa~\\", Bhvadi); assert_has_lat_p(&[], &d("gupU~", Bhvadi), &["gopAyati"]); assert_has_lat_p(&[], &d("DUpa~", Bhvadi), &["DUpAyati"]); assert_has_lat_p(&[], &d("viCa~", Tudadi), &["vicCAyati"]); - assert_has_lat_p(&[], &d("paRa~\\", Bhvadi), &["paRAyati"]); + assert_has_lat_p(&[], &pan, &["paRAyati"]); assert_has_lat_p(&[], &d("pana~\\", Bhvadi), &["panAyati"]); + assert_has_lat_a(&[], &pan, &["paRate"]); } #[test] @@ -283,6 +284,10 @@ fn sutra_3_1_41() { fn sutra_3_1_44() { assert_has_lun_p(&[], &d("qukf\\Y", Tanadi), &["akArzIt"]); assert_has_lun_p(&[], &d("hf\\Y", Bhvadi), &["ahArzIt"]); +} + +#[test] +fn sutra_3_1_44_v1() { assert_has_lun_p( &[], &d("spf\\Sa~", Tudadi), @@ -353,13 +358,12 @@ fn sutra_3_1_49() { ); } -#[ignore] #[test] fn sutra_3_1_52() { let asu = d("asu~", Divadi); - assert_has_tip(&["pari"], &asu, Lun, &["paryAsTata"]); - assert_has_tas(&["pari"], &asu, Lun, &["paryAsTetAm"]); - assert_has_jhi(&["pari"], &asu, Lun, &["paryAsTanta"]); + assert_has_ta(&["pari"], &asu, Lun, &["paryAsTata"]); + assert_has_aataam(&["pari"], &asu, Lun, &["paryAsTetAm"]); + assert_has_jha(&["pari"], &asu, Lun, &["paryAsTanta"]); let vac = d("va\\ca~", Adadi); assert_has_tip(&[], &vac, Lun, &["avocat"]); @@ -400,10 +404,10 @@ fn sutra_3_1_55() { #[test] fn sutra_3_1_56() { - assert_has_lun_p(&[], &d("sf\\", Bhvadi), &["asarat"]); + assert_has_lun_p(&[], &d("sf\\", Juhotyadi), &["asarat"]); assert_has_lun_p(&[], &d("SAsu~", Adadi), &["aSizat"]); - assert_has_lun_p(&[], &d("f\\", Bhvadi), &["Arat"]); - assert_has_lun_a(&["sam"], &d("f\\", Bhvadi), &["samArata"]); + assert_has_lun_p(&[], &d("f\\", Juhotyadi), &["Arat"]); + assert_has_lun_a(&["sam"], &d("f\\", Juhotyadi), &["samArata"]); } #[test] @@ -418,8 +422,7 @@ fn sutra_3_1_57() { #[test] fn sutra_3_1_58() { assert_has_lun_p(&[], &d("jF", Kryadi), &["ajarat", "ajArIt"]); - // TODO: astamBIt? - // assert_has_lun_p(&[], &d("", Kryadi), &["astaBat", "astamBIt"]) + assert_has_lun_p(&[], &d("stanBu~", Kryadi), &["astaBat", "astamBIt"]); assert_has_lun_p(&[], &d("mrucu~", Bhvadi), &["amrucat", "amrocIt"]); assert_has_lun_p(&[], &d("mlucu~", Bhvadi), &["amlucat", "amlocIt"]); assert_has_lun_p(&[], &d("grucu~", Bhvadi), &["agrucat", "agrocIt"]); @@ -432,6 +435,16 @@ fn sutra_3_1_58() { ); } +#[test] +fn sutra_3_1_60() { + let pad = d("pa\\da~\\", Divadi); + assert_has_ta(&["ud"], &pad, Lun, &["udapAdi"]); + assert_has_ta(&["sam"], &pad, Lun, &["samapAdi"]); + // te? + assert_has_aataam(&["ud"], &pad, Lun, &["udapatsAtAm"]); + assert_has_jha(&["ud"], &pad, Lun, &["udapatsata"]); +} + #[test] fn sutra_3_1_61() { assert_has_lun_karmani(&[], &d("dIpI~\\", Divadi), &["adIpi", "adIpizwa"]); @@ -442,6 +455,13 @@ fn sutra_3_1_61() { assert_has_lun_karmani(&[], &d("o~pyAyI~\\", Bhvadi), &["apyAyi", "apyAyizwa"]); } +#[test] +fn sutra_3_1_66() { + assert_has_lun_karmani(&[], &d("SE\\", Bhvadi), &["aSAyi"]); + assert_has_lun_karmani(&[], &d("qukf\\Y", Tanadi), &["akAri"]); + assert_has_lun_karmani(&[], &d("hf\\Y", Bhvadi), &["ahAri"]); +} + #[test] fn sutra_3_1_67() { assert_has_lat_karmani(&[], &d("Asa~\\", Adadi), &["Asyate"]); @@ -546,10 +566,10 @@ fn sutra_3_1_81() { #[test] fn sutra_3_1_82() { - assert_has_lat(&[], &d("sta\\nBu~", Kryadi), &["staBnAti", "staBnoti"]); - assert_has_lat(&[], &d("stu\\nBu~", Kryadi), &["stuBnAti", "stuBnoti"]); - assert_has_lat(&[], &d("ska\\nBu~", Kryadi), &["skaBnAti", "skaBnoti"]); - assert_has_lat(&[], &d("sku\\nBu~", Kryadi), &["skuBnAti", "skuBnoti"]); + assert_has_lat(&[], &d("stanBu~", Kryadi), &["staBnAti", "staBnoti"]); + assert_has_lat(&[], &d("stunBu~", Kryadi), &["stuBnAti", "stuBnoti"]); + assert_has_lat(&[], &d("skanBu~", Kryadi), &["skaBnAti", "skaBnoti"]); + assert_has_lat(&[], &d("skunBu~", Kryadi), &["skuBnAti", "skuBnoti"]); assert_has_lat_p(&[], &d("sku\\Y", Kryadi), &["skunAti", "skunoti"]); } @@ -571,6 +591,20 @@ fn sutra_3_1_91() { assert_has_krdanta(&[], &kf, Krt::anIyar, &["karaRIya"]); } +#[test] +fn sutra_3_1_92() { + // example: 3.2.1 + let kf = d("qukf\\Y", Tanadi); + assert_has_upapada_krdanta("kumBa", &[], &kf, Krt::aR, &["kumBakAra"]); + + // TODO: stamberama, karRejapa + + // example: 3.2.97 + let jan = d("janI~\\", Divadi); + assert_has_upapada_krdanta("upasara", &[], &jan, Krt::qa, &["upasaraja"]); + assert_has_upapada_krdanta("mandura", &[], &jan, Krt::qa, &["manduraja"]); +} + #[test] fn sutra_3_1_93() { let kf = d("qukf\\Y", Tanadi); @@ -583,6 +617,28 @@ fn sutra_3_1_93() { // krt-pratyayas // ------------- +#[test] +fn sutra_3_1_94() { + let kzip = d("kzi\\pa~^", Tudadi); + assert_has_krdanta(&["vi"], &kzip, Krt::Rvul, &["vikzepaka"]); + assert_has_krdanta(&["vi"], &kzip, Krt::tfc, &["vikzeptf"]); + assert_has_krdanta(&["vi"], &kzip, Krt::ka, &["vikzipa"]); + + // asarUpa? + let daa = d("qudA\\Y", Juhotyadi); + assert_has_upapada_krdanta("go", &[], &daa, Krt::ka, &["goda"]); + assert_has_upapada_krdanta("kambala", &[], &daa, Krt::ka, &["kambalada"]); + + // striyAm? + assert_has_krdanta(&[], &san(&d("qukf\\Y", Tanadi)), Krt::a, &["cikIrzA"]); + assert_has_krdanta(&[], &san(&d("hf\\Y", Bhvadi)), Krt::a, &["jihIrzA"]); +} + +#[test] +fn sutra_3_1_95() { + // No examples from KV. +} + #[test] fn sutra_3_1_96() { let kf = d("qukf\\Y", Tanadi); @@ -684,11 +740,74 @@ fn sutra_3_1_100_v1() { assert_has_krdanta(&["AN"], &car, Krt::Ryat, &["AcArya"]); } +#[test] +fn sutra_3_1_106() { + let vad = d("vada~", Bhvadi); + assert_has_upapada_krdanta("brahma", &[], &vad, Krt::yat, &["brahmavadya"]); + assert_has_upapada_krdanta("brahma", &[], &vad, Krt::kyap, &["brahmodya"]); +} + +#[test] +fn sutra_3_1_107() { + let bhu = d("BU", Bhvadi); + assert_has_upapada_krdanta("brahma", &[], &bhu, Krt::kyap, &["brahmaBUya"]); + assert_has_upapada_krdanta("deva", &[], &bhu, Krt::kyap, &["devaBUya"]); + // supi? + assert_has_krdanta(&[], &bhu, Krt::yat, &["Bavya"]); + // an-upasarge? + assert_has_krdanta(&["pra"], &bhu, Krt::yat, &["praBavya"]); +} + +#[ignore] +#[test] +fn sutra_3_1_108() { + let han = d("ha\\na~", Adadi); + assert_has_upapada_krdanta("brahma", &[], &han, Krt::kyap, &["brahmahatya"]); + assert_has_upapada_krdanta("aSva", &[], &han, Krt::kyap, &["aSvahatya"]); + // supi? + assert_has_krdanta(&[], &han, Krt::GaY, &["GAta"]); + assert_has_krdanta(&[], &han, Krt::Ryat, &[]); +} + +#[test] +fn sutra_3_1_109() { + assert_has_krdanta(&[], &d("i\\R", Adadi), Krt::kyap, &["itya"]); + assert_has_krdanta(&[], &d("zwu\\Y", Adadi), Krt::kyap, &["stutya"]); + assert_has_krdanta(&[], &d("SAsu~", Adadi), Krt::kyap, &["Sizya"]); + assert_has_krdanta(&[], &d("vfY", Svadi), Krt::kyap, &["vftya"]); + assert_has_krdanta(&["AN"], &d("df", Svadi), Krt::kyap, &["Adftya"]); + assert_has_krdanta(&[], &d("juzI~\\", Tudadi), Krt::kyap, &["juzya"]); + + // blocks Ryat + assert_has_krdanta(&[], &d("zwu\\Y", Adadi), Krt::Ryat, &[]); + + // vfY, not vfN + let vrnite = &d("vfN", Kryadi); + assert_has_krdanta(&[], &vrnite, Krt::kyap, &[]); + assert_has_krdanta(&[], &vrnite, Krt::Ryat, &["vArya"]); +} + +#[test] +fn sutra_3_1_110() { + assert_has_krdanta(&[], &d("vftu~\\", Bhvadi), Krt::kyap, &["vftya"]); + assert_has_krdanta(&[], &d("vfDu~\\", Bhvadi), Krt::kyap, &["vfDya"]); + // a-kxpi-cfteh? + assert_has_krdanta(&[], &d("kfpU~\\", Bhvadi), Krt::kyap, &[]); + assert_has_krdanta(&[], &d("cftI~", Tudadi), Krt::kyap, &[]); +} + #[test] fn sutra_3_1_111() { assert_has_krdanta(&[], &d("Kanu~^", Bhvadi), Krt::kyap, &["Keya"]); } +#[test] +fn sutra_3_1_112() { + let bhf = d("Bf\\Y", Bhvadi); + assert_has_krdanta(&[], &bhf, Krt::kyap, &["Bftya"]); + assert_has_krdanta(&[], &bhf, Krt::Ryat, &["BArya"]); +} + #[test] fn sutra_3_1_113() { let mfj = d("mfjU~", Adadi); @@ -730,6 +849,17 @@ fn sutra_3_1_125() { assert_has_krdanta(&[], &pu, Krt::yat, &["pavya"]); } +#[test] +fn sutra_3_1_126() { + assert_has_krdanta(&["AN"], &d("zu\\Y", Svadi), Krt::Ryat, &["AsAvya"]); + assert_has_krdanta(&[], &d("yu", Adadi), Krt::Ryat, &["yAvya"]); + assert_has_krdanta(&[], &d("quva\\pa~^", Bhvadi), Krt::Ryat, &["vApya"]); + assert_has_krdanta(&[], &d("rapa~", Bhvadi), Krt::Ryat, &["rApya"]); + assert_has_krdanta(&[], &d("lapa~", Adadi), Krt::Ryat, &["lApya"]); + assert_has_krdanta(&[], &d("trapU~\\z", Bhvadi), Krt::Ryat, &["trApya"]); + assert_has_krdanta(&["AN"], &d("camu~", Bhvadi), Krt::Ryat, &["AcAmya"]); +} + #[test] fn sutra_3_1_133() { let kf = d("qukf\\Y", Tanadi); @@ -740,6 +870,29 @@ fn sutra_3_1_133() { assert_has_krdanta(&[], &hf, Krt::tfc, &["hartf"]); } +#[test] +fn sutra_3_1_135() { + let kzip = &d("kzi\\pa~^", Tudadi); + assert_has_krdanta(&["vi"], &kzip, Krt::ka, &["vikzipa"]); + assert_has_krdanta(&[], &d("bu\\Da~\\", Divadi), Krt::ka, &["buDa"]); + assert_has_krdanta(&[], &d("kfSa~", Divadi), Krt::ka, &["kfSa"]); + assert_has_krdanta(&[], &d("jYA\\", Kryadi), Krt::ka, &["jYa"]); + assert_has_krdanta(&[], &d("prI\\Y", Kryadi), Krt::ka, &["priya"]); + assert_has_krdanta(&[], &d("kF", Tudadi), Krt::ka, &["kira"]); + + // vAsarUpa-vidhi + assert_has_krdanta(&[], &kzip, Krt::Rvul, &["kzepaka"]); + assert_has_krdanta(&[], &kzip, Krt::tfc, &["kzeptf"]); +} + +#[ignore] +#[test] +fn sutra_3_1_136() { + assert_has_krdanta(&["pra"], &d("zWA\\", Bhvadi), Krt::ka, &["prasTa"]); + assert_has_krdanta(&["su"], &d("glE\\", Bhvadi), Krt::ka, &["sugla"]); + assert_has_krdanta(&["su"], &d("mlE\\", Bhvadi), Krt::ka, &["sumla"]); +} + #[test] fn sutra_3_1_137() { let paa = &d("pA\\", Bhvadi); @@ -787,6 +940,13 @@ fn sutra_3_1_142() { // TODO: others } +#[test] +fn sutra_3_1_143() { + let grah = d("graha~^", Kryadi); + assert_has_krdanta(&[], &grah, Krt::aR, &["grAha"]); + assert_has_krdanta(&[], &grah, Krt::ac, &["graha"]); +} + #[test] fn sutra_3_1_144() { assert_has_krdanta(&[], &d("graha~^", Kryadi), Krt::ka, &["gfha"]); @@ -812,6 +972,12 @@ fn sutra_3_1_147() { // TODO: gAyanI } +#[test] +fn sutra_3_1_148() { + assert_has_krdanta(&[], &d("o~hA\\N", Juhotyadi), Krt::Ryuw, &["hAyana"]); + assert_has_krdanta(&[], &d("o~hA\\N", Juhotyadi), Krt::Ryuw, &["hAyana"]); +} + #[test] fn sutra_3_1_149() { assert_has_krdanta(&[], &d("pru\\N", Bhvadi), Krt::vun, &["pravaka"]); diff --git a/vidyut-prakriya/tests/pada_3_2.rs b/vidyut-prakriya/tests/kashika_3_2.rs similarity index 99% rename from vidyut-prakriya/tests/pada_3_2.rs rename to vidyut-prakriya/tests/kashika_3_2.rs index 3a6dc13..367f63d 100644 --- a/vidyut-prakriya/tests/pada_3_2.rs +++ b/vidyut-prakriya/tests/kashika_3_2.rs @@ -1043,7 +1043,6 @@ fn sutra_3_2_124() { // TODO: more } -#[ignore] #[test] fn sutra_3_2_128() { assert_has_krdanta(&[], &d("pUN", Bhvadi), Krt::SAnan, &["pavamAna"]); diff --git a/vidyut-prakriya/tests/kashika_3_3.rs b/vidyut-prakriya/tests/kashika_3_3.rs new file mode 100644 index 0000000..44fde43 --- /dev/null +++ b/vidyut-prakriya/tests/kashika_3_3.rs @@ -0,0 +1,632 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::KrtArtha::*; +use vidyut_prakriya::args::*; + +fn assert_has_bhave_krdanta(upapadas: &[&str], dhatu: &Dhatu, krt: Krt, expected: &[&str]) { + assert_has_artha_krdanta(upapadas, dhatu, KrtArtha::Bhava, krt, expected); +} + +fn assert_krt_blocked(upapadas: &[&str], dhatu: &Dhatu, krt: Krt) { + assert_has_krdanta(upapadas, dhatu, krt, &[]); +} + +#[test] +fn sutra_3_3_1() { + assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::uR, &["kAru"]); + assert_has_krdanta(&[], &d("pA\\", Bhvadi), Krt::uR, &["pAyu"]); + assert_has_krdanta(&[], &d("vA\\", Adadi), Krt::uR, &["vAyu"]); + assert_has_krdanta(&[], &d("ji\\", Bhvadi), Krt::uR, &["jAyu"]); + assert_has_krdanta(&[], &d("qumi\\Y", Svadi), Krt::uR, &["mAyu"]); + assert_has_krdanta(&[], &d("zvada~\\", Bhvadi), Krt::uR, &["svAdu"]); + assert_has_krdanta(&[], &d("sA\\Da~", Svadi), Krt::uR, &["sADu"]); + assert_has_krdanta(&[], &d("aSU~\\", Svadi), Krt::uR, &["ASu"]); + + // For more specific uNAdi tests, see `kaumudi_67.rs` +} + +#[test] +fn sutra_3_3_2() { + assert_has_krdanta(&[], &d("vftu~\\", Bhvadi), Krt::manin, &["vartman"]); + assert_has_krdanta(&[], &d("cara~", Bhvadi), Krt::manin, &["carman"]); +} + +#[test] +fn sutra_3_3_3() { + use Krt::ini; + use Krt::GinuR; + use Krt::Rini; + let gam = d("ga\\mx~", Bhvadi); + assert_has_krdanta(&[], &gam, ini, &["gamin"]); + assert_has_krdanta(&["AN"], &gam, ini, &["AgAmin"]); + assert_has_krdanta(&["pra"], &d("zWA\\", Bhvadi), ini, &["prasTAyin"]); + // per nyAsa, these are from Rini. nyAsa also indicates that prasTAyin comes from Rini, but + // this seems like an error given Unadi 4.9. + assert_has_krdanta(&["prati"], &d("ru\\Di~^r", Rudhadi), Rini, &["pratiroDin"]); + assert_has_krdanta(&["prati"], &d("buDa~", Bhvadi), Rini, &["pratiboDin"]); + assert_has_krdanta(&["prati"], &d("yu\\Da~\\", Divadi), Rini, &["pratiyoDin"]); + assert_has_krdanta(&["prati"], &d("yu\\ji~^r", Rudhadi), GinuR, &["pratiyogin"]); + assert_has_krdanta(&["AN"], &d("yA\\", Adadi), Rini, &["AyAyin"]); +} + +#[test] +fn sutra_3_3_10() { + assert_has_krdanta(&[], &d("Bu\\ja~", Rudhadi), Krt::tumun, &["Boktum"]); +} + +#[test] +fn sutra_3_3_13() { + assert_has_lrt_p(&[], &d("qukf\\Y", Tanadi), &["karizyati"]); + assert_has_lrt_p(&[], &d("hf\\Y", Bhvadi), &["harizyati"]); +} + +#[test] +fn sutra_3_3_15() { + assert_has_lut_p(&[], &d("qukf\\Y", Tanadi), &["kartA"]); + assert_has_lut_p(&[], &d("Bu\\ja~", Rudhadi), &["BoktA"]); +} + +#[test] +fn sutra_3_3_16() { + assert_has_krdanta(&[], &d("pa\\da~\\", Divadi), Krt::GaY, &["pAda"]); + assert_has_krdanta(&[], &d("ru\\jo~", Tudadi), Krt::GaY, &["roga"]); + assert_has_krdanta(&[], &d("vi\\Sa~", Tudadi), Krt::GaY, &["veSa"]); + assert_has_krdanta(&[], &d("spf\\Sa~", Tudadi), Krt::GaY, &["sparSa"]); +} + +#[test] +fn sutra_3_3_17() { + let sr = d("sf\\", Bhvadi); + assert_has_krdanta(&[], &sr, Krt::GaY, &["sAra"]); + assert_has_krdanta(&[], &sr, Krt::tfc, &["sartf"]); + assert_has_krdanta(&[], &sr, Krt::Rvul, &["sAraka"]); +} + +#[test] +fn sutra_3_3_18() { + assert_has_krdanta(&[], &d("qupa\\ca~^z", Bhvadi), Krt::GaY, &["pAka"]); + assert_has_krdanta(&[], &d("tya\\ja~", Bhvadi), Krt::GaY, &["tyAga"]); + assert_has_krdanta(&[], &d("ra\\nja~^", Divadi), Krt::GaY, &["rAga", "raNga"]); +} + +#[test] +fn sutra_3_3_21() { + assert_has_bhave_krdanta(&["aDi"], &d("i\\N", Adadi), Krt::GaY, &["aDyAya"]); + assert_has_bhave_krdanta(&["upa", "aDi"], &d("i\\N", Adadi), Krt::GaY, &["upADyAya"]); +} + +#[test] +fn sutra_3_3_22() { + let ru = d("ru", Adadi); + assert_has_bhave_krdanta(&["upa"], &ru, Krt::GaY, &["uparAva"]); + assert_krt_blocked(&["upa"], &ru, Krt::ap); + assert_has_bhave_krdanta(&[], &ru, Krt::ap, &["rava"]); +} + +#[test] +fn sutra_3_3_23() { + let yu = d("yu", Adadi); + let dru = d("dru\\", Tudadi); + let du = d("du\\", Bhvadi); + assert_has_bhave_krdanta(&["sam"], &yu, Krt::GaY, &["saMyAva"]); + assert_has_bhave_krdanta(&["sam"], &dru, Krt::GaY, &["sandrAva"]); + assert_has_bhave_krdanta(&["sam"], &du, Krt::GaY, &["sandAva"]); + // sami? + assert_krt_blocked(&["pra"], &yu, Krt::GaY); + assert_has_bhave_krdanta(&["pra"], &yu, Krt::ap, &["prayava"]); +} + +#[test] +fn sutra_3_3_24() { + let shri = d("SriY", Bhvadi); + let ni = d("RI\\Y", Bhvadi); + let bhu = d("BU", Bhvadi); + assert_has_bhave_krdanta(&[], &shri, Krt::GaY, &["SrAya"]); + assert_has_bhave_krdanta(&[], &ni, Krt::GaY, &["nAya"]); + assert_has_bhave_krdanta(&[], &bhu, Krt::GaY, &["BAva"]); + // anupasarge? + assert_has_bhave_krdanta(&["pra"], &shri, Krt::ac, &["praSraya"]); + assert_has_bhave_krdanta(&["pra"], &ni, Krt::ac, &["praRaya"]); + assert_has_bhave_krdanta(&["pra"], &bhu, Krt::ac, &["praBava"]); +} + +#[test] +fn sutra_3_3_25() { + let kshu = d("wukzu", Adadi); + let shru = d("Sru\\", Bhvadi); + assert_has_bhave_krdanta(&["vi"], &kshu, Krt::GaY, &["vikzAva"]); + assert_has_bhave_krdanta(&["vi"], &shru, Krt::GaY, &["viSrAva"]); + // vau? + assert_has_bhave_krdanta(&[], &kshu, Krt::ac, &["kzava"]); + assert_has_bhave_krdanta(&[], &shru, Krt::ac, &["Srava"]); +} + +#[test] +fn sutra_3_3_26() { + let ni = d("RI\\Y", Bhvadi); + assert_has_bhave_krdanta(&["ava"], &ni, Krt::GaY, &["avanAya"]); + assert_has_bhave_krdanta(&["ud"], &ni, Krt::GaY, &["unnAya"]); +} + +#[test] +fn sutra_3_3_27() { + let dru = d("dru\\", Tudadi); + let stu = d("zwu\\Y", Adadi); + let sru = d("sru\\", Bhvadi); + assert_has_bhave_krdanta(&["pra"], &dru, Krt::GaY, &["pradrAva"]); + assert_has_bhave_krdanta(&["pra"], &stu, Krt::GaY, &["prastAva"]); + assert_has_bhave_krdanta(&["pra"], &sru, Krt::GaY, &["prasrAva"]); + // pre? + assert_has_bhave_krdanta(&[], &dru, Krt::ap, &["drava"]); + assert_has_bhave_krdanta(&[], &stu, Krt::ap, &["stava"]); + assert_has_bhave_krdanta(&[], &sru, Krt::ap, &["srava"]); +} + +#[test] +fn sutra_3_3_28() { + let pavate = d("pUN", Kryadi); + let punati = d("pUY", Kryadi); + let lu = d("lUY", Kryadi); + assert_has_bhave_krdanta(&["nir"], &pavate, Krt::GaY, &["nizpAva"]); + assert_has_bhave_krdanta(&["nir"], &punati, Krt::GaY, &["nizpAva"]); + assert_has_bhave_krdanta(&["aBi"], &lu, Krt::GaY, &["aBilAva"]); + // nirabhyoH? + assert_has_bhave_krdanta(&[], &pavate, Krt::ap, &["pava"]); + assert_has_bhave_krdanta(&[], &punati, Krt::ap, &["pava"]); + assert_has_bhave_krdanta(&[], &lu, Krt::ap, &["lava"]); +} + +#[test] +fn sutra_3_3_29() { + let girati = d("gF", Tudadi); + let grnati = d("gF", Kryadi); + assert_has_bhave_krdanta(&["ni"], &girati, Krt::GaY, &["nigAra", "nigAla"]); + assert_has_bhave_krdanta(&["ud"], &girati, Krt::GaY, &["udgAra", "udgAla"]); + assert_has_bhave_krdanta(&["ud"], &grnati, Krt::GaY, &["udgAra"]); + assert_has_bhave_krdanta(&["ni"], &girati, Krt::GaY, &["nigAra", "nigAla"]); + assert_has_bhave_krdanta(&["ni"], &grnati, Krt::GaY, &["nigAra"]); + // unnyoH? + assert_has_bhave_krdanta(&[], &girati, Krt::ap, &["gara", "gala"]); + assert_has_bhave_krdanta(&[], &grnati, Krt::ap, &["gara"]); +} + +#[test] +fn sutra_3_3_30() { + let kirati = d("kF", Tudadi); + assert_has_bhave_krdanta(&["ud"], &kirati, Krt::GaY, &["utkAra"]); + assert_has_bhave_krdanta(&["ni"], &kirati, Krt::GaY, &["nikAra"]); + // dhAnye? + assert_has_bhave_krdanta(&["ud"], &kirati, Krt::ap, &["utkara"]); + assert_has_bhave_krdanta(&["ni"], &kirati, Krt::ap, &["nikara"]); +} + +#[test] +fn sutra_3_3_31() { + let stu = d("zwu\\Y", Adadi); + assert_has_bhave_krdanta(&["sam"], &stu, Krt::GaY, &["saMstAva"]); + // yajne? + assert_has_bhave_krdanta(&["sam"], &stu, Krt::ap, &["saMstava"]); +} + +#[test] +fn sutra_3_3_32() { + let stf = d("stFY", Kryadi); + assert_has_bhave_krdanta(&["pra"], &stf, Krt::GaY, &["prastAra"]); + // a-yajne? + assert_has_bhave_krdanta(&["pra"], &stf, Krt::ap, &["prastara"]); +} + +#[test] +fn sutra_3_3_33() { + let stf = d("stFY", Kryadi); + assert_has_bhave_krdanta(&["vi"], &stf, Krt::GaY, &["vistAra"]); + // a-Sabde? + assert_has_bhave_krdanta(&["vi"], &stf, Krt::ap, &["vistara"]); +} + +#[test] +fn sutra_3_3_35() { + let grah = d("graha~^", Kryadi); + assert_has_bhave_krdanta(&["ud"], &grah, Krt::GaY, &["udgrAha"]); + assert_krt_blocked(&["ud"], &grah, Krt::ap); +} + +#[test] +fn sutra_3_3_36() { + let grah = d("graha~^", Kryadi); + assert_has_bhave_krdanta(&["sam"], &grah, Krt::GaY, &["saNgrAha"]); + // muzwO? + assert_has_bhave_krdanta(&["sam"], &grah, Krt::ap, &["saNgraha"]); +} + +#[test] +fn sutra_3_3_38() { + let i = d("i\\R", Adadi); + assert_has_bhave_krdanta(&["pari"], &i, Krt::GaY, &["paryAya"]); + // an-upAtyaye + assert_has_bhave_krdanta(&["pari"], &i, Krt::ac, &["paryaya"]); +} + +#[test] +fn sutra_3_3_39() { + let shi = d("SIN", Adadi); + assert_has_bhave_krdanta(&["vi"], &shi, Krt::GaY, &["viSAya"]); + assert_has_bhave_krdanta(&["upa"], &shi, Krt::GaY, &["upaSAya"]); + // paryAye? + assert_has_bhave_krdanta(&["vi"], &shi, Krt::ac, &["viSaya"]); + assert_has_bhave_krdanta(&["upa"], &shi, Krt::ac, &["upaSaya"]); +} + +#[test] +fn sutra_3_3_40() { + let ci = d("ci\\Y", Svadi); + // TODO: separate out prakAya. + assert_has_bhave_krdanta(&["pra"], &ci, Krt::GaY, &["pracAya", "prakAya"]); + // handAdAne? + assert_has_bhave_krdanta(&["pra"], &ci, Krt::ac, &["pracaya"]); +} + +#[test] +fn sutra_3_3_41() { + // TODO: others + let ci = d("ci\\Y", Svadi); + assert_has_bhave_krdanta(&[], &ci, Krt::GaY, &["cAya", "kAya"]); + assert_has_bhave_krdanta(&[], &ci, Krt::ac, &["caya"]); +} + +#[test] +fn sutra_3_3_45() { + let grah = d("graha~^", Kryadi); + assert_has_bhave_krdanta(&["ava"], &grah, Krt::GaY, &["avagrAha"]); + assert_has_bhave_krdanta(&["ni"], &grah, Krt::GaY, &["nigrAha"]); + assert_has_bhave_krdanta(&["ava"], &grah, Krt::ap, &["avagraha"]); + assert_has_bhave_krdanta(&["ni"], &grah, Krt::ap, &["nigraha"]); +} + +#[test] +fn sutra_3_3_46() { + let grah = d("graha~^", Kryadi); + assert_has_bhave_krdanta(&["pra"], &grah, Krt::GaY, &["pragrAha"]); + // lipsAyAm? + assert_has_bhave_krdanta(&["pra"], &grah, Krt::ap, &["pragraha"]); +} + +#[test] +fn sutra_3_3_47() { + let grah = d("graha~^", Kryadi); + assert_has_bhave_krdanta(&["pari"], &grah, Krt::GaY, &["parigrAha"]); + // yajne? + assert_has_bhave_krdanta(&["pari"], &grah, Krt::ap, &["parigraha"]); +} + +#[test] +fn sutra_3_3_48() { + let vrnite = d("vfN", Kryadi); + let vrnoti = d("vfY", Svadi); + assert_has_bhave_krdanta(&["ni"], &vrnite, Krt::GaY, &["nIvAra"]); + assert_has_bhave_krdanta(&["ni"], &vrnoti, Krt::GaY, &["nIvAra"]); + // dhAnye? + // TODO: assert_has_bhave_krdanta(&["ni"], &vrnite, Krt::ap, &["nivara"]); + assert_has_bhave_krdanta(&["ni"], &vrnoti, Krt::ap, &["nivara"]); +} + +#[test] +fn sutra_3_3_49() { + let shri = d("SriY", Bhvadi); + let yu = d("yu", Adadi); + let pu = d("pUY", Kryadi); + let dru = d("dru\\", Tudadi); + assert_has_bhave_krdanta(&["ud"], &shri, Krt::GaY, &["ucCrAya"]); + assert_has_bhave_krdanta(&["ud"], &yu, Krt::GaY, &["udyAva"]); + assert_has_bhave_krdanta(&["ud"], &pu, Krt::GaY, &["utpAva"]); + assert_has_bhave_krdanta(&["ud"], &dru, Krt::GaY, &["uddrAva"]); +} + +#[test] +fn sutra_3_3_50() { + let ru = d("ru", Adadi); + let plu = d("plu\\N", Bhvadi); + assert_has_bhave_krdanta(&["AN"], &ru, Krt::GaY, &["ArAva"]); + assert_has_bhave_krdanta(&["AN"], &ru, Krt::ap, &["Arava"]); + assert_has_bhave_krdanta(&["AN"], &plu, Krt::GaY, &["AplAva"]); + assert_has_bhave_krdanta(&["AN"], &plu, Krt::ap, &["Aplava"]); +} + +#[test] +fn sutra_3_3_51() { + let grah = d("graha~^", Kryadi); + assert_has_krdanta(&["ava"], &grah, Krt::GaY, &["avagrAha"]); + assert_has_krdanta(&["ava"], &grah, Krt::ap, &["avagraha"]); +} + +#[test] +fn sutra_3_3_52_and_sutra_3_3_53() { + let grah = d("graha~^", Kryadi); + assert_has_krdanta(&["pra"], &grah, Krt::GaY, &["pragrAha"]); + assert_has_krdanta(&["pra"], &grah, Krt::ap, &["pragraha"]); +} + +#[test] +fn sutra_3_3_55() { + let bhu = d("BU", Bhvadi); + assert_has_krdanta(&["pari"], &bhu, Krt::GaY, &["pariBAva"]); + assert_has_krdanta(&["pari"], &bhu, Krt::ap, &["pariBava"]); +} + +#[test] +fn sutra_3_3_56() { + assert_has_bhave_krdanta(&[], &d("ci\\Y", Svadi), Krt::ac, &["caya"]); + assert_has_bhave_krdanta(&[], &d("i\\R", Adadi), Krt::ac, &["aya"]); + assert_has_bhave_krdanta(&[], &d("ji\\", Bhvadi), Krt::ac, &["jaya"]); + assert_has_bhave_krdanta(&[], &d("kzi\\", Svadi), Krt::ac, &["kzaya"]); +} + +#[test] +fn sutra_3_3_57() { + assert_has_bhave_krdanta(&[], &d("kF", Tudadi), Krt::ap, &["kara"]); + assert_has_bhave_krdanta(&[], &d("gF", Tudadi), Krt::ap, &["gara", "gala"]); + assert_has_bhave_krdanta(&[], &d("SF", Kryadi), Krt::ap, &["Sara"]); + assert_has_bhave_krdanta(&[], &d("yu", Adadi), Krt::ap, &["yava"]); + assert_has_bhave_krdanta(&[], &d("lUY", Kryadi), Krt::ap, &["lava"]); + assert_has_bhave_krdanta(&[], &d("zwu\\Y", Adadi), Krt::ap, &["stava"]); + assert_has_bhave_krdanta(&[], &d("pUY", Kryadi), Krt::ap, &["pava"]); +} + +#[test] +fn sutra_3_3_58() { + assert_has_bhave_krdanta(&[], &d("df", Svadi), Krt::ap, &["dara"]); + assert_has_bhave_krdanta(&[], &d("graha~^", Kryadi), Krt::ap, &["graha"]); + assert_has_bhave_krdanta(&[], &d("vfY", Svadi), Krt::ap, &["vara"]); + assert_has_bhave_krdanta(&["nir"], &d("ci\\Y", Svadi), Krt::ap, &["niScaya"]); + assert_has_bhave_krdanta(&[], &d("ga\\mx~", Bhvadi), Krt::ap, &["gama"]); +} + +#[test] +fn sutra_3_3_59() { + let ad = d("a\\da~", Adadi); + assert_has_bhave_krdanta(&["pra"], &ad, Krt::ap, &["praGasa"]); + assert_has_bhave_krdanta(&["vi"], &ad, Krt::ap, &["viGasa"]); + // upasarge? + assert_has_bhave_krdanta(&[], &ad, Krt::GaY, &["GAsa"]); +} + +#[test] +fn sutra_3_3_60() { + let ad = d("a\\da~", Adadi); + assert_has_bhave_krdanta(&["ni"], &ad, Krt::ap, &["niGasa"]); + assert_has_bhave_krdanta(&["ni"], &ad, Krt::aR, &["nyAda"]); +} + +#[test] +fn sutra_3_3_61() { + let vyadh = d("vya\\Da~", Divadi); + let jap = d("japa~", Bhvadi); + assert_has_bhave_krdanta(&[], &vyadh, Krt::ap, &["vyaDa"]); + assert_has_bhave_krdanta(&[], &jap, Krt::ap, &["japa"]); + assert_has_bhave_krdanta(&[], &vyadh, Krt::GaY, &[]); + assert_has_bhave_krdanta(&[], &jap, Krt::GaY, &[]); + // an-upasarge? + assert_has_bhave_krdanta(&["AN"], &vyadh, Krt::GaY, &["AvyADa"]); + assert_has_bhave_krdanta(&["upa"], &jap, Krt::GaY, &["upajApa"]); +} + +#[test] +fn sutra_3_3_62() { + let svan = d("svana~", Bhvadi); + let has = d("hase~", Bhvadi); + assert_has_bhave_krdanta(&[], &svan, Krt::ap, &["svana"]); + assert_has_bhave_krdanta(&[], &svan, Krt::GaY, &["svAna"]); + assert_has_bhave_krdanta(&[], &has, Krt::ap, &["hasa"]); + assert_has_bhave_krdanta(&[], &has, Krt::GaY, &["hAsa"]); + // an-upasarge? + assert_has_bhave_krdanta(&["pra"], &svan, Krt::GaY, &["prasvAna"]); + assert_has_bhave_krdanta(&["pra"], &has, Krt::GaY, &["prahAsa"]); + assert_has_bhave_krdanta(&["pra"], &svan, Krt::ap, &[]); + assert_has_bhave_krdanta(&["pra"], &has, Krt::ap, &[]); +} + +#[test] +fn sutra_3_3_63() { + let yam = d("ya\\ma~", Bhvadi); + assert_has_bhave_krdanta(&["sam"], &yam, Krt::ap, &["saMyama"]); + assert_has_bhave_krdanta(&["sam"], &yam, Krt::GaY, &["saMyAma"]); + assert_has_bhave_krdanta(&["upa"], &yam, Krt::ap, &["upayama"]); + assert_has_bhave_krdanta(&["upa"], &yam, Krt::GaY, &["upayAma"]); + assert_has_bhave_krdanta(&["ni"], &yam, Krt::ap, &["niyama"]); + assert_has_bhave_krdanta(&["ni"], &yam, Krt::GaY, &["niyAma"]); + assert_has_bhave_krdanta(&["vi"], &yam, Krt::ap, &["viyama"]); + assert_has_bhave_krdanta(&["vi"], &yam, Krt::GaY, &["viyAma"]); +} + +#[test] +fn sutra_3_3_64() { + let gad = d("gada~", Bhvadi); + let nad = d("Rada~", Bhvadi); + let path = d("paWa~", Bhvadi); + let svan = d("svana~", Bhvadi); + assert_has_bhave_krdanta(&["ni"], &gad, Krt::ap, &["nigada"]); + assert_has_bhave_krdanta(&["ni"], &gad, Krt::GaY, &["nigAda"]); + assert_has_bhave_krdanta(&["ni"], &nad, Krt::ap, &["ninada"]); + assert_has_bhave_krdanta(&["ni"], &nad, Krt::GaY, &["ninAda"]); + assert_has_bhave_krdanta(&["ni"], &path, Krt::ap, &["nipaWa"]); + assert_has_bhave_krdanta(&["ni"], &path, Krt::GaY, &["nipAWa"]); + assert_has_bhave_krdanta(&["ni"], &svan, Krt::ap, &["nisvana"]); + assert_has_bhave_krdanta(&["ni"], &svan, Krt::GaY, &["nisvAna"]); +} + +#[test] +fn sutra_3_3_65() { + let kvan = d("kvaRa~", Bhvadi); + assert_has_bhave_krdanta(&["ni"], &kvan, Krt::ap, &["nikvaRa"]); + assert_has_bhave_krdanta(&["ni"], &kvan, Krt::GaY, &["nikvARa"]); + assert_has_bhave_krdanta(&[], &kvan, Krt::ap, &["kvaRa"]); + assert_has_bhave_krdanta(&[], &kvan, Krt::GaY, &["kvARa"]); + // etezu? + assert_has_bhave_krdanta(&["ati"], &kvan, Krt::GaY, &["atikvARa"]); +} + +#[test] +fn sutra_3_3_66() { + let pan = d("paRa~\\", Bhvadi); + assert_has_bhave_krdanta(&[], &pan, Krt::ap, &["paRa", "paRAya"]); + // parimARe? + assert_has_bhave_krdanta(&[], &pan, Krt::GaY, &["pARa", "paRAya"]); +} + +#[test] +fn sutra_3_3_67() { + let mad = d("madI~", Divadi); + assert_has_bhave_krdanta(&[], &mad, Krt::ap, &["mada"]); + assert_has_bhave_krdanta(&[], &mad, Krt::GaY, &[]); + // anupasarge? + assert_has_bhave_krdanta(&["ud"], &mad, Krt::GaY, &["unmAda"]); + assert_has_bhave_krdanta(&["pra"], &mad, Krt::GaY, &["pramAda"]); +} + +#[test] +fn sutra_3_3_69() { + let aj = d("aja~", Divadi); + assert_has_krdanta(&["sam"], &aj, Krt::ap, &["samaja"]); + assert_has_krdanta(&["ud"], &aj, Krt::ap, &["udaja"]); + // paSuzu? + assert_has_bhave_krdanta(&["sam"], &aj, Krt::GaY, &["samAja"]); + assert_has_bhave_krdanta(&["ud"], &aj, Krt::GaY, &["udAja"]); +} + +#[test] +fn sutra_3_3_71() { + let sf = d("sf\\", Bhvadi); + assert_has_krdanta(&["upa"], &sf, Krt::ap, &["upasara"]); +} + +#[test] +fn sutra_3_3_72() { + let hve = d("hve\\Y", Bhvadi); + assert_has_bhave_krdanta(&["ni"], &hve, Krt::ap, &["nihava"]); + assert_has_bhave_krdanta(&["aBi"], &hve, Krt::ap, &["aBihava"]); + assert_has_bhave_krdanta(&["upa"], &hve, Krt::ap, &["upahava"]); + assert_has_bhave_krdanta(&["vi"], &hve, Krt::ap, &["vihava"]); + // etezu? + assert_has_bhave_krdanta(&["pra"], &hve, Krt::GaY, &["prahvAya"]); + assert_has_bhave_krdanta(&["pra"], &hve, Krt::ap, &[]); +} + +#[test] +fn sutra_3_3_73() { + let hve = d("hve\\Y", Bhvadi); + assert_has_krdanta(&["AN"], &hve, Krt::ap, &["Ahava"]); + assert_has_krdanta(&["AN"], &hve, Krt::GaY, &["AhvAya"]); +} + +#[test] +fn sutra_3_3_75() { + let hve = d("hve\\Y", Bhvadi); + assert_has_bhave_krdanta(&[], &hve, Krt::ap, &["hava"]); + assert_has_bhave_krdanta(&["AN"], &hve, Krt::GaY, &["AhvAya"]); +} + +#[test] +fn sutra_3_3_76() { + let han = d("ha\\na~", Adadi); + assert_has_bhave_krdanta(&[], &han, Krt::ap, &["vaDa"]); + assert_has_krdanta(&[], &han, Krt::GaY, &["GAta"]); + // anupasargasya? + assert_has_bhave_krdanta(&["pra"], &han, Krt::GaY, &["praGAta"]); + assert_has_bhave_krdanta(&["vi"], &han, Krt::GaY, &["viGAta"]); +} + +#[test] +fn sutra_3_3_77() { + let han = d("ha\\na~", Adadi); + assert_has_artha_krdanta(&[], &han, Murti, Krt::ap, &["Gana"]); +} + +#[ignore] +#[test] +fn sutra_3_3_78() { + let han = d("ha\\na~", Adadi); + assert_has_artha_krdanta(&["antar"], &han, Desha, Krt::ap, &["antarGana"]); + // deSe? + assert_has_krdanta(&["antar"], &han, Krt::GaY, &["antarGAta"]); +} + +#[test] +fn sutra_3_3_88() { + assert_has_krdanta(&[], &d("qupa\\ca~^z", Bhvadi), Krt::ktri, &["paktrima"]); + assert_has_krdanta(&[], &d("quva\\pa~^", Bhvadi), Krt::ktri, &["uptrima"]); + assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::ktri, &["kftrima"]); +} + +#[test] +fn sutra_3_3_89() { + assert_has_krdanta(&[], &d("wuvepf~\\", Bhvadi), Krt::aTuc, &["vepaTu"]); + assert_has_krdanta(&[], &d("wuo~Svi", Bhvadi), Krt::aTuc, &["SvayaTu"]); + assert_has_krdanta(&[], &d("wukzu", Adadi), Krt::aTuc, &["kzavaTu"]); +} + +#[test] +fn sutra_3_3_90() { + assert_has_krdanta(&[], &d("ya\\ja~^", Bhvadi), Krt::naN, &["yajYa"]); + assert_has_krdanta(&[], &d("quyAcf~^", Bhvadi), Krt::naN, &["yAcYA"]); + assert_has_krdanta(&[], &d("yatI~\\", Bhvadi), Krt::naN, &["yatna"]); + assert_has_krdanta(&[], &d("viCa~", Tudadi), Krt::naN, &["viSna"]); + assert_has_krdanta(&[], &d("pra\\Ca~", Tudadi), Krt::naN, &["praSna"]); + assert_has_krdanta(&[], &d("rakza~", Bhvadi), Krt::naN, &["rakzRa"]); +} + +#[test] +fn sutra_3_3_91() { + assert_has_krdanta(&[], &d("Yizva\\pa~", Adadi), Krt::nan, &["svapna"]); +} + +#[test] +fn sutra_3_3_94() { + assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::ktin, &["kfti"]); + assert_has_krdanta(&[], &d("ci\\Y", Svadi), Krt::ktin, &["citi"]); + assert_has_krdanta(&[], &d("ma\\na~\\", Divadi), Krt::ktin, &["mati"]); + // TODO: others +} + +#[test] +fn sutra_3_3_102() { + assert_has_krdanta(&[], &san(&d("qukf\\Y", Tanadi)), Krt::a, &["cikIrzA"]); + assert_has_krdanta(&[], &san(&d("hf\\Y", Bhvadi)), Krt::a, &["jihIrzA"]); + // TODO: others +} + +#[test] +fn sutra_3_3_103() { + assert_has_krdanta(&[], &d("kuqi~\\", Bhvadi), Krt::a, &["kuRqA"]); + assert_has_krdanta(&[], &d("huqi~\\", Bhvadi), Krt::a, &["huRqA"]); + assert_has_krdanta(&[], &d("Iha~\\", Bhvadi), Krt::a, &["IhA"]); + assert_has_krdanta(&[], &d("Uha~\\", Bhvadi), Krt::a, &["UhA"]); + // guroH + assert_has_krdanta(&[], &d("Ba\\ja~^", Bhvadi), Krt::a, &[]); + // halaH + assert_has_krdanta(&[], &d("RI\\Y", Bhvadi), Krt::a, &[]); +} + +#[ignore] +#[test] +fn sutra_3_3_107() { + assert_has_krdanta(&[], &nic(&d("qukf\\Y", Tanadi)), Krt::yuc, &["kAraRA"]); + assert_has_krdanta(&[], &nic(&d("hf\\Y", Bhvadi)), Krt::yuc, &["hArRA"]); + assert_has_krdanta(&[], &nic(&d("Asa~\\", Adadi)), Krt::yuc, &["AsanA"]); + assert_has_krdanta(&[], &nic(&d("SranTa~", Kryadi)), Krt::yuc, &["SranTanA"]); +} + +#[test] +fn sutra_3_3_115() { + assert_has_krdanta(&[], &d("hase~", Bhvadi), Krt::lyuw, &["hasana"]); + assert_has_krdanta(&[], &d("SuBa~\\", Bhvadi), Krt::lyuw, &["SoBana"]); + assert_has_krdanta(&[], &d("jalpa~", Bhvadi), Krt::lyuw, &["jalpana"]); + assert_has_krdanta(&[], &d("SIN", Adadi), Krt::lyuw, &["Sayana"]); + assert_has_krdanta(&[], &d("Asa~\\", Adadi), Krt::lyuw, &["Asana"]); +} + +#[test] +fn sutra_3_3_120() { + assert_has_krdanta(&["ava"], &d("tF", Bhvadi), Krt::GaY, &["avatAra"]); + assert_has_krdanta(&["ava"], &d("stFY", Kryadi), Krt::GaY, &["avastAra"]); +} diff --git a/vidyut-prakriya/tests/pada_3_4.rs b/vidyut-prakriya/tests/kashika_3_4.rs similarity index 100% rename from vidyut-prakriya/tests/pada_3_4.rs rename to vidyut-prakriya/tests/kashika_3_4.rs diff --git a/vidyut-prakriya/tests/pada_4_1.rs b/vidyut-prakriya/tests/kashika_4_1.rs similarity index 99% rename from vidyut-prakriya/tests/pada_4_1.rs rename to vidyut-prakriya/tests/kashika_4_1.rs index 85bf59e..836cb50 100644 --- a/vidyut-prakriya/tests/pada_4_1.rs +++ b/vidyut-prakriya/tests/kashika_4_1.rs @@ -1,6 +1,6 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha::*; +use vidyut_prakriya::args::TaddhitaArtha::*; use vidyut_prakriya::args::Linga::*; use vidyut_prakriya::args::Taddhita as T; use vidyut_prakriya::args::Vacana::*; @@ -15,7 +15,7 @@ fn assert_has_stri(prati: &str, expected: &[&str]) { assert_has_subantas(prati, Stri, Prathama, Eka, expected); } -fn assert_blocked(text: &str, artha: Artha, t: T) { +fn assert_blocked(text: &str, artha: TaddhitaArtha, t: T) { assert_has_artha_taddhita(text, artha, t, &[]); } diff --git a/vidyut-prakriya/tests/pada_4_2.rs b/vidyut-prakriya/tests/kashika_4_2.rs similarity index 98% rename from vidyut-prakriya/tests/pada_4_2.rs rename to vidyut-prakriya/tests/kashika_4_2.rs index 67f0467..9a36951 100644 --- a/vidyut-prakriya/tests/pada_4_2.rs +++ b/vidyut-prakriya/tests/kashika_4_2.rs @@ -1,10 +1,10 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha; -use vidyut_prakriya::args::Artha::*; +use vidyut_prakriya::args::TaddhitaArtha; +use vidyut_prakriya::args::TaddhitaArtha::*; use vidyut_prakriya::args::Taddhita as T; -fn assert_blocked(text: &str, artha: Artha, t: T) { +fn assert_blocked(text: &str, artha: TaddhitaArtha, t: T) { assert_has_artha_taddhita(text, artha, t, &[]); } diff --git a/vidyut-prakriya/tests/pada_4_3.rs b/vidyut-prakriya/tests/kashika_4_3.rs similarity index 98% rename from vidyut-prakriya/tests/pada_4_3.rs rename to vidyut-prakriya/tests/kashika_4_3.rs index 40b0ffb..299ea0f 100644 --- a/vidyut-prakriya/tests/pada_4_3.rs +++ b/vidyut-prakriya/tests/kashika_4_3.rs @@ -1,15 +1,15 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha; -use vidyut_prakriya::args::Artha::*; use vidyut_prakriya::args::Taddhita as T; +use vidyut_prakriya::args::TaddhitaArtha; +use vidyut_prakriya::args::TaddhitaArtha::*; -fn assert_blocked(text: &str, artha: Artha, t: T) { +fn assert_blocked(text: &str, artha: TaddhitaArtha, t: T) { assert_has_artha_taddhita(text, artha, t, &[]); } #[allow(non_snake_case)] -fn assert_no_aR(text: &str, artha: Artha) { +fn assert_no_aR(text: &str, artha: TaddhitaArtha) { assert_blocked(text, artha, T::aR); } diff --git a/vidyut-prakriya/tests/pada_4_4.rs b/vidyut-prakriya/tests/kashika_4_4.rs similarity index 99% rename from vidyut-prakriya/tests/pada_4_4.rs rename to vidyut-prakriya/tests/kashika_4_4.rs index a4709a8..36e6582 100644 --- a/vidyut-prakriya/tests/pada_4_4.rs +++ b/vidyut-prakriya/tests/kashika_4_4.rs @@ -5,12 +5,12 @@ /// system does not model semantics, we have no easy way to implement apavada tests in practice. extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha::*; +use vidyut_prakriya::args::TaddhitaArtha::*; use vidyut_prakriya::args::Gana::*; use vidyut_prakriya::args::Taddhita as T; use vidyut_prakriya::args::*; -fn assert_blocked(text: &str, artha: Artha, taddhita: Taddhita) { +fn assert_blocked(text: &str, artha: TaddhitaArtha, taddhita: Taddhita) { assert_has_artha_taddhita(text, artha, taddhita, &[]); } diff --git a/vidyut-prakriya/tests/pada_5_1.rs b/vidyut-prakriya/tests/kashika_5_1.rs similarity index 96% rename from vidyut-prakriya/tests/pada_5_1.rs rename to vidyut-prakriya/tests/kashika_5_1.rs index e5ebf9b..ad81e26 100644 --- a/vidyut-prakriya/tests/pada_5_1.rs +++ b/vidyut-prakriya/tests/kashika_5_1.rs @@ -1,10 +1,10 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha; -use vidyut_prakriya::args::Artha::*; +use vidyut_prakriya::args::TaddhitaArtha; +use vidyut_prakriya::args::TaddhitaArtha::*; use vidyut_prakriya::args::Taddhita as T; -fn assert_blocked(text: &str, artha: Artha, t: T) { +fn assert_blocked(text: &str, artha: TaddhitaArtha, t: T) { assert_has_artha_taddhita(text, artha, t, &[]); } diff --git a/vidyut-prakriya/tests/pada_5_2.rs b/vidyut-prakriya/tests/kashika_5_2.rs similarity index 98% rename from vidyut-prakriya/tests/pada_5_2.rs rename to vidyut-prakriya/tests/kashika_5_2.rs index 5f8b9ef..9f3ac58 100644 --- a/vidyut-prakriya/tests/pada_5_2.rs +++ b/vidyut-prakriya/tests/kashika_5_2.rs @@ -1,7 +1,7 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha::*; use vidyut_prakriya::args::Taddhita as T; +use vidyut_prakriya::args::TaddhitaArtha::*; #[ignore] #[test] diff --git a/vidyut-prakriya/tests/pada_5_3.rs b/vidyut-prakriya/tests/kashika_5_3.rs similarity index 99% rename from vidyut-prakriya/tests/pada_5_3.rs rename to vidyut-prakriya/tests/kashika_5_3.rs index b866ddf..6bffa56 100644 --- a/vidyut-prakriya/tests/pada_5_3.rs +++ b/vidyut-prakriya/tests/kashika_5_3.rs @@ -1,6 +1,6 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha::*; +use vidyut_prakriya::args::TaddhitaArtha::*; use vidyut_prakriya::args::Taddhita as T; #[ignore] diff --git a/vidyut-prakriya/tests/pada_5_4.rs b/vidyut-prakriya/tests/kashika_5_4.rs similarity index 76% rename from vidyut-prakriya/tests/pada_5_4.rs rename to vidyut-prakriya/tests/kashika_5_4.rs index 2d56d41..084ea77 100644 --- a/vidyut-prakriya/tests/pada_5_4.rs +++ b/vidyut-prakriya/tests/kashika_5_4.rs @@ -1,6 +1,7 @@ extern crate test_utils; use test_utils::*; use vidyut_prakriya::args::Taddhita as T; +use vidyut_prakriya::args::TaddhitaArtha::*; #[test] fn sutra_5_4_3() { @@ -95,12 +96,39 @@ fn sutra_5_4_44() { assert_has_taddhitanta(&prati("pfzWa"), T::tasi, &["pfzWatas"]); } +#[test] +fn sutra_5_4_50() { + assert_has_artha_taddhita("Sukla", AbhutaTadbhava, T::cvi, &["SuklI"]); + assert_has_artha_taddhita("Gawa", AbhutaTadbhava, T::cvi, &["GawI"]); +} + +#[test] +fn sutra_5_4_51() { + assert_has_artha_taddhita("arus", AbhutaTadbhava, T::cvi, &["arU"]); + assert_has_artha_taddhita("unmanas", AbhutaTadbhava, T::cvi, &["unmanI"]); + assert_has_artha_taddhita("uccakzus", AbhutaTadbhava, T::cvi, &["uccakzU"]); + assert_has_artha_taddhita("vicetas", AbhutaTadbhava, T::cvi, &["vicetI"]); + assert_has_artha_taddhita("virahas", AbhutaTadbhava, T::cvi, &["virahI"]); + assert_has_artha_taddhita("virajas", AbhutaTadbhava, T::cvi, &["virajI"]); +} + +#[test] +fn sutra_5_4_52() { + assert_has_artha_taddhita("agni", AbhutaTadbhava, T::sAti, &["agnisAt"]); + assert_has_artha_taddhita("udaka", AbhutaTadbhava, T::sAti, &["udakasAt"]); +} + #[test] fn sutra_5_4_54() { assert_has_taddhitanta(&prati("agni"), T::sAti, &["agnisAt"]); assert_has_taddhitanta(&prati("udaka"), T::sAti, &["udakasAt"]); } +#[test] +fn sutra_5_4_55() { + assert_has_artha_taddhita("brAhmaRa", AbhutaTadbhava, T::trA, &["brAhmaRatrA"]); +} + #[test] fn sutra_5_4_78() { assert_has_taddhitanta(&prati("brahmavarcas"), T::ac, &["brahmavarcasa"]); diff --git a/vidyut-prakriya/tests/pada_6_1.rs b/vidyut-prakriya/tests/kashika_6_1.rs similarity index 99% rename from vidyut-prakriya/tests/pada_6_1.rs rename to vidyut-prakriya/tests/kashika_6_1.rs index 7227c9d..b7f30bd 100644 --- a/vidyut-prakriya/tests/pada_6_1.rs +++ b/vidyut-prakriya/tests/kashika_6_1.rs @@ -295,9 +295,10 @@ fn sutra_6_1_17() { assert_has_nal(&[], &vyac, &["vivyAca"]); assert_has_thal(&[], &vyac, &["vivyaciTa"]); + // SK justifies vavrazWa let vrasc = d("o~vrascU~", Tudadi); assert_has_nal(&[], &vrasc, &["vavraSca"]); - assert_has_thal(&[], &vrasc, &["vavraSciTa"]); + assert_has_thal(&[], &vrasc, &["vavraSciTa", "vavrazWa"]); } #[test] @@ -556,7 +557,6 @@ fn sutra_6_1_56() { ); } -#[ignore] #[test] fn sutra_6_1_57() { assert_has_lat( @@ -625,7 +625,11 @@ fn sutra_6_1_64() { assert_has_lat(&[], &d("kf\\za~", Tudadi), &["kfzati"]); assert_has_lat(&[], &d("zWivu~", Bhvadi), &["zWIvati"]); assert_has_lat(&[], &d("zvazka~\\", Bhvadi), &["zvazkate"]); - assert_has_lat(&[], &yan(&d("zWivu~", Divadi)), &["wezWIvyate"]); + assert_has_lat( + &[], + &yan(&d("zWivu~", Divadi)), + &["tezWIvyate", "wezWIvyate"], + ); // TODO: others } @@ -1070,7 +1074,6 @@ fn sutra_6_1_140() { assert_has_lat(&["upa"], &kr, &["upaskirati", "upakirati"]); } -#[ignore] #[test] fn sutra_6_1_141() { let kr = d("kF", Tudadi); diff --git a/vidyut-prakriya/tests/pada_6_3.rs b/vidyut-prakriya/tests/kashika_6_3.rs similarity index 79% rename from vidyut-prakriya/tests/pada_6_3.rs rename to vidyut-prakriya/tests/kashika_6_3.rs index 2516124..cbd7059 100644 --- a/vidyut-prakriya/tests/pada_6_3.rs +++ b/vidyut-prakriya/tests/kashika_6_3.rs @@ -1,9 +1,9 @@ extern crate test_utils; use test_utils::*; -use vidyut_prakriya::args::Artha::*; use vidyut_prakriya::args::Gana::*; use vidyut_prakriya::args::Lakara::*; use vidyut_prakriya::args::Taddhita as T; +use vidyut_prakriya::args::TaddhitaArtha::*; use vidyut_prakriya::args::*; #[test] @@ -91,3 +91,29 @@ fn sutra_6_3_112() { assert_has_tas(&["ud"], &vah, Lun, &["udavoQAm"]); assert_has_thas(&["ud"], &vah, Lun, &["udavoQam"]); } + +#[test] +fn sutra_6_3_123() { + let kash = d("kASf~", Bhvadi); + assert_has_krdanta(&["ni"], &kash, Krt::ac, &["nIkASa"]); + assert_has_krdanta(&["vi"], &kash, Krt::ac, &["vIkASa"]); + assert_has_krdanta(&["anu"], &kash, Krt::ac, &["anUkASa"]); + // ikaH? + assert_has_krdanta(&["pra"], &kash, Krt::ac, &["prakASa"]); +} + +#[test] +fn sutra_6_3_124() { + let daa = d("qudA\\Y", Juhotyadi); + assert_has_krdanta(&["ni"], &daa, Krt::kta, &["nItta"]); + assert_has_krdanta(&["vi"], &daa, Krt::kta, &["vItta"]); + // ikaH? + assert_has_krdanta(&["pra"], &daa, Krt::kta, &["pratta"]); + assert_has_krdanta(&["ava"], &daa, Krt::kta, &["avatta"]); + // daH? + let tf = d("tF", Bhvadi); + assert_has_krdanta(&["vi"], &tf, Krt::kta, &["vitIrRa"]); + assert_has_krdanta(&["ni"], &tf, Krt::kta, &["nitIrRa"]); + // ti ? + // TODO: how to best justify sudatta? +} diff --git a/vidyut-prakriya/tests/pada_6_4.rs b/vidyut-prakriya/tests/kashika_6_4.rs similarity index 93% rename from vidyut-prakriya/tests/pada_6_4.rs rename to vidyut-prakriya/tests/kashika_6_4.rs index c547621..c50486c 100644 --- a/vidyut-prakriya/tests/pada_6_4.rs +++ b/vidyut-prakriya/tests/kashika_6_4.rs @@ -179,7 +179,6 @@ fn sutra_6_4_15() { assert_has_krdanta(&[], &sham, Krt::ktin, &["SAnti"]); } -#[ignore] #[test] fn sutra_6_4_16() { assert_has_lat(&[], &san(&d("vI\\", Adadi)), &["vivIzati"]); @@ -187,7 +186,7 @@ fn sutra_6_4_16() { assert_has_lat_p(&[], &san(&d("qukf\\Y", Tanadi)), &["cikIrzati"]); assert_has_lat_p(&[], &san(&d("hf\\Y", Bhvadi)), &["jihIrzati"]); assert_has_lat(&[], &san(&d("ha\\na~", Adadi)), &["jiGAMsati"]); - assert_has_lat(&["aDi"], &san(&d("i\\N", Adadi)), &["aDijigaMsate"]); + assert_has_lat(&["aDi"], &san(&d("i\\N", Adadi)), &["aDijigAMsate"]); } #[test] @@ -353,11 +352,11 @@ fn sutra_6_4_27() { assert_has_krdanta(&[], &ranj, Krt::GaY, &["rAga", "raNga"]); } -#[ignore] #[test] fn sutra_6_4_28() { let syand = d("syandU~\\", Bhvadi); assert_has_krdanta(&[], &syand, Krt::GaY, &["syada", "syanda"]); + // TODO: expand with gosyada, aSvasyada, etc. } #[test] @@ -630,7 +629,6 @@ fn sutra_6_4_48() { assert_has_lat_karmani(&[], &san(&hf), &["jihIrzyate"]); } -#[ignore] #[test] fn sutra_6_4_49() { let bhid = d("Bi\\di~^r", Rudhadi); @@ -638,11 +636,11 @@ fn sutra_6_4_49() { assert_has_krdanta(&[], &yan(&bhid), Krt::tumun, &["beBiditum"]); assert_has_krdanta(&[], &yan(&bhid), Krt::tavya, &["beBiditavya"]); - // yasya (as y+a) + // yasya (as "ya", not "y" and "a")? assert_has_krdanta(&[], &d("Irzya~", Bhvadi), Krt::tfc, &["Irzyitf"]); assert_has_krdanta(&[], &d("mavya~", Bhvadi), Krt::tfc, &["mavyitf"]); - // halaH + // halaH? assert_has_krdanta(&[], &yan(&d("lUY", Kryadi)), Krt::tfc, &["lolUyitf"]); assert_has_krdanta(&[], &yan(&d("pUY", Kryadi)), Krt::tfc, &["popUyitf"]); } @@ -696,36 +694,108 @@ fn sutra_6_4_55() { &hf_nic, &["hArayAYcakAra", "hArayAmAsa", "hArayAmbaBUva"], ); + let spfha = &d("spfha", Curadi); + let gfha = &d("gfha", Curadi); // anta assert_has_krdanta(&[], &nic(&d("gaqi~", Bhvadi)), Krt::Jac, &["gaRqayanta"]); assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::Jac, &["maRqayanta"]); // Alu - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::Aluc, &["spfhayAlu"]); - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::Aluc, &["gfhayAlu"]); + assert_has_krdanta(&[], &spfha, Krt::Aluc, &["spfhayAlu"]); + assert_has_krdanta(&[], &gfha, Krt::Aluc, &["gfhayAlu"]); // Ayya - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::Ayya, &["spfhayAyya"]); - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::Ayya, &["gfhayAyya"]); + assert_has_krdanta(&[], &spfha, Krt::Ayya, &["spfhayAyya"]); + assert_has_krdanta(&[], &gfha, Krt::Ayya, &["gfhayAyya"]); // itnu - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::itnuc, &["gfhayAyya"]); - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::izRuc, &["pozayizRu"]); - assert_has_krdanta(&[], &nic(&d("maqi~\\", Bhvadi)), Krt::izRuc, &["pArayizRu"]); + assert_has_krdanta(&[], &d("stana", Curadi), Krt::itnuc, &["stanayitnu"]); + assert_has_krdanta(&[], &nic(&d("puza~", Kryadi)), Krt::izRuc, &["pozayizRu"]); + assert_has_krdanta(&[], &d("pAra", Curadi), Krt::izRuc, &["pArayizRu"]); } #[ignore] #[test] fn sutra_6_4_62() { let ci = d("ci\\Y", Svadi); - assert_has_lrt_karmani(&[], &ci, &["cAyizyate", "cezyate"]); - assert_has_lrn_karmani(&[], &ci, &["acAyizyata", "acezyata"]); - let daa = d("qudA\\Y", Juhotyadi); - assert_has_lrn_karmani(&[], &daa, &["dAyizyate", "dAsyate"]); - assert_has_lrn_karmani(&[], &daa, &["adAyizyata", "adAsyata"]); + let sham = nic(&d("Samo~", Bhvadi)); + let han = d("ha\\na~", Adadi); + let grah = d("graha~^", Kryadi); + let drsh = d("df\\Si~r", Bhvadi); + + // sya + assert_has_ta_k(&[], &ci, Lrt, &["cAyizyate", "cezyate"]); + assert_has_ta_k(&[], &ci, Lrn, &["acAyizyata", "acezyata"]); + assert_has_ta_k(&[], &daa, Lrt, &["dAyizyate", "dAsyate"]); + assert_has_ta_k(&[], &daa, Lrn, &["adAyizyata", "adAsyata"]); + // SAmayizyate is allowed here because mittva is optional by Dhatupatha 1.0934 + assert_has_ta_k( + &[], + &sham, + Lrt, + &["SAmizyate", "Samizyate", "Samayizyate", "SAmayizyate"], + ); + // aSAmayizyata is allowed per DP 1.0934. + assert_has_ta_k( + &[], + &sham, + Lrn, + &["aSAmizyata", "aSamizyata", "aSamayizyata", "aSAmayizyata"], + ); + assert_has_ta_k(&[], &han, Lrt, &["GAnizyate", "hanizyate"]); + assert_has_ta_k(&[], &han, Lrn, &["aGAnizyata", "ahanizyata"]); + assert_has_ta_k(&[], &grah, Lrt, &["grAhizyate", "grahIzyate"]); + assert_has_ta_k(&[], &grah, Lrn, &["agrAhizyata", "agrahIzyata"]); + assert_has_ta_k(&[], &drsh, Lrt, &["darSizyate", "drakzyate"]); + assert_has_ta_k(&[], &drsh, Lrn, &["adarSizyata", "adrakzyata"]); + + // sic + assert_has_aataam_k(&[], &ci, Lun, &["acAyizAtAm", "acezAtAm"]); + assert_has_aataam_k(&[], &daa, Lun, &["adAyizAtAm", "adizAtAm"]); + // aSAmayizAtAm is allowed per DP 1.0934. + assert_has_aataam_k( + &[], + &sham, + Lun, + &["aSAmizAtAm", "aSamizAtAm", "aSamayizAtAm", "aSAmayizAtAm"], + ); + assert_has_aataam_k(&[], &han, Lun, &["aGAnizAtAm", "avaDizAtAm", "ahasAtAm"]); + assert_has_aataam_k(&[], &grah, Lun, &["agrAhizAtAm", "agrahIzAtAm"]); + + // sIyut + assert_has_ta_k(&[], &ci, AshirLin, &["cAyizIzwa", "cezIzwa"]); + assert_has_ta_k(&[], &daa, AshirLin, &["dAyizIzwa", "dAsIzwa"]); + // SAmayizIzwa is allowed per DP 1.0934. + assert_has_ta_k( + &[], + &sham, + AshirLin, + &["SAmizIzwa", "SamizIzwa", "SamayizIzwa", "SAmayizIzwa"], + ); + // TODO: broken below this line. + assert_has_ta_k(&[], &han, AshirLin, &["GAnizIzwa", "vaDizIzwa"]); + assert_has_ta_k(&[], &grah, AshirLin, &["grAhizIzwa", "grahIzIzwa"]); + assert_has_ta_k(&[], &drsh, AshirLin, &["darSizIzwa", "dfkzIzwa"]); - let han = &d("ha\\na~", Adadi); - assert_has_lrt_karmani(&[], &han, &["GAnizyate", "hanizyate"]); - assert_has_lrn_karmani(&[], &han, &["aGAnizyata", "ahanizyata"]); - // TODO: others + // tAsi + assert_has_ta_k(&[], &ci, Lut, &["cAyitA", "cetA"]); + assert_has_ta_k(&[], &daa, Lut, &["dAyitA", "dAtA"]); + assert_has_ta_k(&[], &sham, Lut, &["SAmitA", "SamitA", "SamayitA"]); + assert_has_ta_k(&[], &han, Lut, &["GAnitA", "hantA"]); + assert_has_ta_k(&[], &grah, Lut, &["grAhitA", "grahItA"]); + assert_has_ta_k(&[], &drsh, Lut, &["darSitA", "drazwA"]); + + // sya-sic-sIyut-tAsi? + assert_has_krdanta(&[], &ci, Krt::tavya, &["cetavya"]); + assert_has_krdanta(&[], &daa, Krt::tavya, &["dAtavya"]); + + // bhAvakarmaNoH? + assert_has_tip(&[], &ci, Lrt, &["cezyati"]); + assert_has_tip(&[], &daa, Lrt, &["dAsyati"]); + + // upadeSe? + assert_has_ta_k(&[], &d("qukf\\Y", Tanadi), Lrt, &["kArizyate", "karizyate"]); + + // ac-hana-graha-dRSAm? + assert_has_ta_k(&[], &d("paWa~", Bhvadi), Lrt, &["paWizyate"]); } #[test] @@ -849,12 +919,11 @@ fn sutra_6_4_68() { // saMyogAdeH assert_has_ashirlin_p(&[], &d("yA\\", Adadi), &["yAyAt"]); // kNiti - assert_has_ashirlin_karmani(&[], &glai, &["glAsIzwa"]); + assert_has_ashirlin_karmani(&[], &glai, &["glAsIzwa", "glAyizIzwa"]); // aNgasya assert_has_ashirlin_p(&["nis"], &d("vA\\", Adadi), &["nirvAyAt"]); } -#[ignore] #[test] fn sutra_6_4_69() { assert_has_krdanta(&["pra"], &d("qudA\\Y", Juhotyadi), Krt::ktvA, &["pradAya"]); @@ -1103,7 +1172,7 @@ fn sutra_6_4_98() { } #[test] -fn sutra_6_4_100() { +fn sutra_6_4_101() { let hu = d("hu\\", Juhotyadi); assert_has_hi(&[], &hu, &["juhuDi", "juhutAt"]); assert_has_hi( @@ -1358,7 +1427,6 @@ fn sutra_6_4_116() { assert_has_lat(&[], &yan(&haa), &["jehIyate"]); } -#[ignore] #[test] fn sutra_6_4_117() { let haa = d("o~hA\\k", Juhotyadi); @@ -1458,7 +1526,8 @@ fn sutra_6_4_121() { // ataH assert_has_sip(&[], &d("divu~", Divadi), Lit, &["dideviTa"]); // ekahalmadhya - assert_has_sip(&[], &d("takzU~", Bhvadi), Lit, &["tatakziTa"]); + // SK justifies tatazWa + assert_has_sip(&[], &d("takzU~", Bhvadi), Lit, &["tatakziTa", "tatazWa"]); assert_has_sip(&[], &d("rakza~", Bhvadi), Lit, &["rarakziTa"]); // anAdezAdi assert_has_sip(&[], &d("kaRa~", Bhvadi), Lit, &["cakaRiTa"]); @@ -1498,7 +1567,7 @@ fn sutra_6_4_122_v1() { #[test] fn sutra_6_4_124() { - let jf = d("jF", Kryadi); + let jf = d("jFz", Divadi); assert_has_tas(&[], &jf, Lit, &["jeratuH", "jajaratuH"]); assert_has_jhi(&[], &jf, Lit, &["jeruH", "jajaruH"]); assert_has_sip(&[], &jf, Lit, &["jeriTa", "jajariTa"]); @@ -1626,12 +1695,12 @@ fn sutra_6_4_134() { #[ignore] #[test] fn sutra_6_4_135() { - use V::*; - assert_has_subantas("ukzan", Pum, Sasthi, Eka, &["rAjYaH"]); - assert_has_subantas("BrUnahan", Pum, Trtiya, Eka, &["rAjYA"]); - assert_has_subantas("DrtarAjan", Pum, Caturthi, Eka, &["rAjYe"]); - assert_has_subantas("sAman", Pum, Trtiya, Eka, &["takzRA"]); - assert_has_subantas("vima", Pum, Caturthi, Eka, &["takzRe"]); + use TaddhitaArtha::TasyaApatyam; + assert_has_artha_taddhita("ukzan", TasyaApatyam, T::aR, &["OkzRa"]); + assert_has_artha_taddhita("BrURahan", TasyaApatyam, T::aR, &["BrORaGna"]); + assert_has_artha_taddhita("DftarAjan", TasyaApatyam, T::aR, &["DArtarAjYa"]); + assert_has_artha_taddhita("sAman", TasyaApatyam, T::aR, &["sAmana"]); + assert_has_artha_taddhita("viman", TasyaApatyam, T::aR, &["vEmana"]); } #[test] diff --git a/vidyut-prakriya/tests/pada_7_1.rs b/vidyut-prakriya/tests/kashika_7_1.rs similarity index 100% rename from vidyut-prakriya/tests/pada_7_1.rs rename to vidyut-prakriya/tests/kashika_7_1.rs diff --git a/vidyut-prakriya/tests/pada_7_2.rs b/vidyut-prakriya/tests/kashika_7_2.rs similarity index 99% rename from vidyut-prakriya/tests/pada_7_2.rs rename to vidyut-prakriya/tests/kashika_7_2.rs index aa5bfbe..38150c5 100644 --- a/vidyut-prakriya/tests/pada_7_2.rs +++ b/vidyut-prakriya/tests/kashika_7_2.rs @@ -940,10 +940,12 @@ fn sutra_7_2_61() { // Tali assert_has_vas(&[], &yaa, Lit, &["yayiva"]); assert_has_mas(&[], &yaa, Lit, &["yayima"]); + // nityagrahaRam let dhu = d("DUY", Kryadi); assert_has_krdanta(&["vi"], &dhu, Krt::tfc, &["viDotf", "viDavitf"]); - assert_has_sip(&["vi"], &dhu, Lit, &["viduDaviTa"]); + // SK justifies viduDoTa. + assert_has_sip(&["vi"], &dhu, Lit, &["viduDaviTa", "viduDoTa"]); } #[test] diff --git a/vidyut-prakriya/tests/pada_7_3.rs b/vidyut-prakriya/tests/kashika_7_3.rs similarity index 99% rename from vidyut-prakriya/tests/pada_7_3.rs rename to vidyut-prakriya/tests/kashika_7_3.rs index fe80bf7..9628416 100644 --- a/vidyut-prakriya/tests/pada_7_3.rs +++ b/vidyut-prakriya/tests/kashika_7_3.rs @@ -237,7 +237,8 @@ fn sutra_7_3_54() { fn sutra_7_3_55() { let han = d("ha\\na~", Adadi); assert_has_lat(&[], &san(&han), &["jiGAMsati"]); - assert_has_lat(&[], &yan(&han), &["jaNGanyate"]); + // jeGnIyate is from 7.4.30.v1. + assert_has_lat(&[], &yan(&han), &["jaNGanyate", "jeGnIyate"]); assert_has_mip(&[], &han, Lit, &["jaGana", "jaGAna"]); // TODO: hananIyitum } @@ -689,7 +690,6 @@ fn sutra_7_3_93() { assert_has_tas(&[], &bru, Lat, &["brUtaH", "AhatuH"]); } -#[ignore] #[test] fn sutra_7_3_94() { let yl = |u, g| yan_luk(&d(u, g)); diff --git a/vidyut-prakriya/tests/pada_7_4.rs b/vidyut-prakriya/tests/kashika_7_4.rs similarity index 96% rename from vidyut-prakriya/tests/pada_7_4.rs rename to vidyut-prakriya/tests/kashika_7_4.rs index 5f46e21..9f42c3c 100644 --- a/vidyut-prakriya/tests/pada_7_4.rs +++ b/vidyut-prakriya/tests/kashika_7_4.rs @@ -4,6 +4,7 @@ use vidyut_prakriya::args::Gana::*; use vidyut_prakriya::args::Lakara::*; use vidyut_prakriya::args::Linga::*; use vidyut_prakriya::args::Purusha::*; +use vidyut_prakriya::args::Taddhita as T; use vidyut_prakriya::args::Vacana::*; use vidyut_prakriya::args::Vibhakti as V; use vidyut_prakriya::args::*; @@ -171,7 +172,7 @@ fn sutra_7_4_12() { #[test] fn sutra_7_4_16() { - assert_has_lun(&[], &d("sf\\", Bhvadi), &["asarat"]); + assert_has_lun(&[], &d("sf\\", Juhotyadi), &["asarat"]); assert_has_lun(&[], &d("f\\", Juhotyadi), &["Arat"]); let dfs = d("df\\Si~r", Bhvadi); @@ -284,6 +285,20 @@ fn sutra_7_4_25() { assert_has_vidhilin_p(&[], &d("zu\\Y", Svadi), &["sunuyAt"]); } +#[test] +fn sutra_7_4_26() { + use TaddhitaArtha::AbhutaTadbhava; + assert_has_artha_taddhita("Suca", AbhutaTadbhava, T::cvi, &["SucI"]); + assert_has_artha_taddhita("pawu", AbhutaTadbhava, T::cvi, &["pawU"]); +} + +#[test] +fn sutra_7_4_32() { + use TaddhitaArtha::AbhutaTadbhava; + assert_has_artha_taddhita("Sukla", AbhutaTadbhava, T::cvi, &["SuklI"]); + assert_has_artha_taddhita("KawvA", AbhutaTadbhava, T::cvi, &["KawvI"]); +} + #[test] fn sutra_7_4_27() { // TODO: others @@ -339,6 +354,12 @@ fn sutra_7_4_30() { assert_has_lat(&[], &yan(&d("smf", Bhvadi)), &["sAsmaryate"]); } +#[test] +fn sutra_7_4_30_v1() { + let han = d("ha\\na~", Adadi); + assert_has_ta(&[], &yan(&han), Lat, &["jeGnIyate", "jaNGanyate"]); +} + #[test] fn sutra_7_4_31() { assert_has_lat(&[], &yan(&d("GrA\\", Bhvadi)), &["jeGrIyate"]); @@ -397,7 +418,22 @@ fn sutra_7_4_46() { assert_has_krdanta(&["ava"], &d("dE\\p", Bhvadi), Krt::kta, &["avadAta"]); } -#[ignore] +#[test] +fn sutra_7_4_47() { + let daa = d("qudA\\Y", Juhotyadi); + assert_has_krdanta(&["pra"], &daa, Krt::kta, &["pratta"]); + assert_has_krdanta(&["ava"], &daa, Krt::kta, &["avatta"]); + assert_has_krdanta(&["ni"], &daa, Krt::kta, &["nItta"]); + assert_has_krdanta(&["pari"], &daa, Krt::kta, &["parItta"]); + // acaH? + assert_has_krdanta(&["nir"], &daa, Krt::kta, &["nirdatta"]); + assert_has_krdanta(&["dur"], &daa, Krt::kta, &["durdatta"]); + // upasargAt? + assert_has_krdanta(&[], &daa, Krt::kta, &["datta"]); + // GoH? + assert_has_krdanta(&["ava"], &d("dA\\p", Adadi), Krt::kta, &["avadAta"]); +} + #[test] fn sutra_7_4_48() { assert_has_subantas("ap", Pum, V::Trtiya, Bahu, &["adBiH"]); @@ -466,7 +502,6 @@ fn sutra_7_4_53() { assert_has_krdanta(&["AN"], &vevi, Krt::lyuw, &["Avevyana"]); } -#[ignore] #[test] fn sutra_7_4_54() { assert_has_lat_p(&[], &san(&d("mI\\Y", Kryadi)), &["mitsati"]); diff --git a/vidyut-prakriya/tests/pada_8_2.rs b/vidyut-prakriya/tests/kashika_8_2.rs similarity index 96% rename from vidyut-prakriya/tests/pada_8_2.rs rename to vidyut-prakriya/tests/kashika_8_2.rs index 92812b2..90088df 100644 --- a/vidyut-prakriya/tests/pada_8_2.rs +++ b/vidyut-prakriya/tests/kashika_8_2.rs @@ -4,6 +4,7 @@ use vidyut_prakriya::args::Gana::*; use vidyut_prakriya::args::Lakara::*; use vidyut_prakriya::args::Linga::*; use vidyut_prakriya::args::Taddhita as T; +use vidyut_prakriya::args::TaddhitaArtha; use vidyut_prakriya::args::Vacana::*; use vidyut_prakriya::args::Vibhakti::*; use vidyut_prakriya::args::*; @@ -439,6 +440,19 @@ fn sutra_8_2_38() { assert_has_tip(&[], &dha, Lat, &["daDAti"]); } +#[test] +fn sutra_8_2_39() { + assert_has_sandhi("vAk", "atra", &["vAg atra"]); + assert_has_sandhi("Svaliw", "atra", &["Svaliq atra"]); + assert_has_sandhi("agnicit", "atra", &["agnicid atra"]); + assert_has_sandhi("trizWup", "atra", &["trizWub atra"]); + + // ante? + let vas = d("va\\sa~", Bhvadi); + assert_has_krdanta(&[], &vas, Krt::tfc, &["vastf"]); + assert_has_krdanta(&[], &vas, Krt::tavyat, &["vastavya", "vAstavya"]); +} + #[test] fn sutra_8_2_40() { let labh = d("qula\\Ba~\\z", Bhvadi); @@ -466,7 +480,7 @@ fn sutra_8_2_40() { assert_has_krdanta(&[], &budh, Krt::tfc, &["bodDf"]); assert_has_krdanta(&[], &budh, Krt::tumun, &["bodDum"]); assert_has_krdanta(&[], &budh, Krt::tavya, &["bodDavya"]); - assert_has_ta(&[], &budh, Lun, &["abudDa"]); + assert_has_ta(&[], &budh, Lun, &["abudDa", "aboDi"]); assert_has_thaas(&[], &budh, Lun, &["abudDAH"]); // aDaH? @@ -805,6 +819,18 @@ fn sutra_8_2_78() { assert_has_lat(&[], &d("jiri", Svadi), &["jiriRoti"]); } +#[test] +fn sutra_8_2_79() { + // bha + use TaddhitaArtha::*; + assert_has_artha_taddhita("Dur", TadVahati, T::yat, &["Durya"]); + assert_has_artha_taddhita("div", TatraJata, T::yat, &["divya"]); + // kur + assert_has_tip(&[], &d("qukf\\Y", Tanadi), VidhiLin, &["kuryAt"]); + // chur + assert_has_tip(&[], &d("Cura~", Tanadi), AshirLin, &["CuryAt"]); +} + #[ignore] #[test] fn sutra_8_2_80() { diff --git a/vidyut-prakriya/tests/pada_8_3.rs b/vidyut-prakriya/tests/kashika_8_3.rs similarity index 92% rename from vidyut-prakriya/tests/pada_8_3.rs rename to vidyut-prakriya/tests/kashika_8_3.rs index dfcd573..e591e23 100644 --- a/vidyut-prakriya/tests/pada_8_3.rs +++ b/vidyut-prakriya/tests/kashika_8_3.rs @@ -234,7 +234,7 @@ fn sutra_8_3_66() { #[test] fn sutra_8_3_67() { - let stanbh = d("sta\\nBu~", Kryadi); + let stanbh = d("stanBu~", Kryadi); assert_has_lat_p(&["aBi"], &stanbh, &["aBizwaBnAti", "aBizwaBnoti"]); assert_has_lat_p(&["pari"], &stanbh, &["parizwaBnAti", "parizwaBnoti"]); @@ -252,7 +252,7 @@ fn sutra_8_3_67() { #[test] fn sutra_8_3_68() { - let stanbh = d("sta\\nBu~", Kryadi); + let stanbh = d("stanBu~", Kryadi); assert_has_krdanta(&["ava"], &stanbh, Krt::ktvA, &["avazwaBya", "avastaBya"]); } @@ -423,7 +423,7 @@ fn sutra_8_3_76() { #[test] fn sutra_8_3_77() { - let skanbh = d("ska\\nBu~", Kryadi); + let skanbh = d("skanBu~", Kryadi); assert_has_lat(&["vi"], &skanbh, &["vizkaBnAti", "vizkaBnoti"]); } @@ -457,24 +457,65 @@ fn sutra_8_3_110() { // TODO: others? } -#[ignore] #[test] fn sutra_8_3_112() { let sic = d("zi\\ca~^", Tudadi); assert_has_lat(&[], &yan(&sic), &["sesicyate"]); assert_has_lat(&["aBi"], &yan(&sic), &["aBisesicyate"]); // yani - assert_has_lat(&["aBi"], &san(&sic), &["aBizizikzati"]); + assert_has_lat_p(&["aBi"], &san(&sic), &["aBizizikzati"]); +} + +#[test] +fn sutra_8_3_113() { + let sidh = d("ziDa~", Bhvadi); + assert_has_lat_p(&["aBi"], &nic(&sidh), &["aBiseDayati"]); + assert_has_lat_p(&["pari"], &nic(&sidh), &["pariseDayati"]); + // gatau? + assert_has_lat_p(&["prati"], &nic(&sidh), &["pratizeDayati"]); } -#[ignore] #[test] fn sutra_8_3_115() { let sah = d("zaha~\\", Bhvadi); assert_has_krdanta(&["pari"], &sah, Krt::kta, &["parisoQa", "parizahita"]); - assert_has_krdanta(&["pari"], &sah, Krt::tumun, &["parisoQum"]); - assert_has_krdanta(&["pari"], &sah, Krt::tavya, &["parisoQavya"]); + assert_has_krdanta(&["pari"], &sah, Krt::tumun, &["parisoQum", "parizahitum"]); + assert_has_krdanta( + &["pari"], + &sah, + Krt::tavya, + &["parisoQavya", "parizahitavya"], + ); // soQa? assert_has_lat(&["pari"], &sah, &["parizahate"]); } + +#[test] +fn sutra_8_3_117() { + let sush = d("zu\\Y", Svadi); + assert_has_lrt_p(&["aBi"], &sush, &["aBisozyati"]); + assert_has_lrt_p(&["pari"], &sush, &["parisozyati"]); + assert_has_lrn_p(&["aBi"], &sush, &["aByasozyat"]); + assert_has_lrn_p(&["pari"], &sush, &["paryasozyat"]); + + // sani? + assert_has_lat(&["aBi"], &san(&sush), &["aBisusUzati", "aBisusUzate"]); + + // syasanoH? + assert_has_lit_p(&[], &sush, &["suzAva"]); + + // TODO: aBisusUH +} + +#[test] +fn sutra_8_3_118() { + let sad = d("za\\dx~", Bhvadi); + assert_has_lit_p(&["ni"], &sad, &["nizasAda"]); +} + +#[test] +fn sutra_8_3_118_v1() { + let svanj = d("zva\\nja~\\", Bhvadi); + assert_has_lit(&["pari"], &svanj, &["parizasvaje", "parizasvaYje"]); +} diff --git a/vidyut-prakriya/tests/pada_8_4.rs b/vidyut-prakriya/tests/kashika_8_4.rs similarity index 100% rename from vidyut-prakriya/tests/pada_8_4.rs rename to vidyut-prakriya/tests/kashika_8_4.rs diff --git a/vidyut-prakriya/tests/kaumudi_11.rs b/vidyut-prakriya/tests/kaumudi_11.rs new file mode 100644 index 0000000..5b21f09 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_11.rs @@ -0,0 +1,183 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Linga::*; + +#[test] +fn sk_324() { + assert_has_sup_1s("lih", Pum, &["liw"]); + assert_has_sup_1d("lih", Pum, &["lihO"]); + assert_has_sup_1p("lih", Pum, &["lihaH"]); + assert_has_sup_2s("lih", Pum, &["liham"]); + assert_has_sup_2d("lih", Pum, &["lihO"]); + assert_has_sup_2p("lih", Pum, &["lihaH"]); + assert_has_sup_3s("lih", Pum, &["lihA"]); + assert_has_sup_3d("lih", Pum, &["liqByAm"]); + assert_has_sup_7p("lih", Pum, &["liwtsu", "liwsu"]); +} + +#[ignore] +#[test] +fn sk_325() { + assert_has_sup_1s("gardaB", Pum, &["gardap"]); + + assert_has_sup_1s("duh", Pum, &["Duk"]); + assert_has_sup_1d("duh", Pum, &["duhO"]); + assert_has_sup_1p("duh", Pum, &["duhaH"]); + assert_has_sup_7p("duh", Pum, &["Dukzu"]); +} + +#[test] +fn skip_sk_328_to_sk_329() {} + +#[test] +fn sk_342() { + assert_has_sup_1s("kim", Pum, &["kaH"]); + assert_has_sup_1d("kim", Pum, &["kO"]); + assert_has_sup_1p("kim", Pum, &["ke"]); + assert_has_sup_2s("kim", Pum, &["kam"]); + assert_has_sup_2d("kim", Pum, &["kO"]); + assert_has_sup_2p("kim", Pum, &["kAn"]); +} + +#[test] +fn skip_sk_343() {} + +#[test] +fn sk_344() { + assert_has_sup_1s("idam", Pum, &["ayam"]); +} + +#[test] +fn sk_345() { + assert_has_sup_1d("idam", Pum, &["imO"]); + assert_has_sup_1p("idam", Pum, &["ime"]); +} + +#[test] +fn sk_346() { + assert_has_sup_3s("idam", Pum, &["anena"]); +} + +#[test] +fn skip_sk_347() {} + +#[test] +fn sk_348() { + assert_has_sup_3d("idam", Pum, &["AByAm"]); +} + +#[test] +fn sk_349() { + assert_has_sup_3p("idam", Pum, &["eBiH"]); + assert_has_sup_4s("idam", Pum, &["asmE"]); + assert_has_sup_4d("idam", Pum, &["AByAm"]); + assert_has_sup_4p("idam", Pum, &["eByaH"]); + assert_has_sup_5s("idam", Pum, &["asmAt"]); + assert_has_sup_5d("idam", Pum, &["AByAm"]); + assert_has_sup_5p("idam", Pum, &["eByaH"]); + assert_has_sup_6s("idam", Pum, &["asya"]); + assert_has_sup_6d("idam", Pum, &["anayoH"]); + assert_has_sup_6p("idam", Pum, &["ezAm"]); + assert_has_sup_7s("idam", Pum, &["asmin"]); + assert_has_sup_7d("idam", Pum, &["anayoH"]); + assert_has_sup_7p("idam", Pum, &["ezu"]); + + // TODO: ayaka +} + +#[test] +fn sk_354() { + assert_has_sup_1s("yajvan", Pum, &["yajvA"]); + assert_has_sup_1d("yajvan", Pum, &["yajvAnO"]); + assert_has_sup_1p("yajvan", Pum, &["yajvAnaH"]); +} + +#[test] +fn sk_355() { + assert_has_sup_2p("yajvan", Pum, &["yajvanaH"]); + assert_has_sup_3s("yajvan", Pum, &["yajvanA"]); + assert_has_sup_3d("yajvan", Pum, &["yajvaByAm"]); + + assert_has_sup_2p("brahman", Pum, &["brahmaRaH"]); + assert_has_sup_3s("brahman", Pum, &["brahmaRA"]); + assert_has_sup_3d("brahman", Pum, &["brahmaByAm"]); +} + +#[test] +fn skip_sk_356() {} + +#[test] +fn skip_sk_358() {} + +#[test] +fn skip_sk_371() {} + +#[test] +fn sk_390() { + assert_has_sup_2s("yuzmad", Pum, &["tvAm"]); + assert_has_sup_2s("asmad", Pum, &["mAm"]); + assert_has_sup_2d("yuzmad", Pum, &["yuvAm"]); + assert_has_sup_2d("asmad", Pum, &["AvAm"]); +} + +#[test] +fn sk_391() { + assert_has_sup_2p("yuzmad", Pum, &["yuzmAn"]); + assert_has_sup_2p("asmad", Pum, &["asmAn"]); +} + +#[test] +fn sk_392() { + assert_has_sup_3s("yuzmad", Pum, &["tvayA"]); + assert_has_sup_3s("asmad", Pum, &["mayA"]); +} + +#[test] +fn sk_393() { + assert_has_sup_3d("yuzmad", Pum, &["yuvAByAm"]); + assert_has_sup_3d("asmad", Pum, &["AvAByAm"]); + assert_has_sup_3p("yuzmad", Pum, &["yuzmABiH"]); + assert_has_sup_3p("asmad", Pum, &["asmABiH"]); +} + +#[ignore] +#[test] +fn sk_394() { + assert_has_sup_4s("yuzmad", Pum, &["tuByam"]); + assert_has_sup_4d("asmad", Pum, &["mahyam"]); +} + +#[test] +fn sk_395() { + assert_has_sup_4p("yuzmad", Pum, &["yuzmaByam"]); + assert_has_sup_4p("asmad", Pum, &["asmaByam"]); +} + +#[test] +fn sk_396() { + assert_has_sup_5s("yuzmad", Pum, &["tvat"]); + assert_has_sup_5s("asmad", Pum, &["mat"]); + assert_has_sup_5d("yuzmad", Pum, &["yuvAByAm"]); + assert_has_sup_5d("asmad", Pum, &["AvAByAm"]); +} + +#[ignore] +#[test] +fn sk_397() { + assert_has_sup_5p("yuzmad", Pum, &["yuzmat"]); + assert_has_sup_5p("asmad", Pum, &["asmat"]); +} + +#[test] +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"]); +} + +#[test] +fn skip_sk_401_to_sk_406() {} diff --git a/vidyut-prakriya/tests/kaumudi_43.rs b/vidyut-prakriya/tests/kaumudi_43.rs new file mode 100644 index 0000000..de9db97 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_43.rs @@ -0,0 +1,4572 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Krt; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn skip_sk_2151_to_sk_2167() {} + +#[test] +fn sk_2168() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lat, &["Bavati"]); + assert_has_tas(&[], &bhu, Lat, &["BavataH"]); +} + +#[test] +fn sk_2169() { + let bhu = d("BU", Bhvadi); + assert_has_jhi(&[], &bhu, Lat, &["Bavanti"]); + assert_has_sip(&[], &bhu, Lat, &["Bavasi"]); + assert_has_thas(&[], &bhu, Lat, &["BavaTaH"]); + assert_has_tha(&[], &bhu, Lat, &["BavaTa"]); +} + +#[test] +fn sk_2170() { + let bhu = d("BU", Bhvadi); + assert_has_mip(&[], &bhu, Lat, &["BavAmi"]); + assert_has_vas(&[], &bhu, Lat, &["BavAvaH"]); + assert_has_mas(&[], &bhu, Lat, &["BavAmaH"]); + + // Repeat of forms from SK 2168 and SK 2169. + assert_has_tip(&[], &bhu, Lat, &["Bavati"]); + assert_has_tas(&[], &bhu, Lat, &["BavataH"]); + assert_has_jhi(&[], &bhu, Lat, &["Bavanti"]); + assert_has_sip(&[], &bhu, Lat, &["Bavasi"]); + assert_has_thas(&[], &bhu, Lat, &["BavaTaH"]); + assert_has_tha(&[], &bhu, Lat, &["BavaTa"]); + + let bhuj = d("Bu\\ja~", Rudhadi); + assert_has_thaas(&[], &bhuj, Lrt, &["Bokzyase"]); + assert_has_aathaam(&[], &bhuj, Lrt, &["BokzyeTe"]); + assert_has_dhvam(&[], &bhuj, Lrt, &["BokzyaDve"]); + assert_has_iw(&[], &bhuj, Lrt, &["Bokzye"]); + assert_has_vahi(&[], &bhuj, Lrt, &["BokzyAvahe"]); + assert_has_mahin(&[], &bhuj, Lrt, &["BokzyAmahe"]); + + let man = d("ma\\na~\\", Divadi); + assert_has_thaas(&[], &man, Lat, &["manyase"]); + assert_has_aathaam(&[], &man, Lat, &["manyeTe"]); + assert_has_dhvam(&[], &man, Lat, &["manyaDve"]); + assert_has_ta(&[], &man, Lat, &["manyate"]); +} + +#[test] +fn skip_sk_2171_to_sk_2182() {} + +#[test] +fn sk_2183() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lit, &["baBUva"]); + assert_has_tas(&[], &bhu, Lit, &["baBUvatuH"]); + assert_has_jhi(&[], &bhu, Lit, &["baBUvuH"]); +} + +#[test] +fn sk_2184() { + let bhu = d("BU", Bhvadi); + assert_has_sip(&[], &bhu, Lit, &["baBUviTa"]); + assert_has_thas(&[], &bhu, Lit, &["baBUvaTuH"]); + assert_has_tha(&[], &bhu, Lit, &["baBUva"]); + assert_has_mip(&[], &bhu, Lit, &["baBUva"]); + assert_has_vas(&[], &bhu, Lit, &["baBUviva"]); + assert_has_mas(&[], &bhu, Lit, &["baBUvima"]); +} + +#[test] +fn skip_sk_2185_to_sk_2189() {} + +#[test] +fn sk_2190() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lut, &["BavitA"]); +} + +#[test] +fn skip_sk_2191() {} + +#[test] +fn sk_2192() { + let bhu = d("BU", Bhvadi); + assert_has_tas(&[], &bhu, Lut, &["BavitArO"]); + assert_has_jhi(&[], &bhu, Lut, &["BavitAraH"]); + assert_has_sip(&[], &bhu, Lut, &["BavitAsi"]); + assert_has_thas(&[], &bhu, Lut, &["BavitAsTaH"]); + assert_has_tha(&[], &bhu, Lut, &["BavitAsTa"]); + assert_has_mip(&[], &bhu, Lut, &["BavitAsmi"]); + assert_has_vas(&[], &bhu, Lut, &["BavitAsvaH"]); + assert_has_mas(&[], &bhu, Lut, &["BavitAsmaH"]); +} + +#[test] +fn sk_2193() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lrt, &["Bavizyati"]); + assert_has_tas(&[], &bhu, Lrt, &["BavizyataH"]); + assert_has_jhi(&[], &bhu, Lrt, &["Bavizyanti"]); + assert_has_sip(&[], &bhu, Lrt, &["Bavizyasi"]); + assert_has_thas(&[], &bhu, Lrt, &["BavizyaTaH"]); + assert_has_tha(&[], &bhu, Lrt, &["BavizyaTa"]); + assert_has_mip(&[], &bhu, Lrt, &["BavizyAmi"]); + assert_has_vas(&[], &bhu, Lrt, &["BavizyAvaH"]); + assert_has_mas(&[], &bhu, Lrt, &["BavizyAmaH"]); +} + +#[test] +fn skip_sk_2194_to_sk_2195() {} + +#[test] +fn sk_2196() { + let bhu = d("BU", Bhvadi); + // BavatAt is from SK 2197. + assert_has_tip(&[], &bhu, Lot, &["Bavatu", "BavatAt"]); +} + +#[test] +fn sk_2197() { + let bhu = d("BU", Bhvadi); + // Bavatu is from SK 2196. + assert_has_tip(&[], &bhu, Lot, &["Bavatu", "BavatAt"]); +} + +#[test] +fn skip_sk_2198_to_sk_2199() {} + +#[test] +fn sk_2200() { + let bhu = d("BU", Bhvadi); + assert_has_tas(&[], &bhu, Lot, &["BavatAm"]); + assert_has_jhi(&[], &bhu, Lot, &["Bavantu"]); +} + +#[test] +fn skip_sk_2201() {} + +#[test] +fn sk_2202() { + let bhu = d("BU", Bhvadi); + assert_has_sip(&[], &bhu, Lot, &["Bava", "BavatAt"]); + assert_has_thas(&[], &bhu, Lot, &["Bavatam"]); + assert_has_tha(&[], &bhu, Lot, &["Bavata"]); +} + +#[test] +fn skip_sk_2203() {} + +#[test] +fn sk_2204() { + let bhu = d("BU", Bhvadi); + assert_has_mip(&[], &bhu, Lot, &["BavAni"]); + assert_has_vas(&[], &bhu, Lot, &["BavAva"]); + assert_has_mas(&[], &bhu, Lot, &["BavAma"]); +} + +#[test] +fn skip_sk_2205_to_sk_2206() {} + +#[test] +fn sk_2207() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lan, &["aBavat"]); + assert_has_tas(&[], &bhu, Lan, &["aBavatAm"]); + assert_has_jhi(&[], &bhu, Lan, &["aBavan"]); + assert_has_sip(&[], &bhu, Lan, &["aBavaH"]); + assert_has_thas(&[], &bhu, Lan, &["aBavatam"]); + assert_has_tha(&[], &bhu, Lan, &["aBavata"]); + assert_has_mip(&[], &bhu, Lan, &["aBavam"]); + assert_has_vas(&[], &bhu, Lan, &["aBavAva"]); + assert_has_mas(&[], &bhu, Lan, &["aBavAma"]); +} + +#[test] +fn skip_sk_2208_to_sk_2211() {} + +#[test] +fn sk_2212() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, VidhiLin, &["Bavet"]); + assert_has_tas(&[], &bhu, VidhiLin, &["BavetAm"]); +} + +#[test] +fn skip_sk_2213() {} + +#[test] +fn sk_2214() { + let bhu = d("BU", Bhvadi); + assert_has_jhi(&[], &bhu, VidhiLin, &["BaveyuH"]); + assert_has_sip(&[], &bhu, VidhiLin, &["BaveH"]); + assert_has_thas(&[], &bhu, VidhiLin, &["Bavetam"]); + assert_has_tha(&[], &bhu, VidhiLin, &["Baveta"]); + assert_has_mip(&[], &bhu, VidhiLin, &["Baveyam"]); + assert_has_vas(&[], &bhu, VidhiLin, &["Baveva"]); + assert_has_mas(&[], &bhu, VidhiLin, &["Bavema"]); +} + +#[test] +fn skip_sk_2215_to_sk_2216() {} + +#[test] +fn sk_2217() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, AshirLin, &["BUyAt"]); + assert_has_tas(&[], &bhu, AshirLin, &["BUyAstAm"]); + assert_has_jhi(&[], &bhu, AshirLin, &["BUyAsuH"]); + assert_has_sip(&[], &bhu, AshirLin, &["BUyAH"]); + assert_has_thas(&[], &bhu, AshirLin, &["BUyAstam"]); + assert_has_tha(&[], &bhu, AshirLin, &["BUyAsta"]); + assert_has_mip(&[], &bhu, AshirLin, &["BUyAsam"]); + assert_has_vas(&[], &bhu, AshirLin, &["BUyAsva"]); + assert_has_mas(&[], &bhu, AshirLin, &["BUyAsma"]); +} + +#[test] +fn skip_sk_2218_to_sk_2224() {} + +#[test] +fn sk_2225() { + let bhu = d("BU", Bhvadi); + let edh = d("eDa~\\", Bhvadi); + + assert_has_tip(&[], &bhu, Lun, &["aBUt"]); + assert_has_iw(&[], &edh, Lun, &["EDizi"]); + assert_has_ta(&[], &edh, Lun, &["EDizwa"]); + assert_has_tas(&[], &bhu, Lun, &["aBUtAm"]); +} + +#[test] +fn skip_sk_2226() {} + +#[test] +fn sk_2227() { + let bhu = d("BU", Bhvadi); + assert_has_jhi(&[], &bhu, Lun, &["aBUvan"]); + assert_has_sip(&[], &bhu, Lun, &["aBUH"]); + assert_has_thas(&[], &bhu, Lun, &["aBUtam"]); + assert_has_tha(&[], &bhu, Lun, &["aBUta"]); + assert_has_mip(&[], &bhu, Lun, &["aBUvam"]); + assert_has_vas(&[], &bhu, Lun, &["aBUva"]); + assert_has_mas(&[], &bhu, Lun, &["aBUma"]); +} + +#[test] +fn sk_2228() { + // TODO: support mAN-yoga + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lun, &["aBUt"]); + assert_has_tip(&[], &bhu, Lan, &["aBavat"]); +} + +#[test] +fn sk_2229() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &bhu, Lrn, &["aBavizyat"]); + assert_has_tas(&[], &bhu, Lrn, &["aBavizyatAm"]); + assert_has_jhi(&[], &bhu, Lrn, &["aBavizyan"]); + assert_has_sip(&[], &bhu, Lrn, &["aBavizyaH"]); + assert_has_thas(&[], &bhu, Lrn, &["aBavizyatam"]); + assert_has_tha(&[], &bhu, Lrn, &["aBavizyata"]); + assert_has_mip(&[], &bhu, Lrn, &["aBavizyam"]); + assert_has_vas(&[], &bhu, Lrn, &["aBavizyAva"]); + assert_has_mas(&[], &bhu, Lrn, &["aBavizyAma"]); +} + +#[test] +fn skip_sk_2230() {} + +#[test] +fn sk_2231() { + let bhu = d("BU", Bhvadi); + assert_has_mip(&["pra"], &bhu, Lot, &["praBavARi"]); + assert_has_mip(&["dur"], &bhu, Lot, &["durBavAni"]); + assert_has_mip(&["antar"], &bhu, Lot, &["antarBavAni"]); +} + +#[test] +fn sk_2232() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&["pra", "ni"], &bhu, Lat, &["praRiBavati", "praniBavati"]); + assert_has_tip(&["pra"], &bhu, Lat, &["praBavati"]); + assert_has_tip(&["parA"], &bhu, Lat, &["parABavati"]); + assert_has_tip(&["sam"], &bhu, Lat, &["samBavati"]); + assert_has_tip(&["anu"], &bhu, Lat, &["anuBavati"]); + assert_has_tip(&["aBi"], &bhu, Lat, &["aBiBavati"]); + assert_has_tip(&["ud"], &bhu, Lat, &["udBavati"]); + assert_has_tip(&["pari"], &bhu, Lat, &["pariBavati"]); +} + +#[test] +fn sk_2233() { + let edh = d("eDa~\\", Bhvadi); + assert_has_ta(&[], &edh, Lat, &["eDate"]); +} + +#[test] +fn skip_sk_2234() {} + +#[test] +fn sk_2235() { + let edh = d("eDa~\\", Bhvadi); + assert_has_aataam(&[], &edh, Lat, &["eDete"]); + assert_has_jha(&[], &edh, Lat, &["eDante"]); +} + +#[test] +fn sk_2236() { + let edh = d("eDa~\\", Bhvadi); + assert_has_thaas(&[], &edh, Lat, &["eDase"]); + assert_has_aathaam(&[], &edh, Lat, &["eDeTe"]); + assert_has_dhvam(&[], &edh, Lat, &["eDaDve"]); + assert_has_iw(&[], &edh, Lat, &["eDe"]); + assert_has_vahi(&[], &edh, Lat, &["eDAvahe"]); + assert_has_mahin(&[], &edh, Lat, &["eDAmahe"]); +} + +#[test] +fn skip_sk_2237_to_sk_2243() {} + +#[test] +fn sk_2244() { + let vrasc = d("o~vrascU~", Tudadi); + assert_has_tip(&[], &vrasc, Lit, &["vavraSca"]); +} + +#[test] +fn sk_2245() { + let edh = d("eDa~\\", Bhvadi); + assert_has_ta(&[], &edh, Lit, &["eDAYcakre", "eDAmbaBUva", "eDAmAsa"]); + assert_has_aataam( + &[], + &edh, + Lit, + &["eDAYcakrAte", "eDAmbaBUvatuH", "eDAmAsatuH"], + ); + assert_has_jha(&[], &edh, Lit, &["eDAYcakrire", "eDAmbaBUvuH", "eDAmAsuH"]); +} + +#[test] +fn sk_2246() { + let edh = d("eDa~\\", Bhvadi); + assert_has_thaas(&[], &edh, Lit, &["eDAYcakfze", "eDAmbaBUviTa", "eDAmAsiTa"]); + assert_has_aathaam( + &[], + &edh, + Lit, + &["eDAYcakrATe", "eDAmbaBUvaTuH", "eDAmAsaTuH"], + ); +} + +#[test] +fn sk_2247() { + let edh = d("eDa~\\", Bhvadi); + assert_has_dhvam(&[], &edh, Lit, &["eDAYcakfQve", "eDAmbaBUva", "eDAmAsa"]); + assert_has_iw(&[], &edh, Lit, &["eDAYcakre", "eDAmbaBUva", "eDAmAsa"]); + assert_has_vahi( + &[], + &edh, + Lit, + &["eDAYcakfvahe", "eDAmbaBUviva", "eDAmAsiva"], + ); + assert_has_mahin( + &[], + &edh, + Lit, + &["eDAYcakfmahe", "eDAmbaBUvima", "eDAmAsima"], + ); +} + +#[test] +fn sk_2248() { + let edh = d("eDa~\\", Bhvadi); + + // Only the "Asa/AtasuH" forms are mentioned here. + assert_has_aataam( + &[], + &edh, + Lit, + &["eDAYcakrAte", "eDAmbaBUvatuH", "eDAmAsatuH"], + ); + assert_has_jha(&[], &edh, Lit, &["eDAYcakrire", "eDAmbaBUvuH", "eDAmAsuH"]); + + assert_has_ta(&[], &edh, Lut, &["eDitA"]); + assert_has_aataam(&[], &edh, Lut, &["eDitArO"]); + assert_has_jha(&[], &edh, Lut, &["eDitAraH"]); + assert_has_thaas(&[], &edh, Lut, &["eDitAse"]); + assert_has_aathaam(&[], &edh, Lut, &["eDitAsATe"]); +} + +#[test] +fn sk_2249() { + let edh = d("eDa~\\", Bhvadi); + assert_has_dhvam(&[], &edh, Lut, &["eDitADve"]); +} + +#[test] +fn sk_2250() { + let edh = d("eDa~\\", Bhvadi); + assert_has_iw(&[], &edh, Lut, &["eDitAhe"]); + assert_has_vahi(&[], &edh, Lut, &["eDitAsvahe"]); + assert_has_mahin(&[], &edh, Lut, &["eDitAsmahe"]); + + assert_has_ta(&[], &edh, Lrt, &["eDizyate"]); + assert_has_aataam(&[], &edh, Lrt, &["eDizyete"]); + assert_has_jha(&[], &edh, Lrt, &["eDizyante"]); + assert_has_thaas(&[], &edh, Lrt, &["eDizyase"]); + assert_has_aathaam(&[], &edh, Lrt, &["eDizyeTe"]); + assert_has_dhvam(&[], &edh, Lrt, &["eDizyaDve"]); + assert_has_iw(&[], &edh, Lrt, &["eDizye"]); + assert_has_vahi(&[], &edh, Lrt, &["eDizyAvahe"]); + assert_has_mahin(&[], &edh, Lrt, &["eDizyAmahe"]); +} + +#[test] +fn sk_2251() { + let edh = d("eDa~\\", Bhvadi); + assert_has_ta(&[], &edh, Lot, &["eDatAm"]); + assert_has_aataam(&[], &edh, Lot, &["eDetAm"]); + assert_has_jha(&[], &edh, Lot, &["eDantAm"]); +} + +#[test] +fn sk_2252() { + let edh = d("eDa~\\", Bhvadi); + assert_has_thaas(&[], &edh, Lot, &["eDasva"]); + assert_has_aathaam(&[], &edh, Lot, &["eDeTAm"]); + assert_has_dhvam(&[], &edh, Lot, &["eDaDvam"]); +} + +#[test] +fn sk_2253() { + let edh = d("eDa~\\", Bhvadi); + assert_has_iw(&[], &edh, Lot, &["eDE"]); + assert_has_vahi(&[], &edh, Lot, &["eDAvahE"]); + assert_has_mahin(&[], &edh, Lot, &["eDAmahE"]); +} + +#[test] +fn sk_2254() { + let edh = d("eDa~\\", Bhvadi); + assert_has_ta(&[], &edh, Lan, &["EData"]); + assert_has_aataam(&[], &edh, Lan, &["EDetAm"]); + assert_has_jha(&[], &edh, Lan, &["EDanta"]); + assert_has_thaas(&[], &edh, Lan, &["EDaTAH"]); + assert_has_aathaam(&[], &edh, Lan, &["EDeTAm"]); + assert_has_dhvam(&[], &edh, Lan, &["EDaDvam"]); + assert_has_iw(&[], &edh, Lan, &["EDe"]); + assert_has_vahi(&[], &edh, Lan, &["EDAvahi"]); + assert_has_mahin(&[], &edh, Lan, &["EDAmahi"]); +} + +#[test] +fn sk_2255() { + let edh = d("eDa~\\", Bhvadi); + assert_has_ta(&[], &edh, VidhiLin, &["eDeta"]); + assert_has_aataam(&[], &edh, VidhiLin, &["eDeyAtAm"]); +} + +#[test] +fn sk_2256() { + let edh = d("eDa~\\", Bhvadi); + assert_has_jha(&[], &edh, VidhiLin, &["eDeran"]); + assert_has_thaas(&[], &edh, VidhiLin, &["eDeTAH"]); + assert_has_aathaam(&[], &edh, VidhiLin, &["eDeyATAm"]); + assert_has_dhvam(&[], &edh, VidhiLin, &["eDeDvam"]); +} + +#[test] +fn sk_2257() { + let edh = d("eDa~\\", Bhvadi); + assert_has_iw(&[], &edh, VidhiLin, &["eDeya"]); + assert_has_vahi(&[], &edh, VidhiLin, &["eDevahi"]); + assert_has_mahin(&[], &edh, VidhiLin, &["eDemahi"]); + + assert_has_ta(&[], &edh, AshirLin, &["eDizIzwa"]); + assert_has_aataam(&[], &edh, AshirLin, &["eDizIyAstAm"]); + assert_has_jha(&[], &edh, AshirLin, &["eDizIran"]); + assert_has_thaas(&[], &edh, AshirLin, &["eDizIzWAH"]); + assert_has_aathaam(&[], &edh, AshirLin, &["eDizIyAsTAm"]); + assert_has_dhvam(&[], &edh, AshirLin, &["eDizIDvam"]); + assert_has_iw(&[], &edh, AshirLin, &["eDizIya"]); + assert_has_vahi(&[], &edh, AshirLin, &["eDizIvahi"]); + assert_has_mahin(&[], &edh, AshirLin, &["eDizImahi"]); + + assert_has_ta(&[], &edh, Lun, &["EDizwa"]); + assert_has_aataam(&[], &edh, Lun, &["EDizAtAm"]); +} + +#[test] +fn sk_2258() { + let edh = d("eDa~\\", Bhvadi); + assert_has_jha(&[], &edh, Lun, &["EDizata"]); + assert_has_thaas(&[], &edh, Lun, &["EDizWAH"]); + assert_has_aathaam(&[], &edh, Lun, &["EDizATAm"]); + // TODO: EDiQvam + assert_has_dhvam(&[], &edh, Lun, &["EDiDvam"]); + assert_has_iw(&[], &edh, Lun, &["EDizi"]); + assert_has_vahi(&[], &edh, Lun, &["EDizvahi"]); + assert_has_mahin(&[], &edh, Lun, &["EDizmahi"]); + + assert_has_ta(&[], &edh, Lrn, &["EDizyata"]); + assert_has_aataam(&[], &edh, Lrn, &["EDizyetAm"]); + assert_has_jha(&[], &edh, Lrn, &["EDizyanta"]); + assert_has_thaas(&[], &edh, Lrn, &["EDizyaTAH"]); + assert_has_aathaam(&[], &edh, Lrn, &["EDizyeTAm"]); + assert_has_dhvam(&[], &edh, Lrn, &["EDizyaDvam"]); + assert_has_iw(&[], &edh, Lrn, &["EDizye"]); + assert_has_vahi(&[], &edh, Lrn, &["EDizyAvahi"]); + assert_has_mahin(&[], &edh, Lrn, &["EDizyAmahi"]); + + let spardh = d("sparDa~\\", Bhvadi); + assert_has_ta(&[], &spardh, Lat, &["sparDate"]); +} + +#[test] +fn sk_2259() { + let spardh = d("sparDa~\\", Bhvadi); + assert_has_ta(&[], &spardh, Lit, &["pasparDe"]); + assert_has_ta(&[], &spardh, Lut, &["sparDitA"]); + assert_has_ta(&[], &spardh, Lrt, &["sparDizyate"]); + assert_has_ta(&[], &spardh, Lot, &["sparDatAm"]); + assert_has_ta(&[], &spardh, Lan, &["asparData"]); + assert_has_ta(&[], &spardh, VidhiLin, &["sparDeta"]); + assert_has_ta(&[], &spardh, AshirLin, &["sparDizIzwa"]); + assert_has_ta(&[], &spardh, Lun, &["asparDizwa"]); + assert_has_ta(&[], &spardh, Lrn, &["asparDizyata"]); + + let gadh = d("gADf~\\", Bhvadi); + assert_has_ta(&[], &gadh, Lat, &["gADate"]); + assert_has_ta(&[], &gadh, Lit, &["jagADe"]); + + let badh = d("bADf~\\", Bhvadi); + assert_has_ta(&[], &badh, Lat, &["bADate"]); + + let nath = d("nATf~\\", Bhvadi); + assert_has_ta(&[], &nath, Lat, &["nATate"]); + assert_has_tip(&[], &nath, Lat, &["nATati"]); + + let nadh = d("nADf~\\", Bhvadi); + assert_has_ta(&[], &nadh, Lat, &["nADate"]); + + let dadh = d("daDa~\\", Bhvadi); + assert_has_ta(&[], &dadh, Lat, &["daDate"]); +} + +#[test] +fn skip_sk_2260() {} + +#[test] +fn sk_2261() { + let dadh = d("daDa~\\", Bhvadi); + assert_has_ta(&[], &dadh, Lit, &["deDe"]); + assert_has_aataam(&[], &dadh, Lit, &["deDAte"]); + assert_has_jha(&[], &dadh, Lit, &["deDire"]); + + // "nananTa" is from SK 2399. + assert_has_tas(&[], &d("divu~", Divadi), Lit, &["didivatuH"]); + assert_has_ta(&[], &d("rAsf~\\", Bhvadi), Lit, &["rarAse"]); + assert_has_tas(&[], &d("tsara~", Bhvadi), Lit, &["tatsaratuH"]); + assert_has_tas(&[], &d("kaRa~", Bhvadi), Lit, &["cakaRatuH"]); + assert_has_sip(&[], &d("Ra\\ma~", Bhvadi), Lit, &["nemiTa", "nananTa"]); + assert_has_ta(&[], &d("zaha~\\", Bhvadi), Lit, &["sehe"]); +} + +#[test] +fn sk_2262() { + let skund = d("skudi~\\", Bhvadi); + assert_has_ta(&[], &skund, Lat, &["skundate"]); + assert_has_ta(&[], &skund, Lit, &["cuskunde"]); + + let shvind = d("Svidi~\\", Bhvadi); + assert_has_ta(&[], &shvind, Lat, &["Svindate"]); + assert_has_ta(&[], &shvind, Lit, &["SiSvinde"]); + + let vand = d("vadi~\\", Bhvadi); + assert_has_ta(&[], &vand, Lat, &["vandate"]); + assert_has_ta(&[], &vand, Lit, &["vavande"]); + + let bhand = d("Badi~\\", Bhvadi); + assert_has_ta(&[], &bhand, Lat, &["Bandate"]); + assert_has_ta(&[], &bhand, Lit, &["baBande"]); + + let mand = d("madi~\\", Bhvadi); + assert_has_ta(&[], &mand, Lat, &["mandate"]); + assert_has_ta(&[], &mand, Lit, &["mamande"]); + + let spand = d("spadi~\\", Bhvadi); + assert_has_ta(&[], &spand, Lat, &["spandate"]); + assert_has_ta(&[], &spand, Lit, &["paspande"]); + + let klind = d("klidi~\\", Bhvadi); + assert_has_ta(&[], &klind, Lat, &["klindate"]); + assert_has_ta(&[], &klind, Lit, &["ciklinde"]); + + let mud = d("muda~\\", Bhvadi); + assert_has_ta(&[], &mud, Lat, &["modate"]); + + let dad = d("dada~\\", Bhvadi); + assert_has_ta(&[], &dad, Lat, &["dadate"]); +} + +#[test] +fn sk_2263() { + let dad = d("dada~\\", Bhvadi); + assert_has_ta(&[], &dad, Lit, &["dadade"]); + assert_has_aataam(&[], &dad, Lit, &["dadadAte"]); + assert_has_jha(&[], &dad, Lit, &["dadadire"]); +} + +#[test] +fn sk_2264() { + let svad = d("zvada~\\", Bhvadi); + assert_has_ta(&["anu"], &svad, Lat, &["anusvadate"]); + assert_has_ta(&[], &svad, Lit, &["sasvade"]); + + let svard = d("svarda~\\", Bhvadi); + assert_has_ta(&[], &svard, Lat, &["svardate"]); + assert_has_ta(&[], &svard, Lit, &["sasvarde"]); +} + +#[test] +fn sk_2265() { + let urd = d("urda~\\", Bhvadi); + assert_has_ta(&[], &urd, Lat, &["Urdate"]); + assert_has_ta(&[], &urd, Lit, &["UrdAYcakre", "UrdAmbaBUva", "UrdAmAsa"]); + + let kurd = d("kurda~\\", Bhvadi); + assert_has_ta(&[], &kurd, Lat, &["kUrdate"]); + assert_has_ta(&[], &kurd, Lit, &["cukUrde"]); + + let gurd = d("gurda~\\", Bhvadi); + assert_has_ta(&[], &gurd, Lat, &["gUrdate"]); + + let gud = d("guda~\\", Bhvadi); + assert_has_ta(&[], &gud, Lat, &["godate"]); + assert_has_ta(&[], &gud, Lit, &["jugude"]); + + let sud = d("zUda~\\", Bhvadi); + assert_has_ta(&[], &sud, Lat, &["sUdate"]); + assert_has_ta(&[], &sud, Lit, &["suzUde"]); + + let hrad = d("hrAda~\\", Bhvadi); + assert_has_ta(&[], &hrad, Lat, &["hrAdate"]); + assert_has_ta(&[], &hrad, Lit, &["jahrAde"]); + + let hlad = d("hlAdI~\\", Bhvadi); + assert_has_ta(&[], &hlad, Lat, &["hlAdate"]); + + let svad = d("svAda~\\", Bhvadi); + assert_has_ta(&[], &svad, Lat, &["svAdate"]); + + let pard = d("parda~\\", Bhvadi); + assert_has_ta(&[], &pard, Lat, &["pardate"]); + + let yat = d("yatI~\\", Bhvadi); + assert_has_ta(&[], &yat, Lat, &["yatate"]); + assert_has_ta(&[], &yat, Lit, &["yete"]); + + let yut = d("yutf~\\", Bhvadi); + assert_has_ta(&[], &yut, Lat, &["yotate"]); + assert_has_ta(&[], &yut, Lit, &["yuyute"]); + + let jut = d("jutf~\\", Bhvadi); + assert_has_ta(&[], &jut, Lat, &["jotate"]); + assert_has_ta(&[], &jut, Lit, &["jujute"]); + + let vith = d("viTf~\\", Bhvadi); + assert_has_ta(&[], &vith, Lit, &["viviTe"]); + + let veth = d("veTf~\\", Bhvadi); + assert_has_ta(&[], &veth, Lit, &["viveTe"]); + + let shranth = d("SraTi~\\", Bhvadi); + assert_has_ta(&[], &shranth, Lat, &["SranTate"]); + + let granth = d("graTi~\\", Bhvadi); + assert_has_ta(&[], &granth, Lat, &["granTate"]); + + let katth = d("katTa~\\", Bhvadi); + assert_has_ta(&[], &katth, Lat, &["katTate"]); + + let at = d("ata~", Bhvadi); + assert_has_tip(&[], &at, Lat, &["atati"]); + assert_has_tip(&[], &at, Lit, &["Ata"]); + assert_has_tas(&[], &at, Lit, &["AtatuH"]); + assert_has_jhi(&[], &at, Lit, &["AtuH"]); +} + +#[test] +fn sk_2266() { + let at = d("ata~", Bhvadi); + assert_has_tip(&[], &at, Lun, &["AtIt"]); + assert_has_tas(&[], &at, Lun, &["AtizwAm"]); + assert_has_jhi(&[], &at, Lun, &["AtizuH"]); +} + +#[test] +fn skip_sk_2267() {} + +#[test] +fn sk_2268() { + let at = d("ata~", Bhvadi); + // TODO: mAN-yoga + assert_has_tip(&[], &at, Lun, &["AtIt"]); + assert_has_tas(&[], &at, Lun, &["AtizwAm"]); + assert_has_jhi(&[], &at, Lun, &["AtizuH"]); + + let cit = d("citI~", Bhvadi); + assert_has_tip(&[], &cit, Lat, &["cetati"]); + assert_has_tip(&[], &cit, Lit, &["ciceta"]); + assert_has_tip(&[], &cit, Lun, &["acetIt"]); + assert_has_tas(&[], &cit, Lun, &["acetizwAm"]); + assert_has_jhi(&[], &cit, Lun, &["acetizuH"]); + + let cyut = d("cyuti~r", Bhvadi); + assert_has_tip(&[], &cyut, Lat, &["cyotati"]); + assert_has_tip(&[], &cyut, Lit, &["cucyota"]); +} + +#[test] +fn sk_2269() { + let cyut = d("cyuti~r", Bhvadi); + assert_has_tip(&[], &cyut, Lun, &["acyutat", "acyotIt"]); + + let shcyut = d("Scyuti~r", Bhvadi); + assert_has_tip(&[], &shcyut, Lat, &["Scyotati"]); + assert_has_tip(&[], &shcyut, Lit, &["cuScyota"]); + assert_has_tip(&[], &shcyut, Lun, &["aScyutat", "aScyotIt"]); + + let shcut = d("Scuti~r", Bhvadi); + assert_has_tip(&[], &shcut, Lat, &["Scotati"]); + + let manth = d("manTa~", Bhvadi); + assert_has_tip(&[], &manth, AshirLin, &["maTyAt"]); + + let mathi = d("maTi~", Bhvadi); + assert_has_tip(&[], &mathi, AshirLin, &["manTyAt"]); + + let kuthi = d("kuTi~", Bhvadi); + assert_has_tip(&[], &kuthi, AshirLin, &["kunTyAt"]); + + let sidh = d("ziDa~", Bhvadi); + assert_has_tip(&[], &sidh, Lat, &["seDati"]); + assert_has_tip(&[], &sidh, Lit, &["sizeDa"]); + assert_has_tip(&[], &sidh, Lut, &["seDitA"]); + assert_has_tip(&[], &sidh, Lun, &["aseDIt"]); +} + +#[test] +fn skip_sk_2270_to_sk_2275() {} + +#[test] +fn sk_2276() { + let sidh = d("ziDa~", Bhvadi); + assert_has_tip(&["ni"], &sidh, Lan, &["nyazeDat"]); + assert_has_tip(&["ni"], &sidh, Lun, &["nyazeDIt"]); + assert_has_tip(&["ni"], &sidh, Lrn, &["nyazeDizyat"]); +} + +#[test] +fn sk_2277() { + let sidh = d("ziDa~", Bhvadi); + assert_has_tip(&["ni"], &sidh, Lit, &["nizizeDa"]); + assert_has_tas(&["ni"], &sidh, Lit, &["niziziDatuH"]); +} + +#[test] +fn sk_2278() { + let sidh = d("ziDa~", Bhvadi); + assert_has_tip(&["vi"], &sidh, Lat, &["viseDati"]); +} + +#[test] +fn skip_sk_2279() {} + +#[test] +fn sk_2280() { + let sidh = d("ziDU~", Bhvadi); + assert_has_sip(&[], &sidh, Lit, &["sizedDa", "sizeDiTa"]); + assert_has_tip(&[], &sidh, Lut, &["sedDA", "seDitA"]); + assert_has_tip(&[], &sidh, Lrt, &["setsyati", "seDizyati"]); + // aseDIt is from SK 2281. + assert_has_tip(&[], &sidh, Lun, &["asEtsIt", "aseDIt"]); +} + +#[test] +fn sk_2281() { + let sidh = d("ziDU~", Bhvadi); + assert_has_tas(&[], &sidh, Lun, &["asEdDAm", "aseDizwAm"]); + assert_has_jhi(&[], &sidh, Lun, &["asEtsuH", "aseDizuH"]); + assert_has_sip(&[], &sidh, Lun, &["asEtsIH", "aseDIH"]); + assert_has_thas(&[], &sidh, Lun, &["asEdDam", "aseDizwam"]); + assert_has_tha(&[], &sidh, Lun, &["asEdDa", "aseDizwa"]); + assert_has_mip(&[], &sidh, Lun, &["asEtsam", "aseDizam"]); + assert_has_vas(&[], &sidh, Lun, &["asEtsva", "aseDizva"]); + assert_has_mas(&[], &sidh, Lun, &["asEtsma", "aseDizma"]); + + let khaad = d("KAdf~", Bhvadi); + assert_has_tip(&[], &khaad, Lat, &["KAdati"]); + assert_has_tip(&[], &khaad, Lit, &["caKAda"]); + + let khad = d("Kada~", Bhvadi); + assert_has_tip(&[], &khad, Lat, &["Kadati"]); +} + +#[test] +fn sk_2282() { + let khad = d("Kada~", Bhvadi); + assert_has_tip(&[], &khad, Lit, &["caKAda"]); +} + +#[test] +fn sk_2283() { + let khad = d("Kada~", Bhvadi); + assert_has_mip(&[], &khad, Lit, &["caKAda", "caKada"]); +} + +#[test] +fn sk_2284() { + let khad = d("Kada~", Bhvadi); + assert_has_tip(&[], &khad, Lun, &["aKAdIt", "aKadIt"]); + + let bad = d("bada~", Bhvadi); + assert_has_tip(&[], &bad, Lat, &["badati"]); + assert_has_tip(&[], &bad, Lit, &["babAda"]); + assert_has_tas(&[], &bad, Lit, &["bedatuH"]); + assert_has_sip(&[], &bad, Lit, &["bediTa"]); + assert_has_mip(&[], &bad, Lit, &["babAda", "babada"]); + assert_has_tip(&[], &bad, Lun, &["abAdIt", "abadIt"]); + + let gad = d("gada~", Bhvadi); + assert_has_tip(&[], &gad, Lat, &["gadati"]); +} + +#[test] +fn sk_2285() { + let gad = d("gada~", Bhvadi); + assert_has_tip(&["pra", "ni"], &gad, Lat, &["praRigadati"]); + assert_has_tip(&[], &gad, Lit, &["jagAda"]); + + let rad = d("rada~", Bhvadi); + assert_has_tip(&[], &rad, Lit, &["rarAda"]); + assert_has_tas(&[], &rad, Lit, &["redatuH"]); +} + +#[test] +fn skip_sk_2286() {} + +#[test] +fn sk_2287() { + let nad = d("Rada~", Bhvadi); + assert_has_tip(&["pra"], &nad, Lat, &["praRadati"]); + assert_has_tip(&["pra", "ni"], &nad, Lat, &["praRinadati"]); +} + +#[test] +fn sk_2288() { + let ard = d("arda~", Bhvadi); + assert_has_tip(&[], &ard, Lit, &["Anarda"]); + assert_has_tip(&[], &ard, Lun, &["ArdIt"]); + + let nard = d("narda~", Bhvadi); + assert_has_tip(&["pra"], &nard, Lat, &["pranardati"]); + + let gard = d("garda~", Bhvadi); + assert_has_tip(&[], &gard, Lat, &["gardati"]); + assert_has_tip(&[], &gard, Lit, &["jagarda"]); + + let tard = d("tarda~", Bhvadi); + assert_has_tip(&[], &tard, Lat, &["tardati"]); + + let kard = d("karda~", Bhvadi); + assert_has_tip(&[], &kard, Lat, &["kardati"]); + + let khard = d("Karda~", Bhvadi); + assert_has_tip(&[], &khard, Lat, &["Kardati"]); + assert_has_tip(&[], &khard, Lit, &["caKarda"]); + + let ant = d("ati~", Bhvadi); + assert_has_tip(&[], &ant, Lat, &["antati"]); + assert_has_tip(&[], &ant, Lit, &["Ananta"]); + + let and = d("adi~", Bhvadi); + assert_has_tip(&[], &and, Lat, &["andati"]); + assert_has_tip(&[], &and, Lit, &["Ananda"]); + + let ind = d("idi~", Bhvadi); + assert_has_tip(&[], &ind, Lat, &["indati"]); + assert_has_tip(&[], &ind, Lit, &["indAYcakAra", "indAmbaBUva", "indAmAsa"]); + + let bind = d("bidi~", Bhvadi); + assert_has_tip(&[], &bind, Lat, &["bindati"]); + + let gand = d("gaqi~", Bhvadi); + assert_has_tip(&[], &gand, Lat, &["gaRqati"]); + + let nind = d("Ridi~", Bhvadi); + assert_has_tip(&[], &nind, Lat, &["nindati"]); + assert_has_tip(&["pra"], &nind, Lat, &["praRindati"]); +} + +#[test] +fn sk_2289() { + let nand = d("wunadi~", Bhvadi); + assert_has_tip(&[], &nand, Lat, &["nandati"]); + assert_has_tip(&[], &nand, AshirLin, &["nandyAt"]); + + let cand = d("cadi~", Bhvadi); + assert_has_tip(&[], &cand, Lit, &["cacanda"]); + + let trand = d("tradi~", Bhvadi); + assert_has_tip(&[], &trand, Lit, &["tatranda"]); + + let kand = d("kadi~", Bhvadi); + assert_has_tip(&[], &kand, Lit, &["cakanda"]); + + let krand = d("kradi~", Bhvadi); + assert_has_tip(&[], &krand, Lit, &["cakranda"]); + + let kland = d("kladi~", Bhvadi); + assert_has_tip(&[], &kland, Lit, &["caklanda"]); + + let klind = d("klidi~", Bhvadi); + assert_has_tip(&[], &klind, Lit, &["ciklinda"]); + + let shund = d("SunDa~", Bhvadi); + assert_has_tip(&[], &shund, Lit, &["SuSunDa"]); + assert_has_tip(&[], &shund, AshirLin, &["SuDyAt"]); + + let shik = d("SIkf~\\", Bhvadi); + assert_has_ta(&[], &shik, Lat, &["SIkate"]); + assert_has_ta(&[], &shik, Lit, &["SiSIke"]); + + let lok = d("lokf~\\", Bhvadi); + assert_has_ta(&[], &lok, Lat, &["lokate"]); + assert_has_ta(&[], &lok, Lit, &["luloke"]); + + let shlok = d("Slokf~\\", Bhvadi); + assert_has_ta(&[], &shlok, Lat, &["Slokate"]); + + let drek = d("drekf~\\", Bhvadi); + assert_has_ta(&[], &drek, Lit, &["didreke"]); + + let dhrek = d("Drekf~\\", Bhvadi); + assert_has_ta(&[], &dhrek, Lit, &["diDreke"]); + + let rek = d("rekf~\\", Bhvadi); + assert_has_ta(&[], &rek, Lat, &["rekate"]); + + let sek = d("sekf~\\", Bhvadi); + assert_has_ta(&[], &sek, Lit, &["siseke"]); + + let shak = d("Saki~\\", Bhvadi); + assert_has_ta(&[], &shak, Lat, &["SaNkate"]); + assert_has_ta(&[], &shak, Lit, &["SaSaNke"]); + + let ak = d("aki~\\", Bhvadi); + assert_has_ta(&[], &ak, Lat, &["aNkate"]); + assert_has_ta(&[], &ak, Lit, &["AnaNke"]); + + let vank = d("vaki~\\", Bhvadi); + assert_has_ta(&[], &vank, Lat, &["vaNkate"]); + + let mank = d("maki~\\", Bhvadi); + assert_has_ta(&[], &mank, Lat, &["maNkate"]); + + let kak = d("kaka~\\", Bhvadi); + assert_has_ta(&[], &kak, Lat, &["kakate"]); + assert_has_ta(&[], &kak, Lit, &["cakake"]); + + let kuk = d("kuka~\\", Bhvadi); + assert_has_ta(&[], &kuk, Lat, &["kokate"]); + assert_has_ta(&[], &kuk, Lit, &["cukuke"]); + + let vfk = d("vfka~\\", Bhvadi); + assert_has_ta(&[], &vfk, Lat, &["varkate"]); + assert_has_ta(&[], &vfk, Lit, &["vavfke"]); + + let cak = d("caka~\\", Bhvadi); + assert_has_ta(&[], &cak, Lat, &["cakate"]); + assert_has_ta(&[], &cak, Lit, &["ceke"]); + + let kank = d("kaki~\\", Bhvadi); + assert_has_ta(&[], &kank, Lat, &["kaNkate"]); + + let dhauk = d("QOkf~\\", Bhvadi); + assert_has_ta(&[], &dhauk, Lit, &["quQOke"]); + + let trauk = d("trOkf~\\", Bhvadi); + assert_has_ta(&[], &trauk, Lit, &["tutrOke"]); + + let shvashk = d("zvazka~\\", Bhvadi); + assert_has_ta(&[], &shvashk, Lat, &["zvazkate"]); + assert_has_ta(&[], &shvashk, Lit, &["zazvazke"]); + + let angh = d("aGi~\\", Bhvadi); + assert_has_ta(&[], &angh, Lat, &["aNGate"]); + assert_has_ta(&[], &angh, Lit, &["AnaNGe"]); + + let vangh = d("vaGi~\\", Bhvadi); + assert_has_ta(&[], &vangh, Lat, &["vaNGate"]); + + let mangh = d("maGi~\\", Bhvadi); + assert_has_ta(&[], &mangh, Lat, &["maNGate"]); + + let ragh = d("rAGf~\\", Bhvadi); + assert_has_ta(&[], &ragh, Lat, &["rAGate"]); + + let lagh = d("lAGf~\\", Bhvadi); + assert_has_ta(&[], &lagh, Lat, &["lAGate"]); + + let dragh = d("drAGf~\\", Bhvadi); + assert_has_ta(&[], &dragh, Lat, &["drAGate"]); + + let shlagh = d("SlAGf~\\", Bhvadi); + assert_has_ta(&[], &shlagh, Lat, &["SlAGate"]); + + let phakk = d("Pakka~", Bhvadi); + assert_has_tip(&[], &phakk, Lat, &["Pakkati"]); + assert_has_tip(&[], &phakk, Lit, &["paPakka"]); + + let tak = d("taka~", Bhvadi); + assert_has_tip(&[], &tak, Lat, &["takati"]); + + let tank = d("taki~", Bhvadi); + assert_has_tip(&[], &tank, Lat, &["taNkati"]); + + let bukk = d("bukka~", Bhvadi); + assert_has_tip(&[], &bukk, Lat, &["bukkati"]); + + let kakh = d("kaKa~", Bhvadi); + assert_has_tip(&["pra", "ni"], &kakh, Lat, &["pranikaKati"]); + + let okh = d("oKf~", Bhvadi); + assert_has_tip(&[], &okh, Lat, &["oKati"]); + assert_has_tip(&[], &okh, Lit, &["oKAYcakAra", "oKAmbaBUva", "oKAmAsa"]); + + let shakh = d("SAKf~", Bhvadi); + assert_has_tip(&[], &shakh, Lat, &["SAKati"]); +} + +#[test] +fn sk_2290() { + let ukh = d("uKa~", Bhvadi); + assert_has_tip(&[], &ukh, Lit, &["uvoKa"]); + assert_has_tas(&[], &ukh, Lit, &["UKatuH"]); + assert_has_jhi(&[], &ukh, Lit, &["UKuH"]); + + let unkh = d("uKi~", Bhvadi); + assert_has_tip(&[], &unkh, Lat, &["uNKati"]); + + let vakh = d("vaKa~", Bhvadi); + assert_has_tas(&[], &vakh, Lit, &["vavaKatuH"]); + + let vankh = d("vaKi~", Bhvadi); + assert_has_tip(&[], &vankh, Lat, &["vaNKati"]); + + let makh = d("maKa~", Bhvadi); + assert_has_tas(&[], &makh, Lit, &["meKatuH"]); + + let yung = d("yugi~", Bhvadi); + assert_has_tip(&[], &yung, Lat, &["yuNgati"]); + + let ghagh = d("GaGa~", Bhvadi); + assert_has_tip(&[], &ghagh, Lat, &["GaGati"]); + assert_has_tip(&[], &ghagh, Lit, &["jaGAGa"]); + + let mangh = d("maGi~", Bhvadi); + assert_has_tip(&[], &mangh, Lat, &["maNGati"]); + + let shingh = d("SiGi~", Bhvadi); + assert_has_tip(&[], &shingh, Lat, &["SiNGati"]); + + let varc = d("varca~\\", Bhvadi); + assert_has_ta(&[], &varc, Lat, &["varcate"]); + + let sac = d("zaca~\\", Bhvadi); + assert_has_ta(&[], &sac, Lat, &["sacate"]); + assert_has_ta(&[], &sac, Lit, &["sece"]); + assert_has_ta(&[], &sac, Lut, &["sacitA"]); + + let loc = d("locf~\\", Bhvadi); + assert_has_ta(&[], &loc, Lat, &["locate"]); + assert_has_ta(&[], &loc, Lit, &["luloce"]); + + let shac = d("Saca~\\", Bhvadi); + assert_has_ta(&[], &shac, Lit, &["Sece"]); + + let shvac = d("Svaca~\\", Bhvadi); + assert_has_ta(&[], &shvac, Lat, &["Svacate"]); + + let shvanc = d("Svaci~\\", Bhvadi); + assert_has_ta(&[], &shvanc, Lat, &["SvaYcate"]); + + let kac = d("kaca~\\", Bhvadi); + assert_has_ta(&[], &kac, Lat, &["kacate"]); + + let kanc = d("kaci~\\", Bhvadi); + assert_has_ta(&[], &kanc, Lit, &["cakaYce"]); + + let kanc = d("kAci~\\", Bhvadi); + assert_has_ta(&[], &kanc, Lit, &["cakAYce"]); + + let mac = d("maca~\\", Bhvadi); + assert_has_ta(&[], &mac, Lit, &["mece"]); + + let munc = d("muci~\\", Bhvadi); + assert_has_ta(&[], &munc, Lit, &["mumuYce"]); + + let manc = d("maci~\\", Bhvadi); + assert_has_ta(&[], &manc, Lit, &["mamaYce"]); + + let panc = d("paci~\\", Bhvadi); + assert_has_ta(&[], &panc, Lat, &["paYcate"]); + + let stuc = d("zwuca~\\", Bhvadi); + assert_has_ta(&[], &stuc, Lat, &["stocate"]); + assert_has_ta(&[], &stuc, Lit, &["tuzwuce"]); + + let fj = d("fja~\\", Bhvadi); + assert_has_ta(&[], &fj, Lat, &["arjate"]); + assert_has_ta(&[], &fj, Lit, &["Anfje"]); + + let fnj = d("fji~\\", Bhvadi); + assert_has_ta(&[], &fnj, Lat, &["fYjate"]); + assert_has_ta(&["pra"], &fnj, Lat, &["prArYjate"]); + assert_has_ta(&[], &fnj, Lit, &["fYjAYcakre", "fYjAmbaBUva", "fYjAmAsa"]); + assert_has_ta(&[], &fnj, Lun, &["ArYjizwa"]); + + // TODO: SK has baBfjje, which seems like a typo. + let bhrnj = d("BfjI~\\", Bhvadi); + assert_has_ta(&[], &bhrnj, Lat, &["Barjate"]); + assert_has_ta(&[], &bhrnj, Lit, &["baBfje"]); + assert_has_ta(&[], &bhrnj, Lun, &["aBarjizwa"]); + + let ej = d("ejf~\\", Bhvadi); + assert_has_ta(&[], &ej, Lit, &["ejAYcakre", "ejAmbaBUva", "ejAmAsa"]); + + let ij = d("Ija~\\", Bhvadi); + assert_has_ta(&[], &ij, Lit, &["IjAYcakre", "IjAmbaBUva", "IjAmAsa"]); + + let shuc = d("Suca~", Bhvadi); + assert_has_tip(&[], &shuc, Lat, &["Socati"]); + + let kuc = d("kuca~", Bhvadi); + assert_has_tip(&[], &kuc, Lat, &["kocati"]); + + let kunc = d("kunca~", Bhvadi); + assert_has_tip(&[], &kunc, AshirLin, &["kucyAt"]); + + let krunc = d("krunca~", Bhvadi); + assert_has_tip(&[], &krunc, AshirLin, &["krucyAt"]); + + let lunc = d("lunca~", Bhvadi); + assert_has_tip(&[], &lunc, AshirLin, &["lucyAt"]); + + let anc = d("ancu~", Bhvadi); + assert_has_tip(&[], &anc, AshirLin, &["acyAt", "aYcyAt"]); + + let vanc = d("vancu~", Bhvadi); + assert_has_tip(&[], &vanc, AshirLin, &["vacyAt"]); + + let canc = d("cancu~", Bhvadi); + assert_has_tip(&[], &canc, AshirLin, &["cacyAt"]); + + let tanc = d("tancu~", Bhvadi); + assert_has_tip(&[], &tanc, AshirLin, &["tacyAt"]); + + let tvanc = d("tvancu~", Bhvadi); + assert_has_tip(&[], &tvanc, AshirLin, &["tvacyAt"]); + + let mrunc = d("mruncu~", Bhvadi); + assert_has_tip(&[], &mrunc, AshirLin, &["mrucyAt"]); + assert_has_tip(&[], &mrunc, Lun, &["amruYcIt"]); + + let mlunc = d("mluncu~", Bhvadi); + assert_has_tip(&[], &mlunc, Lun, &["amluYcIt"]); +} + +#[test] +fn sk_2291() { + let mruc = d("mrucu~", Bhvadi); + assert_has_tip(&[], &mruc, Lun, &["amrucat", "amrocIt"]); + + let mluc = d("mlucu~", Bhvadi); + assert_has_tip(&[], &mluc, Lun, &["amlucat", "amlocIt"]); + + // TODO: SK has agrocat? + let gruc = d("grucu~", Bhvadi); + assert_has_tip(&[], &gruc, Lit, &["jugroca"]); + assert_has_tip(&[], &gruc, Lun, &["agrucat", "agrocIt"]); + + let gluc = d("glucu~", Bhvadi); + assert_has_tip(&[], &gluc, Lit, &["jugloca"]); + assert_has_tip(&[], &gluc, Lun, &["aglucat", "aglocIt"]); + + let kuj = d("kuju~", Bhvadi); + assert_has_tip(&[], &kuj, Lun, &["akojIt"]); + + let khuj = d("Kuju~", Bhvadi); + assert_has_tip(&[], &khuj, Lun, &["aKojIt"]); + + let glunc = d("gluncu~", Bhvadi); + assert_has_tip(&[], &glunc, Lun, &["aglucat", "agluYcIt"]); + + let sasj = d("zasja~", Bhvadi); + assert_has_tip(&[], &sasj, Lat, &["sajjati"]); + assert_has_ta(&[], &sasj, Lat, &["sajjate"]); + + let gunj = d("guji~", Bhvadi); + assert_has_tip(&[], &gunj, Lat, &["guYjati"]); + assert_has_tip(&[], &gunj, AshirLin, &["guYjyAt"]); + + let arc = d("arca~", Bhvadi); + assert_has_tip(&[], &arc, Lit, &["Anarca"]); + + let mlech = d("mleCa~", Bhvadi); + assert_has_tip(&[], &mlech, Lat, &["mlecCati"]); + assert_has_tip(&[], &mlech, Lit, &["mimlecCa"]); + + let lach = d("laCa~", Bhvadi); + assert_has_tip(&[], &lach, Lit, &["lalacCa"]); + + let lanch = d("lACi~", Bhvadi); + assert_has_tip(&[], &lanch, Lit, &["lalAYCa"]); + + let vanch = d("vACi~", Bhvadi); + assert_has_tip(&[], &vanch, Lat, &["vAYCati"]); + + let anch = d("ACi~", Bhvadi); + assert_has_tip(&[], &anch, Lat, &["AYCati"]); + assert_has_tip(&[], &anch, Lit, &["AYCa", "AnAYCa"]); + + let hrich = d("hrICa~", Bhvadi); + assert_has_tip(&[], &hrich, Lit, &["jihrIcCa"]); + + let hurch = d("hurCA~", Bhvadi); + assert_has_tip(&[], &hurch, Lat, &["hUrCati"]); + + let murch = d("murCA~", Bhvadi); + assert_has_tip(&[], &murch, Lat, &["mUrCati"]); + + let sphurch = d("sPurCA~", Bhvadi); + assert_has_tip(&[], &sphurch, Lat, &["sPUrCati"]); + + let yuch = d("yuCa~", Bhvadi); + assert_has_tip(&[], &yuch, Lat, &["yucCati"]); + + let unch = d("uCi~", Bhvadi); + assert_has_tip(&[], &unch, Lat, &["uYCati"]); + assert_has_tip(&[], &unch, Lit, &["uYCAYcakAra", "uYCAmbaBUva", "uYCAmAsa"]); + + let uch = d("uCI~", Bhvadi); + assert_has_tip(&["vi"], &uch, Lat, &["vyucCati"]); + + let dhraj = d("Draja~", Bhvadi); + assert_has_tip(&[], &dhraj, Lat, &["Drajati"]); + + let dhranj = d("Draji~", Bhvadi); + assert_has_tip(&[], &dhranj, Lat, &["DraYjati"]); + + let dhfj = d("Dfja~", Bhvadi); + assert_has_tip(&[], &dhfj, Lat, &["Darjati"]); + + let dhrnj = d("Dfji~", Bhvadi); + assert_has_tip(&[], &dhrnj, Lat, &["DfYjati"]); + + let dhvaj = d("Dvaja~", Bhvadi); + assert_has_tip(&[], &dhvaj, Lat, &["Dvajati"]); + + let dhvanj = d("Dvaji~", Bhvadi); + assert_has_tip(&[], &dhvanj, Lat, &["DvaYjati"]); + + let kuj = d("kUja~", Bhvadi); + assert_has_tip(&[], &kuj, Lit, &["cukUja"]); + + let arj = d("arja~", Bhvadi); + assert_has_tip(&[], &arj, Lat, &["arjati"]); + assert_has_tip(&[], &arj, Lit, &["Anarja"]); + + let sarj = d("zarja~", Bhvadi); + assert_has_tip(&[], &sarj, Lat, &["sarjati"]); + assert_has_tip(&[], &sarj, Lit, &["sasarja"]); + + let garj = d("garja~", Bhvadi); + assert_has_tip(&[], &garj, Lat, &["garjati"]); + + let tarj = d("tarja~", Bhvadi); + assert_has_tip(&[], &tarj, Lat, &["tarjati"]); + + let karj = d("karja~", Bhvadi); + assert_has_tip(&[], &karj, Lit, &["cakarja"]); + + let kharj = d("Karja~", Bhvadi); + assert_has_tip(&[], &kharj, Lit, &["caKarja"]); + + let aj = d("aja~", Bhvadi); + assert_has_tip(&[], &aj, Lat, &["ajati"]); +} + +#[test] +fn sk_2292() { + let aj = d("aja~", Bhvadi); + assert_has_tip(&[], &aj, Lit, &["vivAya"]); + assert_has_tas(&[], &aj, Lit, &["vivyatuH"]); + assert_has_jhi(&[], &aj, Lit, &["vivyuH"]); +} + +#[test] +fn skip_sk_2293_to_sk_2295() {} + +#[test] +fn sk_2296() { + // Ajiva and Ajima are justified. + let aj = d("aja~", Bhvadi); + assert_has_sip(&[], &aj, Lit, &["vivayiTa", "viveTa", "AjiTa"]); + assert_has_thas(&[], &aj, Lit, &["vivyaTuH"]); + assert_has_tha(&[], &aj, Lit, &["vivya"]); + assert_has_mip(&[], &aj, Lit, &["vivAya", "vivaya"]); + assert_has_vas(&[], &aj, Lit, &["vivyiva", "Ajiva"]); + assert_has_mas(&[], &aj, Lit, &["vivyima", "Ajima"]); + + assert_has_tip(&[], &aj, Lut, &["vetA", "ajitA"]); + assert_has_tip(&[], &aj, Lrt, &["vezyati", "ajizyati"]); + assert_has_tip(&[], &aj, Lot, &["ajatu", "ajatAt"]); + assert_has_tip(&[], &aj, Lan, &["Ajat"]); + assert_has_tip(&[], &aj, VidhiLin, &["ajet"]); + assert_has_tip(&[], &aj, AshirLin, &["vIyAt"]); +} + +#[test] +fn sk_2297() { + let aj = d("aja~", Bhvadi); + assert_has_tip(&[], &aj, Lun, &["avEzIt", "AjIt"]); + assert_has_tip(&[], &aj, Lrn, &["avezyat", "Ajizyat"]); + + let tej = d("teja~", Bhvadi); + assert_has_tip(&[], &tej, Lat, &["tejati"]); + + let khaj = d("Kaja~", Bhvadi); + assert_has_tip(&[], &khaj, Lat, &["Kajati"]); + + let khanj = d("Kaji~", Bhvadi); + assert_has_tip(&[], &khanj, Lat, &["KaYjati"]); + + let ej = d("ejf~", Bhvadi); + assert_has_tip(&[], &ej, Lit, &["ejAYcakAra", "ejAmbaBUva", "ejAmAsa"]); + + let sphurj = d("wuo~sPUrjA~", Bhvadi); + assert_has_tip(&[], &sphurj, Lat, &["sPUrjati"]); + assert_has_tip(&[], &sphurj, Lit, &["pusPUrja"]); + + let kzi = d("kzi\\", Bhvadi); + assert_has_tip(&[], &kzi, Lat, &["kzayati"]); + assert_has_tip(&[], &kzi, Lit, &["cikzAya"]); + assert_has_tas(&[], &kzi, Lit, &["cikziyatuH"]); + assert_has_jhi(&[], &kzi, Lit, &["cikziyuH"]); + assert_has_sip(&[], &kzi, Lit, &["cikzayiTa", "cikzeTa"]); + assert_has_vas(&[], &kzi, Lit, &["cikziyiva"]); + assert_has_mas(&[], &kzi, Lit, &["cikziyima"]); + assert_has_tip(&[], &kzi, Lut, &["kzetA"]); +} + +#[test] +fn sk_2298() { + let kshi = d("kzi\\", Bhvadi); + assert_has_tip(&[], &kshi, AshirLin, &["kzIyAt"]); + assert_has_tip(&[], &kshi, Lun, &["akzEzIt"]); + + let kshij = d("kzIja~", Bhvadi); + assert_has_tip(&[], &kshij, Lit, &["cikzIja"]); + + let tuj = d("tuja~", Bhvadi); + assert_has_tip(&[], &tuj, Lat, &["tojati"]); + assert_has_tip(&[], &tuj, Lit, &["tutoja"]); + + let vraj = d("vraja~", Bhvadi); + assert_has_tip(&[], &vraj, Lun, &["avrAjIt"]); + + let att = d("awwa~\\", Bhvadi); + assert_has_ta(&[], &att, Lat, &["awwate"]); + assert_has_ta(&[], &att, Lit, &["Anawwe"]); + + // TODO: SK has vivezwa? + let vesht = d("vezwa~\\", Bhvadi); + assert_has_ta(&[], &vesht, Lit, &["vivezwe"]); + + let cesht = d("cezwa~\\", Bhvadi); + assert_has_ta(&[], &cesht, Lun, &["acezwizwa"]); + + let gosht = d("gozwa~\\", Bhvadi); + assert_has_ta(&[], &gosht, Lit, &["jugozwe"]); + + let losht = d("lozwa~\\", Bhvadi); + assert_has_ta(&[], &losht, Lit, &["lulozwe"]); + + let ghatt = d("Gawwa~\\", Bhvadi); + assert_has_ta(&[], &ghatt, Lit, &["jaGawwe"]); + + let at = d("aWi~\\", Bhvadi); + assert_has_ta(&[], &at, Lat, &["aRWate"]); + assert_has_ta(&[], &at, Lit, &["AnaRWe"]); + + let vanth = d("vaWi~\\", Bhvadi); + assert_has_ta(&[], &vanth, Lit, &["vavaRWe"]); + + let manth = d("maWi~\\", Bhvadi); + assert_has_ta(&[], &manth, Lat, &["maRWate"]); + + let kanth = d("kaWi~\\", Bhvadi); + assert_has_ta(&[], &kanth, Lat, &["kaRWate"]); + + let munth = d("muWi~\\", Bhvadi); + assert_has_ta(&[], &munth, Lat, &["muRWate"]); + + let heth = d("heWa~\\", Bhvadi); + assert_has_ta(&[], &heth, Lit, &["jiheWe"]); + + let eth = d("eWa~\\", Bhvadi); + assert_has_ta(&[], ð, Lit, &["eWAYcakre", "eWAmbaBUva", "eWAmAsa"]); + + let hind = d("hiqi~\\", Bhvadi); + assert_has_ta(&[], &hind, Lat, &["hiRqate"]); + assert_has_ta(&[], &hind, Lit, &["jihiRqe"]); + + let hund = d("huqi~\\", Bhvadi); + assert_has_ta(&[], &hund, Lit, &["juhuRqe"]); + + let kund = d("kuqi~\\", Bhvadi); + assert_has_ta(&[], &kund, Lit, &["cukuRqe"]); + + let vand = d("vaqi~\\", Bhvadi); + assert_has_ta(&[], &vand, Lit, &["vavaRqe"]); + + let bhand = d("Baqi~\\", Bhvadi); + assert_has_ta(&[], &bhand, Lit, &["baBaRqe"]); + + let pind = d("piqi~\\", Bhvadi); + assert_has_ta(&[], &pind, Lit, &["pipiRqe"]); + + let mund = d("muqi~\\", Bhvadi); + assert_has_ta(&[], &mund, Lat, &["muRqate"]); + + let tund = d("tuqi~\\", Bhvadi); + assert_has_ta(&[], &tund, Lat, &["tuRqate"]); + + let hund = d("huqi~\\", Bhvadi); + assert_has_ta(&[], &hund, Lat, &["huRqate"]); + + let cand = d("caqi~\\", Bhvadi); + assert_has_ta(&[], &cand, Lat, &["caRqate"]); + + let shand = d("Saqi~\\", Bhvadi); + assert_has_ta(&[], &shand, Lat, &["SaRqate"]); + + let tand = d("taqi~\\", Bhvadi); + assert_has_ta(&[], &tand, Lat, &["taRqate"]); + + let pand = d("paqi~\\", Bhvadi); + assert_has_ta(&[], &pand, Lat, &["paRqate"]); + + let kand = d("kaqi~\\", Bhvadi); + assert_has_ta(&[], &kand, Lat, &["kaRqate"]); + + let hed = d("heqf~\\", Bhvadi); + assert_has_ta(&[], &hed, Lit, &["jiheqe"]); + + let hod = d("hoqf~\\", Bhvadi); + assert_has_ta(&[], &hod, Lit, &["juhoqe"]); + + let bad = d("bAqf~\\", Bhvadi); + assert_has_ta(&[], &bad, Lat, &["bAqate"]); + + let drad = d("drAqf~\\", Bhvadi); + assert_has_ta(&[], &drad, Lat, &["drAqate"]); + + let dhrad = d("DrAqf~\\", Bhvadi); + assert_has_ta(&[], &dhrad, Lat, &["DrAqate"]); + + let shad = d("SAqf~\\", Bhvadi); + assert_has_ta(&[], &shad, Lat, &["SAqate"]); + + let shaut = d("SOwf~", Bhvadi); + assert_has_tip(&[], &shaut, Lat, &["SOwati"]); + assert_has_tip(&[], &shaut, Lit, &["SuSOwa"]); + + let yaut = d("yOwf~", Bhvadi); + assert_has_tip(&[], &yaut, Lat, &["yOwati"]); + + // TODO: SK has mleqati? + let mlet = d("mlewf~", Bhvadi); + assert_has_tip(&[], &mlet, Lat, &["mlewati"]); + + let mred = d("mreqf~", Bhvadi); + assert_has_tip(&[], &mred, Lat, &["mreqati"]); + + let kat = d("kawe~", Bhvadi); + assert_has_tip(&[], &kat, Lit, &["cakAwa"]); +} + +#[test] +fn sk_2299() { + let kat = d("kawe~", Bhvadi); + assert_has_tip(&[], &kat, Lun, &["akawIt"]); + + let at = d("awa~", Bhvadi); + assert_has_tip(&[], &at, Lit, &["Awa"]); + assert_has_tas(&[], &at, Lit, &["AwatuH"]); + assert_has_jhi(&[], &at, Lit, &["AwuH"]); + + let pat = d("pawa~", Bhvadi); + assert_has_tip(&[], &pat, Lit, &["papAwa"]); + assert_has_tas(&[], &pat, Lit, &["pewatuH"]); + assert_has_jhi(&[], &pat, Lit, &["pewuH"]); + + let rat = d("rawa~", Bhvadi); + assert_has_tip(&[], &rat, Lit, &["rarAwa"]); + + let lat = d("lawa~", Bhvadi); + assert_has_tip(&[], &lat, Lit, &["lalAwa"]); + + let shat = d("Sawa~", Bhvadi); + assert_has_tip(&[], &shat, Lit, &["SaSAwa"]); + + let vat = d("vawa~", Bhvadi); + assert_has_tip(&[], &vat, Lit, &["vavAwa"]); + assert_has_tas(&[], &vat, Lit, &["vavawatuH"]); + assert_has_jhi(&[], &vat, Lit, &["vavawuH"]); + assert_has_sip(&[], &vat, Lit, &["vavawiTa"]); + + let kit = d("kiwa~", Bhvadi); + assert_has_tip(&[], &kit, Lat, &["kewati"]); + + let khit = d("Kiwa~", Bhvadi); + assert_has_tip(&[], &khit, Lat, &["Kewati"]); + + let shit = d("Siwa~", Bhvadi); + assert_has_tip(&[], &shit, Lat, &["Sewati"]); + assert_has_tip(&[], &shit, Lit, &["SiSewa"]); + + let sit = d("ziwa~", Bhvadi); + assert_has_tip(&[], &sit, Lat, &["sewati"]); + assert_has_tip(&[], &sit, Lit, &["sizewa"]); + + let it = d("iwa~", Bhvadi); + assert_has_tip(&[], &it, Lat, &["ewati"]); + + let kit = d("kiwa~", Bhvadi); + assert_has_tip(&[], &kit, Lat, &["kewati"]); + + let kat = d("kawI~", Bhvadi); + assert_has_tip(&[], &kat, Lat, &["kawati"]); + + // TODO: why are these here? I don't follow. + let i = d("i\\", Bhvadi); + assert_has_tip(&[], &i, Lat, &["ayati"]); + assert_has_tip(&[], &i, Lit, &["iyAya"]); + assert_has_tas(&[], &i, Lit, &["iyatuH"]); + assert_has_jhi(&[], &i, Lit, &["iyuH"]); + assert_has_sip(&[], &i, Lit, &["iyayiTa", "iyeTa"]); + assert_has_mip(&[], &i, Lit, &["iyAya", "iyaya"]); + + let ii = d("I\\", Bhvadi); + assert_has_tip(&[], &ii, Lit, &["ayAYcakAra", "ayAmbaBUva", "ayAmAsa"]); + + let kund = d("kuqi~", Bhvadi); + assert_has_tip(&[], &kund, Lat, &["kuRqati"]); + + let mund = d("muqi~", Bhvadi); + assert_has_tip(&[], &mund, Lat, &["muRqati"]); + + let pund = d("puqi~", Bhvadi); + assert_has_tip(&[], &pund, Lat, &["puRqati"]); + + let runt = d("ruwi~", Bhvadi); + assert_has_tip(&[], &runt, Lat, &["ruRwati"]); + + let lunt = d("luwi~", Bhvadi); + assert_has_tip(&[], &lunt, Lat, &["luRwati"]); + + let sphutir = d("sPuwi~r", Bhvadi); + assert_has_tip(&[], &sphutir, Lun, &["asPuwat", "asPowIt"]); + + let sphuti = d("sPuwi~", Bhvadi); + assert_has_tip(&[], &sphuti, Lat, &["sPuRwati"]); + + let path = d("paWa~", Bhvadi); + assert_has_tas(&[], &path, Lit, &["peWatuH"]); + assert_has_sip(&[], &path, Lit, &["peWiTa"]); + assert_has_tip(&[], &path, Lun, &["apaWIt", "apAWIt"]); + + let vath = d("vaWa~", Bhvadi); + assert_has_tas(&[], &vath, Lit, &["vavaWatuH"]); + assert_has_sip(&[], &vath, Lit, &["vavaWiTa"]); + + let hath = d("haWa~", Bhvadi); + assert_has_tip(&[], &hath, Lat, &["haWati"]); + assert_has_tip(&[], &hath, Lit, &["jahAWa"]); + + let uth = d("uWa~", Bhvadi); + assert_has_tip(&[], &uth, Lat, &["oWati"]); + + let uuth = d("UWa~", Bhvadi); + assert_has_tip(&[], &uuth, Lat, &["UWati"]); + assert_has_tip(&[], &uuth, Lit, &["UWAYcakAra", "UWAmbaBUva", "UWAmAsa"]); + + let shuth = d("SuWa~", Bhvadi); + assert_has_tip(&[], &shuth, Lat, &["SoWati"]); + + // TODO: how is this justified? SK doesn't mention SuWi. + let shunth = d("SuWi~", Bhvadi); + assert_has_tip(&[], &shunth, Lat, &["SuRWati"]); + + let kunth = d("kuWi~", Bhvadi); + assert_has_tip(&[], &kunth, Lat, &["kuRWati"]); + + let cudd = d("cuqqa~", Bhvadi); + assert_has_tip(&[], &cudd, Lat, &["cuqqati"]); + assert_has_tip(&[], &cudd, Lit, &["cucuqqa"]); + + let add = d("aqqa~", Bhvadi); + assert_has_tip(&[], &add, Lat, &["aqqati"]); + assert_has_tip(&[], &add, Lit, &["Anaqqa"]); + + let kadd = d("kaqqa~", Bhvadi); + assert_has_tip(&[], &kadd, Lat, &["kaqqati"]); + + let krid = d("krIqf~", Bhvadi); + assert_has_tip(&[], &krid, Lit, &["cikrIqa"]); + + let tud = d("tuqf~", Bhvadi); + assert_has_tip(&[], &tud, Lat, &["toqati"]); + assert_has_tip(&[], &tud, Lit, &["tutoqa"]); + + let hud = d("huqf~", Bhvadi); + assert_has_tip(&[], &hud, AshirLin, &["huqyAt"]); + + let huud = d("hUqf~", Bhvadi); + assert_has_tip(&[], &huud, AshirLin, &["hUqyAt"]); + + let hod = d("hoqf~", Bhvadi); + assert_has_tip(&[], &hod, AshirLin, &["hoqyAt"]); + + let ad = d("aqa~", Bhvadi); + assert_has_tip(&[], &ad, Lat, &["aqati"]); + assert_has_tip(&[], &ad, Lit, &["Aqa"]); + assert_has_tas(&[], &ad, Lit, &["AqatuH"]); + assert_has_jhi(&[], &ad, Lit, &["AquH"]); + + let lad = d("laqa~", Bhvadi); + assert_has_tip(&[], &lad, Lat, &["laqati"]); + + let kad = d("kaqa~", Bhvadi); + assert_has_tip(&[], &kad, Lat, &["kaqati"]); + + let kand = d("kaqi~", Bhvadi); + assert_has_tip(&[], &kand, Lat, &["kaRqati"]); + + let gand = d("gaqi~", Bhvadi); + assert_has_tip(&[], &gand, Lat, &["gaRqati"]); + + let tip = d("ti\\pf~\\", Bhvadi); + assert_has_ta(&[], &tip, Lat, &["tepate"]); + assert_has_ta(&[], &tip, Lit, &["titipe"]); + assert_has_thaas(&[], &tip, Lit, &["titipize"]); + assert_has_ta(&[], &tip, Lut, &["teptA"]); + assert_has_ta(&[], &tip, Lrt, &["tepsyate"]); +} + +#[test] +fn sk_2300() { + let tip = d("ti\\pf~\\", Bhvadi); + assert_has_ta(&[], &tip, AshirLin, &["tipsIzwa"]); + assert_has_aataam(&[], &tip, AshirLin, &["tipsIyAstAm"]); + assert_has_jha(&[], &tip, AshirLin, &["tipsIran"]); + assert_has_ta(&[], &tip, Lun, &["atipta"]); + assert_has_aataam(&[], &tip, Lun, &["atipsAtAm"]); + assert_has_jha(&[], &tip, Lun, &["atipsata"]); + + let tep = d("tepf~\\", Bhvadi); + assert_has_ta(&[], &tep, Lat, &["tepate"]); + assert_has_ta(&[], &tep, Lit, &["titepe"]); + + let stip = d("zwipf~\\", Bhvadi); + assert_has_ta(&[], &stip, Lit, &["tizwipe"]); + assert_has_aataam(&[], &stip, Lit, &["tizwipAte"]); + assert_has_jha(&[], &stip, Lit, &["tizwipire"]); + + let step = d("zwepf~\\", Bhvadi); + assert_has_ta(&[], &step, Lit, &["tizwepe"]); + assert_has_aataam(&[], &step, Lit, &["tizwepAte"]); + assert_has_jha(&[], &step, Lit, &["tizwepire"]); + + let glep = d("glepf~\\", Bhvadi); + assert_has_ta(&[], &glep, Lat, &["glepate"]); + + let vep = d("wuvepf~\\", Bhvadi); + assert_has_ta(&[], &vep, Lat, &["vepate"]); + + let trap = d("trapU~\\z", Bhvadi); + assert_has_ta(&[], &trap, Lat, &["trapate"]); +} + +#[test] +fn sk_2301() { + let trap = d("trapU~\\z", Bhvadi); + assert_has_ta(&[], &trap, Lit, &["trepe"]); + assert_has_aataam(&[], &trap, Lit, &["trepAte"]); + assert_has_jha(&[], &trap, Lit, &["trepire"]); + + assert_has_ta(&[], &trap, Lut, &["trapitA", "traptA"]); + assert_has_ta(&[], &trap, AshirLin, &["trapizIzwa", "trapsIzwa"]); + + let kamp = d("kapi~\\", Bhvadi); + assert_has_ta(&[], &kamp, Lat, &["kampate"]); + assert_has_ta(&[], &kamp, Lit, &["cakampe"]); + + let ramb = d("rabi~\\", Bhvadi); + assert_has_ta(&[], &ramb, Lit, &["rarambe"]); + + let lamb = d("labi~\\", Bhvadi); + assert_has_ta(&[], &lamb, Lit, &["lalambe"]); + + let amb = d("abi~\\", Bhvadi); + assert_has_ta(&[], &amb, Lit, &["Anambe"]); + + let kab = d("kabf~\\", Bhvadi); + assert_has_ta(&[], &kab, Lit, &["cakabe"]); + + let klib = d("klIbf~\\", Bhvadi); + assert_has_ta(&[], &klib, Lit, &["ciklIbe"]); + + let kshib = d("kzIbf~\\", Bhvadi); + assert_has_ta(&[], &kshib, Lat, &["kzIbate"]); + + let shib = d("SIBf~\\", Bhvadi); + assert_has_ta(&[], &shib, Lat, &["SIBate"]); + + let rebh = d("reBf~\\", Bhvadi); + assert_has_ta(&[], &rebh, Lit, &["rireBe"]); + + let ambh = d("aBi~\\", Bhvadi); + assert_has_ta(&[], &ambh, Lat, &["amBate"]); + + let rambh = d("raBi~\\", Bhvadi); + assert_has_ta(&[], &rambh, Lat, &["ramBate"]); + + let stambh = d("zwaBi~\\", Bhvadi); + assert_has_ta(&[], &stambh, Lat, &["stamBate"]); + assert_has_ta(&["ud"], &stambh, Lat, &["uttamBate", "utttamBate"]); + assert_has_ta(&["vi"], &stambh, Lat, &["vistamBate"]); + + // TODO: zwamBate, wazwamBe +} + +#[test] +fn sk_2302() { + // TODO: SK has jamBizwa? + let jambh = d("jaBI~\\", Bhvadi); + assert_has_ta(&[], &jambh, Lat, &["jamBate"]); + assert_has_ta(&[], &jambh, Lit, &["jajamBe"]); + assert_has_ta(&[], &jambh, Lut, &["jamBitA"]); + assert_has_ta(&[], &jambh, Lun, &["ajamBizwa"]); + + let jrmbh = d("jfBi~\\", Bhvadi); + assert_has_ta(&[], &jrmbh, Lat, &["jfmBate"]); + assert_has_ta(&[], &jrmbh, Lit, &["jajfmBe"]); + + let shalbh = d("SalBa~\\", Bhvadi); + assert_has_ta(&[], &shalbh, Lit, &["SaSalBe"]); + + let valbh = d("valBa~\\", Bhvadi); + assert_has_ta(&[], &valbh, Lit, &["vavalBe"]); + + let galbh = d("galBa~\\", Bhvadi); + assert_has_ta(&[], &galbh, Lat, &["galBate"]); + + let shranb = d("SranBu~\\", Bhvadi); + assert_has_ta(&[], &shranb, Lat, &["SramBate"]); + + let sranbh = d("sranBu~\\", Bhvadi); + assert_has_ta(&[], &sranbh, Lat, &["sramBate"]); + + let stubh = d("zwuBu~\\", Bhvadi); + assert_has_ta(&[], &stubh, Lat, &["stoBate"]); + assert_has_ta(&["vi"], &stubh, Lat, &["vizwoBate"]); + assert_has_ta(&[], &stubh, Lit, &["tuzwuBe"]); + assert_has_ta(&["vi"], &stubh, Lun, &["vyazwoBizwa"]); +} + +#[test] +fn skip_sk_2303() {} + +#[test] +fn sk_2304() { + let gup = d("gupU~", Bhvadi); + assert_has_tip(&[], &gup, Lat, &["gopAyati"]); +} + +#[test] +fn skip_sk_2305_to_sk_2307() {} + +#[test] +fn sk_2308() { + let gupu = d("gupU~", Bhvadi); + assert_has_tip( + &[], + &gupu, + Lit, + &["jugopa", "gopAyAYcakAra", "gopAyAmbaBUva", "gopAyAmAsa"], + ); + assert_has_tas( + &[], + &gupu, + Lit, + &[ + "jugupatuH", + "gopAyAYcakratuH", + "gopAyAmbaBUvatuH", + "gopAyAmAsatuH", + ], + ); + assert_has_sip( + &[], + &gupu, + Lit, + &[ + "jugopiTa", + "jugopTa", + "gopAyAYcakarTa", + "gopAyAmbaBUviTa", + "gopAyAmAsiTa", + ], + ); + assert_has_tip(&[], &gupu, Lut, &["gopAyitA", "gopitA", "goptA"]); + assert_has_tip(&[], &gupu, AshirLin, &["gopAyyAt", "gupyAt"]); + assert_has_tip(&[], &gupu, Lun, &["agopAyIt", "agopIt", "agOpsIt"]); + + let dhup = d("DUpa~", Bhvadi); + assert_has_tip(&[], &dhup, Lat, &["DUpAyati"]); + assert_has_tip( + &[], + &dhup, + Lit, + &["duDUpa", "DUpAyAYcakAra", "DUpAyAmbaBUva", "DUpAyAmAsa"], + ); + assert_has_sip(&[], &dhup, Lut, &["DUpAyitAsi", "DUpitAsi"]); + + let sap = d("zapa~", Bhvadi); + assert_has_tip(&[], &sap, Lat, &["sapati"]); + + let cup = d("cupa~", Bhvadi); + assert_has_tip(&[], &cup, Lat, &["copati"]); + assert_has_tip(&[], &cup, Lit, &["cucopa"]); + assert_has_tip(&[], &cup, Lut, &["copitA"]); + + let tup = d("tupa~", Bhvadi); + assert_has_tip(&[], &tup, Lat, &["topati"]); + assert_has_tip(&[], &tup, Lit, &["tutopa"]); + + let tump = d("tunpa~", Bhvadi); + assert_has_tip(&[], &tump, Lat, &["tumpati"]); + assert_has_tip(&[], &tump, Lit, &["tutumpa"]); + assert_has_tas(&[], &tump, Lit, &["tutumpatuH"]); + assert_has_tip(&[], &tump, AshirLin, &["tupyAt"]); + assert_has_tip(&["pra"], &tump, Lat, &["prastumpati", "pratumpati"]); + // Forms other than pratostumpIti are justified by normal yan-luk rules. + assert_has_tip( + &["pra"], + &yan_luk(&tump), + Lat, + &[ + "pratostumpIti", + "pratostumpti", + "pratotumpIti", + "pratotumpti", + ], + ); + + let trup = d("trupa~", Bhvadi); + assert_has_tip(&[], &trup, Lat, &["tropati"]); + + let trump = d("trunpa~", Bhvadi); + assert_has_tip(&[], &trump, Lat, &["trumpati"]); + + let tuph = d("tuPa~", Bhvadi); + assert_has_tip(&[], &tuph, Lat, &["toPati"]); + + let tumph = d("tunPa~", Bhvadi); + assert_has_tip(&[], &tumph, Lat, &["tumPati"]); + + let truph = d("truPa~", Bhvadi); + assert_has_tip(&[], &truph, Lat, &["troPati"]); + + let trumph = d("trunPa~", Bhvadi); + assert_has_tip(&[], &trumph, Lat, &["trumPati"]); + + let parp = d("parpa~", Bhvadi); + assert_has_tip(&[], &parp, Lat, &["parpati"]); + assert_has_tip(&[], &parp, Lit, &["paparpa"]); + + let raph = d("raPa~", Bhvadi); + assert_has_tip(&[], &raph, Lat, &["raPati"]); + + let ramph = d("raPi~", Bhvadi); + assert_has_tip(&[], &ramph, Lat, &["ramPati"]); + + let arb = d("arba~", Bhvadi); + assert_has_tip(&[], &arb, Lat, &["arbati"]); + assert_has_tip(&[], &arb, Lit, &["Anarba"]); + + let parb = d("parba~", Bhvadi); + assert_has_tip(&[], &parb, Lat, &["parbati"]); + + let larb = d("larba~", Bhvadi); + assert_has_tip(&[], &larb, Lat, &["larbati"]); + + let barb = d("barba~", Bhvadi); + assert_has_tip(&[], &barb, Lat, &["barbati"]); + + let marb = d("marba~", Bhvadi); + assert_has_tip(&[], &marb, Lat, &["marbati"]); + + let karb = d("karba~", Bhvadi); + assert_has_tip(&[], &karb, Lat, &["karbati"]); + + let kharb = d("Karba~", Bhvadi); + assert_has_tip(&[], &kharb, Lat, &["Karbati"]); + + let garb = d("garba~", Bhvadi); + assert_has_tip(&[], &garb, Lat, &["garbati"]); + + let sharb = d("Sarba~", Bhvadi); + assert_has_tip(&[], &sharb, Lat, &["Sarbati"]); + + let sarb = d("zarba~", Bhvadi); + assert_has_tip(&[], &sarb, Lat, &["sarbati"]); + + let carb = d("carba~", Bhvadi); + assert_has_tip(&[], &carb, Lat, &["carbati"]); + + let kumb = d("kubi~", Bhvadi); + assert_has_tip(&[], &kumb, Lat, &["kumbati"]); + + let lumb = d("lubi~", Bhvadi); + assert_has_tip(&[], &lumb, Lat, &["lumbati"]); + + let tumb = d("tubi~", Bhvadi); + assert_has_tip(&[], &tumb, Lat, &["tumbati"]); + + let cumb = d("cubi~", Bhvadi); + assert_has_tip(&[], &cumb, Lat, &["cumbati"]); + + let srbh = d("zfBu~", Bhvadi); + assert_has_tip(&[], &srbh, Lat, &["sarBati"]); + assert_has_tip(&[], &srbh, Lit, &["sasarBa"]); + assert_has_tip(&[], &srbh, Lut, &["sarBitA"]); + + let srmbh = d("zfnBu~", Bhvadi); + assert_has_tip(&[], &srmbh, Lat, &["sfmBati"]); + assert_has_tip(&[], &srmbh, Lit, &["sasfmBa"]); + assert_has_tip(&[], &srmbh, AshirLin, &["sfByAt"]); + + let sibh = d("ziBu~", Bhvadi); + assert_has_tip(&[], &sibh, Lat, &["seBati"]); + + let simbh = d("zinBu~", Bhvadi); + assert_has_tip(&[], &simbh, Lat, &["simBati"]); + + let ghinn = d("GiRi~\\", Bhvadi); + assert_has_ta(&[], &ghinn, Lat, &["GiRRate"]); + assert_has_ta(&[], &ghinn, Lit, &["jiGiRRe"]); + + let ghunn = d("GuRi~\\", Bhvadi); + assert_has_ta(&[], &ghunn, Lat, &["GuRRate"]); + assert_has_ta(&[], &ghunn, Lit, &["juGuRRe"]); + + let ghrnn = d("GfRi~\\", Bhvadi); + assert_has_ta(&[], &ghrnn, Lat, &["GfRRate"]); + assert_has_ta(&[], &ghrnn, Lit, &["jaGfRRe"]); + + let ghun = d("GuRa~\\", Bhvadi); + assert_has_ta(&[], &ghun, Lat, &["GoRate"]); + + let ghurn = d("GurRa~\\", Bhvadi); + assert_has_ta(&[], &ghurn, Lat, &["GUrRate"]); + + let pan = d("paRa~\\", Bhvadi); + assert_has_ta(&[], &pan, Lat, &["paRate"]); + assert_has_ta(&[], &pan, Lit, &["peRe"]); + assert_has_tip(&[], &pan, Lat, &["paRAyati"]); + assert_has_tip( + &[], + &pan, + Lit, + &["paRAyAYcakAra", "paRAyAmbaBUva", "paRAyAmAsa"], + ); + + assert_has_tip(&[], &pan, Lat, &["paRAyati"]); + assert_has_tip( + &[], + &pan, + Lit, + &["paRAyAYcakAra", "paRAyAmbaBUva", "paRAyAmAsa"], + ); + assert_has_ta(&[], &pan, Lit, &["peRe"]); + assert_has_sip(&[], &pan, Lut, &["paRAyitAsi"]); + assert_has_thaas(&[], &pan, Lut, &["paRitAse"]); + assert_has_tip(&[], &pan, AshirLin, &["paRAyyAt"]); + + let pan2 = d("pana~\\", Bhvadi); + assert_has_tip(&[], &pan2, Lat, &["panAyati"]); + assert_has_tip( + &[], + &pan2, + Lit, + &["panAyAYcakAra", "panAyAmbaBUva", "panAyAmAsa"], + ); + + let bham = d("BAma~\\", Bhvadi); + assert_has_ta(&[], &bham, Lat, &["BAmate"]); + + let ksham = d("kzamU~\\z", Bhvadi); + assert_has_ta(&[], &ksham, Lat, &["kzamate"]); + assert_has_ta(&[], &ksham, Lit, &["cakzame"]); + assert_has_thaas(&[], &ksham, Lit, &["cakzamize", "cakzaMse"]); + assert_has_dhvam(&[], &ksham, Lit, &["cakzamiDve", "cakzanDve"]); + // cakzaRvahe is from SK 2309. + assert_has_vahi(&[], &ksham, Lit, &["cakzamivahe", "cakzaRvahe"]); +} + +#[test] +fn sk_2309() { + // "cakzamivane" is from SK 2308. + let ksham = d("kzamU~\\z", Bhvadi); + assert_has_vahi(&[], &ksham, Lit, &["cakzamivahe", "cakzaRvahe"]); + assert_has_mahin(&[], &ksham, Lit, &["cakzamimahe", "cakzaRmahe"]); + assert_has_ta(&[], &ksham, Lrt, &["kzamizyate", "kzaMsyate"]); + assert_has_ta(&[], &ksham, VidhiLin, &["kzameta"]); + assert_has_ta(&[], &ksham, AshirLin, &["kzamizIzwa", "kzaMsIzwa"]); + assert_has_ta(&[], &ksham, Lun, &["akzamizwa", "akzaMsta"]); +} + +#[test] +fn sk_2310() { + let kam = d("kamu~\\", Bhvadi); + assert_has_ta(&[], &kam, Lat, &["kAmayate"]); +} + +#[test] +fn sk_2311() { + let kam = d("kamu~\\", Bhvadi); + assert_has_ta( + &[], + &kam, + Lit, + &["cakame", "kAmayAYcakre", "kAmayAmbaBUva", "kAmayAmAsa"], + ); + assert_has_ta(&[], &kam, Lut, &["kAmayitA", "kamitA"]); + assert_has_ta(&[], &kam, Lrt, &["kAmayizyate", "kamizyate"]); +} + +#[test] +fn skip_sk_2312() {} + +#[test] +fn sk_2313() { + let taksh = d("takzU~", Bhvadi); + assert_has_tip(&[], &nic(&taksh), Lun, &["atatakzat"]); + + let at = d("awa~", Bhvadi); + assert_has_tip(&[], &nic(&at), Lun, &["Awiwat"]); + + let kf = d("qukf\\Y", Tanadi); + assert_has_krdanta(&[], &nic(&kf), Krt::Rvul, &["kAraka"]); + assert_has_lat_karmani(&[], &nic(&kf), &["kAryate"]); +} + +#[test] +fn skip_sk_2314_to_sk_2317() {} + +#[test] +fn sk_2318() { + let an = d("aRa~", Bhvadi); + assert_has_tip(&[], &an, Lat, &["aRati"]); + + let ran = d("raRa~", Bhvadi); + assert_has_tip(&[], &ran, Lat, &["raRati"]); + + let van = d("vaRa~", Bhvadi); + assert_has_tip(&[], &van, Lat, &["vaRati"]); + assert_has_tas(&[], &van, Lit, &["vavaRatuH"]); + assert_has_sip(&[], &van, Lit, &["vavaRiTa"]); + + let dhan = d("DaRa~", Bhvadi); + assert_has_tip(&[], &dhan, Lat, &["DaRati"]); + + let on = d("oRf~", Bhvadi); + assert_has_tip(&[], &on, Lat, &["oRati"]); + assert_has_tip(&[], &on, Lit, &["oRAYcakAra", "oRAmbaBUva", "oRAmAsa"]); + + let shon = d("SoRf~", Bhvadi); + assert_has_tip(&[], &shon, Lat, &["SoRati"]); + assert_has_tip(&[], &shon, Lit, &["SuSoRa"]); + + let shron = d("SroRf~", Bhvadi); + assert_has_tip(&[], &shron, Lat, &["SroRati"]); + + let pain = d("pERf~", Bhvadi); + assert_has_tip(&[], &pain, Lit, &["pipERa"]); + + // danDraRIti is justified. + let dhran = d("DraRa~", Bhvadi); + assert_has_tip(&[], &dhran, Lat, &["DraRati"]); + assert_has_tip(&[], &yan_luk(&dhran), Lat, &["danDranti", "danDraRIti"]); + + let ban = d("baRa~", Bhvadi); + assert_has_tas(&[], &ban, Lit, &["beRatuH"]); + assert_has_sip(&[], &ban, Lit, &["beRiTa"]); + + let stan = d("zwana~", Bhvadi); + assert_has_tip(&[], &stan, Lat, &["stanati"]); + + let van = d("vana~", Bhvadi); + assert_has_tip(&[], &van, Lat, &["vanati"]); + + let san = d("zaRa~", Bhvadi); + assert_has_tip(&[], &san, Lat, &["sanati"]); + assert_has_tip(&[], &san, Lit, &["sasAna"]); + assert_has_tas(&[], &san, Lit, &["senatuH"]); +} + +#[test] +fn sk_2319() { + let san = d("zaRa~", Bhvadi); + assert_has_tip(&[], &san, AshirLin, &["sAyAt", "sanyAt"]); + + let am = d("ama~", Bhvadi); + assert_has_tip(&[], &am, Lat, &["amati"]); + assert_has_tip(&[], &am, Lit, &["Ama"]); + + let dram = d("drama~", Bhvadi); + assert_has_tip(&[], &dram, Lat, &["dramati"]); + assert_has_tip(&[], &dram, Lit, &["dadrAma"]); + assert_has_tip(&[], &dram, Lun, &["adramIt"]); + + let hamm = d("hamma~", Bhvadi); + assert_has_tip(&[], &hamm, Lat, &["hammati"]); + assert_has_tip(&[], &hamm, Lit, &["jahamma"]); + + // TODO: SK has "mimIta," but what is it? + let mim = d("mImf~", Bhvadi); + assert_has_tip(&[], &mim, Lat, &["mImati"]); + assert_has_tip(&[], &mim, Lit, &["mimIma"]); +} + +#[test] +fn sk_2320() { + let cam = d("camu~", Bhvadi); + assert_has_tip(&[], &cam, Lat, &["camati"]); + assert_has_tip(&["vi"], &cam, Lat, &["vicamati"]); + assert_has_tip(&[], &cam, Lun, &["acamIt"]); + + // TODO: jimi~ will create jimmati? + let jim = d("jima~", Bhvadi); + assert_has_tip(&[], &jim, Lat, &["jemati"]); +} + +#[test] +fn skip_sk_2321() {} + +#[test] +fn sk_2322() { + let kram = d("kramu~", Bhvadi); + assert_has_tip(&[], &kram, Lat, &["krAmyati", "krAmati"]); + assert_has_tip(&[], &kram, Lit, &["cakrAma"]); + assert_has_tip( + &[], + &kram, + Lot, + &["krAmyatu", "krAmatu", "krAmyatAt", "krAmatAt"], + ); +} + +#[test] +fn sk_2323() { + let kram = d("kramu~", Bhvadi); + assert_has_tip(&[], &kram, Lun, &["akramIt"]); + + let ay = d("aya~\\", Bhvadi); + assert_has_ta(&[], &ay, Lat, &["ayate"]); +} + +#[test] +fn sk_2324() { + let ay = d("aya~\\", Bhvadi); + assert_has_ta(&[], &ay, Lit, &["ayAYcakre", "ayAmbaBUva", "ayAmAsa"]); + assert_has_ta(&[], &ay, VidhiLin, &["ayeta"]); + assert_has_ta(&[], &ay, AshirLin, &["ayizIzwa"]); +} + +#[test] +fn sk_2325() { + let ay = d("aya~\\", Bhvadi); + assert_has_dhvam(&[], &ay, AshirLin, &["ayizIQvam", "ayizIDvam"]); + assert_has_ta(&[], &ay, Lun, &["Ayizwa"]); + assert_has_dhvam(&[], &ay, Lun, &["AyiQvam", "AyiDvam"]); +} + +#[test] +fn sk_2326() { + let ay = d("aya~\\", Bhvadi); + assert_has_ta(&["pra"], &ay, Lat, &["plAyate"]); + assert_has_ta(&["parA"], &ay, Lat, &["palAyate"]); + assert_has_ta(&["nis"], &ay, Lat, &["nirayate"]); + assert_has_ta(&["dus"], &ay, Lat, &["durayate"]); + assert_has_ta(&["nir"], &ay, Lat, &["nilayate"]); + assert_has_ta(&["dur"], &ay, Lat, &["dulayate"]); + + let vay = d("vaya~\\", Bhvadi); + assert_has_ta(&[], &vay, Lit, &["vavaye"]); + + let pay = d("paya~\\", Bhvadi); + assert_has_ta(&[], &pay, Lit, &["peye"]); + + let may = d("maya~\\", Bhvadi); + assert_has_ta(&[], &may, Lit, &["meye"]); + + let cay = d("caya~\\", Bhvadi); + assert_has_ta(&[], &cay, Lit, &["ceye"]); + + let tay = d("taya~\\", Bhvadi); + assert_has_ta(&[], &tay, Lit, &["teye"]); + + let nay = d("Raya~\\", Bhvadi); + assert_has_ta(&["pra"], &nay, Lat, &["praRayate"]); + assert_has_ta(&[], &nay, Lit, &["neye"]); + + let day = d("daya~\\", Bhvadi); + assert_has_ta(&[], &day, Lit, &["dayAYcakre", "dayAmbaBUva", "dayAmAsa"]); + + let uy = d("UyI~\\", Bhvadi); + assert_has_ta(&[], &uy, Lit, &["UyAYcakre", "UyAmbaBUva", "UyAmAsa"]); + + let puy = d("pUyI~\\", Bhvadi); + assert_has_ta(&[], &puy, Lat, &["pUyate"]); + assert_has_ta(&[], &puy, Lit, &["pupUye"]); + + let knuy = d("knUyI~\\", Bhvadi); + assert_has_ta(&[], &knuy, Lit, &["cuknUye"]); + + let kshmay = d("kzmAyI~\\", Bhvadi); + assert_has_ta(&[], &kshmay, Lit, &["cakzmAye"]); + + let sphay = d("sPAyI~\\", Bhvadi); + assert_has_ta(&[], &sphay, Lat, &["sPAyate"]); + assert_has_ta(&[], &sphay, Lit, &["pasPAye"]); + + let pyay = d("o~pyAyI~\\", Bhvadi); + assert_has_ta(&[], &pyay, Lat, &["pyAyate"]); +} + +#[test] +fn sk_2327() { + let pyay = d("o~pyAyI~\\", Bhvadi); + assert_has_ta(&[], &pyay, Lit, &["pipye"]); + assert_has_aataam(&[], &pyay, Lit, &["pipyAte"]); + assert_has_jha(&[], &pyay, Lit, &["pipyire"]); +} + +#[test] +fn sk_2328() {} + +#[test] +fn sk_2329() { + let pyay = d("o~pyAyI~\\", Bhvadi); + assert_has_ta(&[], &pyay, Lun, &["apyAyi", "apyAyizwa"]); + + let tay = d("tAyf~\\", Bhvadi); + assert_has_ta(&[], &tay, Lat, &["tAyate"]); + assert_has_ta(&[], &tay, Lit, &["tatAye"]); + assert_has_ta(&[], &tay, Lun, &["atAyi", "atAyizwa"]); + + let val = d("vala~\\", Bhvadi); + assert_has_ta(&[], &val, Lit, &["vavale"]); + + let vall = d("valla~\\", Bhvadi); + assert_has_ta(&[], &vall, Lit, &["vavalle"]); + + let mal = d("mala~\\", Bhvadi); + assert_has_ta(&[], &mal, Lit, &["mele"]); + + let mall = d("malla~\\", Bhvadi); + assert_has_ta(&[], &mall, Lit, &["mamalle"]); + + let bhal = d("Bala~\\", Bhvadi); + assert_has_ta(&[], &bhal, Lit, &["baBale"]); + + let bhall = d("Balla~\\", Bhvadi); + assert_has_ta(&[], &bhall, Lit, &["baBalle"]); + + let kal = d("kala~\\", Bhvadi); + assert_has_ta(&[], &kal, Lat, &["kalate"]); + assert_has_ta(&[], &kal, Lit, &["cakale"]); + + let kall = d("kalla~\\", Bhvadi); + assert_has_ta(&[], &kall, Lat, &["kallate"]); + + let sev = d("zevf~\\", Bhvadi); + assert_has_ta(&["pari"], &sev, Lat, &["parizevate"]); + assert_has_ta(&[], &sev, Lit, &["sizeve"]); + + let gev = d("gevf~\\", Bhvadi); + assert_has_ta(&[], &gev, Lat, &["gevate"]); + assert_has_ta(&[], &gev, Lit, &["jigeve"]); + + let glev = d("glevf~\\", Bhvadi); + assert_has_ta(&[], &glev, Lit, &["jigleve"]); + + let pev = d("pevf~\\", Bhvadi); + assert_has_ta(&[], &pev, Lit, &["pipeve"]); + + let mev = d("mevf~\\", Bhvadi); + assert_has_ta(&[], &mev, Lat, &["mevate"]); + + let mlev = d("mlevf~\\", Bhvadi); + assert_has_ta(&[], &mlev, Lat, &["mlevate"]); + + let mavy = d("mavya~", Bhvadi); + assert_has_tip(&[], &mavy, Lit, &["mamavya"]); + + let hay = d("haya~", Bhvadi); + assert_has_tip(&[], &hay, Lun, &["ahayIt"]); + + let shucy = d("Sucya~", Bhvadi); + assert_has_tip(&[], &shucy, Lit, &["SuSucya"]); + + let al = d("ala~", Bhvadi); + assert_has_tip(&[], &al, Lat, &["alati"]); + assert_has_tip(&[], &al, Lit, &["Ala"]); +} + +#[test] +fn sk_2330() { + // TODO: mAn-yoga + let al = d("ala~", Bhvadi); + assert_has_tip(&[], &al, Lun, &["AlIt"]); + + // "ayaM svarited ityeke" + let al = d("ala~^", Bhvadi); + assert_has_ta(&[], &al, Lat, &["alate"]); + + let phal = d("YiPalA~", Bhvadi); + assert_has_tas(&[], &phal, Lit, &["PelatuH"]); + assert_has_jhi(&[], &phal, Lit, &["PeluH"]); + assert_has_tip(&[], &phal, Lun, &["aPAlIt"]); + + let shil = d("SIla~", Bhvadi); + assert_has_tip(&[], &shil, Lat, &["SIlati"]); + + let tul = d("tUla~", Bhvadi); + assert_has_tip(&[], &tul, Lit, &["tutUla"]); + + let phal = d("Pala~", Bhvadi); + assert_has_tas(&[], &phal, Lit, &["PelatuH"]); + assert_has_jhi(&[], &phal, Lit, &["PeluH"]); + + let til = d("tila~", Bhvadi); + assert_has_tip(&[], &til, Lat, &["telati"]); + + let till = d("tilla~", Bhvadi); + assert_has_tip(&[], &till, Lat, &["tillati"]); + + let skhal = d("sKala~", Bhvadi); + assert_has_tip(&[], &skhal, Lit, &["casKAla"]); + assert_has_tip(&[], &skhal, Lun, &["asKAlIt"]); + + let gal = d("gala~", Bhvadi); + assert_has_tip(&[], &gal, Lat, &["galati"]); + assert_has_tip(&[], &gal, Lun, &["agAlIt"]); + + let sanl = d("zala~", Bhvadi); + assert_has_tip(&[], &sanl, Lat, &["salati"]); + + let shval = d("Svala~", Bhvadi); + assert_has_tip(&[], &shval, Lit, &["SaSvAla"]); + assert_has_tip(&[], &shval, Lun, &["aSvAlIt"]); + + let shvall = d("Svalla~", Bhvadi); + assert_has_tip(&[], &shvall, Lun, &["aSvallIt"]); + + let khol = d("Kolf~", Bhvadi); + assert_has_tip(&[], &khol, Lat, &["Kolati"]); + + let khor = d("Korf~", Bhvadi); + assert_has_tip(&[], &khor, Lat, &["Korati"]); + + let dhor = d("Dorf~", Bhvadi); + assert_has_tip(&[], &dhor, Lat, &["Dorati"]); + + let tsar = d("tsara~", Bhvadi); + assert_has_tip(&[], &tsar, Lit, &["tatsAra"]); + assert_has_tip(&[], &tsar, Lun, &["atsArIt"]); + + let kmar = d("kmara~", Bhvadi); + assert_has_tip(&[], &kmar, Lit, &["cakmAra"]); + + let abh = d("aBra~", Bhvadi); + assert_has_tip(&[], &abh, Lat, &["aBrati"]); + assert_has_tip(&[], &abh, Lit, &["AnaBra"]); + + let shthiv = d("zWivu~", Bhvadi); + assert_has_tip(&[], &shthiv, Lat, &["zWIvati"]); + assert_has_tip(&[], &shthiv, Lit, &["tizWeva", "wizWeva"]); + assert_has_tas(&[], &shthiv, Lit, &["tizWivatuH", "wizWivatuH"]); + assert_has_jhi(&[], &shthiv, Lit, &["tizWivuH", "wizWivuH"]); + assert_has_tip(&[], &shthiv, AshirLin, &["zWIvyAt"]); + + let ji = d("ji\\", Bhvadi); + assert_has_tip(&[], &ji, Lat, &["jayati"]); +} + +#[test] +fn sk_2331() { + let ji = d("ji\\", Bhvadi); + assert_has_tip(&[], &ji, Lit, &["jigAya"]); + assert_has_tas(&[], &ji, Lit, &["jigyatuH"]); + assert_has_jhi(&[], &ji, Lit, &["jigyuH"]); + assert_has_sip(&[], &ji, Lit, &["jigayiTa", "jigeTa"]); + assert_has_mip(&[], &ji, Lit, &["jigAya", "jigaya"]); + assert_has_vas(&[], &ji, Lit, &["jigyiva"]); + assert_has_mas(&[], &ji, Lit, &["jigyima"]); + + assert_has_tip(&[], &ji, Lut, &["jetA"]); + assert_has_tip(&[], &ji, AshirLin, &["jIyAt"]); + assert_has_tip(&[], &ji, Lun, &["ajEzIt"]); + + let jiv = d("jIva~", Bhvadi); + assert_has_tip(&[], &jiv, Lit, &["jijIva"]); + + let piv = d("pIva~", Bhvadi); + assert_has_tip(&[], &piv, Lit, &["pipIva"]); + + let miv = d("mIva~", Bhvadi); + assert_has_tip(&[], &miv, Lit, &["mimIva"]); + + let tiv = d("tIva~", Bhvadi); + assert_has_tip(&[], &tiv, Lit, &["titIva"]); + + let niv = d("RIva~", Bhvadi); + assert_has_tip(&[], &niv, Lit, &["ninIva"]); + + let turv = d("turvI~", Bhvadi); + assert_has_tip(&[], &turv, Lit, &["tutUrva"]); + + let gurv = d("gurvI~", Bhvadi); + assert_has_tip(&[], &gurv, Lat, &["gUrvati"]); + assert_has_tip(&[], &gurv, Lit, &["jugUrva"]); + + let arv = d("arva~", Bhvadi); + assert_has_tip(&[], &arv, Lit, &["Anarva"]); + + let sharv = d("Sarva~", Bhvadi); + assert_has_tip(&[], &sharv, Lat, &["Sarvati"]); + + let sarv = d("zarva~", Bhvadi); + assert_has_tip(&[], &sarv, Lat, &["sarvati"]); + + let inv = d("ivi~", Bhvadi); + assert_has_tip(&[], &inv, Lat, &["invati"]); + assert_has_tip(&[], &inv, Lit, &["invAYcakAra", "invAmbaBUva", "invAmAsa"]); + + let pinv = d("pivi~", Bhvadi); + assert_has_tip(&[], &pinv, Lat, &["pinvati"]); + assert_has_tip(&[], &pinv, Lit, &["pipinva"]); + + let hinv = d("hivi~", Bhvadi); + assert_has_tip(&[], &hinv, Lat, &["hinvati"]); + + let dinv = d("divi~", Bhvadi); + assert_has_tip(&[], &dinv, Lat, &["dinvati"]); +} + +#[test] +fn sk_2332() { + let dhinv = d("Divi~", Bhvadi); + assert_has_tip(&[], &dhinv, Lat, &["Dinoti"]); + assert_has_tas(&[], &dhinv, Lat, &["DinutaH"]); + assert_has_jhi(&[], &dhinv, Lat, &["Dinvanti"]); +} + +#[test] +fn sk_2333() { + let dhinv = d("Divi~", Bhvadi); + assert_has_vas(&[], &dhinv, Lat, &["DinvaH", "DinuvaH"]); + assert_has_mas(&[], &dhinv, Lat, &["DinmaH", "DinumaH"]); + assert_has_mip(&[], &dhinv, Lat, &["Dinomi"]); +} + +#[test] +fn sk_2334() { + let dhinv = d("Divi~", Bhvadi); + assert_has_sip(&[], &dhinv, Lot, &["Dinu", "DinutAt"]); + assert_has_vas(&[], &dhinv, Lot, &["DinavAva"]); + assert_has_mas(&[], &dhinv, Lot, &["DinavAma"]); + + let jinv = d("jivi~", Bhvadi); + assert_has_tip(&[], &jinv, Lat, &["jinvati"]); + + let rinv = d("rivi~", Bhvadi); + assert_has_tip(&[], &rinv, Lat, &["riRvati"]); + + let ranv = d("ravi~", Bhvadi); + assert_has_tip(&[], &ranv, Lat, &["raRvati"]); + + let dhanv = d("Davi~", Bhvadi); + assert_has_tip(&[], &dhanv, Lat, &["Danvati"]); + + let mav = d("mava~", Bhvadi); + assert_has_tip(&[], &mav, Lat, &["mavati"]); + assert_has_tas(&[], &mav, Lit, &["mevatuH"]); + assert_has_jhi(&[], &mav, Lit, &["mevuH"]); + assert_has_tip(&[], &mav, Lun, &["amavIt", "amAvIt"]); + + let av = d("ava~", Bhvadi); + assert_has_tip(&[], &av, Lat, &["avati"]); + assert_has_tip(&[], &av, Lit, &["Ava"]); + // TODO: replace below with avIt (mAN-yoga) + assert_has_tip(&[], &av, Lun, &["AvIt"]); + + let dhav = d("DAvu~^", Bhvadi); + assert_has_tip(&[], &dhav, Lat, &["DAvati"]); + assert_has_ta(&[], &dhav, Lat, &["DAvate"]); + assert_has_tip(&[], &dhav, Lit, &["daDAva"]); + assert_has_ta(&[], &dhav, Lit, &["daDAve"]); + + let dhuksh = d("Dukza~\\", Bhvadi); + assert_has_ta(&[], &dhuksh, Lat, &["Dukzate"]); + assert_has_ta(&[], &dhuksh, Lit, &["duDukze"]); + + let dhiksh = d("Dikza~\\", Bhvadi); + assert_has_ta(&[], &dhiksh, Lat, &["Dikzate"]); + assert_has_ta(&[], &dhiksh, Lit, &["diDikze"]); + + let vfksh = d("vfkza~\\", Bhvadi); + assert_has_ta(&[], &vfksh, Lat, &["vfkzate"]); + assert_has_ta(&[], &vfksh, Lit, &["vavfkze"]); + + let shiksh = d("Sikza~\\", Bhvadi); + assert_has_ta(&[], &shiksh, Lat, &["Sikzate"]); + + let bhiksh = d("Bikza~\\", Bhvadi); + assert_has_ta(&[], &bhiksh, Lat, &["Bikzate"]); + + let klesh = d("kleSa~\\", Bhvadi); + assert_has_ta(&[], &klesh, Lat, &["kleSate"]); + assert_has_ta(&[], &klesh, Lit, &["cikleSe"]); + + let daksh = d("dakza~\\", Bhvadi); + assert_has_ta(&[], &daksh, Lat, &["dakzate"]); + assert_has_ta(&[], &daksh, Lit, &["dadakze"]); + + let diksh = d("dIkza~\\", Bhvadi); + assert_has_ta(&[], &diksh, Lat, &["dIkzate"]); + assert_has_ta(&[], &diksh, Lit, &["didIkze"]); + + let iksh = d("Ikza~\\", Bhvadi); + assert_has_ta(&[], &iksh, Lit, &["IkzAYcakre", "IkzAmbaBUva", "IkzAmAsa"]); + + let ish = d("Iza~\\", Bhvadi); + assert_has_ta(&[], &ish, Lit, &["IzAYcakre", "IzAmbaBUva", "IzAmAsa"]); + + let bhash = d("BAza~\\", Bhvadi); + assert_has_ta(&[], &bhash, Lat, &["BAzate"]); + + let bhash = d("BAza~\\", Bhvadi); + assert_has_ta(&[], &bhash, Lat, &["BAzate"]); + + let varsh = d("varza~\\", Bhvadi); + assert_has_ta(&[], &varsh, Lit, &["vavarze"]); + + let gesh = d("gezf~\\", Bhvadi); + assert_has_ta(&[], &gesh, Lit, &["jigeze"]); + + let jesh = d("jezf~\\", Bhvadi); + assert_has_ta(&[], &jesh, Lat, &["jezate"]); + + let nesh = d("Rezf~\\", Bhvadi); + assert_has_ta(&[], &nesh, Lat, &["nezate"]); + + let esh = d("ezf~\\", Bhvadi); + assert_has_ta(&[], &esh, Lit, &["ezAYcakre", "ezAmbaBUva", "ezAmAsa"]); + + let presh = d("prezf~\\", Bhvadi); + assert_has_ta(&[], &presh, Lit, &["pipreze"]); + + let resh = d("rezf~\\", Bhvadi); + assert_has_ta(&[], &resh, Lat, &["rezate"]); + + let hesh = d("hezf~\\", Bhvadi); + assert_has_ta(&[], &hesh, Lat, &["hezate"]); + + let hresh = d("hrezf~\\", Bhvadi); + assert_has_ta(&[], &hresh, Lat, &["hrezate"]); + + let kas = d("kAsf~\\", Bhvadi); + assert_has_ta(&[], &kas, Lit, &["kAsAYcakre", "kAsAmbaBUva", "kAsAmAsa"]); + + let bhas = d("BAsf~\\", Bhvadi); + assert_has_ta(&[], &bhas, Lit, &["baBAse"]); + + let naas = d("RAsf~\\", Bhvadi); + assert_has_ta(&[], &naas, Lat, &["nAsate"]); + assert_has_ta(&["pra"], &naas, Lat, &["praRAsate"]); + + let nas = d("Rasa~\\", Bhvadi); + assert_has_ta(&[], &nas, Lat, &["nasate"]); + + let bhyas = d("Byasa~\\", Bhvadi); + assert_has_ta(&[], &bhyas, Lat, &["Byasate"]); + assert_has_ta(&[], &bhyas, Lit, &["baByase"]); + + let shas = d("Sasi~\\", Bhvadi); + assert_has_ta(&["AN"], &shas, Lat, &["ASaMsate"]); + assert_has_thaas(&["AN"], &shas, Lat, &["ASaMsase"]); + + let gras = d("grasu~\\", Bhvadi); + assert_has_ta(&[], &gras, Lit, &["jagrase"]); + + let glas = d("glasu~\\", Bhvadi); + assert_has_ta(&[], &glas, Lit, &["jaglase"]); + + let ih = d("Iha~\\", Bhvadi); + assert_has_ta(&[], &ih, Lit, &["IhAYcakre", "IhAmbaBUva", "IhAmAsa"]); + + // TODO: Text lists "vahi" but uses "bahi" ? + let vanh = d("vahi~\\", Bhvadi); + assert_has_ta(&[], &vanh, Lat, &["vaMhate"]); + assert_has_ta(&[], &vanh, Lit, &["vavaMhe"]); + + let manh = d("mahi~\\", Bhvadi); + assert_has_ta(&[], &manh, Lat, &["maMhate"]); + + let anh = d("ahi~\\", Bhvadi); + assert_has_ta(&[], &anh, Lat, &["aMhate"]); + assert_has_ta(&[], &anh, Lit, &["AnaMhe"]); + + let garh = d("garha~\\", Bhvadi); + assert_has_ta(&[], &garh, Lit, &["jagarhe"]); + + let galh = d("galha~\\", Bhvadi); + assert_has_ta(&[], &galh, Lit, &["jagalhe"]); + + let plih = d("pliha~\\", Bhvadi); + assert_has_ta(&[], &plih, Lit, &["piplihe"]); + + let bah = d("bAhf~\\", Bhvadi); + assert_has_ta(&[], &bah, Lit, &["babAhe"]); + + let kash = d("kASf~\\", Bhvadi); + assert_has_ta(&[], &kash, Lit, &["cakASe"]); + + let uh = d("Uha~\\", Bhvadi); + assert_has_ta(&[], &uh, Lit, &["UhAYcakre", "UhAmbaBUva", "UhAmAsa"]); + + let gah = d("gAhU~\\", Bhvadi); + assert_has_ta(&[], &gah, Lat, &["gAhate"]); + assert_has_ta(&[], &gah, Lit, &["jagAhe"]); + assert_has_thaas(&[], &gah, Lit, &["jagAhize", "jaGAkze"]); + assert_has_dhvam(&[], &gah, Lit, &["jagAhiQve", "jagAhiDve", "jaGAQve"]); + // gAQA is from SK 2335. + assert_has_ta(&[], &gah, Lut, &["gAhitA", "gAQA"]); +} + +#[test] +fn sk_2335() { + let gah = d("gAhU~\\", Bhvadi); + assert_has_ta(&[], &gah, Lut, &["gAhitA", "gAQA"]); + assert_has_ta(&[], &gah, Lrt, &["gAhizyate", "GAkzyate"]); + assert_has_ta(&[], &gah, AshirLin, &["gAhizIzwa", "GAkzIzwa"]); + assert_has_ta(&[], &gah, Lun, &["agAhizwa", "agAQa"]); + // agAhizatAm, agAhizata, agAhizWAH, and agAhiDvam/agAhiQvam are justified. + assert_has_aataam(&[], &gah, Lun, &["agAhizAtAm", "aGAkzAtAm"]); + assert_has_jha(&[], &gah, Lun, &["agAhizata", "aGAkzata"]); + assert_has_thaas(&[], &gah, Lun, &["agAhizWAH", "agAQAH"]); + assert_has_dhvam(&[], &gah, Lun, &["agAhiDvam", "agAhiQvam", "aGAQvam"]); + assert_has_iw(&[], &gah, Lun, &["agAhizi", "aGAkzi"]); + + let grh = d("gfhU~\\", Bhvadi); + assert_has_ta(&[], &grh, Lat, &["garhate"]); + assert_has_ta(&[], &grh, Lit, &["jagfhe"]); + assert_has_thaas(&[], &grh, Lit, &["jagfhize", "jaGfkze"]); + // jagfhiDve and jagfhiQve are justified. + assert_has_dhvam(&[], &grh, Lit, &["jagfhiDve", "jagfhiQve", "jaGfQve"]); + assert_has_ta(&[], &grh, Lut, &["garhitA", "garQA"]); + assert_has_ta(&[], &grh, Lrt, &["garhizyate", "Garkzyate"]); + assert_has_ta(&[], &grh, AshirLin, &["garhizIzwa", "GfkzIzwa"]); + assert_has_ta(&[], &grh, Lun, &["agarhizwa", "aGfkzata"]); +} + +#[test] +fn sk_2336() { + let grh = d("gfhU~\\", Bhvadi); + assert_has_ta(&[], &grh, Lun, &["agarhizwa", "aGfkzata"]); +} + +#[test] +fn sk_2337() { + let grh = d("gfhU~\\", Bhvadi); + // agarhizAtAm and agarhizanta are justified. + assert_has_aataam(&[], &grh, Lun, &["agarhizAtAm", "aGfkzAtAm"]); + assert_has_jha(&[], &grh, Lun, &["agarhizata", "aGfkzanta"]); + + let glah = d("glaha~\\", Bhvadi); + assert_has_ta(&[], &glah, Lat, &["glahate"]); + + let ghush = d("Guzi~\\", Bhvadi); + assert_has_ta(&[], &ghush, Lat, &["GuMzate"]); + assert_has_ta(&[], &ghush, Lit, &["juGuMze"]); + + let ghush = d("Guzi~r", Bhvadi); + assert_has_tip(&[], &ghush, Lat, &["Gozati"]); + assert_has_tip(&[], &ghush, Lit, &["juGoza"]); + assert_has_tip(&[], &ghush, Lut, &["GozitA"]); + assert_has_tip(&[], &ghush, Lun, &["aGuzat", "aGozIt"]); +} + +#[test] +fn sk_2338() { + let aksh = d("akzU~", Bhvadi); + assert_has_tip(&[], &aksh, Lat, &["akzRoti", "akzati"]); + assert_has_tas(&[], &aksh, Lat, &["akzRutaH", "akzataH"]); + assert_has_jhi(&[], &aksh, Lat, &["akzRuvanti", "akzanti"]); + assert_has_tip(&[], &aksh, Lit, &["Anakza"]); + assert_has_sip(&[], &aksh, Lit, &["AnakziTa", "AnazWa"]); + assert_has_tip(&[], &aksh, Lut, &["akzitA", "azwA"]); + assert_has_tip(&[], &aksh, Lrt, &["akzizyati", "akzyati"]); + + assert_has_tip( + &[], + &aksh, + Lot, + &["akzRotu", "akzatu", "akzRutAt", "akzatAt"], + ); + assert_has_sip(&[], &aksh, Lot, &["akzRuhi", "akzRutAt", "akza", "akzatAt"]); + assert_has_mip(&[], &aksh, Lot, &["akzRavAni", "akzARi"]); + assert_has_tip(&[], &aksh, Lan, &["AkzRot", "Akzat"]); + assert_has_mip(&[], &aksh, Lan, &["AkzRavam", "Akzam"]); + assert_has_tip(&[], &aksh, VidhiLin, &["akzRuyAt", "akzet"]); + assert_has_tip(&[], &aksh, AshirLin, &["akzyAt"]); + + // TODO: mAn-yoga + assert_has_tip(&[], &aksh, Lun, &["AkzIt"]); + assert_has_tas(&[], &aksh, Lun, &["AkzizwAm", "AzwAm"]); + assert_has_jhi(&[], &aksh, Lun, &["AkzizuH", "AkzuH"]); +} + +#[ignore] +#[test] +fn sk_2339() { + let taksh = d("takzU~", Bhvadi); + assert_has_sip(&[], &taksh, Lit, &["tatakziTa", "tatazWa"]); + assert_has_tip(&[], &taksh, Lun, &["atakzIt", "atAkzIt"]); + assert_has_tas(&[], &taksh, Lun, &["atakzizwAm", "atAzwAm"]); + assert_has_tip(&["sam"], &taksh, Lat, &["santakzati", "santakzRoti"]); + + let uksh = d("ukza~", Bhvadi); + assert_has_tip(&[], &uksh, Lit, &["ukzAYcakAra", "ukzAmbaBUva", "ukzAmAsa"]); + + let niksh = d("Rikza~", Bhvadi); + assert_has_tip(&["pra"], &niksh, Lat, &["praRikzati"]); + + let trksh = d("tfkza~", Bhvadi); + assert_has_tip(&[], &trksh, Lat, &["tfkzati"]); + + let strksh = d("zwfkza~", Bhvadi); + assert_has_tip(&[], &strksh, Lat, &["stfkzati"]); + + let naksh = d("Rakza~", Bhvadi); + assert_has_tip(&[], &naksh, Lat, &["nakzati"]); + + let surksh = d("sUrkza~", Bhvadi); + assert_has_tip(&[], &surksh, Lit, &["susUrkza"]); + + let cush = d("cUza~", Bhvadi); + assert_has_tip(&[], &cush, Lit, &["cucUza"]); + + let bhush = d("BUza~", Bhvadi); + assert_has_tip(&[], &bhush, Lat, &["BUzati"]); + + let ush = d("Uza~", Bhvadi); + assert_has_tip(&[], &ush, Lit, &["UzAYcakAra", "UzAmbaBUva", "UzAmAsa"]); + + let kash = d("kaza~", Bhvadi); + assert_has_tip(&[], &kash, Lit, &["cakAza"]); + + let khash = d("Kaza~", Bhvadi); + assert_has_tip(&[], &khash, Lit, &["caKAza"]); + + let shish = d("Siza~", Bhvadi); + assert_has_tip(&[], &shish, Lit, &["SiSeza"]); + assert_has_sip(&[], &shish, Lit, &["SiSeziTa"]); + assert_has_tip(&[], &shish, Lut, &["SezwA"]); + assert_has_tip(&[], &shish, Lun, &["aSikzat"]); + assert_has_tip(&[], &shish, Lrn, &["aSekzyat"]); + + let jash = d("jaza~", Bhvadi); + assert_has_tas(&[], &jash, Lit, &["jezatuH"]); + + let jhash = d("Jaza~", Bhvadi); + assert_has_tas(&[], &jhash, Lit, &["jaJazatuH"]); + + let shash = d("Saza~", Bhvadi); + assert_has_tas(&[], &shash, Lit, &["SezatuH"]); + + let vash = d("vaza~", Bhvadi); + assert_has_tas(&[], &vash, Lit, &["vavazatuH"]); + + let mash = d("maza~", Bhvadi); + assert_has_tas(&[], &mash, Lit, &["mezatuH"]); +} + +#[test] +fn sk_2340() { + let rush = d("ruza~", Bhvadi); + assert_has_tip(&[], &rush, Lut, &["rozitA", "rozwA"]); + assert_has_tip(&[], &rush, Lrt, &["rozizyati"]); + + let rish = d("riza~", Bhvadi); + assert_has_tip(&[], &rish, Lut, &["rezitA", "rezwA"]); + assert_has_tip(&[], &rish, Lrt, &["rezizyati"]); + + let bhash = d("Baza~", Bhvadi); + assert_has_tip(&[], &bhash, Lat, &["Bazati"]); + assert_has_tip(&[], &bhash, Lit, &["baBAza"]); + + let ush = d("uza~", Bhvadi); + assert_has_tip(&[], &ush, Lat, &["ozati"]); +} + +#[test] +fn sk_2341() { + let ush = d("uza~", Bhvadi); + assert_has_tip( + &[], + &ush, + Lit, + &["uvoza", "ozAYcakAra", "ozAmbaBUva", "ozAmAsa"], + ); + assert_has_tas( + &[], + &ush, + Lit, + &["UzatuH", "ozAYcakratuH", "ozAmbaBUvatuH", "ozAmAsatuH"], + ); + assert_has_sip( + &[], + &ush, + Lit, + &["uvoziTa", "ozAYcakarTa", "ozAmbaBUviTa", "ozAmAsiTa"], + ); + + let jish = d("jizu~", Bhvadi); + assert_has_tip(&[], &jish, Lit, &["jijeza"]); + + let vish = d("vi\\zu~", Bhvadi); + assert_has_sip(&[], &vish, Lit, &["viveziTa"]); + assert_has_vas(&[], &vish, Lit, &["viviziva"]); + assert_has_tip(&[], &vish, Lut, &["vezwA"]); + assert_has_tip(&[], &vish, Lrt, &["vekzyati"]); + assert_has_tip(&[], &vish, Lun, &["avikzat"]); + + let push = d("puza~", Bhvadi); + assert_has_tip(&[], &push, Lat, &["pozati"]); + assert_has_tip(&[], &push, Lut, &["pozitA"]); + assert_has_tip(&[], &push, Lrt, &["pozizyati"]); + assert_has_tip(&[], &push, Lun, &["apozIt"]); + + let shrish = d("Srizu~", Bhvadi); + assert_has_tip(&[], &shrish, Lat, &["Srezati"]); + assert_has_tip(&[], &shrish, Lit, &["SiSreza"]); + assert_has_tip(&[], &shrish, Lut, &["SrezitA"]); + + let shlish = d("Slizu~", Bhvadi); + assert_has_tip(&[], &shlish, Lat, &["Slezati"]); + assert_has_tip(&[], &shlish, Lit, &["SiSleza"]); + assert_has_tip(&[], &shlish, Lut, &["SlezitA"]); + + let prush = d("pruzu~", Bhvadi); + assert_has_tip(&[], &prush, Lit, &["puproza"]); + + let plush = d("pluzu~", Bhvadi); + assert_has_tip(&[], &plush, Lit, &["puploza"]); + + let prsh = d("pfzu~", Bhvadi); + assert_has_tip(&[], &prsh, Lat, &["parzati"]); + assert_has_tip(&[], &prsh, Lit, &["paparza"]); + assert_has_tip(&[], &prsh, AshirLin, &["pfzyAt"]); + + let tus = d("tusa~", Bhvadi); + assert_has_tip(&[], &tus, Lit, &["tutosa"]); + + let hras = d("hrasa~", Bhvadi); + assert_has_tip(&[], &hras, Lit, &["jahrAsa"]); + + let hlas = d("hlasa~", Bhvadi); + assert_has_tip(&[], &hlas, Lit, &["jahlAsa"]); + + let ras = d("rasa~", Bhvadi); + assert_has_tip(&[], &ras, Lit, &["rarAsa"]); + + // TODO: why anit? + let ghas = d("Ga\\sx~", Bhvadi); + assert_has_tip(&[], &ghas, Lat, &["Gasati"]); + assert_has_tip(&[], &ghas, Lut, &["GastA"]); +} + +#[test] +fn sk_2342() { + let ghas = d("Ga\\sx~", Bhvadi); + assert_has_tip(&[], &ghas, Lrt, &["Gatsyati"]); + assert_has_tip(&[], &ghas, Lot, &["Gasatu", "GasatAt"]); + assert_has_tip(&[], &ghas, Lun, &["aGasat"]); + assert_has_tip(&[], &ghas, VidhiLin, &["Gaset"]); +} + +#[test] +fn sk_2343() { + let ghas = d("Ga\\sx~", Bhvadi); + assert_has_tip(&[], &ghas, Lun, &["aGasat"]); + + let pis = d("pisf~", Bhvadi); + assert_has_tas(&[], &pis, Lit, &["pipisatuH"]); + + let pes = d("pesf~", Bhvadi); + assert_has_tas(&[], &pes, Lit, &["pipesatuH"]); + + let has = d("hase~", Bhvadi); + assert_has_tip(&[], &has, Lun, &["ahasIt"]); + + let nish = d("RiSa~", Bhvadi); + assert_has_tip(&["pra"], &nish, Lat, &["praReSati"]); + + let shav = d("Sava~", Bhvadi); + assert_has_tip(&[], &shav, Lat, &["Savati"]); + assert_has_tip(&[], &shav, Lun, &["aSavIt", "aSAvIt"]); + + let shash = d("SaSa~", Bhvadi); + assert_has_tip(&[], &shash, Lit, &["SaSASa"]); + assert_has_tas(&[], &shash, Lit, &["SeSatuH"]); + assert_has_jhi(&[], &shash, Lit, &["SeSuH"]); + assert_has_sip(&[], &shash, Lit, &["SeSiTa"]); + + let shas = d("Sasu~", Bhvadi); + assert_has_tas(&[], &shas, Lit, &["SaSasatuH"]); + assert_has_jhi(&[], &shas, Lit, &["SaSasuH"]); + assert_has_sip(&[], &shas, Lit, &["SaSasiTa"]); + + let shans = d("Sansu~", Bhvadi); + assert_has_tip(&[], &shans, Lit, &["SaSaMsa"]); + assert_has_tip(&[], &shans, AshirLin, &["SasyAt"]); + + let cah = d("caha~", Bhvadi); + assert_has_tip(&[], &cah, Lun, &["acahIt"]); + + let mah = d("maha~", Bhvadi); + assert_has_tip(&[], &mah, Lun, &["amahIt"]); + + let ranh = d("rahi~", Bhvadi); + assert_has_tip(&[], &ranh, Lat, &["raMhati"]); + assert_has_tip(&[], &ranh, AshirLin, &["raMhyAt"]); + + let drh = d("dfha~", Bhvadi); + assert_has_tip(&[], &drh, Lat, &["darhati"]); + assert_has_tip(&[], &drh, Lit, &["dadarha"]); + assert_has_tas(&[], &drh, Lit, &["dadfhatuH"]); + + let drnh = d("dfhi~", Bhvadi); + assert_has_tip(&[], &drnh, Lat, &["dfMhati"]); + + let brh = d("bfha~", Bhvadi); + assert_has_tip(&[], &brh, Lat, &["barhati"]); + + let brnh = d("bfhi~", Bhvadi); + assert_has_tip(&[], &brnh, Lat, &["bfMhati"]); + + let brhir = d("bfhi~r", Bhvadi); + assert_has_tip(&[], &brhir, Lun, &["abfhat", "abarhIt"]); + + let tuh = d("tuhi~r", Bhvadi); + assert_has_tip(&[], &tuh, Lat, &["tohati"]); + assert_has_tip(&[], &tuh, Lit, &["tutoha"]); + assert_has_tip(&[], &tuh, Lun, &["atuhat", "atohIt"]); + + let duh = d("duhi~r", Bhvadi); + assert_has_tip(&[], &duh, Lat, &["dohati"]); + assert_has_tip(&[], &duh, Lit, &["dudoha"]); + assert_has_tip(&[], &duh, Lun, &["aduhat", "adohIt"]); + + let uh = d("uhi~r", Bhvadi); + assert_has_tip(&[], &uh, Lat, &["ohati"]); + assert_has_tip(&[], &uh, Lit, &["uvoha"]); + assert_has_tas(&[], &uh, Lit, &["UhatuH"]); + assert_has_tip(&[], &uh, Lut, &["ohitA"]); + // TODO: mAn-yoga + assert_has_tip(&[], &uh, Lun, &["OhIt", "Ohat"]); + + let arh = d("arha~", Bhvadi); + assert_has_tip(&[], &arh, Lit, &["Anarha"]); + + let dyut = d("dyuta~\\", Bhvadi); + assert_has_ta(&[], &dyut, Lat, &["dyotate"]); +} + +#[test] +fn sk_2344() { + let dyut = d("dyuta~\\", Bhvadi); + assert_has_ta(&[], &dyut, Lit, &["didyute"]); + assert_has_aataam(&[], &dyut, Lit, &["didyutAte"]); + assert_has_ta(&[], &dyut, Lut, &["dyotitA"]); +} + +#[test] +fn sk_2345() { + let dyut = d("dyuta~\\", Bhvadi); + assert_has_tip(&[], &dyut, Lun, &["adyutat"]); + assert_has_ta(&[], &dyut, Lun, &["adyotizwa"]); + + let shvit = d("SvitA~\\", Bhvadi); + assert_has_ta(&[], &shvit, Lat, &["Svetate"]); + assert_has_ta(&[], &shvit, Lit, &["SiSvite"]); + assert_has_tip(&[], &shvit, Lun, &["aSvitat"]); + assert_has_ta(&[], &shvit, Lun, &["aSvetizwa"]); + + let mid = d("YimidA~\\", Bhvadi); + assert_has_ta(&[], &mid, Lat, &["medate"]); +} + +#[test] +fn sk_2346() { + let mid = d("YimidA~\\", Bhvadi); + assert_has_ta(&[], &mid, Lit, &["mimide"]); + assert_has_tip(&[], &mid, Lun, &["amidat"]); + assert_has_ta(&[], &mid, Lun, &["amedizwa"]); + + let svid = d("YizvidA~\\", Bhvadi); + assert_has_ta(&[], &svid, Lat, &["svedate"]); + assert_has_ta(&[], &svid, Lit, &["sizvide"]); + assert_has_tip(&[], &svid, Lun, &["asvidat"]); + assert_has_ta(&[], &svid, Lun, &["asvedizwa"]); + + let kshvid = d("YikzvidA~\\", Bhvadi); + assert_has_tip(&[], &kshvid, Lun, &["akzvidat"]); + assert_has_ta(&[], &kshvid, Lun, &["akzvedizwa"]); + + let ruc = d("ruca~\\", Bhvadi); + assert_has_ta(&[], &ruc, Lat, &["rocate"]); + assert_has_tip(&[], &ruc, Lun, &["arucat"]); + assert_has_ta(&[], &ruc, Lun, &["arocizwa"]); + + let ghut = d("Guwa~\\", Bhvadi); + assert_has_ta(&[], &ghut, Lat, &["Gowate"]); + assert_has_ta(&[], &ghut, Lit, &["juGuwe"]); + assert_has_tip(&[], &ghut, Lun, &["aGuwat"]); + assert_has_ta(&[], &ghut, Lun, &["aGowizwa"]); + + let rut = d("ruwa~\\", Bhvadi); + assert_has_tip(&[], &rut, Lun, &["aruwat"]); + assert_has_ta(&[], &rut, Lun, &["arowizwa"]); + + let nabh = d("RaBa~\\", Bhvadi); + assert_has_tip(&[], &nabh, Lun, &["anaBat"]); + assert_has_ta(&[], &nabh, Lun, &["anaBizwa"]); + + let tubh = d("tuBa~\\", Bhvadi); + assert_has_tip(&[], &tubh, Lun, &["atuBat"]); + assert_has_ta(&[], &tubh, Lun, &["atoBizwa"]); + + let srans = d("sransu~\\", Bhvadi); + assert_has_tip(&[], &srans, Lun, &["asrasat"]); + assert_has_ta(&[], &srans, Lun, &["asraMsizwa"]); + + let srambh = d("sranBu~\\", Bhvadi); + assert_has_tip(&[], &srambh, Lun, &["asraBat"]); + assert_has_ta(&[], &srambh, Lun, &["asramBizwa"]); + + let vrt = d("vftu~\\", Bhvadi); + assert_has_ta(&[], &vrt, Lat, &["vartate"]); +} + +#[test] +fn skip_sk_2347() {} + +#[test] +fn sk_2348() { + let vrt = d("vftu~\\", Bhvadi); + assert_has_tip(&[], &vrt, Lrt, &["vartsyati"]); + assert_has_ta(&[], &vrt, Lrt, &["vartizyate"]); + assert_has_tip(&[], &vrt, Lun, &["avftat"]); + assert_has_ta(&[], &vrt, Lun, &["avartizwa"]); + assert_has_tip(&[], &vrt, Lrn, &["avartsyat"]); + + let syand = d("syandU~\\", Bhvadi); + assert_has_ta(&[], &syand, Lat, &["syandate"]); + assert_has_ta(&[], &syand, Lit, &["sasyande"]); + assert_has_thaas(&[], &syand, Lit, &["sasyandize", "sasyantse"]); + assert_has_dhvam( + &[], + &syand, + Lit, + &["sasyandiDve", "sasyanDve", "sasyandDve"], + ); + assert_has_ta(&[], &syand, Lut, &["syanditA", "syantA", "syanttA"]); + assert_has_tip(&[], &syand, Lrt, &["syantsyati"]); + assert_has_ta(&[], &syand, Lrt, &["syandizyate", "syantsyate"]); + assert_has_ta(&[], &syand, AshirLin, &["syandizIzwa", "syantsIzwa"]); + assert_has_tip(&[], &syand, Lun, &["asyadat"]); + assert_has_ta(&[], &syand, Lun, &["asyandizwa", "asyanta", "asyantta"]); + // asyandizAtAm is justified by asandizwa above. + assert_has_aataam(&[], &syand, Lun, &["asyantsAtAm", "asyandizAtAm"]); + assert_has_tip(&[], &syand, Lrn, &["asyantsyat"]); + assert_has_ta(&[], &syand, Lrn, &["asyandizyata", "asyantsyata"]); +} + +#[test] +fn sk_2349() { + let syand = d("syandU~\\", Bhvadi); + assert_has_ta(&["anu"], &syand, Lat, &["anuzyandate", "anusyandate"]); +} + +#[test] +fn sk_2350() { + let klp = d("kfpU~\\", Bhvadi); + assert_has_ta(&[], &klp, Lat, &["kalpate"]); + assert_has_ta(&[], &klp, Lit, &["cakxpe"]); + assert_has_thaas(&[], &klp, Lit, &["cakxpize", "cakxpse"]); +} + +#[test] +fn skip_sk_2351() {} + +#[test] +fn sk_2352() { + let klp = d("kfpU~\\", Bhvadi); + assert_has_sip(&[], &klp, Lut, &["kalptAsi"]); + assert_has_tha(&[], &klp, Lut, &["kalptAsTa"]); + assert_has_thaas(&[], &klp, Lut, &["kalpitAse", "kalptAse"]); + assert_has_tip(&[], &klp, Lrt, &["kalpsyati"]); + assert_has_ta(&[], &klp, Lrt, &["kalpizyate", "kalpsyate"]); + assert_has_ta(&[], &klp, AshirLin, &["kalpizIzwa", "kxpsIzwa"]); + assert_has_tip(&[], &klp, Lun, &["akxpat"]); + assert_has_ta(&[], &klp, Lun, &["akalpizwa", "akxpta"]); + assert_has_tip(&[], &klp, Lrn, &["akalpsyat"]); + assert_has_ta(&[], &klp, Lrn, &["akalpizyata", "akalpsyata"]); + + let ghatt = d("Gawa~\\", Bhvadi); + assert_has_ta(&[], &ghatt, Lat, &["Gawate"]); + assert_has_ta(&[], &ghatt, Lit, &["jaGawe"]); + assert_has_tip(&[], &nic(&ghatt), Lat, &["Gawayati"]); + assert_has_tip(&["vi"], &nic(&ghatt), Lat, &["viGawayati"]); + + // TODO: why is this here? + let shru = d("Sru\\", Bhvadi); + assert_has_sip(&[], &shru, Lot, &["SfRu", "SfRutAt"]); + + let vyath = d("vyaTa~\\", Bhvadi); + assert_has_ta(&[], &vyath, Lat, &["vyaTate"]); +} + +#[ignore] +#[test] +fn sk_2353() { + let vyath = d("vyaTa~\\", Bhvadi); + assert_has_ta(&[], &vyath, Lit, &["vivyaTe"]); + + let prath = d("praTa~\\", Bhvadi); + assert_has_ta(&[], &prath, Lit, &["papraTe"]); + + let pras = d("prasa~\\", Bhvadi); + assert_has_ta(&[], &pras, Lit, &["paprase"]); + + // TODO: patch 6.4.93 to match on an-upadha for kzanj + let kshanj = d("kzaji~\\", Bhvadi); + assert_has_ta_k(&[], &nic(&kshanj), Lun, &["akzaYji", "akzAYji"]); + assert_has_krdanta(&[], &nic(&kshanj), Krt::Ramul, &["kzaYjam", "kzAYjam"]); + + let jvar = d("jvara~", Bhvadi); + assert_has_tip(&[], &jvar, Lat, &["jvarati"]); + + let gad = d("gaqa~", Bhvadi); + assert_has_tip(&[], &gad, Lat, &["gaqati"]); + + let hed = d("heqa~", Bhvadi); + assert_has_tip(&[], &hed, Lat, &["heqati"]); + assert_has_tip(&[], &hed, Lit, &["jiheqa"]); + assert_has_tip(&[], &nic(&hed), Lat, &["hiqayati"]); + assert_has_lun_karmani(&[], &hed, &["ahiqi", "ahIqi"]); + + let hed_anadare = d("heqf~", Bhvadi); + assert_has_tip(&[], &nic(&hed_anadare), Lat, &["heqayati"]); + + let stak = d("zwaka~", Bhvadi); + assert_has_tip(&[], &stak, Lat, &["stakati"]); + + let kakh = d("kaKe~", Bhvadi); + assert_has_tip(&[], &kakh, Lun, &["akaKIt"]); + + let kan = d("kaRa~", Bhvadi); + assert_has_tip(&[], &kan, Lit, &["cakARa"]); + + let ran = d("raRa~", Bhvadi); + assert_has_tip(&[], &ran, Lit, &["rarARa"]); + + let krath = d("kraTa~", Bhvadi); + assert_has_tip(&[], &nic(&krath), Lat, &["krATayati"]); + assert_has_lun_karmani(&[], &krath, &["akraTi", "akrATi"]); + assert_has_krdanta(&[], &krath, Krt::Ramul, &["kraTam", "krATam"]); + + let van = d("vana~", Bhvadi); + assert_has_tip(&["pra"], &nic(&van), Lat, &["pravanayati"]); + + let jval = d("jvala~", Bhvadi); + assert_has_tip(&["pra"], &nic(&jval), Lat, &["prajvalayati"]); + + let hval = d("hvala~", Bhvadi); + assert_has_tip(&["pra"], &nic(&hval), Lat, &["prahvalayati"]); + + let hmal = d("hmala~", Bhvadi); + assert_has_tip(&["pra"], &nic(&hmal), Lat, &["prahmalayati"]); + + let dr = d("dF", Bhvadi); + assert_has_tip(&[], &nic(&dr), Lat, &["darayati"]); + + let nr = d("nF", Bhvadi); + assert_has_tip(&[], &nic(&nr), Lat, &["nArayati"]); + + let shra = d("SrA", Bhvadi); + assert_has_tip(&[], &nic(&shra), Lat, &["Srapayati"]); + + let cal = d("cala~", Bhvadi); + assert_has_tip(&[], &nic(&cal), Lat, &["calayati"]); + + let chad = d("CadiH", Bhvadi); + assert_has_tip(&[], &nic(&chad), Lat, &["Cadayati"]); + + let lad = d("laqa~", Bhvadi); + assert_has_tip(&[], &nic(&lad), Lat, &["laqayati"]); + + let mad = d("madI~", Bhvadi); + assert_has_tip(&[], &nic(&mad), Lat, &["madayati"]); + + let dhvan = d("Dvana~", Bhvadi); + assert_has_tip(&[], &nic(&dhvan), Lat, &["Dvanayati"]); + + let dal = d("dala~", Bhvadi); + assert_has_tip(&[], &nic(&dal), Lat, &["dalayati"]); + + let val = d("vala~\\", Bhvadi); + assert_has_tip(&[], &nic(&val), Lat, &["valayati"]); + + let skhal = d("sKala~", Bhvadi); + assert_has_tip(&[], &nic(&skhal), Lat, &["sKalayati"]); + + let trap = d("trapU~\\z", Bhvadi); + assert_has_tip(&[], &nic(&trap), Lat, &["trapayati"]); + + let kshai = d("kzE\\", Bhvadi); + assert_has_tip(&[], &nic(&kshai), Lat, &["kzapayati"]); + + let svan = d("svana~", Bhvadi); + assert_has_tip(&[], &nic(&svan), Lat, &["svanayati"]); + + assert_has_tip(&[], &nic(&svan), Lat, &["jArayati"]); + + assert_has_tip(&[], &nic(&svan), Lat, &["jvalayati"]); + assert_has_tip(&[], &nic(&svan), Lat, &["jvAlayati"]); + assert_has_tip(&[], &nic(&svan), Lat, &["prajvalayati"]); + + assert_has_ta(&[], &nic(&svan), Lat, &["kAmayate"]); + + assert_has_tip(&[], &nic(&svan), Lat, &["Amayati"]); + + assert_has_tip(&[], &nic(&svan), Lat, &["cAmayati"]); + + let sham = d("Samo~", Bhvadi); + assert_has_tip(&["ni"], &nic(&sham), Lat, &["niSAmayati"]); + + assert_has_tip(&[], &nic(&sham), Lat, &["AyAmayati"]); + + let skhad = d("sKadi~\\r", Bhvadi); + assert_has_tip(&["ava"], &skhad, Lat, &["avasKAdayati"]); + assert_has_tip(&["pari"], &skhad, Lat, &["parisKAdayati"]); +} + +#[test] +fn sk_2354() { + // paPaRiTa is in KV 6.4.125. + let phan = d("PaRa~", Bhvadi); + assert_has_tas(&[], &phan, Lit, &["PeRatuH", "paPaRatuH"]); + assert_has_jhi(&[], &phan, Lit, &["PeRuH", "paPaRuH"]); + assert_has_sip(&[], &phan, Lit, &["PeRiTa", "paPaRiTa"]); + assert_has_tip(&[], &nic(&phan), Lat, &["PaRayati"]); + + let raj = d("rAjf~^", Bhvadi); + assert_has_tip(&[], &raj, Lat, &["rAjati"]); + assert_has_ta(&[], &raj, Lat, &["rAjate"]); + assert_has_tas(&[], &raj, Lit, &["rejatuH", "rarAjatuH"]); + assert_has_ta(&[], &raj, Lit, &["reje", "rarAje"]); + + let bhraj = d("wuBrAjf~\\", Bhvadi); + assert_has_ta(&[], &bhraj, Lit, &["Breje", "baBrAje"]); + + let bhrash = d("wuBrASf~\\", Bhvadi); + assert_has_ta(&[], &bhrash, Lat, &["BrASyate", "BrASate"]); + assert_has_ta(&[], &bhrash, Lit, &["BreSe", "baBrASe"]); + + let bhlash = d("wuBlASf~\\", Bhvadi); + assert_has_ta(&[], &bhlash, Lat, &["BlASyate", "BlASate"]); + assert_has_ta(&[], &bhlash, Lit, &["BleSe", "baBlASe"]); + + let syam = d("syamu~", Bhvadi); + assert_has_tas(&[], &syam, Lit, &["syematuH", "sasyamatuH"]); + assert_has_tip(&[], &syam, Lun, &["asyamIt"]); + + let svan = d("svana~", Bhvadi); + assert_has_tas(&[], &svan, Lit, &["svenatuH", "sasvanatuH"]); + assert_has_tip(&[], &svan, Lun, &["asvAnIt", "asvanIt"]); + + // visvanati and avasvanati are from KV 8.3.69. + assert_has_tip(&["vi"], &svan, Lat, &["vizvaRati", "visvanati"]); + assert_has_tip(&["ava"], &svan, Lat, &["avazvaRati", "avasvanati"]); + + let dhvan = d("Dvana~", Bhvadi); + assert_has_tas(&[], &dhvan, Lit, &["daDvanatuH"]); + + let sam = d("zama~", Bhvadi); + assert_has_tip(&[], &sam, Lit, &["sasAma"]); + + let stam = d("zwama~", Bhvadi); + assert_has_tip(&[], &stam, Lit, &["tastAma"]); + + let jval = d("jvala~", Bhvadi); + assert_has_tip(&[], &jval, Lun, &["ajvAlIt"]); + + let bal = d("bala~", Bhvadi); + assert_has_tip(&[], &bal, Lat, &["balati"]); + assert_has_tas(&[], &bal, Lit, &["belatuH"]); + assert_has_jhi(&[], &bal, Lit, &["beluH"]); + + let pul = d("pula~", Bhvadi); + assert_has_tip(&[], &pul, Lat, &["polati"]); + + let kul = d("kula~", Bhvadi); + assert_has_tip(&[], &kul, Lat, &["kolati"]); + assert_has_tip(&[], &kul, Lit, &["cukola"]); + + let shal = d("Sala~", Bhvadi); + assert_has_tip(&[], &shal, Lit, &["SaSAla"]); + + let hul = d("hula~", Bhvadi); + assert_has_tip(&[], &hul, Lit, &["juhola"]); + + let pat = d("patx~", Bhvadi); + assert_has_tip(&[], &pat, Lit, &["papAta"]); + assert_has_tas(&[], &pat, Lit, &["petatuH"]); + assert_has_tip(&[], &pat, Lut, &["patitA"]); +} + +#[test] +fn sk_2355() { + let pat = d("patx~", Bhvadi); + assert_has_tip(&[], &pat, Lun, &["apaptat"]); + assert_has_tip(&["pra", "ni"], &pat, Lun, &["praRyapaptat"]); + + let kvath = d("kvaTe~", Bhvadi); + assert_has_tip(&[], &kvath, Lat, &["kvaTati"]); + assert_has_tip(&[], &kvath, Lit, &["cakvATa"]); + assert_has_tip(&[], &kvath, Lun, &["akvaTIt"]); + + let path = d("paTe~", Bhvadi); + assert_has_tip(&[], &path, Lun, &["apaTIt"]); + + let math = d("maTe~", Bhvadi); + assert_has_tas(&[], &math, Lit, &["meTatuH"]); + assert_has_tip(&[], &math, Lun, &["amaTIt"]); + + let van = d("wuvama~", Bhvadi); + assert_has_tip(&[], &van, Lit, &["vavAma"]); + assert_has_tas(&[], &van, Lit, &["vavamatuH"]); + + let bhram = d("Bramu~", Bhvadi); + assert_has_tip(&[], &bhram, Lat, &["Bramyati", "Bramati"]); +} + +#[test] +fn sk_2356() { + let bhram = d("Bramu~", Bhvadi); + assert_has_tas(&[], &bhram, Lit, &["BrematuH", "baBramatuH"]); + assert_has_tip(&[], &bhram, Lun, &["aBramIt"]); + + let kshar = d("kzara~", Bhvadi); + assert_has_tip(&[], &kshar, Lun, &["akzArIt"]); + + // soQA is from SK 2862. + let sah = d("zaha~\\", Bhvadi); + assert_has_ta(&["pari"], &sah, Lat, &["parizahate"]); + assert_has_ta(&[], &sah, Lit, &["sehe"]); + assert_has_ta(&[], &sah, Lut, &["sahitA", "soQA"]); +} + +#[test] +fn skip_sk_2357() {} + +#[test] +fn sk_2358() { + // sahitA is from SK 2356. + let sah = d("zaha~\\", Bhvadi); + assert_has_ta(&["pari"], &sah, Lut, &["parisoQA", "parizahitA"]); +} + +#[test] +fn sk_2359() { + let sah = d("zaha~\\", Bhvadi); + assert_has_ta(&["pari"], &sah, Lan, &["paryasahata", "paryazahata"]); + + let ram = d("ra\\mu~\\", Bhvadi); + assert_has_ta(&[], &ram, Lit, &["reme"]); + assert_has_thaas(&[], &ram, Lit, &["remize"]); + assert_has_ta(&[], &ram, Lut, &["rantA"]); + assert_has_ta(&[], &ram, Lrt, &["raMsyate"]); + assert_has_ta(&[], &ram, AshirLin, &["raMsIzwa"]); + assert_has_ta(&[], &ram, Lun, &["araMsta"]); +} + +#[test] +fn sk_2360() { + let sad = d("za\\dx~", Bhvadi); + assert_has_tip(&[], &sad, Lat, &["sIdati"]); + assert_has_tip(&[], &sad, Lit, &["sasAda"]); + assert_has_tas(&[], &sad, Lit, &["sedatuH"]); + assert_has_sip(&[], &sad, Lit, &["sediTa", "sasatTa"]); + assert_has_tip(&[], &sad, Lut, &["sattA"]); + assert_has_tip(&[], &sad, Lrt, &["satsyati"]); + assert_has_tip(&[], &sad, Lun, &["asadat"]); + + assert_has_tip(&["ni"], &sad, Lat, &["nizIdati"]); + assert_has_tip(&["ni"], &sad, Lan, &["nyazIdat"]); +} + +#[test] +fn sk_2361() { + let sad = d("za\\dx~", Bhvadi); + assert_has_tip(&["ni"], &sad, Lit, &["nizasAda"]); + assert_has_tas(&["ni"], &sad, Lit, &["nizedatuH"]); +} + +#[test] +fn sk_2362() { + let shad = d("Sa\\dx~", Bhvadi); + assert_has_ta(&[], &shad, Lat, &["SIyate"]); + assert_has_tip(&[], &shad, Lit, &["SaSAda"]); + assert_has_tas(&[], &shad, Lit, &["SedatuH"]); + assert_has_sip(&[], &shad, Lit, &["SediTa", "SaSatTa"]); + assert_has_tip(&[], &shad, Lut, &["SattA"]); + assert_has_tip(&[], &shad, Lun, &["aSadat"]); + + let krush = d("kru\\Sa~", Bhvadi); + assert_has_tip(&[], &krush, Lat, &["kroSati"]); + assert_has_tip(&[], &krush, Lut, &["krozwA"]); + assert_has_tip(&[], &krush, Lun, &["akrukzat"]); + + let kuc = d("kuca~", Bhvadi); + assert_has_tip(&[], &kuc, Lat, &["kocati"]); + assert_has_tip(&[], &kuc, Lit, &["cukoca"]); + + let budh = d("buDa~", Bhvadi); + assert_has_tip(&[], &budh, Lat, &["boDati"]); + assert_has_tip(&[], &budh, Lut, &["boDitA"]); + assert_has_tip(&[], &budh, Lrt, &["boDizyati"]); + + let ruh = d("ru\\ha~", Bhvadi); + assert_has_tip(&[], &ruh, Lat, &["rohati"]); + assert_has_tip(&[], &ruh, Lit, &["ruroha"]); + assert_has_sip(&[], &ruh, Lit, &["rurohiTa"]); + assert_has_tip(&[], &ruh, Lut, &["roQA"]); + assert_has_tip(&[], &ruh, Lrt, &["rokzyati"]); + assert_has_tip(&[], &ruh, Lun, &["arukzat"]); + + let kas = d("kasa~", Bhvadi); + assert_has_tip(&[], &kas, Lun, &["akAsIt", "akasIt"]); + + let hikk = d("hikka~^", Bhvadi); + assert_has_tip(&[], &hikk, Lat, &["hikkati"]); + assert_has_ta(&[], &hikk, Lat, &["hikkate"]); + + let anc = d("ancu~^", Bhvadi); + assert_has_tip(&[], &anc, Lat, &["aYcati"]); + assert_has_ta(&[], &anc, Lat, &["aYcate"]); + + let yac = d("wuyAcf~^", Bhvadi); + assert_has_tip(&[], &yac, Lat, &["yAcati"]); + assert_has_ta(&[], &yac, Lat, &["yAcate"]); + + let ret = d("rewf~^", Bhvadi); + assert_has_tip(&[], &ret, Lat, &["rewati"]); + assert_has_ta(&[], &ret, Lat, &["rewate"]); + + // TODO: text has aYcAtIt? surely acatIt? + let cat = d("cate~^", Bhvadi); + assert_has_tip(&[], &cat, Lit, &["cacAta"]); + assert_has_ta(&[], &cat, Lit, &["cete"]); + assert_has_tip(&[], &cat, Lun, &["acatIt"]); + + let cad = d("cade~^", Bhvadi); + assert_has_tip(&[], &cad, Lit, &["cacAda"]); + assert_has_ta(&[], &cad, Lit, &["cede"]); + assert_has_tip(&[], &cad, Lun, &["acadIt"]); + + let proth = d("proTf~^", Bhvadi); + assert_has_tip(&[], &proth, Lit, &["puproTa"]); + assert_has_ta(&[], &proth, Lit, &["puproTe"]); + + let mid = d("midf~^", Bhvadi); + assert_has_tip(&[], &mid, Lit, &["mimeda"]); + assert_has_ta(&[], &mid, Lit, &["mimide"]); + + let med = d("medf~^", Bhvadi); + assert_has_ta(&[], &med, Lit, &["mimede"]); + + let mith = d("miTf~^", Bhvadi); + assert_has_tip(&[], &mith, Lit, &["mimeTa"]); + + let midh = d("miDf~^", Bhvadi); + assert_has_tip(&[], &midh, Lat, &["meDati"]); + assert_has_tip(&[], &midh, Lit, &["mimeDa"]); + + let nid = d("Ridf~^", Bhvadi); + assert_has_tip(&[], &nid, Lit, &["nineda"]); + assert_has_tas(&[], &nid, Lit, &["ninidatuH"]); + // TODO: text has ninida? + assert_has_jhi(&[], &nid, Lit, &["niniduH"]); + + let ned = d("Redf~^", Bhvadi); + assert_has_ta(&[], &ned, Lit, &["ninede"]); + + let shrdh = d("SfDu~^", Bhvadi); + assert_has_tip(&[], &shrdh, Lat, &["SarDati"]); + assert_has_ta(&[], &shrdh, Lat, &["SarDate"]); + assert_has_tip(&[], &shrdh, Lut, &["SarDitA"]); + + let mrdh = d("mfDu~^", Bhvadi); + assert_has_tip(&[], &mrdh, Lat, &["marDati"]); + assert_has_ta(&[], &mrdh, Lat, &["marDate"]); + + let budh = d("buDi~^r", Bhvadi); + assert_has_tip(&[], &budh, Lat, &["boDati"]); + // TODO: text has boDete? + assert_has_ta(&[], &budh, Lat, &["boDate"]); + assert_has_tip(&[], &budh, Lun, &["abuDat", "aboDIt"]); + assert_has_ta(&[], &budh, Lun, &["aboDizwa"]); + + let bund = d("u~bundi~^r", Bhvadi); + assert_has_ta(&[], &bund, Lit, &["bubunde"]); + assert_has_tip(&[], &bund, Lun, &["abudat", "abundIt"]); + + let ven = d("veRf~^", Bhvadi); + assert_has_tip(&[], &ven, Lat, &["veRati"]); + assert_has_ta(&[], &ven, Lat, &["veRate"]); + + let khan = d("Kanu~^", Bhvadi); + assert_has_tip(&[], &khan, Lat, &["Kanati"]); + assert_has_ta(&[], &khan, Lat, &["Kanate"]); +} + +#[test] +fn sk_2363() { + let khan = d("Kanu~^", Bhvadi); + assert_has_tas(&[], &khan, Lit, &["caKnatuH"]); + assert_has_tip(&[], &khan, AshirLin, &["KAyAt", "KanyAt"]); + + let civ = d("cIvf~^", Bhvadi); + assert_has_tip(&[], &civ, Lit, &["cicIva"]); + assert_has_ta(&[], &civ, Lit, &["cicIve"]); + + let vyay = d("vyaya~^", Bhvadi); + assert_has_tip(&[], &vyay, Lun, &["avyayIt"]); + + let dash = d("dASf~^", Bhvadi); + assert_has_tip(&[], &dash, Lit, &["dadASa"]); + assert_has_ta(&[], &dash, Lit, &["dadASe"]); + + let bhesh = d("Bezf~^", Bhvadi); + assert_has_tip(&[], &bhesh, Lat, &["Bezati"]); + assert_has_ta(&[], &bhesh, Lat, &["Bezate"]); + + let as_ = d("asa~^", Bhvadi); + assert_has_tip(&[], &as_, Lat, &["asati"]); + assert_has_ta(&[], &as_, Lat, &["asate"]); + assert_has_tip(&[], &as_, Lit, &["Asa"]); + assert_has_ta(&[], &as_, Lit, &["Ase"]); + + let spash = d("spaSa~^", Bhvadi); + assert_has_tip(&[], &spash, Lat, &["spaSati"]); + assert_has_ta(&[], &spash, Lat, &["spaSate"]); + + let lash = d("laza~^", Bhvadi); + assert_has_tip(&[], &lash, Lat, &["lazyati", "lazati"]); + assert_has_ta(&[], &lash, Lit, &["leze"]); + + let chash = d("Caza~^", Bhvadi); + assert_has_tas(&[], &chash, Lit, &["cacCazatuH"]); + assert_has_ta(&[], &chash, Lit, &["cacCaze"]); +} + +#[test] +fn sk_2364() { + let ruh = d("guhU~^", Bhvadi); + assert_has_tip(&[], &ruh, Lat, &["gUhati"]); + assert_has_ta(&[], &ruh, Lat, &["gUhate"]); + assert_has_tip(&[], &ruh, Lut, &["gUhitA", "goQA"]); + assert_has_tip(&[], &ruh, Lrt, &["gUhizyati", "Gokzyati"]); + assert_has_tip(&[], &ruh, VidhiLin, &["gUhet"]); + assert_has_tip(&[], &ruh, AshirLin, &["guhyAt"]); + assert_has_tip(&[], &ruh, Lun, &["agUhIt", "aGukzat"]); +} + +#[test] +fn sk_2365() { + // TODO: double-check these. + let guh = d("guhU~^", Bhvadi); + assert_has_ta(&[], &guh, Lun, &["agUQa", "aGukzata", "agUhizwa"]); + assert_has_aataam(&[], &guh, Lun, &["aGukzAtAm", "agUhizAtAm"]); + assert_has_jha(&[], &guh, Lun, &["aGukzanta", "agUhizata"]); + assert_has_vahi(&[], &guh, Lun, &["aguhvahi", "aGukzAvahi", "agUhizvahi"]); + assert_has_mahin(&[], &guh, Lun, &["aGukzAmahi", "agUhizmahi"]); + + let shri = d("SriY", Bhvadi); + assert_has_tip(&[], &shri, Lat, &["Srayati"]); + assert_has_ta(&[], &shri, Lat, &["Srayate"]); + assert_has_tas(&[], &shri, Lit, &["SiSriyatuH"]); + assert_has_tip(&[], &shri, Lut, &["SrayitA"]); + assert_has_tip(&[], &shri, Lun, &["aSiSriyat"]); + + let bhr = d("Bf\\Y", Bhvadi); + assert_has_tip(&[], &bhr, Lat, &["Barati"]); + assert_has_tip(&[], &bhr, Lit, &["baBAra"]); + assert_has_tas(&[], &bhr, Lit, &["baBratuH"]); + assert_has_sip(&[], &bhr, Lit, &["baBarTa"]); + assert_has_vas(&[], &bhr, Lit, &["baBfva"]); + assert_has_thaas(&[], &bhr, Lit, &["baBfze"]); + assert_has_tip(&[], &bhr, Lut, &["BartA"]); +} + +#[test] +fn sk_2366() { + let bhr = d("Bf\\Y", Bhvadi); + assert_has_tip(&[], &bhr, Lrt, &["Barizyati"]); +} + +#[test] +fn sk_2367() { + let bhr = d("Bf\\Y", Bhvadi); + assert_has_tip(&[], &bhr, AshirLin, &["BriyAt"]); +} + +#[test] +fn sk_2368() { + let bhr = d("Bf\\Y", Bhvadi); + assert_has_ta(&[], &bhr, AshirLin, &["BfzIzwa"]); + assert_has_aataam(&[], &bhr, AshirLin, &["BfzIyAstAm"]); + assert_has_tip(&[], &bhr, Lun, &["aBArzIt"]); + assert_has_tas(&[], &bhr, Lun, &["aBArzwAm"]); + assert_has_jhi(&[], &bhr, Lun, &["aBArzuH"]); +} + +#[test] +fn sk_2369() { + let bhr = d("Bf\\Y", Bhvadi); + assert_has_ta(&[], &bhr, Lun, &["aBfta"]); + assert_has_aataam(&[], &bhr, Lun, &["aBfzAtAm"]); + + let hr = d("hf\\Y", Bhvadi); + assert_has_sip(&[], &hr, Lit, &["jaharTa"]); + assert_has_vas(&[], &hr, Lit, &["jahriva"]); + assert_has_thaas(&[], &hr, Lit, &["jahrize"]); + assert_has_tip(&[], &hr, Lut, &["hartA"]); + + let dhr = d("Df\\Y", Bhvadi); + assert_has_tip(&[], &dhr, Lat, &["Darati"]); + assert_has_tip(&[], &dhr, Lun, &["aDArzIt"]); + + let ni = d("RI\\Y", Bhvadi); + assert_has_sip(&[], &ni, Lit, &["ninayiTa", "nineTa"]); + + let dhe = d("De\\w", Bhvadi); + assert_has_tip(&[], &dhe, Lat, &["Dayati"]); +} + +#[test] +fn skip_sk_2370() {} + +#[test] +fn sk_2371() { + let dhe = d("De\\w", Bhvadi); + assert_has_tip(&[], &dhe, Lit, &["daDO"]); +} + +#[test] +fn sk_2372() { + let dhe = d("De\\w", Bhvadi); + assert_has_tas(&[], &dhe, Lit, &["daDatuH"]); + assert_has_jhi(&[], &dhe, Lit, &["daDuH"]); + assert_has_sip(&[], &dhe, Lit, &["daDiTa", "daDATa"]); + assert_has_vas(&[], &dhe, Lit, &["daDiva"]); + assert_has_tip(&[], &dhe, Lut, &["DAtA"]); +} + +#[test] +fn skip_sk_2373() {} + +#[test] +fn sk_2374() { + let dhe = d("De\\w", Bhvadi); + assert_has_tip(&[], &dhe, AshirLin, &["DeyAt"]); + assert_has_tas(&[], &dhe, AshirLin, &["DeyAstAm"]); + assert_has_jhi(&[], &dhe, AshirLin, &["DeyAsuH"]); +} + +#[test] +fn sk_2375() { + // aDAt and aDAtAm are from SK 2376. + // aDAsIt etc. are from SK 2377. + let dhe = d("De\\w", Bhvadi); + assert_has_tip(&[], &dhe, Lun, &["aDAt", "adaDat", "aDAsIt"]); + assert_has_tas(&[], &dhe, Lun, &["aDAtAm", "adaDatAm", "aDAsizwAm"]); +} + +#[test] +fn sk_2376() { + // adaDat etc. are from SK 2375. + // aDAsIt etc. are from SK 2377. + let dhe = d("De\\w", Bhvadi); + assert_has_tip(&[], &dhe, Lun, &["aDAt", "adaDat", "aDAsIt"]); + assert_has_tas(&[], &dhe, Lun, &["aDAtAm", "adaDatAm", "aDAsizwAm"]); + assert_has_jhi(&[], &dhe, Lun, &["aDuH", "adaDan", "aDAsizuH"]); +} + +#[test] +fn sk_2377() { + // adaDat etc. are from SK 2375. + // aDAt etc. are from SK 2376. + let dhe = d("De\\w", Bhvadi); + assert_has_tip(&[], &dhe, Lun, &["aDAt", "adaDat", "aDAsIt"]); + assert_has_tas(&[], &dhe, Lun, &["aDAtAm", "adaDatAm", "aDAsizwAm"]); + assert_has_jhi(&[], &dhe, Lun, &["aDuH", "adaDan", "aDAsizuH"]); + + let glai = d("glE\\", Bhvadi); + assert_has_tip(&[], &glai, Lat, &["glAyati"]); + assert_has_tip(&[], &glai, Lit, &["jaglO"]); + assert_has_sip(&[], &glai, Lit, &["jagliTa", "jaglATa"]); +} + +#[test] +fn sk_2378() { + let glai = d("glE\\", Bhvadi); + assert_has_tip(&[], &glai, AshirLin, &["glAyAt", "gleyAt"]); + assert_has_tip(&[], &glai, Lun, &["aglAsIt"]); + + let mlai = d("mlE\\", Bhvadi); + assert_has_tip(&[], &mlai, Lat, &["mlAyati"]); + + let styai = d("zwyE\\", Bhvadi); + assert_has_tip(&[], &styai, Lat, &["styAyati"]); + + let kshai = d("kzE\\", Bhvadi); + assert_has_tip(&[], &kshai, Lat, &["kzAyati"]); + + let jai = d("jE\\", Bhvadi); + assert_has_tip(&[], &jai, Lit, &["jajO"]); + + let sai = d("zE\\", Bhvadi); + assert_has_tip(&[], &sai, Lit, &["sasO"]); + assert_has_tip(&[], &sai, Lut, &["sAtA"]); + assert_has_tip(&[], &sai, AshirLin, &["sAyAt"]); + assert_has_tip(&[], &sai, Lun, &["asAsIt"]); + + // TODO: SK has gEyAt? + let gai = d("gE\\", Bhvadi); + assert_has_tip(&[], &gai, AshirLin, &["geyAt"]); + assert_has_tip(&[], &gai, Lun, &["agAsIt"]); + + let pai = d("pE\\", Bhvadi); + assert_has_tip(&[], &pai, AshirLin, &["pAyAt"]); + assert_has_tip(&[], &pai, Lun, &["apAsIt"]); + + let stai = d("zwE\\", Bhvadi); + assert_has_tip(&[], &stai, Lat, &["stAyati"]); + + let snai = d("zRE\\", Bhvadi); + assert_has_tip(&[], &snai, Lat, &["snAyati"]); + + let dai = d("dE\\p", Bhvadi); + assert_has_tip(&[], &dai, Lat, &["dAyati"]); + assert_has_tip(&[], &dai, AshirLin, &["dAyAt"]); + assert_has_tip(&[], &dai, Lun, &["adAsIt"]); + + let pa = d("pA\\", Bhvadi); + assert_has_tip(&[], &pa, Lat, &["pibati"]); + assert_has_tip(&[], &pa, AshirLin, &["peyAt"]); + assert_has_tip(&[], &pa, Lun, &["apAt"]); + + let ghra = d("GrA\\", Bhvadi); + assert_has_tip(&[], &ghra, Lat, &["jiGrati"]); + assert_has_tip(&[], &ghra, AshirLin, &["GrAyAt", "GreyAt"]); + assert_has_tip(&[], &ghra, Lun, &["aGrAsIt", "aGrAt"]); + + let dhma = d("DmA\\", Bhvadi); + assert_has_tip(&[], &dhma, Lat, &["Damati"]); + + let stha = d("zWA\\", Bhvadi); + assert_has_tip(&[], &stha, Lat, &["tizWati"]); + assert_has_tip(&["aDi"], &stha, Lit, &["aDitazWO"]); + assert_has_tip(&["aDi"], &stha, Lut, &["aDizWAtA"]); + assert_has_tip(&[], &stha, AshirLin, &["sTeyAt"]); + + let mna = d("mnA\\", Bhvadi); + assert_has_tip(&[], &mna, Lat, &["manati"]); + + let da = d("dA\\R", Bhvadi); + assert_has_tip(&["pra", "ni"], &da, Lat, &["praRiyacCati"]); + assert_has_tip(&[], &da, AshirLin, &["deyAt"]); + assert_has_tip(&[], &da, Lun, &["adAt"]); + + let hvr = d("hvf\\", Bhvadi); + assert_has_tip(&[], &hvr, Lat, &["hvarati"]); +} + +#[test] +fn sk_2379() { + let hvr = d("hvf\\", Bhvadi); + assert_has_tip(&[], &hvr, Lit, &["jahvAra"]); + assert_has_tas(&[], &hvr, Lit, &["jahvaratuH"]); + assert_has_jhi(&[], &hvr, Lit, &["jahvaruH"]); + assert_has_sip(&[], &hvr, Lit, &["jahvarTa"]); + assert_has_tip(&[], &hvr, Lut, &["hvartA"]); + assert_has_tip(&[], &hvr, Lrt, &["hvarizyati"]); +} + +#[test] +fn sk_2380() { + let hvr = d("hvf\\", Bhvadi); + assert_has_tip(&[], &hvr, AshirLin, &["hvaryAt"]); + // LSK has ahvArzIt, which seems more correct + assert_has_tip(&[], &hvr, Lun, &["ahvArzIt"]); + + let svr = d("svf", Bhvadi); + assert_has_sip(&[], &svr, Lit, &["sasvariTa", "sasvarTa"]); +} + +#[ignore] +#[test] +fn sk_2381() { + let svr = d("svf", Bhvadi); + assert_has_vas(&[], &svr, Lit, &["sasvariva"]); + assert_has_mas(&[], &svr, Lit, &["sasvarima"]); + + assert_has_tip(&[], &svr, Lrt, &["svarizyati"]); + assert_has_tip(&[], &svr, AshirLin, &["svaryAt"]); + // asvArIt is in S. C. Vasu's translations. Online editions tend to have "asvarIt" which seems + // incorrect. + assert_has_tip(&[], &svr, Lun, &["asvArIt", "asvArzIt"]); + assert_has_tas(&[], &svr, Lun, &["asvArizwAm", "asvArzwAm"]); + + let sr = d("sf\\", Bhvadi); + assert_has_sip(&[], &sr, Lit, &["sasarTa"]); + assert_has_vas(&[], &sr, Lit, &["sasfva"]); + assert_has_tip(&[], &sr, AshirLin, &["sriyAt"]); + assert_has_tip(&[], &sr, Lun, &["asArzIt"]); + assert_has_tas(&[], &sr, Lun, &["asArzwAm"]); +} + +#[test] +fn sk_2382() { + // sarati is allowed per KV on 7.3.78. + let sr = d("sf\\", Bhvadi); + assert_has_tip(&[], &sr, Lat, &["DAvati", "sarati"]); + + let r = d("f\\", Bhvadi); + assert_has_tip(&[], &r, Lat, &["fcCati"]); +} + +#[test] +fn sk_2383() { + let r = d("f\\", Bhvadi); + assert_has_tip(&[], &r, Lit, &["Ara"]); + assert_has_tas(&[], &r, Lit, &["AratuH"]); + assert_has_jhi(&[], &r, Lit, &["AruH"]); +} + +#[test] +fn sk_2384() { + let r = d("f\\", Bhvadi); + assert_has_sip(&[], &r, Lit, &["AriTa"]); + assert_has_tip(&[], &r, Lut, &["artA"]); + assert_has_tip(&[], &r, Lrt, &["arizyati"]); + assert_has_tip(&[], &r, AshirLin, &["aryAt"]); + assert_has_tip(&[], &r, Lun, &["ArzIt"]); + assert_has_tas(&[], &r, Lun, &["ArzwAm"]); + + let gr = d("gf\\", Bhvadi); + assert_has_tip(&[], &gr, Lat, &["garati"]); + assert_has_tip(&[], &gr, Lit, &["jagAra"]); + assert_has_sip(&[], &gr, Lit, &["jagarTa"]); + assert_has_vas(&[], &gr, Lit, &["jagriva"]); + assert_has_tip(&[], &gr, AshirLin, &["griyAt"]); + assert_has_tip(&[], &gr, Lun, &["agArzIt"]); + + let sru = d("sru\\", Bhvadi); + assert_has_sip(&[], &sru, Lit, &["susroTa"]); + assert_has_vas(&[], &sru, Lit, &["susruva"]); + assert_has_tip(&[], &sru, AshirLin, &["srUyAt"]); + assert_has_tip(&[], &sru, Lun, &["asusruvat"]); + + let su = d("zu\\", Bhvadi); + assert_has_sip(&[], &su, Lit, &["suzoTa", "suzaviTa"]); + assert_has_vas(&[], &su, Lit, &["suzuviva"]); + assert_has_tip(&[], &su, Lut, &["sotA"]); +} + +#[test] +fn sk_2385() { + let su = d("zu\\", Bhvadi); + // TODO: also support asAvIt? + assert_has_tip(&[], &su, Lun, &["asOzIt"]); +} + +#[test] +fn sk_2386() { + let shru = d("Sru\\", Bhvadi); + assert_has_tip(&[], &shru, Lat, &["SfRoti"]); + assert_has_tas(&[], &shru, Lat, &["SfRutaH"]); +} + +#[test] +fn sk_2387() { + let shru = d("Sru\\", Bhvadi); + assert_has_jhi(&[], &shru, Lat, &["SfRvanti"]); + assert_has_mip(&[], &shru, Lat, &["SfRomi"]); + assert_has_vas(&[], &shru, Lat, &["SfRvaH", "SfRuvaH"]); + assert_has_mas(&[], &shru, Lat, &["SfRmaH", "SfRumaH"]); + assert_has_sip(&[], &shru, Lit, &["SuSroTa"]); + assert_has_vas(&[], &shru, Lit, &["SuSruva"]); + assert_has_sip(&[], &shru, Lot, &["SfRu", "SfRutAt"]); + assert_has_mip(&[], &shru, Lot, &["SfRavAni"]); + assert_has_tip(&[], &shru, VidhiLin, &["SfRuyAt"]); + assert_has_tip(&[], &shru, AshirLin, &["SrUyAt"]); + assert_has_tip(&[], &shru, Lun, &["aSrOzIt"]); + + let dhru = d("Dru\\", Bhvadi); + assert_has_tip(&[], &dhru, Lat, &["Dravati"]); + + let du = d("du\\", Bhvadi); + assert_has_sip(&[], &du, Lit, &["dudoTa", "dudaviTa"]); + assert_has_vas(&[], &du, Lit, &["duduviva"]); + + let dru = d("dru\\", Bhvadi); + assert_has_sip(&[], &dru, Lit, &["dudroTa"]); + assert_has_vas(&[], &dru, Lit, &["dudruva"]); + assert_has_tip(&[], &dru, Lun, &["adudruvat"]); + + let ji = d("ji\\", Bhvadi); + assert_has_tip(&[], &ji, Lat, &["jayati"]); + assert_has_ta(&["parA"], &ji, Lat, &["parAjayate"]); + + let smi = d("zmi\\N", Bhvadi); + assert_has_ta(&[], &smi, Lat, &["smayate"]); + assert_has_ta(&[], &smi, Lit, &["sizmiye"]); + assert_has_dhvam(&[], &smi, Lit, &["sizmiyiQve", "sizmiyiDve"]); + + let gu = d("gu\\N", Bhvadi); + assert_has_ta(&[], &gu, Lat, &["gavate"]); + assert_has_ta(&[], &gu, Lit, &["juguve"]); + + let gaa = d("gA\\N", Bhvadi); + assert_has_ta(&[], &gaa, Lat, &["gAte"]); + assert_has_aataam(&[], &gaa, Lat, &["gAte"]); + assert_has_jha(&[], &gaa, Lat, &["gAte"]); + assert_has_iw(&[], &gaa, Lan, &["age"]); + assert_has_ta(&[], &gaa, VidhiLin, &["geta"]); + assert_has_aataam(&[], &gaa, VidhiLin, &["geyAtAm"]); + assert_has_jha(&[], &gaa, VidhiLin, &["geran"]); + assert_has_ta(&[], &gaa, AshirLin, &["gAsIzwa"]); + assert_has_ta(&[], &gaa, Lun, &["agAsta"]); + + let ku = d("ku\\N", Bhvadi); + assert_has_ta(&[], &ku, Lat, &["kavate"]); + assert_has_ta(&[], &ku, Lit, &["cukuve"]); + + let ghu = d("Gu\\N", Bhvadi); + assert_has_ta(&[], &ghu, Lat, &["Gavate"]); + + let u = d("u\\N", Bhvadi); + assert_has_ta(&[], &u, Lat, &["avate"]); + assert_has_ta(&[], &u, Lit, &["Uve"]); + assert_has_ta(&[], &u, Lut, &["otA"]); + assert_has_ta(&[], &u, Lrt, &["ozyate"]); + assert_has_ta(&[], &u, AshirLin, &["ozIzwa"]); + assert_has_ta(&[], &u, Lun, &["Ozwa"]); + + let nu = d("Nu\\N", Bhvadi); + assert_has_ta(&[], &nu, Lat, &["Navate"]); + assert_has_ta(&[], &nu, Lit, &["YuNuve"]); + assert_has_ta(&[], &nu, Lut, &["NotA"]); + + let ru = d("ru\\N", Bhvadi); + assert_has_ta(&[], &ru, Lit, &["ruruve"]); + // TODO: how does SK have ravitAse here? + assert_has_thaas(&[], &ru, Lut, &["rotAse"]); + + let dhr = d("Df\\N", Bhvadi); + assert_has_ta(&[], &dhr, Lat, &["Darate"]); + assert_has_ta(&[], &dhr, Lit, &["daDre"]); + + let me = d("me\\N", Bhvadi); + assert_has_ta(&["pra", "ni"], &me, Lat, &["praRimayate"]); + + let de = d("de\\N", Bhvadi); + assert_has_ta(&[], &de, Lat, &["dayate"]); +} + +#[test] +fn sk_2388() { + let de = d("de\\N", Bhvadi); + assert_has_ta(&[], &de, Lit, &["digye"]); +} + +#[test] +fn sk_2389() { + let de = d("de\\N", Bhvadi); + assert_has_ta(&[], &de, Lun, &["adita"]); + assert_has_thaas(&[], &de, Lun, &["adiTAH"]); + + let shyai = d("SyE\\N", Bhvadi); + assert_has_ta(&[], ­ai, Lat, &["SyAyate"]); + + let pyai = d("pyE\\N", Bhvadi); + assert_has_ta(&[], &pyai, Lat, &["pyAyate"]); + assert_has_ta(&[], &pyai, Lit, &["papye"]); + + let trai = d("trE\\N", Bhvadi); + assert_has_ta(&[], &trai, Lat, &["trAyate"]); + + let pu = d("pUN", Bhvadi); + assert_has_ta(&[], &pu, Lat, &["pavate"]); + assert_has_ta(&[], &pu, Lit, &["pupuve"]); +} + +#[test] +fn sk_2390() { + let tr = d("tF", Bhvadi); + assert_has_tip(&[], &tr, Lat, &["tarati"]); + assert_has_tas(&[], &tr, Lit, &["teratuH"]); + assert_has_jhi(&[], &tr, Lit, &["teruH"]); +} + +#[test] +fn sk_2391() { + let tr = d("tF", Bhvadi); + assert_has_tip(&[], &tr, Lut, &["tarItA", "taritA"]); + assert_has_sip(&[], &tr, Lit, &["teriTa"]); + assert_has_tip(&[], &tr, AshirLin, &["tIryAt"]); +} + +#[test] +fn sk_2392() { + let tr = d("tF", Bhvadi); + assert_has_tas(&[], &tr, Lun, &["atArizwAm"]); +} + +#[test] +fn skip_sk_2393_to_sk_2394() {} + +#[test] +fn sk_2395() { + let gup = d("gupa~\\", Bhvadi); + assert_has_ta(&[], &gup, Lat, &["jugupsate"]); + assert_has_ta( + &[], + &gup, + Lit, + &["jugupsAYcakre", "jugupsAmbaBUva", "jugupsAmAsa"], + ); + + let tij = d("tija~\\", Bhvadi); + assert_has_ta(&[], &tij, Lat, &["titikzate"]); + + let man = d("mAna~\\", Bhvadi); + assert_has_ta(&[], &man, Lat, &["mImAMsate"]); + + let badh = d("baDa~\\", Bhvadi); + assert_has_ta(&[], &badh, Lat, &["bIBatsate"]); + + let rabh = d("ra\\Ba~\\", Bhvadi); + assert_has_ta(&["AN"], &rabh, Lat, &["AraBate"]); + assert_has_ta(&["AN"], &rabh, Lit, &["AreBe"]); + assert_has_ta(&[], &rabh, Lut, &["rabDA"]); + assert_has_ta(&[], &rabh, Lrt, &["rapsyate"]); + + let labh = d("qula\\Ba~\\z", Bhvadi); + assert_has_ta(&[], &labh, Lat, &["laBate"]); +} + +#[test] +fn skip_sk_2396() {} + +#[test] +fn sk_2397() { + let svanj = d("zva\\nja~\\", Bhvadi); + assert_has_ta(&[], &svanj, Lat, &["svajate"]); + assert_has_ta(&["pari"], &svanj, Lat, &["parizvajate"]); + + // dadamBatuH is from SK 2533. + let dambh = d("danBu~", Bhvadi); + assert_has_tas(&[], &dambh, Lit, &["deBatuH", "dadamBatuH"]); + + assert_has_ta(&["pari"], &svanj, Lit, &["parizasvaje", "parizasvaYje"]); + assert_has_thaas(&[], &svanj, Lit, &["sasvajize", "sasvaYjize"]); + assert_has_ta(&[], &svanj, Lut, &["svaNktA"]); + assert_has_ta(&[], &svanj, Lrt, &["svaNkzyate"]); + assert_has_ta(&[], &svanj, VidhiLin, &["svajeta"]); + assert_has_ta(&[], &svanj, AshirLin, &["svaNkzIzwa"]); + assert_has_ta(&["prati"], &svanj, Lun, &["pratyazvaNkta"]); + assert_has_ta(&["pari"], &svanj, Lun, &["paryazvaNkta", "paryasvaNkta"]); + + let had = d("ha\\da~\\", Bhvadi); + assert_has_ta(&[], &had, Lat, &["hadate"]); + assert_has_ta(&[], &had, Lit, &["jahade"]); + assert_has_ta(&[], &had, Lut, &["hattA"]); + assert_has_ta(&[], &had, Lrt, &["hatsyate"]); + assert_has_ta(&[], &had, VidhiLin, &["hadeta"]); + assert_has_ta(&[], &had, AshirLin, &["hatsIzwa"]); + assert_has_ta(&[], &had, Lun, &["ahatta"]); + + let skand = d("ska\\ndi~r", Bhvadi); + assert_has_sip(&[], &skand, Lit, &["caskandiTa", "caskanTa", "caskantTa"]); + assert_has_tip(&[], &skand, Lut, &["skantA", "skanttA"]); + assert_has_tip(&[], &skand, Lrt, &["skantsyati"]); + assert_has_tip(&[], &skand, AshirLin, &["skadyAt"]); + assert_has_tip(&[], &skand, Lun, &["askadat", "askAntsIt"]); + assert_has_tas(&[], &skand, Lun, &["askadatAm", "askAntAm", "askAnttAm"]); + assert_has_jhi(&[], &skand, Lun, &["askadan", "askAntsuH"]); +} + +#[test] +fn sk_2398() { + let skand = d("ska\\ndi~r", Bhvadi); + assert_has_tip( + &["vi"], + &skand, + Lut, + &["vizkantA", "viskantA", "vizkanttA", "viskanttA"], + ); + assert_has_krdanta(&["vi"], &skand, Krt::kta, &["viskanna"]); +} + +#[test] +fn sk_2399() { + let skand = d("ska\\ndi~r", Bhvadi); + assert_has_tip(&["pari"], &skand, Lat, &["parizkandati", "pariskandati"]); + assert_has_krdanta(&["pari"], &skand, Krt::kta, &["parizkaRRa", "pariskanna"]); + + let yabh = d("ya\\Ba~", Bhvadi); + assert_has_sip(&[], &yabh, Lit, &["yeBiTa", "yayabDa"]); + assert_has_tip(&[], &yabh, Lut, &["yabDA"]); + assert_has_tip(&[], &yabh, Lrt, &["yapsyati"]); + assert_has_tip(&[], &yabh, Lun, &["ayApsIt"]); + + let nam = d("Ra\\ma~", Bhvadi); + assert_has_sip(&[], &nam, Lit, &["nemiTa", "nananTa"]); + assert_has_tip(&[], &nam, Lut, &["nantA"]); + assert_has_tip(&[], &nam, Lun, &["anaMsIt"]); + assert_has_tas(&[], &nam, Lun, &["anaMsizwAm"]); +} + +#[test] +fn sk_2400() { + let gam = d("ga\\mx~", Bhvadi); + assert_has_tip(&[], &gam, Lat, &["gacCati"]); + assert_has_tip(&[], &gam, Lit, &["jagAma"]); + assert_has_tas(&[], &gam, Lit, &["jagmatuH"]); + assert_has_jhi(&[], &gam, Lit, &["jagmuH"]); + assert_has_sip(&[], &gam, Lit, &["jagamiTa", "jaganTa"]); + assert_has_tip(&[], &gam, Lut, &["gantA"]); +} + +#[test] +fn sk_2401() { + let gam = d("ga\\mx~", Bhvadi); + assert_has_tip(&[], &gam, Lrt, &["gamizyati"]); + assert_has_tip(&[], &gam, Lun, &["agamat"]); + + let srp = d("sf\\px~", Bhvadi); + assert_has_tip(&[], &srp, Lat, &["sarpati"]); + assert_has_tip(&[], &srp, Lit, &["sasarpa"]); +} + +#[test] +fn sk_2402() { + let srp = d("sf\\px~", Bhvadi); + assert_has_tip(&[], &srp, Lut, &["sraptA", "sarptA"]); + assert_has_tip(&[], &srp, Lrt, &["srapsyati", "sarpsyati"]); + assert_has_tip(&[], &srp, Lun, &["asfpat"]); + + let yam = d("ya\\ma~", Bhvadi); + assert_has_tip(&[], &yam, Lat, &["yacCati"]); + assert_has_sip(&[], &yam, Lit, &["yemiTa", "yayanTa"]); + assert_has_tip(&[], &yam, Lut, &["yantA"]); + assert_has_tip(&[], &yam, Lun, &["ayaMsIt"]); + assert_has_tas(&[], &yam, Lun, &["ayaMsizwAm"]); + + let tap = d("ta\\pa~", Bhvadi); + assert_has_tip(&[], &tap, Lut, &["taptA"]); + assert_has_tip(&[], &tap, Lun, &["atApsIt"]); +} + +#[test] +fn sk_2403() { + let tyaj = d("tya\\ja~", Bhvadi); + assert_has_sip(&[], &tyaj, Lit, &["tatyajiTa", "tatyakTa"]); + assert_has_tip(&[], &tyaj, Lut, &["tyaktA"]); + assert_has_tip(&[], &tyaj, Lun, &["atyAkzIt"]); + + let sanj = d("za\\nja~", Bhvadi); + assert_has_tip(&[], &sanj, Lat, &["sajati"]); + assert_has_tip(&[], &sanj, Lut, &["saNktA"]); + + let drsh = d("df\\Si~r", Bhvadi); + assert_has_tip(&[], &drsh, Lat, &["paSyati"]); +} + +#[test] +fn skip_sk_2404() {} + +#[test] +fn sk_2405() { + let drsh = d("df\\Si~r", Bhvadi); + assert_has_sip(&[], &drsh, Lit, &["dadrazWa", "dadarSiTa"]); + assert_has_tip(&[], &drsh, Lut, &["drazwA"]); + assert_has_tip(&[], &drsh, Lrt, &["drakzyati"]); + assert_has_tip(&[], &drsh, AshirLin, &["dfSyAt"]); +} + +#[test] +fn sk_2406() { + // adrAkzIt is from SK 2407. + let dfs = d("df\\Si~r", Bhvadi); + assert_has_tip(&[], &dfs, Lun, &["adarSat", "adrAkzIt"]); +} + +#[test] +fn sk_2407() { + // adarSat is from SK 2406. + let dfs = d("df\\Si~r", Bhvadi); + assert_has_tip(&[], &dfs, Lun, &["adarSat", "adrAkzIt"]); + + let dansh = d("da\\nSa~", Bhvadi); + assert_has_tip(&[], &dansh, Lat, &["daSati"]); + assert_has_sip(&[], &dansh, Lit, &["dadaMSiTa", "dadaMzWa"]); + assert_has_tip(&[], &dansh, Lut, &["daMzwA"]); + assert_has_tip(&[], &dansh, Lrt, &["daNkzyati"]); + assert_has_tip(&[], &dansh, AshirLin, &["daSyAt"]); + assert_has_tip(&[], &dansh, Lun, &["adANkzIt"]); + + let krsh = d("kf\\za~", Bhvadi); + assert_has_tip(&[], &krsh, Lut, &["krazwA", "karzwA"]); + assert_has_tip(&[], &krsh, Lrt, &["krakzyati", "karkzyati"]); + // akrAkzuH is justified. + assert_has_tip(&[], &krsh, Lun, &["akrAkzIt", "akArkzIt", "akfkzat"]); + assert_has_tas(&[], &krsh, Lun, &["akrAzwAm", "akArzwAm", "akfkzatAm"]); + assert_has_jhi(&[], &krsh, Lun, &["akrAkzuH", "akArkzuH", "akfkzan"]); + + let dah = d("da\\ha~", Bhvadi); + assert_has_sip(&[], &dah, Lit, &["dehiTa", "dadagDa"]); + assert_has_tip(&[], &dah, Lut, &["dagDA"]); + assert_has_tip(&[], &dah, Lrt, &["Dakzyati"]); + assert_has_tip(&[], &dah, Lun, &["aDAkzIt"]); + assert_has_tas(&[], &dah, Lun, &["adAgDAm"]); + assert_has_jhi(&[], &dah, Lun, &["aDAkzuH"]); + + let mih = d("mi\\ha~", Bhvadi); + assert_has_tip(&[], &mih, Lit, &["mimeha"]); + assert_has_sip(&[], &mih, Lit, &["mimehiTa"]); + assert_has_tip(&[], &mih, Lut, &["meQA"]); + assert_has_tip(&[], &mih, Lrt, &["mekzyati"]); + assert_has_tip(&[], &mih, Lun, &["amikzat"]); + + // TODO: cikitsate ?? + let kit = d("kita~", Bhvadi); + assert_has_tip(&[], &kit, Lat, &["cikitsati"]); + let ket = d("keta", Curadi); + assert_has_tip(&[], &ket, Lat, &["ketayati"]); + + let dan = d("dAna~^", Bhvadi); + assert_has_tip(&[], &dan, Lat, &["dIdAMsati"]); + + let shan = d("SAna~^", Bhvadi); + assert_has_tip(&[], &shan, Lat, &["SISAMsati"]); + assert_has_ta(&[], &shan, Lat, &["SISAMsate"]); + + let pac = d("qupa\\ca~^z", Bhvadi); + assert_has_tip(&[], &pac, Lat, &["pacati"]); + assert_has_ta(&[], &pac, Lat, &["pacate"]); + assert_has_sip(&[], &pac, Lit, &["peciTa", "papakTa"]); + assert_has_ta(&[], &pac, Lit, &["pece"]); + assert_has_tip(&[], &pac, Lut, &["paktA"]); + assert_has_ta(&[], &pac, AshirLin, &["pakzIzwa"]); + + let sac = d("zaca~^", Bhvadi); + assert_has_tip(&[], &sac, Lat, &["sacati"]); + assert_has_ta(&[], &sac, Lat, &["sacate"]); + + let bhaj = d("Ba\\ja~^", Bhvadi); + assert_has_tas(&[], &bhaj, Lit, &["BejatuH"]); + assert_has_jhi(&[], &bhaj, Lit, &["BejuH"]); + assert_has_sip(&[], &bhaj, Lit, &["BejiTa", "baBakTa"]); + assert_has_tip(&[], &bhaj, Lut, &["BaktA"]); + assert_has_tip(&[], &bhaj, Lrt, &["Bakzyati"]); + assert_has_ta(&[], &bhaj, Lrt, &["Bakzyate"]); + assert_has_tip(&[], &bhaj, Lun, &["aBAkzIt"]); + assert_has_ta(&[], &bhaj, Lun, &["aBakta"]); + + let ranj = d("ra\\nja~^", Bhvadi); + assert_has_tip(&[], &ranj, Lat, &["rajati"]); + assert_has_ta(&[], &ranj, Lat, &["rajate"]); + assert_has_tip(&[], &ranj, Lun, &["arANkzIt"]); + assert_has_ta(&[], &ranj, Lun, &["araNkta"]); + + let shap = d("Sa\\pa~^", Bhvadi); + assert_has_tip(&[], &shap, Lit, &["SaSApa"]); + assert_has_ta(&[], &shap, Lit, &["Sepe"]); + assert_has_tip(&[], &shap, Lun, &["aSApsIt"]); + assert_has_ta(&[], &shap, Lun, &["aSapta"]); + + let tvish = d("tvi\\za~^", Bhvadi); + assert_has_tip(&[], &tvish, Lat, &["tvezati"]); + assert_has_ta(&[], &tvish, Lat, &["tvezate"]); + assert_has_ta(&[], &tvish, Lit, &["titvize"]); + assert_has_tip(&[], &tvish, Lrt, &["tvekzyati"]); + assert_has_ta(&[], &tvish, AshirLin, &["tvikzIzwa"]); + assert_has_tip(&[], &tvish, Lun, &["atvikzat"]); + assert_has_aataam(&[], &tvish, Lun, &["atvikzAtAm"]); + + let yaj = d("ya\\ja~^", Bhvadi); + assert_has_tip(&[], &yaj, Lat, &["yajati"]); + assert_has_ta(&[], &yaj, Lat, &["yajate"]); +} + +#[test] +fn sk_2408() { + let yaj = d("ya\\ja~^", Bhvadi); + assert_has_tip(&[], &yaj, Lit, &["iyAja"]); +} + +#[test] +fn sk_2409() { + let yaj = d("ya\\ja~^", Bhvadi); + assert_has_tas(&[], &yaj, Lit, &["IjatuH"]); + assert_has_jhi(&[], &yaj, Lit, &["IjuH"]); + assert_has_sip(&[], &yaj, Lit, &["iyajiTa", "iyazWa"]); + assert_has_ta(&[], &yaj, Lit, &["Ije"]); + + assert_has_tip(&[], &yaj, Lut, &["yazwA"]); + assert_has_tip(&[], &yaj, Lrt, &["yakzyati"]); + assert_has_tip(&[], &yaj, AshirLin, &["ijyAt"]); + assert_has_ta(&[], &yaj, AshirLin, &["yakzIzwa"]); + assert_has_tip(&[], &yaj, Lun, &["ayAkzIt"]); + assert_has_ta(&[], &yaj, Lun, &["ayazwa"]); + + let vap = d("quva\\pa~^", Bhvadi); + assert_has_tip(&[], &vap, Lat, &["vapati"]); + assert_has_tip(&[], &vap, Lit, &["uvApa"]); + assert_has_ta(&[], &vap, Lit, &["Upe"]); + assert_has_tip(&[], &vap, Lut, &["vaptA"]); + assert_has_tip(&[], &vap, AshirLin, &["upyAt"]); + assert_has_ta(&[], &vap, AshirLin, &["vapsIzwa"]); + assert_has_tip(&["pra", "ni"], &vap, Lun, &["praRyavApsIt"]); + assert_has_ta(&[], &vap, Lun, &["avapta"]); + + let vah = d("va\\ha~^", Bhvadi); + assert_has_tip(&[], &vah, Lit, &["uvAha"]); + assert_has_sip(&[], &vah, Lit, &["uvoQa", "uvahiTa"]); + assert_has_ta(&[], &vah, Lit, &["Uhe"]); + assert_has_tip(&[], &vah, Lut, &["voQA"]); + assert_has_tip(&[], &vah, Lrt, &["vakzyati"]); + + assert_has_tip(&[], &vah, Lun, &["avAkzIt"]); + assert_has_tas(&[], &vah, Lun, &["avoQAm"]); + assert_has_jhi(&[], &vah, Lun, &["avAkzuH"]); + assert_has_ta(&[], &vah, Lun, &["avoQa"]); + assert_has_aataam(&[], &vah, Lun, &["avakzAtAm"]); + assert_has_jha(&[], &vah, Lun, &["avakzata"]); + assert_has_thaas(&[], &vah, Lun, &["avoQAH"]); + assert_has_dhvam(&[], &vah, Lun, &["avoQvam"]); + + let vas = d("va\\sa~", Bhvadi); + assert_has_tip(&[], &vas, Lat, &["vasati"]); + assert_has_tip(&[], &vas, Lit, &["uvAsa"]); +} + +#[test] +fn sk_2410() { + let vas = d("va\\sa~", Bhvadi); + assert_has_tas(&[], &vas, Lit, &["UzatuH"]); + assert_has_jhi(&[], &vas, Lit, &["UzuH"]); + assert_has_sip(&[], &vas, Lit, &["uvasiTa", "uvasTa"]); + + assert_has_tip(&[], &vas, Lut, &["vastA"]); + assert_has_tip(&[], &vas, Lrt, &["vatsyati"]); + assert_has_tip(&[], &vas, AshirLin, &["uzyAt"]); + assert_has_tip(&[], &vas, Lun, &["avAtsIt"]); + assert_has_tas(&[], &vas, Lun, &["avAttAm"]); + + let ve = d("ve\\Y", Bhvadi); + assert_has_tip(&[], &ve, Lat, &["vayati"]); + assert_has_ta(&[], &ve, Lat, &["vayate"]); +} + +#[test] +fn sk_2411() { + // vavO is from SK 2415. + let ve = d("ve\\Y", Bhvadi); + assert_has_tip(&[], &ve, Lit, &["uvAya", "vavO"]); +} + +#[test] +fn skip_sk_2412() {} + +#[test] +fn sk_2413() { + // UvatuH and UvuH are from SK 2413. + // vavatuH and vavuH are from SK 2415. + let ve = d("ve\\Y", Bhvadi); + assert_has_tas(&[], &ve, Lit, &["UyatuH", "UvatuH", "vavatuH"]); + assert_has_jhi(&[], &ve, Lit, &["UyuH", "UvuH", "vavuH"]); +} + +#[test] +fn sk_2414() { + // vaviTa, vavATa, and vave are from SK 2415. + let ve = d("ve\\Y", Bhvadi); + assert_has_tas(&[], &ve, Lit, &["UyatuH", "UvatuH", "vavatuH"]); + assert_has_jhi(&[], &ve, Lit, &["UyuH", "UvuH", "vavuH"]); + assert_has_sip(&[], &ve, Lit, &["uvayiTa", "vaviTa", "vavATa"]); + assert_has_ta(&[], &ve, Lit, &["Uye", "Uve", "vave"]); +} + +#[test] +fn sk_2415() { + // uvAya is from SK 2411. + let ve = d("ve\\Y", Bhvadi); + assert_has_tip(&[], &ve, Lit, &["uvAya", "vavO"]); + assert_has_tas(&[], &ve, Lit, &["UyatuH", "UvatuH", "vavatuH"]); + assert_has_jhi(&[], &ve, Lit, &["UyuH", "UvuH", "vavuH"]); + assert_has_sip(&[], &ve, Lit, &["uvayiTa", "vaviTa", "vavATa"]); + assert_has_ta(&[], &ve, Lit, &["Uye", "Uve", "vave"]); + + assert_has_tip(&[], &ve, Lut, &["vAtA"]); + assert_has_tip(&[], &ve, AshirLin, &["UyAt"]); + assert_has_ta(&[], &ve, AshirLin, &["vAsIzwa"]); + assert_has_tip(&[], &ve, Lun, &["avAsIt"]); + + let vye = d("vye\\Y", Bhvadi); + assert_has_tip(&[], &vye, Lat, &["vyayati"]); +} + +#[test] +fn sk_2416() { + let vye = d("vye\\Y", Bhvadi); + assert_has_tip(&[], &vye, Lit, &["vivyAya"]); + assert_has_tas(&[], &vye, Lit, &["vivyatuH"]); + assert_has_jhi(&[], &vye, Lit, &["vivyuH"]); + assert_has_sip(&[], &vye, Lit, &["vivyayiTa"]); + assert_has_mip(&[], &vye, Lit, &["vivyAya", "vivyaya"]); + + assert_has_tip(&[], &vye, Lut, &["vyAtA"]); + assert_has_tip(&[], &vye, AshirLin, &["vIyAt"]); + assert_has_ta(&[], &vye, AshirLin, &["vyAsIzwa"]); + assert_has_tip(&[], &vye, Lun, &["avyAsIt"]); + assert_has_ta(&[], &vye, Lun, &["avyAsta"]); +} + +#[test] +fn sk_2417() { + let hve = d("hve\\Y", Bhvadi); + assert_has_tip(&[], &hve, Lit, &["juhAva"]); + assert_has_tas(&[], &hve, Lit, &["juhuvatuH"]); + assert_has_jhi(&[], &hve, Lit, &["juhuvuH"]); + assert_has_sip(&[], &hve, Lit, &["juhoTa", "juhaviTa"]); + assert_has_ta(&[], &hve, Lit, &["juhuve"]); + assert_has_tip(&[], &hve, Lut, &["hvAtA"]); + assert_has_tip(&[], &hve, AshirLin, &["hUyAt"]); + assert_has_ta(&[], &hve, AshirLin, &["hvAsIzwa"]); +} + +#[test] +fn skip_sk_2418() {} + +#[test] +fn sk_2419() { + let hve = d("hve\\Y", Bhvadi); + assert_has_tip(&[], &hve, Lun, &["ahvat"]); + assert_has_tas(&[], &hve, Lun, &["ahvatAm"]); + assert_has_jhi(&[], &hve, Lun, &["ahvan"]); + assert_has_ta(&[], &hve, Lun, &["ahvata", "ahvAsta"]); + + let vad = d("vada~", Bhvadi); + assert_has_tip(&[], &vad, Lat, &["vadati"]); + assert_has_tip(&[], &vad, Lit, &["uvAda"]); + assert_has_tas(&[], &vad, Lit, &["UdatuH"]); + assert_has_sip(&[], &vad, Lit, &["uvadiTa"]); + assert_has_tip(&[], &vad, Lut, &["vaditA"]); + assert_has_tip(&[], &vad, AshirLin, &["udyAt"]); + assert_has_tip(&[], &vad, Lun, &["avAdIt"]); + + let shvi = d("wuo~Svi", Bhvadi); + assert_has_tip(&[], &shvi, Lat, &["Svayati"]); +} + +#[test] +fn sk_2420() { + let shvi = d("wuo~Svi", Bhvadi); + assert_has_tip(&[], &shvi, Lit, &["SuSAva", "SiSvAya"]); + assert_has_tas(&[], &shvi, Lit, &["SuSuvatuH", "SiSviyatuH"]); + assert_has_tip(&[], &shvi, Lut, &["SvayitA"]); + assert_has_tip(&[], &shvi, VidhiLin, &["Svayet"]); + assert_has_tip(&[], &shvi, AshirLin, &["SUyAt"]); +} + +#[test] +fn sk_2421() { + let shvi = d("wuo~Svi", Bhvadi); + // aSiSviyatAm and aSiSviyan are justified. + // aSvayizwAm and aSvayizuH are justified. + assert_has_tip(&[], &shvi, Lun, &["aSvat", "aSiSviyat", "aSvayIt"]); + assert_has_tas(&[], &shvi, Lun, &["aSvatAm", "aSiSviyatAm", "aSvayizwAm"]); + assert_has_jhi(&[], &shvi, Lun, &["aSvan", "aSiSviyan", "aSvayizuH"]); +} + +#[test] +fn sk_2422() { + let fti = d("fti", Bhvadi); + assert_has_ta(&[], &fti, Lat, &["ftIyate"]); + assert_has_ta( + &[], + &fti, + Lit, + &["ftIyAYcakre", "ftIyAmbaBUva", "ftIyAmAsa"], + ); + assert_has_tip(&[], &fti, Lit, &["Anarta"]); + assert_has_tip(&[], &fti, Lrt, &["artizyati"]); + assert_has_tip(&[], &fti, Lun, &["ArtIt"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_44.rs b/vidyut-prakriya/tests/kaumudi_44.rs new file mode 100644 index 0000000..3ac066f --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_44.rs @@ -0,0 +1,977 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2423() { + let ad = d("a\\da~", Adadi); + assert_has_tip(&[], &ad, Lat, &["atti"]); + assert_has_tas(&[], &ad, Lat, &["attaH"]); + assert_has_jhi(&[], &ad, Lat, &["adanti"]); +} + +#[ignore] +#[test] +fn sk_2424() { + // AduH justified by KV 2.4.40. + let ad = d("a\\da~", Adadi); + assert_has_tip(&[], &ad, Lit, &["jaGAsa", "Ada"]); + assert_has_tas(&[], &ad, Lit, &["jakzatuH", "AdatuH"]); + assert_has_jhi(&[], &ad, Lit, &["jakzuH", "AduH"]); + assert_has_sip(&[], &ad, Lit, &["jaGasiTa", "AdiTa"]); + + assert_has_tip(&[], &ad, Lut, &["attA"]); + assert_has_tip(&[], &ad, Lrt, &["atsyati"]); +} + +#[test] +fn sk_2425() { + let ad = d("a\\da~", Adadi); + assert_has_sip(&[], &ad, Lot, &["adDi", "attAt"]); + assert_has_mip(&[], &ad, Lot, &["adAni"]); +} + +#[test] +fn sk_2426() { + let ad = d("a\\da~", Adadi); + assert_has_tip(&[], &ad, Lan, &["Adat"]); + assert_has_tas(&[], &ad, Lan, &["AttAm"]); + assert_has_jhi(&[], &ad, Lan, &["Adan"]); + assert_has_sip(&[], &ad, Lan, &["AdaH"]); + assert_has_thas(&[], &ad, Lan, &["Attam"]); + assert_has_tha(&[], &ad, Lan, &["Atta"]); + assert_has_mip(&[], &ad, Lan, &["Adam"]); + assert_has_vas(&[], &ad, Lan, &["Adva"]); + assert_has_mas(&[], &ad, Lan, &["Adma"]); + + assert_has_tip(&[], &ad, VidhiLin, &["adyAt"]); + assert_has_tas(&[], &ad, VidhiLin, &["adyAtAm"]); + assert_has_jhi(&[], &ad, VidhiLin, &["adyuH"]); + + assert_has_tas(&[], &ad, AshirLin, &["adyAstAm"]); + assert_has_jhi(&[], &ad, AshirLin, &["adyAsuH"]); +} + +#[test] +fn sk_2427() { + let ad = d("a\\da~", Adadi); + assert_has_tip(&[], &ad, Lun, &["aGasat"]); + + let han = d("ha\\na~", Adadi); + assert_has_tip(&["pra", "ni"], &han, Lat, &["praRihanti"]); +} + +#[test] +fn sk_2428() { + let han = d("ha\\na~", Adadi); + assert_has_tas(&[], &han, Lat, &["hataH"]); + assert_has_jhi(&[], &han, Lat, &["Gnanti"]); +} + +#[test] +fn sk_2429() { + let han = d("ha\\na~", Adadi); + assert_has_mip(&["pra"], &han, Lat, &["prahaRmi", "prahanmi"]); + assert_has_vas(&["pra"], &han, Lat, &["prahaRvaH", "prahanvaH"]); + + assert_has_tip(&[], &han, Lit, &["jaGAna"]); + assert_has_tas(&[], &han, Lit, &["jaGnatuH"]); + assert_has_jhi(&[], &han, Lit, &["jaGnuH"]); +} + +#[test] +fn sk_2430() { + let han = d("ha\\na~", Adadi); + assert_has_sip(&[], &han, Lit, &["jaGaniTa", "jaGanTa"]); + assert_has_tip(&[], &han, Lut, &["hantA"]); + assert_has_tip(&[], &han, Lrt, &["hanizyati"]); + assert_has_tip(&[], &han, Lot, &["hantu", "hatAt"]); + assert_has_jhi(&[], &han, Lot, &["Gnantu"]); +} + +#[test] +fn sk_2431() { + let han = d("ha\\na~", Adadi); + assert_has_sip(&[], &han, Lot, &["jahi", "hatAt"]); + assert_has_mip(&[], &han, Lot, &["hanAni"]); + assert_has_vas(&[], &han, Lot, &["hanAva"]); + assert_has_mas(&[], &han, Lot, &["hanAma"]); + + assert_has_tip(&[], &han, Lan, &["ahan"]); + assert_has_tas(&[], &han, Lan, &["ahatAm"]); + assert_has_jhi(&[], &han, Lan, &["aGnan"]); + assert_has_mip(&[], &han, Lan, &["ahanam"]); +} + +#[test] +fn skip_sk_2432_to_sk_2433() {} + +#[test] +fn sk_2434() { + let han = d("ha\\na~", Adadi); + assert_has_tip(&[], &han, AshirLin, &["vaDyAt"]); + assert_has_tas(&[], &han, AshirLin, &["vaDyAstAm"]); + assert_has_tip(&[], &han, VidhiLin, &["hanyAt"]); + assert_has_tip(&["pra"], &han, VidhiLin, &["prahaRyAt"]); + assert_has_tip(&[], &han, Lun, &["avaDIt"]); + + let dvish = d("dvi\\za~^", Adadi); + assert_has_tip(&[], &dvish, Lat, &["dvezwi"]); + assert_has_ta(&[], &dvish, Lat, &["dvizwe"]); + assert_has_tip(&[], &dvish, Lut, &["dvezwA"]); + assert_has_tip(&[], &dvish, Lrt, &["dvekzyati"]); + assert_has_ta(&[], &dvish, Lrt, &["dvekzyate"]); + assert_has_tip(&[], &dvish, Lot, &["dvezwu", "dvizwAt"]); + assert_has_sip(&[], &dvish, Lot, &["dviqQi", "dvizwAt"]); + assert_has_mip(&[], &dvish, Lot, &["dvezARi"]); + assert_has_iw(&[], &dvish, Lot, &["dvezE"]); + assert_has_vahi(&[], &dvish, Lot, &["dvezAvahE"]); + assert_has_tip(&[], &dvish, Lan, &["advew"]); +} + +#[test] +fn sk_2435() { + let dvish = d("dvi\\za~^", Adadi); + assert_has_jhi(&[], &dvish, Lan, &["advizuH", "advizan"]); + assert_has_mip(&[], &dvish, Lan, &["advezam"]); + assert_has_ta(&[], &dvish, VidhiLin, &["dvizIta"]); + assert_has_ta(&[], &dvish, AshirLin, &["dvikzIzwa"]); + assert_has_tip(&[], &dvish, Lun, &["advikzat"]); + + let duh = d("du\\ha~^", Adadi); + assert_has_tip(&[], &duh, Lat, &["dogDi"]); + assert_has_tas(&[], &duh, Lat, &["dugDaH"]); + assert_has_sip(&[], &duh, Lat, &["Dokzi"]); + assert_has_ta(&[], &duh, Lat, &["dugDe"]); + assert_has_thaas(&[], &duh, Lat, &["Dukze"]); + assert_has_dhvam(&[], &duh, Lat, &["DugDve"]); + assert_has_tip(&[], &duh, Lot, &["dogDu", "dugDAt"]); + assert_has_sip(&[], &duh, Lot, &["dugDi", "dugDAt"]); + assert_has_mip(&[], &duh, Lot, &["dohAni"]); + assert_has_thaas(&[], &duh, Lot, &["Dukzva"]); + assert_has_dhvam(&[], &duh, Lot, &["DugDvam"]); + assert_has_iw(&[], &duh, Lot, &["dohE"]); + assert_has_tip(&[], &duh, Lan, &["aDok"]); + assert_has_mip(&[], &duh, Lan, &["adoham"]); + assert_has_dhvam(&[], &duh, Lan, &["aDugDvam"]); + assert_has_tip(&[], &duh, Lun, &["aDukzat"]); + // adugDa is from KV 7.3.73 + assert_has_ta(&[], &duh, Lun, &["aDukzata", "adugDa"]); + + let dih = d("di\\ha~^", Adadi); + assert_has_tip(&["pra", "ni"], &dih, Lat, &["praRidegDi"]); + + let lih = d("li\\ha~^", Adadi); + assert_has_tip(&[], &lih, Lat, &["leQi"]); + assert_has_tas(&[], &lih, Lat, &["lIQaH"]); + assert_has_jhi(&[], &lih, Lat, &["lihanti"]); + assert_has_sip(&[], &lih, Lat, &["lekzi"]); + assert_has_ta(&[], &lih, Lat, &["lIQe"]); + assert_has_thaas(&[], &lih, Lat, &["likze"]); + assert_has_dhvam(&[], &lih, Lat, &["lIQve"]); + assert_has_tip(&[], &lih, Lot, &["leQu", "lIQAt"]); + assert_has_ta(&[], &lih, Lot, &["lIQAm"]); + assert_has_mip(&[], &lih, Lot, &["lehAni"]); + assert_has_tip(&[], &lih, Lan, &["alew"]); + assert_has_ta(&[], &lih, Lun, &["alikzata", "alIQa"]); + assert_has_tas(&[], &lih, Lun, &["alikzatAm"]); + // alihvahi is justified. + assert_has_vahi(&[], &lih, Lun, &["alikzAvahi", "alihvahi"]); + + let caksh = d("ca\\kzi~\\N", Adadi); + assert_has_ta(&[], &caksh, Lat, &["cazwe"]); + assert_has_aataam(&[], &caksh, Lat, &["cakzAte"]); +} + +#[test] +fn skip_sk_2436() {} + +#[test] +fn skip_sk_2439() {} + +#[ignore] +#[test] +fn sk_2440() { + let id = d("Iqa~\\", Adadi); + assert_has_thaas(&[], &id, Lat, &["Iqize"]); + assert_has_dhvam(&[], &id, Lat, &["IqiDve"]); + assert_has_thaas(&[], &id, Lot, &["Iqizva"]); + assert_has_dhvam(&[], &id, Lot, &["IqiDvam"]); + assert_has_dhvam(&[], &id, Lan, &["EqQvam"]); + + let ish = d("ISa~\\", Adadi); + assert_has_ta(&[], &ish, Lat, &["Izwe"]); + assert_has_thaas(&[], &ish, Lat, &["ISize"]); + assert_has_dhvam(&[], &ish, Lat, &["ISiDve"]); + + let aas = d("Asa~\\", Adadi); + assert_has_ta(&[], &aas, Lat, &["Aste"]); + assert_has_ta(&[], &aas, Lit, &["AsAYcakre", "AsAmbaBUva", "AsAmAsa"]); + assert_has_thaas(&[], &aas, Lot, &["Assva"]); + assert_has_dhvam(&[], &aas, Lot, &["ADvam"]); + assert_has_ta(&[], &aas, Lun, &["Asizwa"]); + + let shas = d("SAsu~\\", Adadi); + assert_has_ta(&["AN"], &shas, Lat, &["ASAste"]); + assert_has_aataam(&["AN"], &shas, Lat, &["ASAsAte"]); + + let vas = d("vasa~\\", Adadi); + assert_has_ta(&[], &vas, Lat, &["vaste"]); + assert_has_thaas(&[], &vas, Lat, &["vasse"]); + assert_has_dhvam(&[], &vas, Lat, &["vaDve"]); + assert_has_ta(&[], &vas, Lit, &["vavase"]); + assert_has_ta(&[], &vas, Lut, &["vasitA"]); + + let kans = d("kasi~\\", Adadi); + assert_has_ta(&[], &kans, Lat, &["kaMste"]); + assert_has_aataam(&[], &kans, Lat, &["kaMsAte"]); + assert_has_jha(&[], &kans, Lat, &["kaMsate"]); + + let kas = d("kasa~\\", Adadi); + assert_has_ta(&[], &kas, Lat, &["kaste"]); + + let kash = d("kaSa~\\", Adadi); + assert_has_ta(&[], &kash, Lat, &["kazwe"]); + assert_has_aataam(&[], &kash, Lat, &["kaSAte"]); + assert_has_thaas(&[], &kash, Lat, &["kakze"]); + assert_has_dhvam(&[], &kash, Lat, &["kaqQve"]); + + let nins = d("Risi~\\", Adadi); + assert_has_ta(&[], &nins, Lat, &["niMste"]); + + let nij = d("Riji~\\", Adadi); + assert_has_ta(&[], &nij, Lat, &["niNkte"]); + assert_has_thaas(&[], &nij, Lat, &["niNkze"]); + assert_has_ta(&[], &nij, Lut, &["niYjitA"]); + + let shij = d("Siji~\\", Adadi); + assert_has_ta(&[], &shij, Lat, &["SiNkte"]); + + let pinj = d("piji~\\", Adadi); + assert_has_ta(&[], &pinj, Lat, &["piNkte"]); + + let prnj = d("pfji~\\", Adadi); + assert_has_ta(&[], &prnj, Lat, &["pfNkte"]); + + let vrj = d("vfjI~\\", Adadi); + assert_has_ta(&[], &vrj, Lat, &["vfkte"]); + assert_has_aataam(&[], &vrj, Lat, &["vfjAte"]); + assert_has_thaas(&[], &vrj, Lat, &["vfkze"]); + + let vrji = d("vfji~\\", Adadi); + assert_has_ta(&[], &vrji, Lat, &["vfNkte"]); + + let prc = d("pfcI~\\", Adadi); + assert_has_ta(&[], &prc, Lat, &["pfkte"]); + + let su = d("zUN", Adadi); + assert_has_ta(&[], &su, Lat, &["sUte"]); + assert_has_ta(&[], &su, Lit, &["suzuve"]); + assert_has_thaas(&[], &su, Lit, &["suzuvize"]); + assert_has_ta(&[], &su, Lut, &["sotA", "savitA"]); + assert_has_iw(&[], &su, Lot, &["suvE"]); + assert_has_ta(&[], &su, AshirLin, &["savizIzwa", "sozIzwa"]); + assert_has_ta(&[], &su, Lun, &["asavizwa", "asozwa"]); +} + +#[test] +fn sk_2441() { + let shi = d("SIN", Adadi); + assert_has_ta(&[], &shi, Lat, &["Sete"]); + assert_has_aataam(&[], &shi, Lat, &["SayAte"]); +} + +#[test] +fn sk_2442() { + let shi = d("SIN", Adadi); + assert_has_jha(&[], &shi, Lat, &["Serate"]); + assert_has_thaas(&[], &shi, Lat, &["Seze"]); + assert_has_dhvam(&[], &shi, Lat, &["SeDve"]); + assert_has_iw(&[], &shi, Lat, &["Saye"]); + assert_has_vahi(&[], &shi, Lat, &["Sevahe"]); + assert_has_ta(&[], &shi, Lit, &["SiSye"]); + assert_has_ta(&[], &shi, Lut, &["SayitA"]); + assert_has_ta(&[], &shi, Lun, &["aSayizwa"]); +} + +#[test] +fn sk_2443() { + let yu = d("yu", Adadi); + assert_has_tip(&[], &yu, Lat, &["yOti"]); + assert_has_tas(&[], &yu, Lat, &["yutaH"]); + assert_has_jhi(&[], &yu, Lat, &["yuvanti"]); + assert_has_tip(&[], &yu, Lit, &["yuyAva"]); + assert_has_tip(&[], &yu, Lut, &["yavitA"]); + assert_has_tip(&[], &yu, VidhiLin, &["yuyAt"]); + assert_has_tip(&[], &yu, AshirLin, &["yUyAt"]); + assert_has_tip(&[], &yu, Lun, &["ayAvIt"]); +} + +#[test] +fn sk_2444() { + let ru = d("ru", Adadi); + assert_has_tip(&[], &ru, Lat, &["ravIti", "rOti"]); + assert_has_tas(&[], &ru, Lat, &["ruvItaH", "rutaH"]); + assert_has_jhi(&[], &ru, Lat, &["ruvanti"]); + + let sham = d("Samu~", Divadi); + assert_has_tip(&[], &sham, Lat, &["SAmyati"]); + + // TODO: sk has rUvIyAt? + assert_has_tip(&[], &ru, VidhiLin, &["ruvIyAt", "ruyAt"]); + assert_has_tip(&[], &ru, AshirLin, &["rUyAt"]); + assert_has_tip(&[], &ru, Lun, &["arAvIt"]); + assert_has_tip(&[], &ru, Lrn, &["aravizyat"]); + + let tu = d("tu\\", Adadi); + assert_has_tip(&[], &tu, Lat, &["tavIti", "tOti"]); + assert_has_tas(&[], &tu, Lat, &["tuvItaH", "tutaH"]); + assert_has_tip(&[], &tu, Lut, &["totA"]); + assert_has_tip(&[], &tu, Lrt, &["tozyati"]); + + let nu = d("Ru", Adadi); + assert_has_tip(&[], &nu, Lat, &["nOti"]); + assert_has_tip(&[], &nu, Lut, &["navitA"]); + + let kshu = d("wukzu", Adadi); + assert_has_tip(&[], &kshu, Lat, &["kzOti"]); + assert_has_tip(&[], &kshu, Lut, &["kzavitA"]); + + let kshnu = d("kzRu", Adadi); + assert_has_tip(&[], &kshnu, Lat, &["kzROti"]); + assert_has_tip(&[], &kshnu, Lut, &["kzRavitA"]); + + let snu = d("zRu", Adadi); + assert_has_tip(&[], &snu, Lat, &["snOti"]); + assert_has_tip(&[], &snu, Lit, &["suzRAva"]); + assert_has_tip(&[], &snu, Lut, &["snavitA"]); + assert_has_tip(&[], &snu, VidhiLin, &["snuyAt"]); + assert_has_tip(&[], &snu, AshirLin, &["snUyAt"]); +} + +#[test] +fn sk_2445() { + let urnu = d("UrRuY", Adadi); + assert_has_tip(&[], &urnu, Lat, &["UrROti", "UrRoti"]); + assert_has_tas(&[], &urnu, Lat, &["UrRutaH"]); + assert_has_jhi(&[], &urnu, Lat, &["UrRuvanti"]); + assert_has_ta(&[], &urnu, Lat, &["UrRute"]); + assert_has_aataam(&[], &urnu, Lat, &["UrRuvAte"]); + assert_has_jha(&[], &urnu, Lat, &["UrRuvate"]); +} + +#[test] +fn sk_2446() { + let urnu = d("UrRuY", Adadi); + assert_has_tip(&[], &urnu, Lit, &["UrRunAva"]); + assert_has_tas(&[], &urnu, Lit, &["UrRunuvatuH"]); + assert_has_jhi(&[], &urnu, Lit, &["UrRunuvuH"]); +} + +#[test] +fn sk_2447() { + let urnu = d("UrRuY", Adadi); + assert_has_sip(&[], &urnu, Lit, &["UrRunuviTa", "UrRunaviTa"]); + assert_has_tip(&[], &urnu, Lut, &["UrRuvitA", "UrRavitA"]); + assert_has_tip(&[], &urnu, Lot, &["UrROtu", "UrRotu", "UrRutAt"]); + assert_has_mip(&[], &urnu, Lot, &["UrRavAni"]); + assert_has_iw(&[], &urnu, Lot, &["UrRavE"]); +} + +#[test] +fn sk_2448() { + let urnu = d("UrRuY", Adadi); + assert_has_tip(&[], &urnu, Lan, &["OrRot"]); + assert_has_sip(&[], &urnu, Lan, &["OrRoH"]); + assert_has_tip(&[], &urnu, VidhiLin, &["UrRuyAt"]); + assert_has_sip(&[], &urnu, VidhiLin, &["UrRuyAH"]); + assert_has_ta(&[], &urnu, AshirLin, &["UrRavizIzwa", "UrRuvizIzwa"]); + // OrRAvIt is from SK 2449. + // OrRuvIt is justified. + assert_has_tip(&[], &urnu, Lun, &["OrRavIt", "OrRuvIt", "OrRAvIt"]); + // OrRavizwAm is from SK 2449. + // OrRAvizwAm is justified. + assert_has_tas(&[], &urnu, Lun, &["OrRuvizwAm", "OrRavizwAm", "OrRAvizwAm"]); +} + +#[test] +fn sk_2449() { + let urnu = d("UrRuY", Adadi); + assert_has_tip(&[], &urnu, Lun, &["OrRavIt", "OrRuvIt", "OrRAvIt"]); + assert_has_tas(&[], &urnu, Lun, &["OrRuvizwAm", "OrRavizwAm", "OrRAvizwAm"]); + // OrRavizuH and OrRAvizuH are justified. + assert_has_jhi(&[], &urnu, Lun, &["OrRuvizuH", "OrRavizuH", "OrRAvizuH"]); + + let dyu = d("dyu\\", Adadi); + assert_has_tip(&[], &dyu, Lat, &["dyOti"]); + assert_has_tip(&[], &dyu, Lut, &["dyotA"]); + + let su = d("zu\\", Adadi); + assert_has_tip(&[], &su, Lut, &["sotA"]); + assert_has_tip(&[], &su, Lun, &["asOzIt"]); + + let ku = d("ku\\", Adadi); + assert_has_tip(&[], &ku, Lut, &["kotA"]); + + let stu = d("zwu\\Y", Adadi); + assert_has_tip(&[], &stu, Lat, &["stOti", "stavIti"]); + assert_has_tas(&[], &stu, Lat, &["stutaH", "stuvItaH"]); + assert_has_ta(&[], &stu, Lat, &["stute", "stuvIte"]); + assert_has_tip(&[], &stu, Lun, &["astAvIt"]); + assert_has_tip(&["aBi"], &stu, Lan, &["aByazwOt", "aByazwavIt"]); + assert_has_tip( + &["pari"], + &stu, + Lan, + &["paryazwOt", "paryazwavIt", "paryastOt", "paryastavIt"], + ); +} + +#[test] +fn sk_2450() { + let bru = d("brUY", Adadi); + assert_has_tip(&[], &bru, Lat, &["Aha", "bravIti"]); + assert_has_tas(&[], &bru, Lat, &["AhatuH", "brUtaH"]); + assert_has_jhi(&[], &bru, Lat, &["AhuH", "bruvanti"]); +} + +#[test] +fn sk_2451() { + let bru = d("brUY", Adadi); + assert_has_sip(&[], &bru, Lat, &["AtTa", "bravIzi"]); + assert_has_thas(&[], &bru, Lat, &["AhaTuH", "brUTaH"]); +} + +#[test] +fn sk_2452() { + let bru = d("brUY", Adadi); + assert_has_tip(&[], &bru, Lat, &["bravIti", "Aha"]); + assert_has_tas(&[], &bru, Lat, &["brUtaH", "AhatuH"]); + assert_has_jhi(&[], &bru, Lat, &["bruvanti", "AhuH"]); + assert_has_ta(&[], &bru, Lat, &["brUte"]); +} + +#[test] +fn sk_2453() { + let bru = d("brUY", Adadi); + assert_has_tip(&[], &bru, Lit, &["uvAca"]); + assert_has_tas(&[], &bru, Lit, &["UcatuH"]); + assert_has_jhi(&[], &bru, Lit, &["UcuH"]); + assert_has_sip(&[], &bru, Lit, &["uvaciTa", "uvakTa"]); + assert_has_ta(&[], &bru, Lit, &["Uce"]); + assert_has_tip(&[], &bru, Lut, &["vaktA"]); + assert_has_tip(&[], &bru, Lot, &["bravItu", "brUtAt"]); + assert_has_tip(&[], &bru, VidhiLin, &["brUyAt"]); + assert_has_mip(&[], &bru, Lot, &["bravARi"]); + assert_has_iw(&[], &bru, Lot, &["bravE"]); + // TODO: why brUyAt again? + assert_has_tip(&[], &bru, VidhiLin, &["brUyAt"]); + assert_has_tip(&[], &bru, AshirLin, &["ucyAt"]); +} + +#[test] +fn sk_2454() { + let bru = d("brUY", Adadi); + assert_has_tip(&[], &bru, Lun, &["avocat"]); + assert_has_ta(&[], &bru, Lun, &["avocata"]); + + let i = d("i\\R", Adadi); + assert_has_tip(&[], &i, Lat, &["eti"]); + assert_has_tas(&[], &i, Lat, &["itaH"]); +} + +#[test] +fn sk_2455() { + let i = d("i\\R", Adadi); + assert_has_jhi(&[], &i, Lat, &["yanti"]); + assert_has_tip(&[], &i, Lit, &["iyAya"]); +} + +#[test] +fn sk_2456() { + let i = d("i\\R", Adadi); + assert_has_tas(&[], &i, Lit, &["IyatuH"]); + assert_has_jhi(&[], &i, Lit, &["IyuH"]); + assert_has_sip(&[], &i, Lit, &["iyayiTa", "iyeTa"]); + assert_has_tip(&[], &i, Lut, &["etA"]); + assert_has_sip(&[], &i, Lot, &["ihi", "itAt"]); + assert_has_mip(&[], &i, Lot, &["ayAni"]); + assert_has_tip(&[], &i, Lan, &["Et"]); + assert_has_tas(&[], &i, Lan, &["EtAm"]); + assert_has_jhi(&[], &i, Lan, &["Ayan"]); + assert_has_tip(&[], &i, VidhiLin, &["iyAt"]); + assert_has_tip(&[], &i, AshirLin, &["IyAt"]); +} + +#[ignore] +#[test] +fn sk_2457() { + let i = d("i\\R", Adadi); + assert_has_tip(&["nir"], &i, AshirLin, &["niriyAt"]); + assert_has_tip(&["aBi"], &i, AshirLin, &["aBIyAt"]); + assert_has_tip(&["sam", "AN"], &i, AshirLin, &["sameyAt"]); + + assert_has_tip(&["sam"], &i, AshirLin, &["samIyAt"]); +} + +#[test] +fn sk_2458() { + let i = d("i\\R", Adadi); + assert_has_tip(&[], &i, Lun, &["agAt"]); + assert_has_tas(&[], &i, Lun, &["agAtAm"]); + assert_has_jhi(&[], &i, Lun, &["aguH"]); + + let i = d("i\\N", Adadi); + assert_has_ta(&["aDi"], &i, Lat, &["aDIte"]); + assert_has_aataam(&["aDi"], &i, Lat, &["aDIyAte"]); + assert_has_jha(&["aDi"], &i, Lat, &["aDIyate"]); +} + +#[test] +fn sk_2459() { + let i = d("i\\N", Adadi); + assert_has_ta(&["aDi"], &i, Lit, &["aDijage"]); + assert_has_aataam(&["aDi"], &i, Lit, &["aDijagAte"]); + assert_has_jha(&["aDi"], &i, Lit, &["aDijagire"]); + assert_has_ta(&["aDi"], &i, Lut, &["aDyetA"]); + assert_has_ta(&["aDi"], &i, Lrt, &["aDyezyate"]); + assert_has_iw(&["aDi"], &i, Lot, &["aDyayE"]); + assert_has_ta(&["aDi"], &i, Lan, &["aDyEta"]); + assert_has_aataam(&["aDi"], &i, Lan, &["aDyEyAtAm"]); + assert_has_jha(&["aDi"], &i, Lan, &["aDyEyata"]); + assert_has_iw(&["aDi"], &i, Lan, &["aDyEyi"]); + assert_has_vahi(&["aDi"], &i, Lan, &["aDyEvahi"]); + assert_has_ta(&["aDi"], &i, VidhiLin, &["aDIyIta"]); + assert_has_aataam(&["aDi"], &i, VidhiLin, &["aDIyIyAtAm"]); + assert_has_dhvam(&["aDi"], &i, VidhiLin, &["aDIyIDvam"]); + assert_has_iw(&["aDi"], &i, VidhiLin, &["aDIyIya"]); + assert_has_ta(&["aDi"], &i, AshirLin, &["aDyezIzwa"]); +} + +#[test] +fn skip_sk_2460_to_sk_2461() {} + +#[ignore] +#[test] +fn sk_2462() { + let in_ = d("i\\N", Adadi); + assert_has_ta(&["aDi"], &in_, Lun, &["aDyagIzwa", "aDyEzwa"]); + assert_has_ta(&["aDi"], &in_, Lrn, &["aDyagIzyata", "aDyEzyata"]); + + let ik = d("i\\k", Adadi); + assert_has_jhi(&["aDi"], &ik, Lat, &["aDiyanti"]); + assert_has_tip(&["aDi"], &ik, Lun, &["aDyagAt"]); + + let vi = d("vI\\", Adadi); + assert_has_tip(&[], &vi, Lat, &["veti"]); + assert_has_tas(&[], &vi, Lat, &["vItaH"]); + assert_has_jhi(&[], &vi, Lat, &["viyanti"]); + assert_has_sip(&[], &vi, Lat, &["vezi"]); + assert_has_mip(&[], &vi, Lat, &["vemi"]); + assert_has_sip(&[], &vi, Lot, &["vIhi"]); + assert_has_tip(&[], &vi, Lan, &["avet"]); + assert_has_tas(&[], &vi, Lan, &["avItAm"]); + assert_has_jhi(&[], &vi, Lan, &["aviyan", "avyan"]); + assert_has_tip(&[], &vi, Lat, &["eti"]); + assert_has_tas(&[], &vi, Lat, &["ItaH"]); + assert_has_jhi(&[], &vi, Lat, &["iyanti"]); + assert_has_tip(&[], &vi, AshirLin, &["IyAt"]); + assert_has_tip(&[], &vi, Lun, &["EzIt"]); + + let yaa = d("yA\\", Adadi); + assert_has_tip(&["pra", "ni"], &yaa, Lat, &["praRiyAti"]); + assert_has_tas(&[], &yaa, Lat, &["yAtaH"]); + assert_has_jhi(&[], &yaa, Lat, &["yAnti"]); +} + +#[test] +fn sk_2463() { + let yaa = d("yA\\", Adadi); + assert_has_jhi(&[], &yaa, Lan, &["ayuH", "ayAn"]); + assert_has_tip(&[], &yaa, AshirLin, &["yAyAt"]); + assert_has_tas(&[], &yaa, VidhiLin, &["yAyAtAm"]); + assert_has_tas(&[], &yaa, AshirLin, &["yAyAstAm"]); + + let paa = d("pA\\", Adadi); + assert_has_tas(&[], &paa, AshirLin, &["pAyAstAm"]); + assert_has_tip(&[], &paa, Lun, &["apAsIt"]); + + let daa = d("dA\\p", Adadi); + assert_has_tip(&["pra", "ni"], &daa, Lat, &["praRidAti", "pranidAti"]); + assert_has_tas(&[], &daa, AshirLin, &["dAyAstAm"]); + assert_has_tip(&[], &daa, Lun, &["adAsIt"]); + + let maa = d("mA\\", Adadi); + assert_has_tip(&["pari"], &maa, Lat, &["parimAti"]); + assert_has_tip(&["pra", "ni"], &maa, Lat, &["praRimAti", "pranimAti"]); + + let vac = d("va\\ca~", Adadi); + assert_has_tip(&[], &vac, Lat, &["vakti"]); + assert_has_tas(&[], &vac, Lat, &["vaktaH"]); + assert_has_sip(&[], &vac, Lot, &["vagDi", "vaktAt"]); + assert_has_tip(&[], &vac, VidhiLin, &["vacyAt"]); + assert_has_tip(&[], &vac, AshirLin, &["ucyAt"]); + assert_has_tip(&[], &vac, Lun, &["avocat"]); +} + +#[test] +fn sk_2464() { + let vid = d("vida~", Adadi); + assert_has_tip(&[], &vid, Lat, &["veda", "vetti"]); + assert_has_tas(&[], &vid, Lat, &["vidatuH", "vittaH"]); + assert_has_jhi(&[], &vid, Lat, &["viduH", "vidanti"]); + assert_has_sip(&[], &vid, Lat, &["vetTa", "vetsi"]); + assert_has_thas(&[], &vid, Lat, &["vidaTuH", "vitTaH"]); + assert_has_tha(&[], &vid, Lat, &["vida", "vitTa"]); + assert_has_mip(&[], &vid, Lat, &["veda", "vedmi"]); + assert_has_vas(&[], &vid, Lat, &["vidva", "vidvaH"]); + assert_has_mas(&[], &vid, Lat, &["vidma", "vidmaH"]); + + assert_has_tip( + &[], + &vid, + Lit, + &["viveda", "vidAYcakAra", "vidAmbaBUva", "vidAmAsa"], + ); + assert_has_tas( + &[], + &vid, + Lit, + &[ + "vividatuH", + "vidAYcakratuH", + "vidAmbaBUvatuH", + "vidAmAsatuH", + ], + ); +} + +#[test] +fn skip_sk_2465() {} + +#[test] +fn sk_2468() { + let vid = d("vida~", Adadi); + assert_has_sip(&[], &vid, Lan, &["aveH", "avet"]); + + let as_ = d("asa~", Adadi); + assert_has_tip(&[], &as_, Lat, &["asti"]); +} + +#[test] +fn sk_2469() { + let as_ = d("asa~", Adadi); + assert_has_tas(&[], &as_, Lat, &["staH"]); + assert_has_jhi(&[], &as_, Lat, &["santi"]); + assert_has_sip(&[], &as_, Lat, &["asi"]); + assert_has_thas(&[], &as_, Lat, &["sTaH"]); + assert_has_tha(&[], &as_, Lat, &["sTa"]); + assert_has_mip(&[], &as_, Lat, &["asmi"]); + assert_has_vas(&[], &as_, Lat, &["svaH"]); + assert_has_mas(&[], &as_, Lat, &["smaH"]); +} + +#[test] +fn sk_2470() { + let as_ = d("asa~", Adadi); + assert_has_tip(&[], &as_, Lit, &["baBUva"]); + assert_has_tip(&[], &as_, Lut, &["BavitA"]); + assert_has_tip(&[], &as_, Lot, &["astu", "stAt"]); + assert_has_tas(&[], &as_, Lot, &["stAm"]); + assert_has_jhi(&[], &as_, Lot, &["santu"]); +} + +#[test] +fn sk_2471() { + let as_ = d("asa~", Adadi); + + assert_has_sip(&[], &as_, Lot, &["eDi", "stAt"]); + assert_has_thas(&[], &as_, Lot, &["stam"]); + assert_has_tha(&[], &as_, Lot, &["sta"]); + assert_has_mip(&[], &as_, Lot, &["asAni"]); + assert_has_vas(&[], &as_, Lot, &["asAva"]); + assert_has_mas(&[], &as_, Lot, &["asAma"]); + + assert_has_tip(&[], &as_, Lan, &["AsIt"]); + assert_has_tas(&[], &as_, Lan, &["AstAm"]); + assert_has_jhi(&[], &as_, Lan, &["Asan"]); + assert_has_tip(&[], &as_, VidhiLin, &["syAt"]); + assert_has_tip(&[], &as_, AshirLin, &["BUyAt"]); + assert_has_tip(&[], &as_, Lun, &["aBUt"]); +} + +#[ignore] +#[test] +fn sk_2473() { + let mrj = d("mfjU~", Adadi); + assert_has_tip(&[], &mrj, Lat, &["mArzwi"]); + assert_has_tas(&[], &mrj, Lat, &["mfzwaH"]); + assert_has_jhi(&[], &mrj, Lat, &["mfjanti", "mArjanti"]); + assert_has_tip(&[], &mrj, Lit, &["mamArja"]); + assert_has_tas(&[], &mrj, Lit, &["mamArjatuH", "mamfjatuH"]); + assert_has_sip(&[], &mrj, Lat, &["mamArjiTa", "mamArzWa"]); + assert_has_tip(&[], &mrj, Lut, &["mArjitA", "mArzwA"]); + assert_has_tip(&[], &mrj, Lot, &["mfqQi", "mrzwAt"]); + assert_has_tip(&[], &mrj, Lan, &["amArw"]); + assert_has_mip(&[], &mrj, Lan, &["amArjam"]); + assert_has_tip(&[], &mrj, Lun, &["amArjIt", "amArkzIt"]); +} + +#[test] +fn sk_2474() { + let rud = d("rudi~r", Adadi); + assert_has_tip(&[], &rud, Lat, &["roditi"]); + assert_has_tas(&[], &rud, Lat, &["ruditaH"]); + assert_has_sip(&[], &rud, Lot, &["rudihi", "ruditAt"]); +} + +#[test] +fn skip_sk_2475() {} + +#[test] +fn sk_2476() { + let rud = d("rudi~r", Adadi); + assert_has_tip(&[], &rud, Lan, &["arodIt", "arodat"]); + assert_has_tas(&[], &rud, Lan, &["aruditAm"]); + assert_has_jhi(&[], &rud, Lan, &["arudan"]); + assert_has_sip(&[], &rud, Lan, &["arodIH", "arodaH"]); + assert_has_tip(&[], &rud, VidhiLin, &["rudyAt"]); + assert_has_tip(&[], &rud, Lun, &["arudat", "arodIt"]); + + let svap = d("Yizva\\pa~", Adadi); + assert_has_tip(&[], &svap, Lat, &["svapiti"]); + assert_has_tas(&[], &svap, Lat, &["svapitaH"]); + assert_has_tip(&[], &svap, Lit, &["suzvApa"]); + assert_has_tas(&[], &svap, Lit, &["suzupatuH"]); + assert_has_jhi(&[], &svap, Lit, &["suzupuH"]); + assert_has_sip(&[], &svap, Lit, &["suzvapiTa", "suzvapTa"]); +} + +#[ignore] +#[test] +fn sk_2477() { + let svap = d("Yizva\\pa~", Adadi); + assert_has_tas(&[], &svap, Lit, &["suzuzupatuH"]); + assert_has_jhi(&[], &svap, Lit, &["suzuzupuH"]); + assert_has_tip(&[], &svap, Lat, &["susuzvApa"]); + assert_has_tip(&[], &svap, Lut, &["susvaptA"]); + assert_has_tip(&[], &svap, Lat, &["asvapIt"]); + assert_has_tip(&[], &svap, Lat, &["asvapat"]); + assert_has_tip(&[], &svap, AshirLin, &["svapyAt"]); + assert_has_tip(&[], &svap, AshirLin, &["supyAt"]); + assert_has_tip(&[], &svap, AshirLin, &["suzupyAt"]); + assert_has_tip(&[], &svap, Lat, &["asvApsIt"]); + assert_has_tip(&[], &svap, Lat, &["Svasiti"]); + assert_has_tip(&[], &svap, Lut, &["SvasitA"]); + assert_has_tip(&[], &svap, Lat, &["aSvasIt"]); + assert_has_tip(&[], &svap, Lat, &["aSvasat"]); + assert_has_tip(&[], &svap, Lat, &["SvasyAtAm"]); + assert_has_tas(&[], &svap, AshirLin, &["SvasyAstAm"]); + assert_has_tip(&[], &svap, Lat, &["hmyantakzaRa"]); + assert_has_tip(&[], &svap, Lat, &["aSvasIt"]); + assert_has_tip(&[], &svap, Lat, &["aniti"]); + assert_has_tip(&[], &svap, Lat, &["Ana"]); + assert_has_tip(&[], &svap, Lut, &["anitA"]); + assert_has_tip(&[], &svap, Lat, &["AnIt"]); + assert_has_tip(&[], &svap, Lat, &["Anat"]); +} + +#[test] +fn sk_2478() { + let an = d("ana~", Adadi); + assert_has_tip(&["pra"], &an, Lat, &["prARiti"]); + + let jaksh = d("jakza~", Adadi); + assert_has_tip(&[], &jaksh, Lat, &["jakziti"]); + assert_has_tas(&[], &jaksh, Lat, &["jakzitaH"]); +} + +#[test] +fn sk_2479() { + let jaksh = d("jakza~", Adadi); + assert_has_jhi(&[], &jaksh, Lat, &["jakzati"]); + assert_has_jhi(&[], &jaksh, Lan, &["ajakzuH"]); + + let jagr = d("jAgf", Adadi); + assert_has_tip(&[], &jagr, Lat, &["jAgarti"]); + assert_has_tas(&[], &jagr, Lat, &["jAgftaH"]); + assert_has_jhi(&[], &jagr, Lat, &["jAgrati"]); + assert_has_tip( + &[], + &jagr, + Lit, + &["jajAgAra", "jAgarAYcakAra", "jAgarAmbaBUva", "jAgarAmAsa"], + ); +} + +#[test] +fn sk_2480() { + let jagr = d("jAgf", Adadi); + assert_has_tas( + &[], + &jagr, + Lit, + &[ + "jajAgaratuH", + "jAgarAYcakratuH", + "jAgarAmbaBUvatuH", + "jAgarAmAsatuH", + ], + ); + assert_has_sip(&[], &jagr, Lan, &["ajAgaH"]); + assert_has_tas(&[], &jagr, Lan, &["ajAgftAm"]); +} + +#[test] +fn sk_2481() { + let jagr = d("jAgf", Adadi); + assert_has_jhi(&[], &jagr, Lan, &["ajAgaruH"]); + assert_has_jhi(&[], &jagr, VidhiLin, &["jAgfyuH"]); + assert_has_tip(&[], &jagr, AshirLin, &["jAgaryAt"]); + assert_has_tas(&[], &jagr, AshirLin, &["jAgaryAstAm"]); + assert_has_jhi(&[], &jagr, AshirLin, &["jAgaryAsuH"]); + assert_has_tip(&[], &jagr, Lun, &["ajAgarIt"]); + + let daridra = d("daridrA", Adadi); + assert_has_tip(&[], &daridra, Lat, &["daridrAti"]); +} + +#[test] +fn sk_2482() { + let daridra = d("daridrA", Adadi); + assert_has_tas(&[], &daridra, Lat, &["daridritaH"]); +} + +#[ignore] +#[test] +fn sk_2483() { + let daridra = d("daridrA", Adadi); + assert_has_jhi(&[], &daridra, Lat, &["daridrati"]); + + assert_has_tip( + &[], + &daridra, + Lit, + &["daridrAYcakAra", "daridrAmbaBUva", "daridrAmAsa"], + ); + assert_has_tip(&[], &daridra, Lit, &["dadaridrO"]); + assert_has_tas(&[], &daridra, Lit, &["dadaridratuH"]); + assert_has_tip(&[], &daridra, Lut, &["daridritA"]); + assert_has_tip(&[], &daridra, Lan, &["adaridrAt"]); + assert_has_tas(&[], &daridra, Lan, &["adaridritAm"]); + assert_has_jhi(&[], &daridra, Lan, &["adaridruH"]); + assert_has_tip(&[], &daridra, VidhiLin, &["daridriyAt"]); + assert_has_tip(&[], &daridra, AshirLin, &["daridryAt"]); + assert_has_tip(&[], &daridra, Lun, &["adiridrIt", "adaridrAsIt"]); + + let cakas = d("cakAsf~", Adadi); + assert_has_tip(&[], &cakas, Lat, &["cakAsti"]); + assert_has_tip(&[], &cakas, Lat, &["cakAsati"]); + assert_has_tip(&[], &cakas, Lat, &["cakAsAMcakAra"]); + assert_has_tip(&[], &cakas, Lat, &["cakAdDi"]); +} + +#[test] +fn sk_2484() { + let cakas = d("cakAsf~", Adadi); + // We generate "acakAd" but `assert_has_tip` drops it. + assert_has_tip(&[], &cakas, Lan, &["acakAt"]); + assert_has_jhi(&[], &cakas, Lan, &["acakAsuH"]); +} + +#[test] +fn sk_2485() { + let cakas = d("cakAsf~", Adadi); + assert_has_sip(&[], &cakas, Lan, &["acakAH", "acakAt"]); + + let shas = d("SAsu~", Adadi); + assert_has_tip(&[], &shas, Lat, &["SAsti"]); +} + +#[test] +fn sk_2486() { + let shas = d("SAsu~", Adadi); + assert_has_tas(&[], &shas, Lat, &["SizwaH"]); + assert_has_jhi(&[], &shas, Lat, &["SAsati"]); + assert_has_tas(&[], &shas, Lit, &["SaSAsatuH"]); + assert_has_tip(&[], &shas, Lot, &["SAstu", "SizwAt"]); + assert_has_tas(&[], &shas, Lot, &["SizwAm"]); + assert_has_jhi(&[], &shas, Lot, &["SAsatu"]); +} + +#[test] +fn sk_2487() { + let shas = d("SAsu~", Adadi); + assert_has_sip(&[], &shas, Lot, &["SADi", "SizwAt"]); + assert_has_tip(&[], &shas, Lan, &["aSAt"]); + assert_has_tas(&[], &shas, Lan, &["aSizwAm"]); + assert_has_jhi(&[], &shas, Lan, &["aSAsuH"]); + assert_has_sip(&[], &shas, Lan, &["aSAH", "aSAt"]); + assert_has_tip(&[], &shas, VidhiLin, &["SizyAt"]); + assert_has_tip(&[], &shas, Lun, &["aSizat"]); + assert_has_tip(&[], &shas, Lrn, &["aSAsizyat"]); + + let didhi = d("dIDIN", Adadi); + assert_has_aataam(&[], &didhi, Lat, &["dIDyAte"]); +} + +#[ignore] +#[test] +fn sk_2488() { + let didhi = d("dIDIN", Adadi); + assert_has_iw(&[], &didhi, Lat, &["dIDye"]); + assert_has_ta( + &[], + &didhi, + Lit, + &["dIDyAYcakre", "dIDyAmbaBUva", "dIDyAmAsa"], + ); + assert_has_ta(&[], &didhi, Lut, &["dIDitA"]); + assert_has_ta(&[], &didhi, Lrt, &["dIDizyate"]); + + let sas = d("zasa~", Adadi); + assert_has_tip(&[], &sas, Lat, &["sasti"]); + assert_has_tas(&[], &sas, Lat, &["sastaH"]); + assert_has_jhi(&[], &sas, Lat, &["sasanti"]); + assert_has_tip(&[], &sas, Lit, &["sasAsa"]); + assert_has_tas(&[], &sas, Lit, &["sesatuH"]); + assert_has_tip(&[], &sas, Lot, &["sastu", "sastAt"]); + assert_has_sip(&[], &sas, Lot, &["saDi", "sastAt"]); + assert_has_tip(&[], &sas, Lan, &["asat"]); + assert_has_tas(&[], &sas, Lan, &["asastAm"]); + assert_has_sip(&[], &sas, Lan, &["asaH", "asat"]); + assert_has_tip(&[], &sas, AshirLin, &["sasyAt"]); + assert_has_tip(&[], &sas, Lun, &["asAsIt", "asasIt"]); + + let sanst = d("zasti~", Adadi); + assert_has_tip(&[], &sanst, Lat, &["santi"]); + assert_has_tas(&[], &sanst, Lat, &["santaH"]); + assert_has_tip(&[], &sanst, Lat, &["saMstanti"]); + assert_has_tip(&[], &sanst, Lat, &["saMsti"]); + + let vash = d("vaSa~", Adadi); + assert_has_tip(&[], &vash, Lat, &["vazwi"]); + assert_has_tas(&[], &vash, Lat, &["uzwaH"]); + assert_has_jhi(&[], &vash, Lat, &["uSanti"]); + assert_has_sip(&[], &vash, Lat, &["vakzi"]); + assert_has_thas(&[], &vash, Lat, &["uzwaH"]); + assert_has_tip(&[], &vash, Lat, &["uvASa"]); + assert_has_tas(&[], &vash, Lit, &["USatuH"]); + assert_has_tip(&[], &vash, Lut, &["vaSitA"]); + assert_has_tip(&[], &vash, Lot, &["vazwu", "uzwAt"]); + assert_has_tip(&[], &vash, Lat, &["uqQi", "uzwAt"]); + assert_has_tip(&[], &vash, Lan, &["avaw", "avaq"]); + assert_has_tas(&[], &vash, Lan, &["OzwAm"]); + assert_has_jhi(&[], &vash, Lan, &["OSan"]); + assert_has_mip(&[], &vash, Lan, &["avaSam"]); + assert_has_tip(&[], &vash, AshirLin, &["uSyAtAm"]); + assert_has_tas(&[], &vash, AshirLin, &["uSyAstAm"]); + + let hnu = d("hnu\\N", Adadi); + assert_has_ta(&[], &hnu, Lat, &["hnute"]); + assert_has_ta(&[], &hnu, Lit, &["juhnuve"]); + assert_has_ta(&[], &hnu, VidhiLin, &["hnuvIta"]); + assert_has_ta(&[], &hnu, AshirLin, &["hnozIzwa"]); + assert_has_ta(&[], &hnu, Lun, &["ahnozwa"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_45.rs b/vidyut-prakriya/tests/kaumudi_45.rs new file mode 100644 index 0000000..559e14d --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_45.rs @@ -0,0 +1,326 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn skip_sk_2489() {} + +#[test] +fn sk_2490() { + let hu = d("hu\\", Juhotyadi); + assert_has_tip(&[], &hu, Lat, &["juhoti"]); + assert_has_tas(&[], &hu, Lat, &["juhutaH"]); + assert_has_jhi(&[], &hu, Lat, &["juhvati"]); +} + +#[test] +fn sk_2491() { + let hu = d("hu\\", Juhotyadi); + assert_has_tip( + &[], + &hu, + Lit, + &["juhAva", "juhavAYcakAra", "juhavAmbaBUva", "juhavAmAsa"], + ); + assert_has_tip(&[], &hu, Lut, &["hotA"]); + assert_has_tip(&[], &hu, Lrt, &["hozyati"]); + assert_has_tip(&[], &hu, Lot, &["juhotu", "juhutAt"]); + assert_has_sip(&[], &hu, Lot, &["juhuDi", "juhutAt"]); + assert_has_mip(&[], &hu, Lot, &["juhavAni"]); + assert_has_jhi(&[], &hu, Lan, &["ajuhavuH"]); + assert_has_tip(&[], &hu, VidhiLin, &["juhuyAt"]); + assert_has_tip(&[], &hu, AshirLin, &["hUyAt"]); + assert_has_tip(&[], &hu, Lun, &["ahOzIt"]); + + let bhi = d("YiBI\\", Juhotyadi); + assert_has_tip(&[], &bhi, Lat, &["biBeti"]); +} + +#[test] +fn sk_2492() { + let bhi = d("YiBI\\", Juhotyadi); + assert_has_tas(&[], &bhi, Lat, &["biBitaH", "biBItaH"]); + assert_has_jhi(&[], &bhi, Lat, &["biByati"]); + + assert_has_tip( + &[], + &bhi, + Lit, + &["biBAya", "biBayAYcakAra", "biBayAmbaBUva", "biBayAmAsa"], + ); + assert_has_tip(&[], &bhi, Lut, &["BetA"]); + + let hri = d("hrI\\", Juhotyadi); + assert_has_tip(&[], &hri, Lat, &["jihreti"]); + assert_has_tas(&[], &hri, Lat, &["jihrItaH"]); + assert_has_jhi(&[], &hri, Lat, &["jihriyati"]); + assert_has_tip( + &[], + &hri, + Lit, + &["jihrAya", "jihrayAYcakAra", "jihrayAmbaBUva", "jihrayAmAsa"], + ); +} + +#[test] +fn skip_sk_2493() {} + +#[test] +fn sk_2494() { + let pr = d("pF", Juhotyadi); + assert_has_tip(&[], &pr, Lat, &["piparti"]); + assert_has_tas(&[], &pr, Lat, &["pipUrtaH"]); + assert_has_jhi(&[], &pr, Lat, &["pipurati"]); + assert_has_tip(&[], &pr, Lit, &["papAra"]); +} + +#[ignore] +#[test] +fn sk_2495() { + let prr = d("pF", Juhotyadi); + assert_has_tas(&[], &prr, Lit, &["papratuH", "paparatuH"]); + assert_has_jhi(&[], &prr, Lit, &["papruH", "paparuH"]); + assert_has_tip(&[], &prr, Lut, &["paritA", "parItA"]); + assert_has_tip(&[], &prr, Lan, &["apipaH"]); + assert_has_tas(&[], &prr, Lan, &["apipUrtAm"]); + assert_has_jhi(&[], &prr, Lan, &["apiparuH"]); + assert_has_tip(&[], &prr, VidhiLin, &["pipUryAt"]); + assert_has_tip(&[], &prr, AshirLin, &["pUryAt"]); + assert_has_tip(&[], &prr, Lun, &["apArIt"]); + assert_has_tas(&[], &prr, Lun, &["apArizwAm"]); + + let pr = d("pf", Juhotyadi); + assert_has_tip(&[], &pr, Lat, &["piparti"]); + assert_has_tas(&[], &pr, Lat, &["pipftaH"]); + assert_has_jhi(&[], &pr, Lat, &["piprati"]); + assert_has_tip(&[], &pr, VidhiLin, &["pipfyAt"]); + assert_has_tip(&[], &pr, AshirLin, &["priyAt"]); + assert_has_tip(&[], &pr, Lun, &["apArzIt"]); +} + +#[test] +fn sk_2496() { + let bhr = d("quBf\\Y", Juhotyadi); + assert_has_tip(&[], &bhr, Lat, &["biBarti"]); + assert_has_tas(&[], &bhr, Lat, &["biBftaH"]); + assert_has_jhi(&[], &bhr, Lat, &["biBrati"]); + assert_has_dhvam(&[], &bhr, Lat, &["biBfDve"]); + assert_has_tip( + &[], + &bhr, + Lit, + &["baBAra", "biBarAYcakAra", "biBarAmbaBUva", "biBarAmAsa"], + ); + assert_has_sip( + &[], + &bhr, + Lit, + &[ + "baBarTa", + "biBarAYcakarTa", + "biBarAmbaBUviTa", + "biBarAmAsiTa", + ], + ); + assert_has_vas( + &[], + &bhr, + Lit, + &["baBfva", "biBarAYcakfva", "biBarAmbaBUviva", "biBarAmAsiva"], + ); + assert_has_sip(&[], &bhr, Lot, &["biBfhi", "biBftAt"]); + assert_has_mip(&[], &bhr, Lot, &["biBarARi"]); + assert_has_tip(&[], &bhr, Lan, &["abiBaH"]); + assert_has_tas(&[], &bhr, Lan, &["abiBftAm"]); + assert_has_jhi(&[], &bhr, Lan, &["abiBaruH"]); + assert_has_tip(&[], &bhr, VidhiLin, &["biBfyAt"]); + assert_has_tip(&[], &bhr, AshirLin, &["BriyAt"]); + assert_has_ta(&[], &bhr, AshirLin, &["BfzIzwa"]); + assert_has_tip(&[], &bhr, Lun, &["aBArzIt"]); + assert_has_ta(&[], &bhr, Lun, &["aBfta"]); +} + +#[test] +fn sk_2497() { + let maa = d("mA\\N", Juhotyadi); + assert_has_ta(&[], &maa, Lat, &["mimIte"]); + assert_has_aataam(&[], &maa, Lat, &["mimAte"]); + assert_has_jha(&[], &maa, Lat, &["mimate"]); + assert_has_ta(&["pra", "ni"], &maa, Lun, &["praRyamAsta"]); + + let ohaan = d("o~hA\\N", Juhotyadi); + assert_has_ta(&[], &ohaan, Lat, &["jihIte"]); + assert_has_aataam(&[], &ohaan, Lat, &["jihAte"]); + assert_has_jha(&[], &ohaan, Lat, &["jihate"]); + assert_has_ta(&[], &ohaan, Lit, &["jahe"]); + assert_has_ta(&[], &ohaan, Lut, &["hAtA"]); + assert_has_ta(&[], &ohaan, Lrt, &["hAsyate"]); + + let ohaak = d("o~hA\\k", Juhotyadi); + assert_has_tip(&[], &ohaak, Lat, &["jahAti"]); +} + +#[test] +fn sk_2498() { + let ohaak = d("o~hA\\k", Juhotyadi); + assert_has_tas(&[], &ohaak, Lat, &["jahitaH", "jahItaH"]); + assert_has_jhi(&[], &ohaak, Lat, &["jahati"]); + assert_has_tip(&[], &ohaak, Lit, &["jahO"]); +} + +#[test] +fn sk_2499() { + let ohaak = d("o~hA\\k", Juhotyadi); + assert_has_sip( + &[], + &ohaak, + Lot, + &["jahAhi", "jahihi", "jahIhi", "jahitAt", "jahItAt"], + ); + assert_has_tip(&[], &ohaak, Lan, &["ajahAt"]); + assert_has_jhi(&[], &ohaak, Lan, &["ajahuH"]); +} + +#[test] +fn sk_2500() { + let ohaak = d("o~hA\\k", Juhotyadi); + assert_has_tip(&[], &ohaak, VidhiLin, &["jahyAt"]); + assert_has_tip(&[], &ohaak, AshirLin, &["heyAt"]); + assert_has_tip(&[], &ohaak, Lun, &["ahAsIt"]); + + let daa = d("qudA\\Y", Juhotyadi); + assert_has_tip(&["pra", "ni"], &daa, Lat, &["praRidadAti"]); + assert_has_tas(&[], &daa, Lat, &["dattaH"]); + assert_has_jhi(&[], &daa, Lat, &["dadati"]); + assert_has_ta(&[], &daa, Lat, &["datte"]); + assert_has_tip(&[], &daa, Lit, &["dadO"]); + assert_has_sip(&[], &daa, Lot, &["dehi", "dattAt"]); + assert_has_tip(&[], &daa, Lan, &["adadAt"]); + assert_has_tas(&[], &daa, Lan, &["adattAm"]); + assert_has_jhi(&[], &daa, Lan, &["adaduH"]); + assert_has_tip(&[], &daa, VidhiLin, &["dadyAt"]); + assert_has_tip(&[], &daa, AshirLin, &["deyAt"]); + assert_has_tip(&[], &daa, Lun, &["adAt"]); + assert_has_tas(&[], &daa, Lun, &["adAtAm"]); + assert_has_jhi(&[], &daa, Lun, &["aduH"]); + assert_has_ta(&[], &daa, Lun, &["adita"]); + + let dhaa = d("quDA\\Y", Juhotyadi); + assert_has_tip(&["pra", "ni"], &dhaa, Lat, &["praRidaDAti"]); +} + +#[test] +fn sk_2501() { + let dhaa = d("quDA\\Y", Juhotyadi); + assert_has_tas(&[], &dhaa, Lat, &["DattaH"]); + assert_has_jhi(&[], &dhaa, Lat, &["daDati"]); + assert_has_thas(&[], &dhaa, Lat, &["DatTaH"]); + assert_has_vas(&[], &dhaa, Lat, &["daDvaH"]); + assert_has_ta(&[], &dhaa, Lat, &["Datte"]); + assert_has_thaas(&[], &dhaa, Lat, &["Datse"]); + assert_has_dhvam(&[], &dhaa, Lat, &["DadDve"]); + assert_has_sip(&[], &dhaa, Lot, &["Dehi", "DattAt"]); + assert_has_ta(&[], &dhaa, Lun, &["aDita"]); +} + +#[test] +fn sk_2502() { + let nij = d("Ri\\ji~^r", Juhotyadi); + assert_has_tip(&[], &nij, Lat, &["nenekti"]); + assert_has_tas(&[], &nij, Lat, &["neniktaH"]); + assert_has_jhi(&[], &nij, Lat, &["nenijati"]); + assert_has_tip(&[], &nij, Lit, &["nineja"]); + assert_has_tip(&[], &nij, Lut, &["nektA"]); + assert_has_tip(&[], &nij, Lrt, &["nekzyati"]); + assert_has_tip(&[], &nij, Lot, &["nenektu", "neniktAt"]); + // TODO: SK has nenigDa? + assert_has_sip(&[], &nij, Lot, &["nenigDi", "neniktAt"]); +} + +#[test] +fn sk_2503() { + let nij = d("Ri\\ji~^r", Juhotyadi); + assert_has_mip(&[], &nij, Lot, &["nenijAni"]); + assert_has_tip(&[], &nij, Lan, &["anenek"]); + assert_has_tas(&[], &nij, Lan, &["aneniktAm"]); + assert_has_jhi(&[], &nij, Lan, &["anenijuH"]); + assert_has_tip(&[], &nij, VidhiLin, &["nenijyAt"]); + assert_has_tip(&[], &nij, AshirLin, &["nijyAt"]); + assert_has_tip(&[], &nij, Lun, &["anijat", "anEkzIt"]); + assert_has_ta(&[], &nij, Lun, &["anikta"]); + + let vij = d("vi\\ji~^r", Juhotyadi); + assert_has_tip(&[], &vij, Lat, &["vevekti"]); + assert_has_ta(&[], &vij, Lat, &["vevikte"]); + assert_has_sip(&[], &vij, Lit, &["vivejiTa"]); + + let vish = d("vi\\zx~^", Juhotyadi); + assert_has_tip(&[], &vish, Lat, &["vevezwi"]); + assert_has_ta(&[], &vish, Lat, &["vevizwe"]); + assert_has_tip(&[], &vish, Lun, &["avizat"]); + assert_has_ta(&[], &vish, Lun, &["avikzata"]); + assert_has_aataam(&[], &vish, Lun, &["avikzAtAm"]); + assert_has_jha(&[], &vish, Lun, &["avikzanta"]); + + let r = d("f\\", Juhotyadi); + assert_has_tip(&[], &r, Lat, &["iyarti"]); + assert_has_tas(&[], &r, Lat, &["iyftaH"]); + assert_has_jhi(&[], &r, Lat, &["iyrati"]); + assert_has_tip(&[], &r, Lit, &["Ara"]); + assert_has_tas(&[], &r, Lit, &["AratuH"]); + assert_has_sip(&[], &r, Lit, &["AriTa"]); + assert_has_tip(&[], &r, Lut, &["artA"]); + assert_has_tip(&[], &r, Lrt, &["arizyati"]); + assert_has_mip(&[], &r, Lot, &["iyarARi"]); + assert_has_tip(&[], &r, Lan, &["EyaH"]); + assert_has_tas(&[], &r, Lan, &["EyftAm"]); + assert_has_jhi(&[], &r, Lan, &["EyaruH"]); + assert_has_tip(&[], &r, VidhiLin, &["iyfyAt"]); + assert_has_tip(&[], &r, AshirLin, &["aryAt"]); + assert_has_tip(&[], &r, Lun, &["Arat"]); + + let sr = d("sf\\", Juhotyadi); + assert_has_tip(&[], &sr, Lat, &["sasarti"]); + + let bhas = d("Basa~", Juhotyadi); + assert_has_tip(&[], &bhas, Lat, &["baBasti"]); + assert_has_tas(&[], &bhas, Lat, &["babDaH"]); + assert_has_jhi(&[], &bhas, Lat, &["bapsati"]); + + let ki = d("ki\\", Juhotyadi); + assert_has_tip(&[], &ki, Lat, &["ciketi"]); + + let tur = d("tura~", Juhotyadi); + assert_has_tip(&[], &tur, Lat, &["tutorti"]); + assert_has_tas(&[], &tur, Lat, &["tutUrtaH"]); + assert_has_jhi(&[], &tur, Lat, &["tuturati"]); + + let dhish = d("Diza~", Juhotyadi); + assert_has_tip(&[], &dhish, Lat, &["diDezwi"]); + assert_has_tas(&[], &dhish, Lat, &["diDizwaH"]); + + let dhan = d("Dana~", Juhotyadi); + assert_has_tip(&[], &dhan, Lat, &["daDanti"]); + assert_has_tas(&[], &dhan, Lat, &["daDantaH"]); + assert_has_jhi(&[], &dhan, Lat, &["daDanati"]); + + let jan = d("jana~", Juhotyadi); + assert_has_tip(&[], &jan, Lat, &["jajanti"]); +} + +#[test] +fn sk_2504() { + let jan = d("jana~", Juhotyadi); + assert_has_tas(&[], &jan, Lat, &["jajAtaH"]); + assert_has_jhi(&[], &jan, Lat, &["jajYati"]); + assert_has_sip(&[], &jan, Lat, &["jajaMsi"]); + assert_has_tip(&[], &jan, Lit, &["jajAna"]); + assert_has_tip(&[], &jan, VidhiLin, &["jajanyAt", "jajAyAt"]); + assert_has_tip(&[], &jan, AshirLin, &["janyAt", "jAyAt"]); + + let gaa = d("gA\\", Juhotyadi); + assert_has_tip(&[], &gaa, Lat, &["jigAti"]); + assert_has_tas(&[], &gaa, Lat, &["jigItaH"]); + assert_has_jhi(&[], &gaa, Lat, &["jigati"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_46.rs b/vidyut-prakriya/tests/kaumudi_46.rs new file mode 100644 index 0000000..9a357ba --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_46.rs @@ -0,0 +1,607 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[ignore] +#[test] +fn sk_2505() { + let div = d("divu~", Divadi); + assert_has_tip(&[], &div, Lat, &["dIvyati"]); + assert_has_tip(&[], &div, Lit, &["dideva"]); + assert_has_tip(&[], &div, Lut, &["devitA"]); + assert_has_tip(&[], &div, Lrt, &["devizyati"]); + assert_has_tip(&[], &div, Lot, &["dIvyatu", "dIvyatAt"]); + assert_has_tip(&[], &div, Lan, &["adIvyat"]); + assert_has_tip(&[], &div, VidhiLin, &["dIvyet"]); + assert_has_tip(&[], &div, AshirLin, &["dIvyAt"]); + assert_has_tip(&[], &div, Lun, &["adevIt"]); + assert_has_tip(&[], &div, Lrn, &["adevizyat"]); + + let siv = d("zivu~", Divadi); + assert_has_tip(&["pari"], &siv, Lat, &["parizIvyati"]); + // TODO: is parisizeva allowed? + assert_has_tip(&["pari"], &siv, Lit, &["parizizeva", "parisizeva"]); + assert_has_tip(&["ni"], &siv, Lun, &["nyazevIt", "nyasevIt"]); + + let snus = d("zRusu~", Divadi); + assert_has_tip(&[], &snus, Lat, &["snusyati"]); + assert_has_tip(&[], &snus, Lit, &["suzRosa"]); + + let snas = d("zRasu~", Divadi); + assert_has_tip(&[], &snas, Lat, &["snasyati"]); + assert_has_tip(&[], &snas, Lit, &["sasnAsa"]); + + let knas = d("knasu~", Divadi); + assert_has_tip(&[], &knas, Lit, &["caknAsa"]); + + let vyush = d("vyuza~", Divadi); + assert_has_tip(&[], &vyush, Lit, &["vuvyoza"]); + + let nrt = d("nftI~", Divadi); + assert_has_tip(&[], &nrt, Lat, &["nftyati"]); + assert_has_tip(&[], &nrt, Lit, &["nanarta"]); +} + +#[ignore] +#[test] +fn sk_2506() { + let nrt = d("nftI~", Divadi); + assert_has_tip(&[], &nrt, Lrt, &["nartizyati", "nartsyati"]); + assert_has_tip(&[], &nrt, VidhiLin, &["nftyet"]); + assert_has_tip(&[], &nrt, AshirLin, &["nftyAt"]); + assert_has_tip(&[], &nrt, Lun, &["anartIt"]); + + let tras = d("trasI~", Divadi); + assert_has_tip(&[], &tras, Lat, &["trasyati", "trasati"]); + assert_has_tas(&[], &tras, Lit, &["tresatuH", "tatrasatuH"]); + + let kship = d("kzi\\pa~", Divadi); + assert_has_tip(&[], &kship, Lat, &["kzipyati"]); + assert_has_tip(&[], &kship, Lut, &["kzeptA"]); + + let pushp = d("puzpa~", Divadi); + assert_has_tip(&[], &pushp, Lat, &["puzpyati"]); + assert_has_tip(&[], &pushp, Lit, &["pupuzpa"]); + + let tim = d("tima~", Divadi); + assert_has_tip(&[], &tim, Lat, &["timyati"]); + + let stim = d("zwima~", Divadi); + assert_has_tip(&[], &stim, Lat, &["stimyati"]); + + let stiim = d("zwIma~", Divadi); + assert_has_tip(&[], &stiim, Lat, &["stImyati"]); + + let vrid = d("vrIqa~", Divadi); + assert_has_tip(&[], &vrid, Lat, &["vrIqyati"]); + + let ish = d("iza~", Divadi); + assert_has_tip(&[], &ish, Lat, &["izyati"]); + + let sah = d("zaha~", Divadi); + assert_has_tip(&[], &sah, Lat, &["sahyati"]); + + let suh = d("zuha~", Divadi); + assert_has_tip(&[], &suh, Lat, &["suhyati"]); + + let jrr = d("jFz", Divadi); + assert_has_tip(&[], &jrr, Lat, &["jIryati"]); + assert_has_tas(&[], &jrr, Lit, &["jajaratuH", "jeratuH"]); + assert_has_tip(&[], &jrr, Lut, &["jaritA", "jarItA"]); + assert_has_tip(&[], &jrr, VidhiLin, &["jIryet"]); + assert_has_tip(&[], &jrr, AshirLin, &["jIryAt"]); + // ajArIt is from KV 3.1.58. + assert_has_tip(&[], &jrr, Lun, &["ajarat", "ajArIt"]); + assert_has_tas(&[], &jrr, Lun, &["ajaratAm", "ajArizwAm"]); + + let jhrr = d("JFz", Divadi); + assert_has_tip(&[], &jhrr, Lat, &["JIryati"]); + assert_has_tas(&[], &jhrr, Lit, &["jaJaratuH"]); + assert_has_tip(&[], &jhrr, Lun, &["aJArIt"]); + + let su = d("zUN", Divadi); + assert_has_ta(&[], &su, Lat, &["sUyate"]); + assert_has_ta(&[], &su, Lit, &["suzuve"]); + assert_has_thaas(&[], &su, Lit, &["suzuvize"]); + assert_has_vahi(&[], &su, Lit, &["suzuvivahe"]); + assert_has_ta(&[], &su, Lut, &["sotA", "savitA"]); + + let du = d("dUN", Divadi); + assert_has_ta(&[], &du, Lat, &["dUyate"]); + + let di = d("dI\\N", Divadi); + assert_has_ta(&[], &di, Lat, &["dIyate"]); +} + +#[test] +fn sk_2507() { + let di = d("dI\\N", Divadi); + assert_has_ta(&[], &di, Lit, &["didIye"]); +} + +#[test] +fn sk_2508() { + let di = d("dI\\N", Divadi); + assert_has_ta(&[], &di, Lut, &["dAtA"]); + assert_has_ta(&[], &di, Lrt, &["dAsyate"]); + assert_has_ta(&[], &di, Lun, &["adAsta"]); + assert_has_thaas(&[], &di, Lun, &["adAsTAH"]); + + let di = d("qIN", Divadi); + assert_has_ta(&[], &di, Lat, &["qIyate"]); + assert_has_ta(&[], &di, Lit, &["qiqye"]); + + let dhi = d("DI\\N", Divadi); + assert_has_ta(&[], &dhi, Lat, &["DIyate"]); + assert_has_ta(&[], &dhi, Lit, &["diDye"]); + assert_has_ta(&[], &dhi, Lut, &["DetA"]); + + let mi = d("mI\\N", Divadi); + assert_has_ta(&[], &mi, Lat, &["mIyate"]); + + let ri = d("rI\\N", Divadi); + assert_has_ta(&[], &ri, Lat, &["rIyate"]); +} + +#[test] +fn sk_2509() { + let li = d("lI\\N", Divadi); + assert_has_ta(&[], &li, Lut, &["letA", "lAtA"]); + assert_has_ta(&[], &li, Lrt, &["lezyate", "lAsyate"]); + assert_has_ta(&[], &li, Lat, &["lIyate"]); + assert_has_ta(&[], &li, Lit, &["lilye"]); + + let vri = d("vrI\\N", Divadi); + assert_has_ta(&[], &vri, Lat, &["vrIyate"]); + assert_has_ta(&[], &vri, Lit, &["vivriye"]); + + let p = d("pI\\N", Divadi); + assert_has_ta(&[], &p, Lat, &["pIyate"]); + + let maa = d("mA\\N", Divadi); + assert_has_ta(&[], &maa, Lat, &["mAyate"]); + assert_has_ta(&[], &maa, Lit, &["mame"]); + + let ii = d("I\\N", Divadi); + assert_has_ta(&[], &ii, Lat, &["Iyate"]); + assert_has_ta(&[], &ii, Lit, &["ayAYcakre", "ayAmbaBUva", "ayAmAsa"]); + + let pri = d("prI\\N", Divadi); + assert_has_ta(&[], &pri, Lat, &["prIyate"]); + assert_has_ta(&[], &pri, Lit, &["pipriye"]); +} + +#[test] +fn sk_2510() { + let sho = d("So\\", Divadi); + assert_has_tip(&[], &sho, Lat, &["Syati"]); + assert_has_tas(&[], &sho, Lat, &["SyataH"]); + assert_has_jhi(&[], &sho, Lat, &["Syanti"]); + assert_has_tip(&[], &sho, Lit, &["SaSO"]); + assert_has_tas(&[], &sho, Lit, &["SaSatuH"]); + assert_has_tip(&[], &sho, Lut, &["SAtA"]); + assert_has_tip(&[], &sho, Lrt, &["SAsyati"]); + assert_has_tip(&[], &sho, Lun, &["aSAt", "aSAsIt"]); + assert_has_tas(&[], &sho, Lun, &["aSAtAm", "aSAsizwAm"]); + assert_has_jhi(&[], &sho, Lun, &["aSuH", "aSAsizuH"]); + + let cho = d("Co\\", Divadi); + assert_has_tip(&[], &cho, Lat, &["Cyati"]); + + let so = d("zo\\", Divadi); + assert_has_tip(&[], &so, Lat, &["syati"]); + assert_has_tip(&[], &so, Lit, &["sasO"]); + assert_has_tip(&["aBi"], &so, Lat, &["aBizyati"]); + assert_has_tip(&["aBi"], &so, Lan, &["aByazyat"]); + assert_has_tip(&["aBi"], &so, Lit, &["aBisasO"]); + + let do_ = d("do\\", Divadi); + assert_has_tip(&[], &do_, Lat, &["dyati"]); + assert_has_tip(&[], &do_, Lit, &["dadO"]); + assert_has_tip(&["pra", "ni"], &do_, Lut, &["praRidAtA"]); + assert_has_tip(&[], &do_, AshirLin, &["deyAt"]); + assert_has_tip(&[], &do_, Lun, &["adAt"]); +} + +#[test] +fn sk_2511() { + let jan = d("janI~\\", Divadi); + assert_has_ta(&[], &jan, Lat, &["jAyate"]); + assert_has_ta(&[], &jan, Lit, &["jajYe"]); + assert_has_aataam(&[], &jan, Lit, &["jajYAte"]); + assert_has_jha(&[], &jan, Lit, &["jajYire"]); + assert_has_ta(&[], &jan, Lut, &["janitA"]); + assert_has_ta(&[], &jan, Lrt, &["janizyate"]); +} + +#[test] +fn sk_2512() { + let jan = d("janI~\\", Divadi); + assert_has_ta(&[], &jan, Lun, &["ajani", "ajanizwa"]); + + let dip = d("dIpI~\\", Divadi); + assert_has_ta(&[], &dip, Lat, &["dIpyate"]); + assert_has_ta(&[], &dip, Lit, &["didIpe"]); + assert_has_ta(&[], &dip, Lun, &["adIpi", "adIpizwa"]); + + let pur = d("pUrI~\\", Divadi); + assert_has_ta(&[], &pur, Lat, &["pUryate"]); + assert_has_ta(&[], &pur, Lun, &["apUri", "apUrizwa"]); + + let tur = d("tUrI~\\", Divadi); + assert_has_ta(&[], &tur, Lat, &["tUryate"]); + + let dhur = d("DUrI~\\", Divadi); + assert_has_ta(&[], &dhur, Lat, &["DUryate"]); + assert_has_ta(&[], &dhur, Lit, &["duDUre"]); + + let gur = d("gUrI~\\", Divadi); + assert_has_ta(&[], &gur, Lat, &["gUryate"]); + assert_has_ta(&[], &gur, Lit, &["jugUre"]); + + let tap = d("ta\\pa~\\", Divadi); + assert_has_ta(&[], &tap, Lat, &["tapyate"]); + assert_has_ta(&[], &tap, Lut, &["taptA"]); + assert_has_ta(&[], &tap, Lrt, &["tapsyate"]); + + let vrt = d("vftu~\\", Divadi); + assert_has_ta(&[], &vrt, Lat, &["vftyate"]); + + let klish = d("kliSa~\\", Divadi); + assert_has_ta(&[], &klish, Lat, &["kliSyate"]); + assert_has_ta(&[], &klish, Lut, &["kleSitA"]); + + let kash = d("kASf~\\", Divadi); + assert_has_ta(&[], &kash, Lat, &["kASyate"]); + + let vash = d("vASf~\\", Divadi); + assert_has_ta(&[], &vash, Lat, &["vASyate"]); + assert_has_ta(&[], &vash, Lit, &["vavASe"]); + + let mrsh = d("mfza~^", Divadi); + assert_has_tip(&[], &mrsh, Lat, &["mfzyati"]); + assert_has_ta(&[], &mrsh, Lat, &["mfzyate"]); + assert_has_tip(&[], &mrsh, Lit, &["mamarza"]); + assert_has_ta(&[], &mrsh, Lit, &["mamfze"]); + + let shuc = d("I~Suci~^r", Divadi); + assert_has_tip(&[], &shuc, Lat, &["Sucyati"]); + assert_has_ta(&[], &shuc, Lat, &["Sucyate"]); + assert_has_tip(&[], &shuc, Lit, &["SuSoca"]); + assert_has_ta(&[], &shuc, Lit, &["SuSuce"]); + assert_has_tip(&[], &shuc, Lun, &["aSucat", "aSocIt"]); + assert_has_ta(&[], &shuc, Lun, &["aSocizwa"]); + + let nah = d("Ra\\ha~^", Divadi); + assert_has_tip(&[], &nah, Lat, &["nahyati"]); + assert_has_ta(&[], &nah, Lat, &["nahyate"]); + assert_has_tip(&[], &nah, Lit, &["nanAha"]); + assert_has_sip(&[], &nah, Lit, &["nanadDa", "nehiTa"]); + assert_has_ta(&[], &nah, Lit, &["nehe"]); + assert_has_tip(&[], &nah, Lut, &["nadDA"]); + assert_has_tip(&[], &nah, Lrt, &["natsyati"]); + assert_has_tip(&[], &nah, Lun, &["anAtsIt"]); + + let ranj = d("ra\\nja~^", Divadi); + assert_has_tip(&[], &ranj, Lat, &["rajyati"]); + assert_has_ta(&[], &ranj, Lat, &["rajyate"]); + + let shap = d("Sa\\pa~^", Divadi); + assert_has_tip(&[], &shap, Lat, &["Sapyati"]); + assert_has_ta(&[], &shap, Lat, &["Sapyate"]); + + let pad = d("pa\\da~\\", Divadi); + assert_has_ta(&[], &pad, Lat, &["padyate"]); + assert_has_ta(&[], &pad, Lit, &["pede"]); + assert_has_ta(&[], &pad, Lut, &["pattA"]); + assert_has_ta(&[], &pad, VidhiLin, &["padyeta"]); + assert_has_ta(&[], &pad, AshirLin, &["patsIzwa"]); +} + +#[test] +fn sk_2513() { + let pad = d("pa\\da~\\", Divadi); + assert_has_ta(&[], &pad, Lun, &["apAdi"]); + assert_has_aataam(&[], &pad, Lun, &["apatsAtAm"]); + assert_has_jha(&[], &pad, Lun, &["apatsata"]); + + let khid = d("Ki\\da~\\", Divadi); + assert_has_ta(&[], &khid, Lat, &["Kidyate"]); + assert_has_ta(&[], &khid, Lit, &["ciKide"]); + assert_has_ta(&[], &khid, Lut, &["KettA"]); + assert_has_ta(&[], &khid, Lun, &["aKitta"]); + + let vid = d("vi\\da~\\", Divadi); + assert_has_ta(&[], &vid, Lat, &["vidyate"]); + assert_has_ta(&[], &vid, Lut, &["vettA"]); + + let budh = d("bu\\Da~\\", Divadi); + assert_has_ta(&[], &budh, Lat, &["buDyate"]); + assert_has_ta(&[], &budh, Lit, &["bubuDe"]); + assert_has_ta(&[], &budh, Lut, &["bodDA"]); + assert_has_ta(&[], &budh, Lrt, &["Botsyate"]); + assert_has_ta(&[], &budh, AshirLin, &["ButsIzwa"]); + assert_has_ta(&[], &budh, Lun, &["aboDi", "abudDa"]); + assert_has_aataam(&[], &budh, Lun, &["aButsAtAm"]); + + let yudh = d("yu\\Da~\\", Divadi); + assert_has_ta(&[], &yudh, Lat, &["yuDyate"]); + assert_has_ta(&[], &yudh, Lit, &["yuyuDe"]); + assert_has_ta(&[], &yudh, Lut, &["yodDA"]); + assert_has_ta(&[], &yudh, Lun, &["ayudDa"]); + + // TODO: yuDyati + + let rudh = d("ru\\Da~\\", Divadi); + assert_has_ta(&["anu"], &rudh, Lat, &["anuruDyate"]); + + let an = d("aRa~\\", Divadi); + assert_has_ta(&[], &an, Lat, &["aRyate"]); + assert_has_ta(&[], &an, Lit, &["ARe"]); + assert_has_ta(&[], &an, Lut, &["aRitA"]); + + let man = d("ma\\na~\\", Divadi); + assert_has_ta(&[], &man, Lat, &["manyate"]); + assert_has_ta(&[], &man, Lit, &["mene"]); + assert_has_ta(&[], &man, Lut, &["mantA"]); + + let yuj = d("yu\\ja~\\", Divadi); + assert_has_ta(&[], &yuj, Lat, &["yujyate"]); + assert_has_ta(&[], &yuj, Lut, &["yoktA"]); + + let srj = d("sf\\ja~\\", Divadi); + assert_has_ta(&["sam"], &srj, Lat, &["saMsfjyate"]); + assert_has_thaas(&[], &srj, Lit, &["sasfjize"]); + assert_has_ta(&[], &srj, Lut, &["srazwA"]); + assert_has_ta(&[], &srj, Lrt, &["srakzyate"]); + assert_has_ta(&[], &srj, AshirLin, &["sfkzIzwa"]); + assert_has_ta(&[], &srj, Lun, &["asfzwa"]); + assert_has_aataam(&[], &srj, Lun, &["asfkzAtAm"]); + + let lish = d("li\\Sa~\\", Divadi); + assert_has_ta(&[], &lish, Lat, &["liSyate"]); + assert_has_ta(&[], &lish, Lut, &["lezwA"]); + assert_has_ta(&[], &lish, Lrt, &["lekzyate"]); + assert_has_ta(&[], &lish, AshirLin, &["likzIzwa"]); + assert_has_ta(&[], &lish, Lun, &["alikzata"]); + assert_has_aataam(&[], &lish, Lun, &["alikzAtAm"]); + + let raadh = d("rA\\Da~", Divadi); + assert_has_tip(&[], &raadh, Lit, &["rarADa"]); + assert_has_tas(&[], &raadh, Lit, &["rarADatuH"]); + assert_has_sip(&[], &raadh, Lit, &["rarADiTa"]); + assert_has_tip(&[], &raadh, Lut, &["rAdDA"]); + assert_has_tip(&[], &raadh, Lrt, &["rAtsyati"]); + + let vyadh = d("vya\\Da~", Divadi); + assert_has_tip(&[], &vyadh, Lat, &["viDyati"]); + assert_has_tip(&[], &vyadh, Lit, &["vivyADa"]); + assert_has_tas(&[], &vyadh, Lit, &["viviDatuH"]); + assert_has_sip(&[], &vyadh, Lit, &["vivyadDa", "vivyaDiTa"]); + assert_has_tip(&[], &vyadh, Lut, &["vyadDA"]); + assert_has_tip(&[], &vyadh, Lrt, &["vyatsyati"]); + assert_has_tip(&[], &vyadh, VidhiLin, &["viDyet"]); + assert_has_tip(&[], &vyadh, AshirLin, &["viDyAt"]); + assert_has_tip(&[], &vyadh, Lun, &["avyAtsIt"]); + + let push = d("pu\\za~", Divadi); + assert_has_tip(&[], &push, Lat, &["puzyati"]); + assert_has_tip(&[], &push, Lit, &["pupoza"]); + assert_has_sip(&[], &push, Lit, &["pupoziTa"]); + assert_has_tip(&[], &push, Lut, &["pozwA"]); + assert_has_tip(&[], &push, Lrt, &["pokzyati"]); + assert_has_tip(&[], &push, Lun, &["apuzat"]); + + let shush = d("Su\\za~", Divadi); + assert_has_tip(&[], &shush, Lun, &["aSuzat"]); + + let shlish = d("Sli\\za~", Divadi); + assert_has_tip(&[], &shlish, Lat, &["Slizyati"]); + assert_has_tip(&[], &shlish, Lit, &["SiSleza"]); + assert_has_tip(&[], &shlish, Lut, &["SlezwA"]); + assert_has_tip(&[], &shlish, Lrt, &["Slekzyati"]); +} + +#[ignore] +#[test] +fn sk_2514() { + let x = d("Sli\\za~", Divadi); + // TODO: samAslikzat + assert_has_lun_karmani(&[], &x, &["aSlezi"]); + assert_has_aataam(&[], &x, Lun, &["aSlikzAtAm"]); + assert_has_jha(&[], &x, Lun, &["aSlikzata"]); + assert_has_thaas(&[], &x, Lun, &["aSlizWAH"]); + assert_has_dhvam(&[], &x, Lun, &["aSliQvam"]); + + assert_has_tip(&[], &x, Lat, &["Sakyati"]); + assert_has_tip(&[], &x, Lat, &["SaSAka"]); + assert_has_tip(&[], &x, Lat, &["SekiTa"]); + assert_has_tip(&[], &x, Lat, &["SaSakTa"]); + assert_has_ta(&[], &x, Lit, &["Seke"]); + assert_has_tip(&[], &x, Lut, &["SaktA"]); + assert_has_tip(&[], &x, Lrt, &["Sakzyati"]); + assert_has_ta(&[], &x, Lrt, &["Sakzyate"]); + assert_has_tip(&[], &x, Lat, &["aSakat"]); + assert_has_tip(&[], &x, Lat, &["aSakta"]); + assert_has_ta(&[], &x, Lit, &["sewko'yamityeke"]); + assert_has_tip(&[], &x, Lut, &["SakitA"]); + assert_has_tip(&[], &x, Lrt, &["Sakizyati"]); + assert_has_tip(&[], &x, Lat, &["GarmasrutAvityarTaH"]); + assert_has_tip(&[], &x, Lat, &["svidyati"]); + assert_has_tip(&[], &x, Lat, &["sizveda"]); + assert_has_tip(&[], &x, Lat, &["sizvediTa"]); + assert_has_tip(&[], &x, Lut, &["svettA"]); + assert_has_tip(&[], &x, Lat, &["asvidat"]); + assert_has_tip(&[], &x, Lut, &["krodDA"]); + assert_has_tip(&[], &x, Lrt, &["krotsyati"]); + assert_has_tip(&[], &x, Lut, &["kzodDA"]); + assert_has_tip(&[], &x, Lat, &["SuDyati"]); + assert_has_tip(&[], &x, Lat, &["SuSoDa"]); + assert_has_tip(&[], &x, Lut, &["SodDA"]); + assert_has_tip(&[], &x, Lat, &["UditpAWaH"]); + assert_has_tip(&[], &x, Lat, &["prAmAdikaH"]); + assert_has_tip(&[], &x, Lat, &["siDyati"]); + assert_has_tip(&[], &x, Lut, &["sedDA"]); + assert_has_tip(&[], &x, Lrt, &["setsyati"]); + assert_has_tip(&[], &x, Lat, &["asiDat"]); + assert_has_tip(&[], &x, Lat, &["saMrIdDirnizpattiH"]); + assert_has_tip(&[], &x, Lat, &["raDyati"]); + assert_has_tas(&[], &x, Lit, &["raranDatuH"]); +} + +#[ignore] +#[test] +fn sk_2515() { + let radh = d("ra\\Da~", Divadi); + assert_has_sip(&[], &radh, Lit, &["raranDiTa", "raradDa"]); + assert_has_vas(&[], &radh, Lit, &["raranDiva", "reDva"]); +} + +#[ignore] +#[test] +fn sk_2516() { + let radh = d("ra\\Da~", Divadi); + assert_has_tip(&[], &radh, Lut, &["raDitA", "radDA"]); + assert_has_tip(&[], &radh, Lrt, &["raDizyati", "ratsyati"]); + assert_has_tip(&[], &radh, Lun, &["araDat"]); + + let nash = d("Ra\\Sa~", Divadi); + assert_has_tip(&[], &nash, Lat, &["naSyati"]); + assert_has_tip(&[], &nash, Lit, &["nanASa"]); + assert_has_tas(&[], &nash, Lit, &["neSatuH"]); + // nanaMzWa is from SK 2517. + assert_has_sip(&[], &nash, Lat, &["neSiTa", "nanaMzWa"]); +} + +#[ignore] +#[test] +fn sk_2517() { + let nash = d("Ra\\Sa~", Divadi); + assert_has_sip(&[], &nash, Lit, &["neSiTa", "nanaMzWa"]); + assert_has_vas(&[], &nash, Lit, &["neSiva", "neSva"]); + assert_has_mas(&[], &nash, Lit, &["neSima", "neSma"]); + assert_has_tip(&[], &nash, Lut, &["naSitA", "naMzwA"]); + assert_has_tip(&[], &nash, Lrt, &["naSizyati", "naNkzyati"]); + assert_has_tip(&[], &nash, VidhiLin, &["naSyet"]); + assert_has_tip(&[], &nash, AshirLin, &["naSyAt"]); + assert_has_tip(&[], &nash, Lun, &["anaSat"]); + assert_has_tip(&["pra"], &nash, Lat, &["praRaSyati"]); +} + +#[test] +fn sk_2520() { + let as_ = d("asu~", Divadi); + assert_has_tip(&[], &as_, Lun, &["AsTat"]); + assert_has_ta(&["pari"], &as_, Lun, &["paryAsTata"]); +} + +#[test] +fn skip_sk_2521() {} + +#[test] +fn sk_2522() { + let yas = d("yasu~", Divadi); + assert_has_tip(&[], &yas, Lat, &["yasyati", "yasati"]); + assert_has_tip(&["sam"], &yas, Lat, &["saMyasyati", "saMyasati"]); + assert_has_tip(&["pra"], &yas, Lat, &["prayasyati"]); + + let jas = d("jasu~", Divadi); + assert_has_tip(&[], &jas, Lat, &["jasyati"]); + + let tas = d("tasu~", Divadi); + assert_has_tip(&[], &tas, Lat, &["tasyati"]); + assert_has_tip(&[], &tas, Lun, &["atasat"]); + + let das = d("dasu~", Divadi); + assert_has_tip(&[], &das, Lat, &["dasyati"]); + assert_has_tip(&[], &das, Lun, &["adasat"]); + + let vas = d("vasu~", Divadi); + assert_has_tip(&[], &vas, Lat, &["vasyati"]); + assert_has_tip(&[], &vas, Lit, &["vavAsa"]); + assert_has_tas(&[], &vas, Lit, &["vavasatuH"]); + + let bas = d("basu~", Divadi); + assert_has_tas(&[], &bas, Lit, &["besatuH"]); + assert_has_jhi(&[], &bas, Lit, &["besuH"]); + + let vyush = d("vyuza~", Divadi); + assert_has_tip(&[], &vyush, Lun, &["avyuzat"]); + + let plush = d("pluza~", Divadi); + assert_has_tip(&[], &plush, Lun, &["apluzat"]); + + let bis = d("bisa~", Divadi); + assert_has_tip(&[], &bis, Lat, &["bisyati"]); + assert_has_tip(&[], &bis, Lun, &["abisat"]); + + let kus = d("kusa~", Divadi); + assert_has_tip(&[], &kus, Lun, &["akusat"]); + + let uc = d("uca~", Divadi); + assert_has_tip(&[], &uc, Lat, &["ucyati"]); + assert_has_tip(&[], &uc, Lit, &["uvoca"]); + assert_has_tas(&[], &uc, Lit, &["UcatuH"]); + // TODO: mAN-yoga + assert_has_sip(&[], &uc, Lun, &["OcaH"]); + + let bhrsh = d("BfSu~", Divadi); + assert_has_tip(&[], &bhrsh, Lit, &["baBarSa"]); + assert_has_tip(&[], &bhrsh, Lun, &["aBfSat"]); + + let bhransh = d("BranSu~", Divadi); + assert_has_tip(&[], &bhransh, Lat, &["BraSyati"]); + assert_has_tip(&[], &bhransh, Lun, &["aBraSat"]); + + let vrsh = d("vfSa~", Divadi); + assert_has_tip(&[], &vrsh, Lat, &["vfSyati"]); + assert_has_tip(&[], &vrsh, Lun, &["avfSat"]); + + let krsh = d("kfSa~", Divadi); + assert_has_tip(&[], &krsh, Lat, &["kfSyati"]); + + let rush = d("ruza~", Divadi); + assert_has_tip(&[], &rush, Lut, &["rozitA", "rozwA"]); + + let rish = d("riza~", Divadi); + assert_has_tip(&[], &rish, Lut, &["rezitA", "rezwA"]); + + let yup = d("yupa~", Divadi); + assert_has_tip(&[], &yup, Lat, &["yupyati"]); + + let rup = d("rupa~", Divadi); + assert_has_tip(&[], &rup, Lat, &["rupyati"]); + + let lup = d("lupa~", Divadi); + assert_has_tip(&[], &lup, Lat, &["lupyati"]); + assert_has_tip(&[], &lup, Lut, &["lopitA"]); + + let lubh = d("luBa~", Divadi); + assert_has_tip(&[], &lubh, Lut, &["loBitA", "lobDA"]); + assert_has_tip(&[], &lubh, Lrt, &["loBizyati"]); + assert_has_tip(&[], &lubh, VidhiLin, &["luByet"]); + assert_has_tip(&[], &lubh, AshirLin, &["luByAt"]); + assert_has_tip(&[], &lubh, Lun, &["aluBat"]); + + let kshubh = d("kzuBa~", Divadi); + assert_has_tip(&[], &kshubh, Lat, &["kzuByati"]); + + let klid = d("klidU~", Divadi); + assert_has_tip(&[], &klid, Lat, &["klidyati"]); + assert_has_sip(&[], &klid, Lit, &["ciklediTa", "cikletTa"]); + assert_has_vas(&[], &klid, Lit, &["ciklidiva", "ciklidva"]); + assert_has_mas(&[], &klid, Lit, &["ciklidima", "ciklidma"]); + assert_has_tip(&[], &klid, Lut, &["kleditA", "klettA"]); + + let mid = d("YimidA~", Divadi); + assert_has_tip(&[], &mid, Lat, &["medyati"]); + assert_has_tip(&[], &mid, Lun, &["amidat"]); + + let rdh = d("fDu~", Divadi); + assert_has_tip(&[], &rdh, Lit, &["AnarDa"]); + assert_has_tip(&[], &rdh, Lun, &["ArDat"]); + + let grdh = d("gfDu~", Divadi); + assert_has_tip(&[], &grdh, Lun, &["agfDat"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_47.rs b/vidyut-prakriya/tests/kaumudi_47.rs new file mode 100644 index 0000000..0d6d124 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_47.rs @@ -0,0 +1,259 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2523() { + let su = d("zu\\Y", Svadi); + assert_has_tip(&[], &su, Lat, &["sunoti"]); + assert_has_tas(&[], &su, Lat, &["sunutaH"]); + assert_has_jhi(&[], &su, Lat, &["sunvanti"]); + + assert_has_vas(&[], &su, Lat, &["sunvaH", "sunuvaH"]); + assert_has_vahi(&[], &su, Lat, &["sunvahe", "sunuvahe"]); + assert_has_tip(&[], &su, Lit, &["suzAva"]); + assert_has_ta(&[], &su, Lit, &["suzuve"]); + assert_has_tip(&[], &su, Lut, &["sotA"]); + assert_has_sip(&[], &su, Lot, &["sunu", "sunutAt"]); + assert_has_mip(&[], &su, Lot, &["sunavAni"]); + assert_has_iw(&[], &su, Lot, &["sunavE"]); + assert_has_tip(&[], &su, VidhiLin, &["sunuyAt"]); + assert_has_tip(&[], &su, AshirLin, &["sUyAt"]); + assert_has_tip(&[], &su, Lun, &["asAvIt"]); + assert_has_ta(&[], &su, Lun, &["asozwa"]); + + assert_has_tip(&["aBi"], &su, Lat, &["aBizuRoti"]); + assert_has_tip(&["aBi"], &su, Lan, &["aByazuRot"]); + assert_has_tip(&["aBi"], &su, Lit, &["aBisuzAva"]); +} + +#[test] +fn sk_2524() { + let su = d("zu\\Y", Svadi); + assert_has_tip(&["vi"], &su, Lrt, &["visozyati"]); + + let si = d("zi\\Y", Svadi); + assert_has_tip(&[], &si, Lat, &["sinoti"]); + assert_has_tip(&["vi"], &si, Lat, &["visinoti"]); + assert_has_tip(&[], &si, Lit, &["sizAya"]); + assert_has_ta(&[], &si, Lit, &["sizye"]); + + let shi = d("Si\\Y", Svadi); + assert_has_tip(&[], &shi, Lut, &["SetA"]); + + let mi = d("qumi\\Y", Svadi); + assert_has_tip(&[], &mi, Lit, &["mamO"]); + assert_has_sip(&[], &mi, Lit, &["mamiTa", "mamATa"]); + assert_has_ta(&[], &mi, Lit, &["mimye"]); + assert_has_tip(&[], &mi, Lut, &["mAtA"]); + assert_has_tip(&[], &mi, AshirLin, &["mIyAt"]); + assert_has_ta(&[], &mi, AshirLin, &["mAsIzwa"]); + assert_has_tip(&[], &mi, Lun, &["amAsIt"]); + assert_has_tas(&[], &mi, Lun, &["amAsizwAm"]); + assert_has_ta(&[], &mi, Lun, &["amAsta"]); + + let ci = d("ci\\Y", Svadi); + assert_has_tip(&["pra", "ni"], &ci, Lat, &["praRicinoti"]); +} + +#[test] +fn sk_2525() { + let ci = d("ci\\Y", Svadi); + assert_has_tip(&["pra", "ni"], &ci, Lit, &["praRicikAya", "praRicicAya"]); + assert_has_ta(&[], &ci, Lit, &["cikye", "cicye"]); + assert_has_tip(&[], &ci, Lun, &["acEzIt"]); + assert_has_ta(&[], &ci, Lun, &["acezwa"]); + + let str = d("stf\\Y", Svadi); + assert_has_tip(&[], &str, Lat, &["stfRoti"]); + assert_has_ta(&[], &str, Lat, &["stfRute"]); + assert_has_tip(&[], &str, AshirLin, &["staryAt"]); +} + +#[test] +fn sk_2526() { + let str = d("stf\\Y", Svadi); + assert_has_ta(&[], &str, AshirLin, &["starizIzwa", "stfzIzwa"]); + assert_has_ta(&[], &str, Lun, &["astarizwa", "astfta"]); + + let kr = d("kf\\Y", Svadi); + assert_has_tip(&[], &kr, Lat, &["kfRoti"]); + assert_has_ta(&[], &kr, Lat, &["kfRute"]); + assert_has_tip(&[], &kr, Lit, &["cakAra"]); + assert_has_sip(&[], &kr, Lit, &["cakarTa"]); + assert_has_ta(&[], &kr, Lit, &["cakre"]); + assert_has_tip(&[], &kr, AshirLin, &["kriyAt"]); + assert_has_ta(&[], &kr, AshirLin, &["kfzIzwa"]); + assert_has_tip(&[], &kr, Lun, &["akArzIt"]); + assert_has_ta(&[], &kr, Lun, &["akfta"]); +} + +#[ignore] +#[test] +fn sk_2527() { + let vr = d("vfY", Svadi); + assert_has_sip(&[], &vr, Lit, &["vavariTa"]); + assert_has_vas(&[], &vr, Lit, &["vavfva"]); + assert_has_vahi(&[], &vr, Lit, &["vavfvahe"]); + assert_has_tip(&[], &vr, Lut, &["varitA"]); +} + +#[test] +fn skip_sk_2528() {} + +#[ignore] +#[test] +fn sk_2529() { + let vr = d("vfY", Svadi); + assert_has_ta(&[], &vr, AshirLin, &["varizIzwa", "vfzIzwa"]); + assert_has_tip(&[], &vr, Lun, &["avArIt"]); + assert_has_ta(&[], &vr, Lun, &["avarizwa", "avarIzwa", "avfta"]); + + let dhu = d("Du\\Y", Svadi); + assert_has_tip(&[], &dhu, Lat, &["Dunoti"]); + assert_has_ta(&[], &dhu, Lat, &["Dunute"]); + assert_has_tip(&[], &dhu, Lun, &["aDOzIt"]); + assert_has_tip(&[], &dhu, Lrn, &["aDozyat"]); + + let dhuu = d("DUY", Svadi); + assert_has_tip(&[], &dhuu, Lat, &["DUnoti"]); + assert_has_ta(&[], &dhuu, Lat, &["DUnute"]); + assert_has_sip(&[], &dhuu, Lit, &["duDaviTa", "duDoTa"]); + assert_has_vas(&[], &dhuu, Lit, &["duDuviva"]); + assert_has_tip(&[], &dhuu, Lun, &["aDAvIt"]); + assert_has_ta(&[], &dhuu, Lun, &["aDavizwa", "aDozwa"]); + + let du = d("wudu\\", Svadi); + assert_has_tip(&[], &du, Lat, &["dunoti"]); +} + +#[test] +fn sk_2530() { + let hi = d("hi\\", Svadi); + assert_has_tip(&["pra"], &hi, Lat, &["prahiRoti"]); +} + +#[test] +fn sk_2531() { + let hi = d("hi\\", Svadi); + assert_has_tip(&[], &hi, Lit, &["jiGAya"]); + + let pr = d("pf\\", Svadi); + assert_has_tip(&[], &pr, Lat, &["pfRoti"]); + assert_has_tip(&[], &pr, Lut, &["partA"]); + + let spr = d("spf\\", Svadi); + assert_has_tip(&[], &spr, Lat, &["spfRoti"]); + assert_has_tip(&[], &spr, Lit, &["paspAra"]); + + let smr = d("smf\\", Svadi); + assert_has_tip(&[], &smr, Lat, &["smfRoti"]); + + let aap = d("A\\px~", Svadi); + assert_has_tip(&[], &aap, Lat, &["Apnoti"]); + assert_has_tas(&[], &aap, Lat, &["ApnutaH"]); + assert_has_jhi(&[], &aap, Lat, &["Apnuvanti"]); + assert_has_vas(&[], &aap, Lat, &["ApnuvaH"]); + assert_has_tip(&[], &aap, Lit, &["Apa"]); + assert_has_tip(&[], &aap, Lut, &["AptA"]); + assert_has_sip(&[], &aap, Lot, &["Apnuhi", "ApnutAt"]); + assert_has_tip(&[], &aap, Lun, &["Apat"]); + + let shak = d("Sa\\kx~", Svadi); + assert_has_tip(&[], &shak, Lun, &["aSakat"]); + + let raadh = d("rA\\Da~", Svadi); + assert_has_tip(&[], &raadh, Lat, &["rADnoti"]); +} + +#[test] +fn sk_2532() { + let radh = d("rA\\Da~", Svadi); + assert_has_tas(&["apa"], &radh, Lit, &["apareDatuH"]); + assert_has_jhi(&[], &radh, Lit, &["reDuH"]); + assert_has_sip(&[], &radh, Lit, &["reDiTa"]); + assert_has_tip(&[], &radh, Lut, &["rAdDA"]); + + let sadh = d("sA\\Da~", Svadi); + assert_has_tip(&[], &sadh, Lat, &["sADnoti"]); + assert_has_tip(&[], &sadh, Lut, &["sAdDA"]); + assert_has_tip(&[], &sadh, Lun, &["asAtsIt"]); + assert_has_tas(&[], &sadh, Lun, &["asAdDAm"]); + + let ash = d("aSU~\\", Svadi); + assert_has_ta(&[], &ash, Lat, &["aSnute"]); +} + +#[test] +fn sk_2533() { + let ash = d("aSU~\\", Svadi); + assert_has_ta(&[], &ash, Lit, &["AnaSe"]); + assert_has_ta(&[], &ash, Lut, &["aSitA", "azwA"]); + assert_has_ta(&[], &ash, Lrt, &["aSizyate", "akzyate"]); + assert_has_ta(&[], &ash, VidhiLin, &["aSnuvIta"]); + assert_has_ta(&[], &ash, AshirLin, &["akzIzwa", "aSizIzwa"]); + assert_has_ta(&[], &ash, Lun, &["ASizwa", "Azwa"]); + // ASizAtAm is justified by ASizwa above. + assert_has_aataam(&[], &ash, Lun, &["ASizAtAm", "AkzAtAm"]); + + let stigh = d("zwiGa~\\", Svadi); + assert_has_ta(&[], &stigh, Lat, &["stiGnute"]); + assert_has_ta(&[], &stigh, Lit, &["tizwiGe"]); + assert_has_ta(&[], &stigh, Lut, &["steGitA"]); + + let tik = d("tika~", Svadi); + assert_has_tip(&[], &tik, Lat, &["tiknoti"]); + + let tig = d("tiga~", Svadi); + assert_has_tip(&[], &tig, Lat, &["tignoti"]); + + let sagh = d("zaGa~", Svadi); + assert_has_tip(&[], &sagh, Lat, &["saGnoti"]); + + let dhrsh = d("YiDfzA~", Svadi); + assert_has_tip(&[], &dhrsh, Lat, &["DfzRoti"]); + assert_has_tip(&[], &dhrsh, Lit, &["daDarza"]); + assert_has_tip(&[], &dhrsh, Lut, &["DarzitA"]); + + let danbh = d("danBu~", Svadi); + assert_has_tip(&[], &danbh, Lat, &["daBnoti"]); + assert_has_tip(&[], &danbh, Lit, &["dadamBa"]); + assert_has_tas(&[], &danbh, Lit, &["deBatuH", "dadamBatuH"]); + // dadamBuH is justified by dadamBatuH above. + assert_has_jhi(&[], &danbh, Lit, &["deBuH", "dadamBuH"]); + assert_has_sip(&[], &danbh, Lit, &["dadamBiTa"]); + assert_has_mip(&[], &danbh, Lit, &["dadamBa"]); + // TODO: tip/sip/mip of deBa, deBiTa, deBa + assert_has_tip(&[], &danbh, AshirLin, &["daByAt"]); + + let trp = d("tfpa~", Svadi); + assert_has_tip(&[], &trp, Lat, &["tfpnoti"]); + + let ah = d("aha~", Svadi); + assert_has_tip(&[], &ah, Lat, &["ahnoti"]); + + let dagh = d("daGa~", Svadi); + assert_has_tip(&[], &dagh, Lat, &["daGnoti"]); + + let cam = d("camu~", Svadi); + assert_has_tip(&[], &cam, Lat, &["camnoti"]); + + let ri = d("ri\\", Svadi); + assert_has_tip(&[], &ri, Lat, &["riRoti"]); + + let kshi = d("kzi\\", Svadi); + assert_has_tip(&[], &kshi, Lat, &["kziRoti"]); + + let rkshi = d("f\\kzi", Svadi); + assert_has_tip(&[], &rkshi, Lat, &["fkziRoti"]); + + let ciri = d("ciri", Svadi); + assert_has_tip(&[], &ciri, Lat, &["ciriRoti"]); + + let jiri = d("jiri", Svadi); + assert_has_tip(&[], &jiri, Lat, &["jiriRoti"]); + + let dash = d("dASa~", Svadi); + assert_has_tip(&[], &dash, Lat, &["dASnoti"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_48.rs b/vidyut-prakriya/tests/kaumudi_48.rs new file mode 100644 index 0000000..6e183eb --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_48.rs @@ -0,0 +1,589 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Krt; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2534() { + let tud = d("tu\\da~^", Tudadi); + assert_has_tip(&[], &tud, Lat, &["tudati"]); + assert_has_ta(&[], &tud, Lat, &["tudate"]); + assert_has_tip(&[], &tud, Lit, &["tutoda"]); + assert_has_sip(&[], &tud, Lit, &["tutodiTa"]); + assert_has_ta(&[], &tud, Lit, &["tutude"]); + assert_has_tip(&[], &tud, Lut, &["tottA"]); + assert_has_tip(&[], &tud, Lun, &["atOtsIt"]); + assert_has_ta(&[], &tud, Lun, &["atutta"]); + + let nud = d("Ru\\da~^", Tudadi); + assert_has_tip(&[], &nud, Lat, &["nudati"]); + assert_has_ta(&[], &nud, Lat, &["nudate"]); + assert_has_tip(&[], &nud, Lit, &["nunoda"]); + assert_has_ta(&[], &nud, Lit, &["nunude"]); + assert_has_tip(&[], &nud, Lut, &["nottA"]); + + let dish = d("di\\Sa~^", Tudadi); + assert_has_tip(&[], &dish, Lut, &["dezwA"]); + assert_has_ta(&[], &dish, AshirLin, &["dikzIzwa"]); + assert_has_tip(&[], &dish, Lun, &["adikzat"]); + assert_has_ta(&[], &dish, Lun, &["adikzata"]); + + let bhrasj = d("Bra\\sja~^", Tudadi); + assert_has_tip(&[], &bhrasj, Lat, &["Bfjjati"]); + assert_has_ta(&[], &bhrasj, Lat, &["Bfjjate"]); +} + +#[test] +fn sk_2535() { + let bhrasj = d("Bra\\sja~^", Tudadi); + assert_has_tip(&[], &bhrasj, Lit, &["baBarja", "baBrajja"]); + assert_has_tas(&[], &bhrasj, Lit, &["baBarjatuH", "baBrajjatuH"]); + assert_has_sip( + &[], + &bhrasj, + Lit, + &["baBarjiTa", "baBarzWa", "baBrajjiTa", "baBrazWa"], + ); + assert_has_ta(&[], &bhrasj, Lit, &["baBarje", "baBrajje"]); + + assert_has_tip(&[], &bhrasj, Lut, &["BrazwA", "BarzwA"]); + assert_has_tip(&[], &bhrasj, Lrt, &["Brakzyati", "Barkzyati"]); + assert_has_tip(&[], &bhrasj, AshirLin, &["BfjjyAt"]); + assert_has_tas(&[], &bhrasj, AshirLin, &["BfjjyAstAm"]); + assert_has_ta(&[], &bhrasj, AshirLin, &["BarkzIzwa", "BrakzIzwa"]); + assert_has_tip(&[], &bhrasj, Lun, &["aBArkzIt", "aBrAkzIt"]); + assert_has_ta(&[], &bhrasj, Lun, &["aBarzwa", "aBrazwa"]); + + let kship = d("kzi\\pa~^", Tudadi); + assert_has_tip(&[], &kship, Lat, &["kzipati"]); + assert_has_ta(&[], &kship, Lat, &["kzipate"]); + assert_has_tip(&[], &kship, Lut, &["kzeptA"]); + assert_has_tip(&[], &kship, Lun, &["akzEpsIt"]); + assert_has_ta(&[], &kship, Lun, &["akzipta"]); + + let krsh = d("kf\\za~^", Tudadi); + assert_has_tip(&[], &krsh, Lat, &["kfzati"]); + assert_has_ta(&[], &krsh, Lat, &["kfzate"]); + assert_has_tip(&[], &krsh, Lut, &["krazwA", "karzwA"]); + assert_has_tip(&[], &krsh, AshirLin, &["kfzyAt"]); + assert_has_ta(&[], &krsh, AshirLin, &["kfkzIzwa"]); + assert_has_tip(&[], &krsh, Lun, &["akrAkzIt", "akArkzIt", "akfkzat"]); + assert_has_ta(&[], &krsh, Lun, &["akfzwa", "akfkzata"]); + assert_has_aataam(&[], &krsh, Lun, &["akfkzAtAm"]); + assert_has_jha(&[], &krsh, Lun, &["akfkzata", "akfkzanta"]); + + let rsh = d("fzI~", Tudadi); + assert_has_tip(&[], &rsh, Lat, &["fzati"]); + assert_has_tip(&[], &rsh, Lit, &["Anarza"]); + + let jush = d("juzI~\\", Tudadi); + assert_has_ta(&[], &jush, Lat, &["juzate"]); + + let vij = d("o~vijI~\\", Tudadi); + assert_has_ta(&["ud"], &vij, Lat, &["udvijate"]); +} + +#[test] +fn sk_2536() { + let vij = d("o~vijI~\\", Tudadi); + assert_has_ta(&["ud"], &vij, Lut, &["udvijitA"]); + assert_has_ta(&["ud"], &vij, Lrt, &["udvijizyate"]); + + let laj = d("o~lajI~\\", Tudadi); + assert_has_ta(&[], &laj, Lat, &["lajate"]); + assert_has_ta(&[], &laj, Lit, &["leje"]); + + let lasj = d("o~lasjI~\\", Tudadi); + assert_has_ta(&[], &lasj, Lat, &["lajjate"]); + assert_has_ta(&[], &lasj, Lit, &["lalajje"]); + + let vrasc = d("o~vrascU~", Tudadi); + assert_has_tip(&[], &vrasc, Lat, &["vfScati"]); + assert_has_tip(&[], &vrasc, Lit, &["vavraSca"]); + assert_has_tas(&[], &vrasc, Lit, &["vavraScatuH"]); + assert_has_sip(&[], &vrasc, Lit, &["vavraSciTa", "vavrazWa"]); + assert_has_tip(&[], &vrasc, Lut, &["vraScitA", "vrazwA"]); + assert_has_tip(&[], &vrasc, Lrt, &["vraScizyati", "vrakzyati"]); + assert_has_tip(&[], &vrasc, AshirLin, &["vfScyAt"]); + assert_has_tip(&[], &vrasc, Lun, &["avraScIt", "avrAkzIt"]); + + let vyac = d("vyaca~", Tudadi); + assert_has_tip(&[], &vyac, Lat, &["vicati"]); + assert_has_tip(&[], &vyac, Lit, &["vivyAca"]); + assert_has_tas(&[], &vyac, Lit, &["vivicatuH"]); + assert_has_tip(&[], &vyac, Lut, &["vyacitA"]); + assert_has_tip(&[], &vyac, Lrt, &["vyacizyati"]); + assert_has_tip(&[], &vyac, AshirLin, &["vicyAt"]); + assert_has_tip(&[], &vyac, Lun, &["avyAcIt", "avyacIt"]); + + let unch = d("uCi~", Tudadi); + assert_has_tip(&[], &unch, Lat, &["uYCati"]); + + let uch = d("uCI~", Tudadi); + assert_has_tip(&[], &uch, Lat, &["ucCati"]); + + let rch = d("fCa~", Tudadi); + assert_has_tip(&[], &rch, Lit, &["AnarCa", "AnarcCa"]); + assert_has_tas(&[], &rch, Lit, &["AnarCatuH", "AnarcCatuH"]); + assert_has_tip(&[], &rch, Lut, &["fcCitA"]); + + let mich = d("miCa~", Tudadi); + assert_has_tip(&[], &mich, Lun, &["amicCIt"]); + + let tvac = d("tvaca~", Tudadi); + assert_has_tip(&[], &tvac, Lit, &["tatvAca"]); + + let rc = d("fca~", Tudadi); + assert_has_tip(&[], &rc, Lit, &["Anarca"]); + + let lubh = d("luBa~", Tudadi); + assert_has_tip(&[], &lubh, Lat, &["luBati"]); + assert_has_tip(&[], &lubh, Lut, &["loBitA", "lobDA"]); + assert_has_tip(&[], &lubh, Lrt, &["loBizyati"]); + + let riph = d("riPa~", Tudadi); + assert_has_tip(&[], &riph, Lat, &["riPati"]); + assert_has_tip(&[], &riph, Lit, &["rirePa"]); + + let trp = d("tfpa~", Tudadi); + assert_has_tip(&[], &trp, Lat, &["tfpati"]); + assert_has_tip(&[], &trp, Lit, &["tatarpa"]); + assert_has_tip(&[], &trp, Lut, &["tarpitA"]); + assert_has_tip(&[], &trp, Lun, &["atarpIt"]); + + let trmph = d("tfnPa~", Tudadi); + assert_has_tip(&[], &trmph, Lat, &["tfmPati"]); + assert_has_tip(&[], &trmph, Lit, &["tatfmPa"]); + assert_has_tip(&[], &trmph, AshirLin, &["tfPyAt"]); + + let tup = d("tupa~", Tudadi); + assert_has_tip(&[], &tup, Lat, &["tupati"]); + + let tump = d("tunpa~", Tudadi); + assert_has_tip(&[], &tump, Lat, &["tumpati"]); + + let tuph = d("tuPa~", Tudadi); + assert_has_tip(&[], &tuph, Lat, &["tuPati"]); + + let tumph = d("tunPa~", Tudadi); + assert_has_tip(&[], &tumph, Lat, &["tumPati"]); + + let drp = d("dfpa~", Tudadi); + assert_has_tip(&[], &drp, Lat, &["dfpati"]); + + let drmph = d("dfnPa~", Tudadi); + assert_has_tip(&[], &drmph, Lat, &["dfmPati"]); + + let rph = d("fPa~", Tudadi); + assert_has_tip(&[], &rph, Lat, &["fPati"]); + assert_has_tip(&[], &rph, Lit, &["AnarPa"]); + + let rmph = d("fnPa~", Tudadi); + assert_has_tip(&[], &rmph, Lat, &["fmPati"]); + assert_has_tip(&[], &rmph, Lit, &["fmPAYcakAra", "fmPAmbaBUva", "fmPAmAsa"]); + + let guph = d("guPa~", Tudadi); + assert_has_tip(&[], &guph, Lat, &["guPati"]); + assert_has_tip(&[], &guph, Lit, &["jugoPa"]); + + let gumph = d("gunPa~", Tudadi); + assert_has_tip(&[], &gumph, Lat, &["gumPati"]); + assert_has_tip(&[], &gumph, Lit, &["jugumPa"]); + + let ubh = d("uBa~", Tudadi); + assert_has_tip(&[], &ubh, Lat, &["uBati"]); + assert_has_tip(&[], &ubh, Lit, &["uvoBa"]); + + let umbh = d("unBa~", Tudadi); + assert_has_tip(&[], &umbh, Lat, &["umBati"]); + assert_has_tip(&[], &umbh, Lit, &["umBAYcakAra", "umBAmbaBUva", "umBAmAsa"]); + + let shubh = d("SuBa~", Tudadi); + assert_has_tip(&[], &shubh, Lat, &["SuBati"]); + + let shumbh = d("SunBa~", Tudadi); + assert_has_tip(&[], &shumbh, Lat, &["SumBati"]); + + let drbh = d("dfBI~", Tudadi); + assert_has_tip(&[], &drbh, Lat, &["dfBati"]); + + // cartsyati is from KV 7.2.57. + let crt = d("cftI~", Tudadi); + assert_has_tip(&[], &crt, Lut, &["cartitA"]); + assert_has_tip(&[], &crt, Lrt, &["cartizyati", "cartsyati"]); + assert_has_tip(&[], &crt, Lun, &["acartIt"]); + + let vidh = d("viDa~", Tudadi); + assert_has_tip(&[], &vidh, Lat, &["viDati"]); + assert_has_tip(&[], &vidh, Lut, &["veDitA"]); + + let jud = d("juqa~", Tudadi); + assert_has_tip(&[], &jud, Lat, &["juqati"]); + + let mrd = d("mfqa~", Tudadi); + assert_has_tip(&[], &mrd, Lat, &["mfqati"]); + assert_has_tip(&[], &mrd, Lut, &["marqitA"]); + + let prd = d("pfqa~", Tudadi); + assert_has_tip(&[], &prd, Lat, &["pfqati"]); + + let prn = d("pfRa~", Tudadi); + assert_has_tip(&[], &prn, Lat, &["pfRati"]); + assert_has_tip(&[], &prn, Lit, &["paparRa"]); + + let vrn = d("vfRa~", Tudadi); + assert_has_tip(&[], &vrn, Lat, &["vfRati"]); + + let tun = d("tuRa~", Tudadi); + assert_has_tip(&[], &tun, Lit, &["tutoRa"]); + + let pun = d("puRa~", Tudadi); + assert_has_tip(&[], &pun, Lat, &["puRati"]); + + let sur = d("zura~", Tudadi); + assert_has_tip(&[], &sur, Lat, &["surati"]); + assert_has_tip(&[], &sur, Lit, &["suzora"]); + + let kur = d("kura~", Tudadi); + assert_has_tip(&[], &kur, Lat, &["kurati"]); + assert_has_tip(&[], &kur, AshirLin, &["kUryAt"]); + + let trh = d("tfhU~", Tudadi); + assert_has_tip(&[], &trh, Lat, &["tfhati"]); + assert_has_tip(&[], &trh, Lit, &["tatarha"]); + + let strh = d("stfhU~", Tudadi); + assert_has_tip(&[], &strh, Lat, &["stfhati"]); + assert_has_tip(&[], &strh, Lit, &["tastarha"]); + assert_has_tip(&[], &strh, Lut, &["starhitA", "starQA"]); + + // atfMhizwAm is justified. + let trnh = d("tfnhU~", Tudadi); + assert_has_tip(&[], &trnh, Lun, &["atfMhIt", "atArNkzIt"]); + assert_has_tas(&[], &trnh, Lun, &["atfMhizwAm", "atArRQAm"]); + + let ish = d("izu~", Tudadi); + assert_has_tip(&[], &ish, Lat, &["icCati"]); + assert_has_tip(&[], &ish, Lut, &["ezitA", "ezwA"]); + assert_has_tip(&[], &ish, Lrt, &["ezizyati"]); + assert_has_tip(&[], &ish, AshirLin, &["izyAt"]); + assert_has_tip(&[], &ish, Lun, &["EzIt"]); + + let mish = d("miza~", Tudadi); + assert_has_tip(&[], &mish, Lat, &["mizati"]); + assert_has_tip(&[], &mish, Lut, &["mezitA"]); + + let likh = d("liKa~", Tudadi); + assert_has_tip(&[], &likh, Lit, &["lileKa"]); + + let kut = d_kutadi("kuwa~", Tudadi); + assert_has_sip(&[], &kut, Lit, &["cukuwiTa"]); + assert_has_mip(&[], &kut, Lit, &["cukowa", "cukuwa"]); + assert_has_tip(&[], &kut, Lut, &["kuwitA"]); + + let chur = d_kutadi("Cura~", Tudadi); + assert_has_tip(&[], &chur, AshirLin, &["CuryAt"]); + + let sphut = d_kutadi("sPuwa~", Tudadi); + assert_has_tip(&[], &sphut, Lat, &["sPuwati"]); + assert_has_tip(&[], &sphut, Lit, &["pusPowa"]); + + let trut = d_kutadi("truwa~", Tudadi); + assert_has_tip(&[], &trut, Lat, &["truwyati", "truwati"]); + assert_has_tip(&[], &trut, Lit, &["tutrowa"]); + assert_has_tip(&[], &trut, Lut, &["truwitA"]); + + let tut = d_kutadi("tuwa~", Tudadi); + assert_has_tip(&[], &tut, Lat, &["tuwati"]); + assert_has_tip(&[], &tut, Lit, &["tutowa"]); + assert_has_tip(&[], &tut, Lut, &["tuwitA"]); + + let krd = d_kutadi("kfqa~", Tudadi); + assert_has_tip(&[], &krd, Lit, &["cakarqa"]); + assert_has_tip(&[], &krd, Lut, &["kfqitA"]); + + let thud = d_kutadi("Tuqa~", Tudadi); + assert_has_tip(&[], &thud, Lat, &["Tuqati"]); + assert_has_tip(&[], &thud, Lit, &["tuToqa"]); + + let sthud = d_kutadi("sTuqa~", Tudadi); + assert_has_tip(&[], &sthud, Lit, &["tusToqa"]); + + let sphur = d_kutadi("sPura~", Tudadi); + assert_has_tip(&[], &sphur, Lat, &["sPurati"]); +} + +#[ignore] +#[test] +fn sk_2537() { + // nissPurati and nizzPurati are justified. + let sphur = d("sPura~", Tudadi); + assert_has_tip( + &["nis"], + &sphur, + Lat, + &["niHzPurati", "niHsPurati", "nissPurati", "nizzPurati"], + ); + + let sphar = d("sPara~", Tudadi); + assert_has_tip(&[], &sphar, Lit, &["pasPAra"]); + + let gur = d_kutadi("gurI~\\", Tudadi); + assert_has_ta(&[], &gur, Lat, &["gurate"]); + assert_has_ta(&[], &gur, Lit, &["jugure"]); + assert_has_ta(&[], &gur, Lut, &["guritA"]); + + let nu = d_kutadi("RU", Tudadi); + assert_has_tip(&[], &nu, Lat, &["nuvati"]); + assert_has_tip(&[], &nu, Lun, &["anuvIt"]); + + let dhu = d("DU", Tudadi); + assert_has_tip(&[], &dhu, Lat, &["Duvati"]); + + let gu = d_kutadi("gu\\", Tudadi); + assert_has_sip(&[], &gu, Lit, &["juguviTa", "juguTa"]); + assert_has_tip(&[], &gu, Lut, &["gutA"]); + assert_has_tip(&[], &gu, Lrt, &["guzyati"]); + assert_has_tip(&[], &gu, Lun, &["aguzIt"]); + // TODO: SK has agUtAm? + assert_has_tas(&[], &gu, Lun, &["agutAm"]); + assert_has_jhi(&[], &gu, Lun, &["aguzuH"]); + + let dhru = d_kutadi("Dru\\", Tudadi); + assert_has_sip(&[], &dhru, Lit, &["duDruviTa"]); + assert_has_tip(&[], &dhru, Lut, &["DruvitA"]); + assert_has_tip(&[], &dhru, Lrt, &["Druvizyati"]); + assert_has_tip(&[], &dhru, AshirLin, &["DrUvyAt"]); + assert_has_tip(&[], &dhru, Lun, &["aDruvIt"]); + assert_has_tas(&[], &dhru, Lun, &["aDruvizwAm"]); + + let kuu = d("kUN", Tudadi); + assert_has_ta(&[], &kuu, Lut, &["kuvitA"]); + assert_has_ta(&[], &kuu, Lun, &["akuvizwa"]); + + let ku = d("ku\\N", Tudadi); + assert_has_ta(&[], &ku, Lut, &["kutA"]); + assert_has_ta(&[], &ku, Lun, &["akuta"]); + + let pr = d("pf\\N", Tudadi); + assert_has_ta(&["vi", "AN"], &pr, Lat, &["vyApriyate"]); + assert_has_ta(&["vi", "AN"], &pr, Lit, &["vyApapre"]); + assert_has_aataam(&["vi", "AN"], &pr, Lat, &["vyApaprAte"]); + assert_has_ta(&["vi", "AN"], &pr, Lrt, &["vyAparizyate"]); + assert_has_ta(&["vi", "AN"], &pr, Lun, &["vyApfta"]); + assert_has_aataam(&["vi", "AN"], &pr, Lun, &["vyApfzAtAm"]); +} + +#[test] +fn sk_2538() { + let mr = d("mf\\N", Tudadi); + assert_has_ta(&[], &mr, Lat, &["mriyate"]); + assert_has_tip(&[], &mr, Lit, &["mamAra"]); + assert_has_sip(&[], &mr, Lit, &["mamarTa"]); + assert_has_vas(&[], &mr, Lit, &["mamriva"]); + assert_has_sip(&[], &mr, Lut, &["martAsi"]); + assert_has_tip(&[], &mr, Lrt, &["marizyati"]); + assert_has_ta(&[], &mr, AshirLin, &["mfzIzwa"]); + assert_has_ta(&[], &mr, Lun, &["amfta"]); + + let ri = d("ri\\", Tudadi); + assert_has_tip(&[], &ri, Lat, &["riyati"]); + + let pi = d("pi\\", Tudadi); + assert_has_tip(&[], &pi, Lat, &["piyati"]); + + assert_has_tip(&[], &ri, Lut, &["retA"]); + assert_has_tip(&[], &pi, Lut, &["petA"]); + + let su = d("zU", Tudadi); + assert_has_tip(&[], &su, Lat, &["suvati"]); + assert_has_tip(&[], &su, Lut, &["savitA"]); + + let kr = d("kF", Tudadi); + assert_has_tip(&[], &kr, Lat, &["kirati"]); + assert_has_tas(&[], &kr, Lat, &["kirataH"]); + assert_has_tip(&[], &kr, Lit, &["cakAra"]); + assert_has_tas(&[], &kr, Lit, &["cakaratuH"]); + assert_has_tip(&[], &kr, Lut, &["karitA", "karItA"]); + assert_has_tip(&[], &kr, AshirLin, &["kIryAt"]); + assert_has_tip(&[], &kr, Lun, &["akArIt"]); +} + +#[test] +fn sk_2539() { + let kr = d("kF", Tudadi); + assert_has_tip(&["upa"], &kr, Lat, &["upaskirati", "upakirati"]); + assert_has_tip(&["upa"], &kr, Lan, &["upAskirat", "upAkirat"]); + assert_has_tip(&["upa"], &kr, Lit, &["upacaskAra", "upacakAra"]); +} + +#[test] +fn sk_2540() { + let kr = d("kF", Tudadi); + assert_has_tip(&["upa"], &kr, Lat, &["upaskirati", "upakirati"]); + assert_has_tip(&["prati"], &kr, Lat, &["pratiskirati", "pratikirati"]); +} + +#[test] +fn sk_2541() { + let gr = d("gF", Tudadi); + assert_has_tip(&[], &gr, Lat, &["girati", "gilati"]); + assert_has_tip(&[], &gr, Lit, &["jagAra", "jagAla"]); + assert_has_sip(&[], &gr, Lit, &["jagariTa", "jagaliTa"]); + assert_has_tip(&[], &gr, Lut, &["garitA", "garItA", "galitA", "galItA"]); + + let dr = d("df\\N", Tudadi); + assert_has_ta(&["AN"], &dr, Lat, &["Adriyate"]); + assert_has_aataam(&["AN"], &dr, Lat, &["Adriyete"]); + assert_has_ta(&["AN"], &dr, Lit, &["Adadre"]); + assert_has_thaas(&["AN"], &dr, Lit, &["Adadrize"]); + assert_has_ta(&["AN"], &dr, Lut, &["AdartA"]); + assert_has_ta(&["AN"], &dr, Lrt, &["Adarizyate"]); + assert_has_ta(&["AN"], &dr, AshirLin, &["AdfzIzwa"]); + assert_has_ta(&["AN"], &dr, Lun, &["Adfta"]); + assert_has_aataam(&["AN"], &dr, Lun, &["AdfzAtAm"]); + + let dhr = d("Df\\N", Tudadi); + assert_has_ta(&[], &dhr, Lat, &["Driyate"]); + + let prach = d("pra\\Ca~", Tudadi); + assert_has_tip(&[], &prach, Lat, &["pfcCati"]); + assert_has_tip(&[], &prach, Lit, &["papracCa"]); + assert_has_tas(&[], &prach, Lit, &["papracCatuH"]); + assert_has_sip(&[], &prach, Lit, &["papracCiTa", "paprazWa"]); + assert_has_tip(&[], &prach, Lut, &["prazwA"]); + assert_has_tip(&[], &prach, Lrt, &["prakzyati"]); + assert_has_tip(&[], &prach, Lun, &["aprAkzIt"]); + + let srj = d("sf\\ja~", Tudadi); + assert_has_sip(&[], &srj, Lit, &["sasarjiTa", "sasrazWa"]); + assert_has_tip(&[], &srj, Lut, &["srazwA"]); + assert_has_tip(&[], &srj, Lrt, &["srakzyati"]); + assert_has_tip(&[], &srj, VidhiLin, &["sfjet"]); + assert_has_tip(&[], &srj, AshirLin, &["sfjyAt"]); + assert_has_tip(&[], &srj, Lun, &["asrAkzIt"]); + + let masj = d("wuma\\sjo~", Tudadi); + assert_has_tip(&[], &masj, Lat, &["majjati"]); + assert_has_tip(&[], &masj, Lit, &["mamajja"]); + assert_has_sip(&[], &masj, Lit, &["mamaNkTa", "mamajjiTa"]); + assert_has_tip(&[], &masj, Lut, &["maNktA"]); + assert_has_tip(&[], &masj, Lrt, &["maNkzyati"]); + assert_has_tip(&[], &masj, Lun, &["amANkzIt"]); + assert_has_tas(&[], &masj, Lun, &["amANktAm"]); + assert_has_jhi(&[], &masj, Lun, &["amANkzuH"]); + + let ruj = d("ru\\jo~", Tudadi); + assert_has_tip(&[], &ruj, Lut, &["roktA"]); + assert_has_tip(&[], &ruj, Lrt, &["rokzyati"]); + assert_has_tip(&[], &ruj, Lun, &["arOkzIt"]); + assert_has_tas(&[], &ruj, Lun, &["arOktAm"]); + + let chup = d("Cu\\pa~", Tudadi); + assert_has_tip(&[], &chup, Lun, &["acCOpsIt"]); + + let rush = d("ru\\Sa~", Tudadi); + assert_has_tip(&[], &rush, Lut, &["rozwA"]); + assert_has_tip(&[], &rush, Lrt, &["rokzyati"]); + + let rish = d("ri\\Sa~", Tudadi); + assert_has_tip(&[], &rish, Lut, &["rezwA"]); + assert_has_tip(&[], &rish, Lrt, &["rekzyati"]); + + let lish = d("li\\Sa~", Tudadi); + assert_has_tip(&[], &lish, Lun, &["alikzat"]); + + let sprsh = d("spf\\Sa~", Tudadi); + assert_has_tip(&[], &sprsh, Lut, &["sprazwA", "sparzwA"]); + assert_has_tip(&[], &sprsh, Lrt, &["sprakzyati", "sparkzyati"]); + assert_has_tip(&[], &sprsh, Lun, &["asprAkzIt", "aspArkzIt", "aspfkzat"]); + + let vicch = d("viCa~", Tudadi); + assert_has_tip(&[], &vicch, Lat, &["vicCAyati"]); + assert_has_tip( + &[], + &vicch, + Lit, + &["vivicCa", "vicCAyAYcakAra", "vicCAyAmbaBUva", "vicCAyAmAsa"], + ); + + let vish = d("vi\\Sa~", Tudadi); + assert_has_tip(&[], &vish, Lat, &["viSati"]); + assert_has_tip(&[], &vish, Lut, &["vezwA"]); + + let mrsh = d("mf\\Sa~", Tudadi); + assert_has_tip(&[], &mrsh, Lun, &["amrAkzIt", "amArkzIt", "amfkzat"]); + + let sad = d("za\\dx~", Tudadi); + assert_has_tip(&[], &sad, Lat, &["sIdati"]); + assert_has_krdanta(&[], &sad, Krt::Satf, &["sIdat"]); + assert_has_krdanta(&[], &sad, Krt::GaY, &["sAda"]); + + let mil = d("mila~^", Tudadi); + assert_has_tip(&[], &mil, Lat, &["milati"]); + assert_has_ta(&[], &mil, Lat, &["milate"]); + assert_has_tip(&[], &mil, Lit, &["mimela"]); + assert_has_ta(&[], &mil, Lit, &["mimile"]); +} + +#[ignore] +#[test] +fn sk_2542() { + let muc = d("mu\\cx~^", Tudadi); + assert_has_tip(&[], &muc, Lat, &["muYcati"]); + assert_has_ta(&[], &muc, Lat, &["muYcate"]); + assert_has_tip(&[], &muc, Lut, &["moktA"]); + assert_has_tip(&[], &muc, AshirLin, &["mucyAt"]); + assert_has_ta(&[], &muc, AshirLin, &["mukzIzwa"]); + assert_has_tip(&[], &muc, Lun, &["amucat"]); + assert_has_ta(&[], &muc, Lun, &["amukta"]); + assert_has_aataam(&[], &muc, Lun, &["amukzAtAm"]); + + let lup = d("lu\\px~^", Tudadi); + assert_has_tip(&[], &lup, Lat, &["lumpati"]); + assert_has_ta(&[], &lup, Lat, &["lumpate"]); + assert_has_tip(&[], &lup, Lun, &["alupat"]); + assert_has_ta(&[], &lup, Lun, &["alupta"]); + + let vid = d("vi\\dx~^", Tudadi); + assert_has_tip(&[], &vid, Lat, &["vindati"]); + assert_has_ta(&[], &vid, Lat, &["vindate"]); + assert_has_tip(&[], &vid, Lit, &["viveda"]); + assert_has_ta(&[], &vid, Lit, &["vivide"]); + assert_has_tip(&[], &vid, Lut, &["veditA", "vettA"]); + // TODO: is pariveditA justified? + assert_has_tip(&["pari"], &vid, Lut, &["parivettA", "pariveditA"]); + + let lip = d("li\\pa~^", Tudadi); + assert_has_tip(&[], &lip, Lat, &["limpati"]); + assert_has_ta(&[], &lip, Lat, &["limpate"]); + assert_has_tip(&[], &lip, Lut, &["leptA"]); + assert_has_tip(&[], &lip, Lun, &["alipat"]); + assert_has_ta(&[], &lip, Lun, &["alipata", "alipta"]); + + let sic = d("zi\\ca~^", Tudadi); + assert_has_tip(&[], &sic, Lat, &["siYcati"]); + assert_has_ta(&[], &sic, Lat, &["siYcate"]); + assert_has_tip(&[], &sic, Lun, &["asicat"]); + assert_has_tip(&[], &sic, Lun, &["asicata", "asikta"]); + assert_has_tip(&["aBi"], &sic, Lat, &["aBiziYcati"]); + assert_has_tip(&["aBi"], &sic, Lan, &["aByaziYcat"]); + assert_has_tip(&[], &sic, Lit, &["aBizizeca"]); + + let krt = d("kftI~", Tudadi); + assert_has_tip(&[], &krt, Lat, &["kfntati"]); + assert_has_tip(&[], &krt, Lit, &["cakarta"]); + assert_has_tip(&[], &krt, Lut, &["kartitA"]); + assert_has_tip(&[], &krt, Lrt, &["kartizyati", "kartsyati"]); + assert_has_tip(&[], &krt, Lun, &["akartIt"]); + + let khid = d("Ki\\da~", Tudadi); + assert_has_tip(&[], &khid, Lat, &["Kindati"]); + assert_has_tip(&[], &khid, Lit, &["ciKeda"]); + assert_has_tip(&[], &khid, Lut, &["KettA"]); + + let pish = d("piSa~", Tudadi); + assert_has_tip(&[], &pish, Lat, &["piMSati", "peSati"]); + assert_has_tip(&[], &pish, Lot, &["piMSatu"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_49.rs b/vidyut-prakriya/tests/kaumudi_49.rs new file mode 100644 index 0000000..d76403a --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_49.rs @@ -0,0 +1,193 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[ignore] +#[test] +fn sk_2543() { + let rudh = d("ru\\Di~^r", Rudhadi); + assert_has_tip(&[], &rudh, Lat, &["ruRadDi"]); + assert_has_tas(&[], &rudh, Lat, &["rundDaH", "runDaH"]); + assert_has_jhi(&[], &rudh, Lat, &["runDanti"]); + assert_has_iw(&[], &rudh, Lat, &["runDe"]); + assert_has_tip(&[], &rudh, Lut, &["rodDA"]); + assert_has_tip(&[], &rudh, Lrt, &["rotsyati"]); + assert_has_tip(&[], &rudh, Lot, &["ruRadDu", "rundDAt", "runDAt"]); + assert_has_sip(&[], &rudh, Lot, &["rundDi", "runDi", "rundDAt", "runDAt"]); + assert_has_mip(&[], &rudh, Lot, &["ruRaDAni"]); + assert_has_iw(&[], &rudh, Lot, &["ruRaDE"]); + + assert_has_tip(&[], &rudh, Lan, &["aruRat"]); + assert_has_tas(&[], &rudh, Lan, &["arunDAm", "arundDAm"]); + assert_has_sip(&[], &rudh, Lan, &["aruRat", "aruRaH"]); + assert_has_mip(&[], &rudh, Lan, &["aruRaDam"]); + + assert_has_tip(&[], &rudh, Lun, &["aruDat", "arOtsIt"]); + assert_has_ta(&[], &rudh, Lun, &["arudDa"]); + + let bhid = d("Bi\\di~^r", Rudhadi); + assert_has_tip(&[], &bhid, Lat, &["Binatti"]); + assert_has_ta(&[], &bhid, Lat, &["Bintte", "Binte"]); + assert_has_tip(&[], &bhid, Lut, &["BettA"]); + assert_has_tip(&[], &bhid, Lrt, &["Betsyati"]); + assert_has_ta(&[], &bhid, Lrt, &["Betsyate"]); + + assert_has_tip(&[], &bhid, Lan, &["aBinat"]); + assert_has_tas(&[], &bhid, Lan, &["aBinttAm", "aBintAm"]); + assert_has_mip(&[], &bhid, Lan, &["aBinadam"]); + assert_has_ta(&[], &bhid, Lan, &["aBinta", "aBintta"]); + assert_has_tip(&[], &bhid, Lun, &["aBidat", "aBEtsIt"]); + assert_has_ta(&[], &bhid, Lun, &["aBitta"]); + + let chid = d("Ci\\di~^r", Rudhadi); + assert_has_tip(&[], &chid, Lun, &["acCidat", "acCEtsIt"]); + assert_has_ta(&[], &chid, Lun, &["acCitta"]); + + let ric = d("ri\\ci~^r", Rudhadi); + assert_has_tip(&[], &ric, Lat, &["riRakti"]); + assert_has_ta(&[], &ric, Lat, &["riNkte"]); + assert_has_tip(&[], &ric, Lit, &["rireca"]); + assert_has_ta(&[], &ric, Lit, &["ririce"]); + assert_has_ta(&[], &ric, Lut, &["rektA"]); + assert_has_tip(&[], &ric, Lan, &["ariRak"]); + assert_has_tip(&[], &ric, Lun, &["aricat", "arEkzIt"]); + assert_has_ta(&[], &ric, Lun, &["arikta"]); + + let vic = d("vi\\ci~^r", Rudhadi); + assert_has_tip(&[], &vic, Lat, &["vinakti"]); + assert_has_ta(&[], &vic, Lat, &["viNkte"]); + + let kzud = d("kzu\\di~^r", Rudhadi); + assert_has_tip(&[], &kzud, Lat, &["kzuRatti"]); + assert_has_ta(&[], &kzud, Lat, &["kzunte", "kzuntte"]); + assert_has_tip(&[], &kzud, Lut, &["kzottA"]); + assert_has_tip(&[], &kzud, Lun, &["akzudat", "akzOtsIt"]); + assert_has_ta(&[], &kzud, Lun, &["akzutta"]); + + let yuj = d("yu\\ji~^r", Rudhadi); + assert_has_tip(&[], &yuj, Lut, &["yoktA"]); + + let chrd = d("u~Cfdi~^r", Rudhadi); + assert_has_tip(&[], &chrd, Lat, &["CfRatti"]); + assert_has_ta(&[], &chrd, Lat, &["Cfntte", "Cfnte"]); + assert_has_tip(&[], &chrd, Lit, &["cacCarda"]); + assert_has_thaas(&[], &chrd, Lit, &["cacCfdize", "cacCftse"]); + assert_has_tip(&[], &chrd, Lut, &["CarditA"]); + assert_has_tip(&[], &chrd, Lrt, &["Cardizyati", "Cartsyati"]); + assert_has_tip(&[], &chrd, Lun, &["acCfdat", "acCardIt"]); + assert_has_ta(&[], &chrd, Lun, &["acCardizwa"]); + + let trd = d("u~tfdi~^r", Rudhadi); + assert_has_tip(&[], &trd, Lat, &["tfRatti"]); + + let krt = d("kftI~", Rudhadi); + assert_has_tip(&[], &krt, Lat, &["kfRatti"]); +} + +#[test] +fn sk_2544() { + let indh = d("YiinDI~\\", Rudhadi); + assert_has_ta(&[], &indh, Lat, &["inDe", "indDe"]); + assert_has_thaas(&[], &indh, Lat, &["intse"]); + assert_has_ta(&[], &indh, Lut, &["inDitA"]); + assert_has_iw(&[], &indh, Lot, &["inaDE"]); + assert_has_ta(&[], &indh, Lan, &["EnDa", "EndDa"]); + assert_has_thaas(&[], &indh, Lan, &["EnDAH", "EndDAH"]); + + let khid = d("Ki\\da~\\", Rudhadi); + assert_has_ta(&[], &khid, Lut, &["KettA"]); + + let vid = d("vi\\da~\\", Rudhadi); + assert_has_ta(&[], &vid, Lat, &["vinte", "vintte"]); + assert_has_ta(&[], &vid, Lut, &["vettA"]); + + let shish = d("Si\\zx~", Rudhadi); + assert_has_tip(&[], &shish, Lat, &["Sinazwi"]); + assert_has_tas(&[], &shish, Lat, &["SiMzwaH"]); + assert_has_jhi(&[], &shish, Lat, &["SiMzanti"]); + assert_has_sip(&[], &shish, Lit, &["SiSeziTa"]); + assert_has_tip(&[], &shish, Lut, &["SezwA"]); + assert_has_tip(&[], &shish, Lrt, &["Sekzyati"]); + assert_has_sip(&[], &shish, Lot, &["SiRQi", "SiRqQi", "SiMzwAt"]); + assert_has_mip(&[], &shish, Lot, &["SinazARi"]); + assert_has_tip(&[], &shish, Lan, &["aSinaw"]); + assert_has_tip(&[], &shish, Lun, &["aSizat"]); + + let pish = d("pi\\zx~", Rudhadi); + assert_has_tip(&[], &pish, Lat, &["pinazwi"]); + + let bhanj = d("Ba\\njo~", Rudhadi); + assert_has_tip(&[], &bhanj, Lat, &["Banakti"]); + assert_has_sip(&[], &bhanj, Lit, &["baBaYjiTa", "baBaNkTa"]); + assert_has_tip(&[], &bhanj, Lut, &["BaNktA"]); + + let bhuj = d("Bu\\ja~", Rudhadi); + assert_has_tip(&[], &bhuj, Lat, &["Bunakti"]); + assert_has_tip(&[], &bhuj, Lut, &["BoktA"]); + assert_has_tip(&[], &bhuj, Lrt, &["Bokzyati"]); + assert_has_tip(&[], &bhuj, Lan, &["aBunak"]); +} + +#[test] +fn sk_2545() { + let trh = d("tfha~", Rudhadi); + assert_has_tip(&[], &trh, Lat, &["tfReQi"]); + assert_has_tas(&[], &trh, Lat, &["tfRQaH"]); + assert_has_tip(&[], &trh, Lit, &["tatarha"]); + assert_has_tip(&[], &trh, Lut, &["tarhitA"]); + assert_has_tip(&[], &trh, Lan, &["atfRew"]); + + let hins = d("hisi~", Rudhadi); + assert_has_tip(&[], &hins, Lat, &["hinasti"]); + assert_has_tip(&[], &hins, Lit, &["jihiMsa"]); + assert_has_tip(&[], &hins, Lut, &["hiMsitA"]); + + let und = d("undI~", Rudhadi); + assert_has_tip(&[], &und, Lat, &["unatti"]); + assert_has_tas(&[], &und, Lat, &["untaH", "unttaH"]); + assert_has_jhi(&[], &und, Lat, &["undanti"]); + assert_has_tip(&[], &und, Lit, &["undAYcakAra", "undAmbaBUva", "undAmAsa"]); + assert_has_tip(&[], &und, Lan, &["Onat"]); + assert_has_tas(&[], &und, Lan, &["OntAm", "OnttAm"]); + assert_has_jhi(&[], &und, Lan, &["Ondan"]); + assert_has_sip(&[], &und, Lan, &["OnaH", "Onat"]); + assert_has_mip(&[], &und, Lan, &["Onadam"]); + + let anj = d("anjU~", Rudhadi); + assert_has_tip(&[], &anj, Lat, &["anakti"]); + assert_has_tas(&[], &anj, Lat, &["aNktaH"]); + assert_has_jhi(&[], &anj, Lat, &["aYjanti"]); + assert_has_tip(&[], &anj, Lit, &["AnaYja"]); + assert_has_sip(&[], &anj, Lit, &["AnaYjiTa", "AnaNkTa"]); + assert_has_tip(&[], &anj, Lut, &["aNktA", "aYjitA"]); + assert_has_sip(&[], &anj, Lot, &["aNgDi", "aNktAt"]); + assert_has_mip(&[], &anj, Lot, &["anajAni"]); + assert_has_tip(&[], &anj, Lan, &["Anak"]); +} + +#[test] +fn sk_2546() { + let anj = d("anjU~", Rudhadi); + assert_has_tip(&[], &anj, Lun, &["AYjIt"]); + + let tanj = d("tancU~", Rudhadi); + assert_has_tip(&[], &tanj, Lat, &["tanakti"]); + assert_has_tip(&[], &tanj, Lut, &["taNktA", "taYcitA"]); + + let vij = d("o~vijI~", Rudhadi); + assert_has_tip(&[], &vij, Lat, &["vinakti"]); + assert_has_tas(&[], &vij, Lat, &["viNktaH"]); + assert_has_sip(&[], &vij, Lit, &["vivijiTa"]); + assert_has_tip(&[], &vij, Lut, &["vijitA"]); + assert_has_tip(&[], &vij, Lan, &["avinak"]); + assert_has_tip(&[], &vij, Lun, &["avijIt"]); + + let vrj = d("vfjI~", Rudhadi); + assert_has_tip(&[], &vrj, Lat, &["vfRakti"]); + assert_has_tip(&[], &vrj, Lut, &["varjitA"]); + + let prc = d("pfcI~", Rudhadi); + assert_has_tip(&[], &prc, Lat, &["pfRakti"]); + assert_has_tip(&[], &prc, Lit, &["paparca"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_50.rs b/vidyut-prakriya/tests/kaumudi_50.rs new file mode 100644 index 0000000..1d67997 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_50.rs @@ -0,0 +1,110 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[ignore] +#[test] +fn sk_2547() { + let tan = d("tanu~^", Tanadi); + assert_has_tip(&[], &tan, Lat, &["tanoti"]); + assert_has_vas(&[], &tan, Lat, &["tanvaH", "tanuvaH"]); + assert_has_ta(&[], &tan, Lat, &["tanute"]); + assert_has_tip(&[], &tan, Lit, &["tatAna"]); + assert_has_ta(&[], &tan, Lit, &["tene"]); + assert_has_sip(&[], &tan, Lot, &["tanu", "tanutAt"]); + assert_has_tip(&[], &tan, Lun, &["atanIt", "atAnIt"]); + assert_has_ta(&[], &tan, Lun, &["atata", "atanizwa"]); + assert_has_thaas(&[], &tan, Lun, &["ataTAH", "atanizWAH"]); + + let shan = d("zaRu~^", Tanadi); + assert_has_tip(&[], &shan, Lat, &["sanoti"]); + assert_has_ta(&[], &shan, Lat, &["sanute"]); + assert_has_tip(&[], &shan, AshirLin, &["sAyAt", "sanyAt"]); + assert_has_ta(&[], &shan, Lun, &["asAta", "asanizwa"]); + assert_has_thaas(&[], &shan, Lun, &["asATAH", "asanizWAH"]); + + let kshan = d("kzaRu~^", Tanadi); + assert_has_tip(&[], &kshan, Lat, &["kzaRoti"]); + assert_has_ta(&[], &kshan, Lat, &["kzaRute"]); + assert_has_tip(&[], &kshan, Lun, &["akzaRIt"]); + assert_has_ta(&[], &kshan, Lun, &["akzata", "akzaRizwa"]); + assert_has_thaas(&[], &kshan, Lun, &["akzaTAH", "akzaRizWAH"]); + + let kshin = d("kziRu~^", Tanadi); + assert_has_tip(&[], &kshin, Lat, &["kziRoti", "kzeRoti"]); + assert_has_sip(&[], &kshin, Lut, &["kzeRitAsi"]); + assert_has_thaas(&[], &kshin, Lut, &["kzeRitAse"]); + assert_has_tip(&[], &kshin, Lun, &["akzeRIt"]); + assert_has_tip(&[], &kshin, Lun, &["akzita", "akzeRizwa"]); + + let rn = d("fRu~^", Tanadi); + assert_has_tip(&[], &rn, Lat, &["arRoti"]); + assert_has_tas(&[], &rn, Lat, &["arRutaH"]); + assert_has_jhi(&[], &rn, Lat, &["arRvanti"]); + assert_has_tip(&[], &rn, Lit, &["AnarRa"]); + assert_has_ta(&[], &rn, Lit, &["AnfRe"]); + assert_has_thaas(&[], &rn, Lut, &["arRitAse"]); + assert_has_tip(&[], &rn, Lun, &["ArRIt"]); + assert_has_ta(&[], &rn, Lun, &["Arta", "ArRizwa"]); + assert_has_thaas(&[], &rn, Lun, &["ArTAH", "ArRizWAH"]); + + let trn = d("tfRu~^", Tanadi); + assert_has_tip(&[], &trn, Lat, &["tfRoti", "tarRoti"]); + assert_has_ta(&[], &trn, Lat, &["tfRute"]); + + let ghrn = d("GfRu~^", Tanadi); + assert_has_tip(&[], &ghrn, Lit, &["jaGarRa"]); + assert_has_ta(&[], &ghrn, Lit, &["jaGfRe"]); + + let van = d("vanu~\\", Tanadi); + assert_has_ta(&[], &van, Lat, &["vanute"]); + assert_has_ta(&[], &van, Lit, &["vavane"]); + assert_has_tip(&[], &van, Lat, &["vanoti"]); + assert_has_tip(&[], &van, Lit, &["vavAna"]); + + let man = d("manu~\\", Tanadi); + assert_has_ta(&[], &man, Lat, &["manute"]); + assert_has_ta(&[], &man, Lit, &["mene"]); + + let kr = d("qukf\\Y", Tanadi); + assert_has_tip(&[], &kr, Lat, &["karoti"]); + assert_has_jhi(&[], &kr, Lat, &["kurvanti"]); +} + +#[test] +fn sk_2548() { + let kf = &d("qukf\\Y", Tanadi); + assert_has_vas(&[], kf, Lat, &["kurvaH"]); + assert_has_mas(&[], kf, Lat, &["kurmaH"]); + assert_has_sip(&[], kf, Lit, &["cakarTa"]); + assert_has_vas(&[], kf, Lit, &["cakfva"]); + assert_has_thaas(&[], kf, Lit, &["cakfze"]); + assert_has_tip(&[], kf, Lut, &["kartA"]); + assert_has_tip(&[], kf, Lrt, &["karizyati"]); +} + +#[test] +fn sk_2549() { + let kf = &d("qukf\\Y", Tanadi); + assert_has_tip(&[], kf, VidhiLin, &["kuryAt"]); + assert_has_tip(&[], kf, AshirLin, &["kriyAt"]); + assert_has_ta(&[], kf, AshirLin, &["kfzIzwa"]); + assert_has_tip(&[], kf, Lun, &["akArzIt"]); + assert_has_ta(&[], kf, Lun, &["akfta"]); + assert_has_thaas(&[], kf, Lun, &["akfTAH"]); +} + +#[test] +fn sk_2550() { + let kf = &d("qukf\\Y", Tanadi); + assert_has_tip(&["sam"], kf, Lat, &["saMskaroti", "saNkaroti"]); + assert_has_jhi(&["sam"], kf, Lat, &["saMskurvanti", "saNkurvanti"]); + assert_has_tip(&["pari"], kf, Lat, &["parizkaroti", "parikaroti"]); + assert_has_tip( + &["pari"], + kf, + Lun, + &["paryazkArzIt", "paryaskArzIt", "paryakArzIt"], + ); +} diff --git a/vidyut-prakriya/tests/kaumudi_51.rs b/vidyut-prakriya/tests/kaumudi_51.rs new file mode 100644 index 0000000..8584a6e --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_51.rs @@ -0,0 +1,315 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2554() { + let kri = d("qukrI\\Y", Kryadi); + assert_has_tip(&[], &kri, Lat, &["krIRAti"]); + assert_has_jhi(&[], &kri, Lat, &["krIRanti"]); + assert_has_ta(&[], &kri, Lat, &["krIRIte"]); + assert_has_aataam(&[], &kri, Lat, &["krIRAte"]); + + assert_has_tip(&[], &kri, Lit, &["cikrAya"]); + assert_has_tas(&[], &kri, Lit, &["cikriyatuH"]); + // SK has "cikriyiTa" which is almost certainly a typo. + assert_has_sip(&[], &kri, Lit, &["cikrayiTa", "cikreTa"]); + assert_has_vas(&[], &kri, Lit, &["cikriyiva"]); + assert_has_thaas(&[], &kri, Lit, &["cikriyize"]); + + assert_has_tip(&[], &kri, Lut, &["kretA"]); + assert_has_tip(&[], &kri, Lrt, &["krezyati"]); + // krIRAtu is not listed (typo?) + // krItAt is listed (typo?) + assert_has_tip(&[], &kri, Lot, &["krIRAtu", "krIRItAt"]); + assert_has_ta(&[], &kri, AshirLin, &["krezIzwa"]); + assert_has_tip(&[], &kri, Lun, &["akrEzIt"]); + assert_has_ta(&[], &kri, Lun, &["akrezwa"]); + + let pri = d("prI\\Y", Kryadi); + assert_has_tip(&[], &pri, Lat, &["prIRAti"]); + assert_has_ta(&[], &pri, Lat, &["prIRIte"]); + + let mi = d("mI\\Y", Kryadi); + assert_has_tip(&["pra"], &mi, Lat, &["pramIRAti"]); + assert_has_ta(&["pra"], &mi, Lat, &["pramIRIte"]); + + assert_has_tip(&[], &mi, Lit, &["mamO"]); + assert_has_tas(&[], &mi, Lit, &["mimyatuH"]); + assert_has_sip(&[], &mi, Lit, &["mamiTa", "mamATa"]); + assert_has_ta(&[], &mi, Lit, &["mimye"]); + assert_has_tip(&[], &mi, Lut, &["mAtA"]); + assert_has_tip(&[], &mi, Lrt, &["mAsyati"]); + assert_has_tip(&[], &mi, AshirLin, &["mIyAt"]); + assert_has_ta(&[], &mi, AshirLin, &["mAsIzwa"]); + assert_has_tip(&[], &mi, Lun, &["amAsIt"]); + assert_has_tas(&[], &mi, Lun, &["amAsizwAm"]); + assert_has_ta(&[], &mi, Lun, &["amAsta"]); + + let si = d("zi\\Y", Kryadi); + assert_has_tip(&[], &si, Lat, &["sinAti"]); + assert_has_ta(&[], &si, Lat, &["sinIte"]); + assert_has_tip(&[], &si, Lit, &["sizAya"]); + assert_has_ta(&[], &si, Lit, &["sizye"]); + assert_has_tip(&[], &si, Lut, &["setA"]); +} + +#[ignore] +#[test] +fn sk_2555() { + let sku = d("sku\\Y", Kryadi); + assert_has_tip(&[], &sku, Lat, &["skunoti", "skunAti"]); + assert_has_ta(&[], &sku, Lat, &["skunute", "skunIte"]); + assert_has_tip(&[], &sku, Lit, &["cuskAva"]); + assert_has_ta(&[], &sku, Lit, &["cuskuve"]); + assert_has_tip(&[], &sku, Lut, &["skotA"]); + assert_has_tip(&[], &sku, Lun, &["askOzIt"]); + assert_has_ta(&[], &sku, Lun, &["askozwa"]); + + let stambh = d("stanBu~", Kryadi); + assert_has_tip(&["vi"], &stambh, Lat, &["vizwaBnoti", "vizwaBnAti"]); + assert_has_tip( + &["ava"], + &stambh, + Lat, + &["avazwaBnoti", "avazwaBnAti", "avastaBnoti", "avastaBnAti"], + ); + assert_has_tip(&["ava"], &stambh, Lit, &["avatazwamBa", "avatastamBa"]); + assert_has_tip(&["vi"], &stambh, Lun, &["vyazwaBat", "vyazwamBIt"]); + + let stumbh = d("stu\\nBu~", Kryadi); + assert_has_tip(&[], &stumbh, Lat, &["stuBnoti", "stuBnAti"]); +} + +#[test] +fn sk_2556() { + let skambh = d("skanBu~", Kryadi); + assert_has_tip(&["vi"], &skambh, Lat, &["vizkaBnoti", "vizkaBnAti"]); + + let skumbh = d("skunBu~", Kryadi); + assert_has_tip(&[], &skumbh, Lat, &["skuBnoti", "skuBnAti"]); +} + +#[test] +fn sk_2557() { + let stambh = d("stanBu~", Kryadi); + assert_has_sip( + &[], + &stambh, + Lot, + &["staBAna", "staBnItAt", "staBnuhi", "staBnutAt"], + ); + + let stumbh = d("stunBu~", Kryadi); + assert_has_sip( + &[], + &stumbh, + Lot, + &["stuBAna", "stuBnItAt", "stuBnuhi", "stuBnutAt"], + ); + + let skambh = d("skanBu~", Kryadi); + assert_has_sip( + &[], + &skambh, + Lot, + &["skaBAna", "skaBnItAt", "skaBnuhi", "skaBnutAt"], + ); + + let skumbh = d("skunBu~", Kryadi); + assert_has_sip( + &[], + &skumbh, + Lot, + &["skuBAna", "skuBnItAt", "skuBnuhi", "skuBnutAt"], + ); + + let yu = d("yu\\Y", Kryadi); + assert_has_tip(&[], &yu, Lat, &["yunAti"]); + assert_has_ta(&[], &yu, Lat, &["yunIte"]); + assert_has_tip(&[], &yu, Lut, &["yotA"]); + + let knu = d("knUY", Kryadi); + assert_has_tip(&[], &knu, Lat, &["knUnAti"]); + assert_has_ta(&[], &knu, Lat, &["knUnIte"]); + assert_has_tip(&[], &knu, Lut, &["knavitA"]); + + let dru = d("drUY", Kryadi); + assert_has_tip(&[], &dru, Lat, &["drURAti"]); + assert_has_ta(&[], &dru, Lat, &["drURIte"]); +} + +#[test] +fn sk_2558() { + let pu = d("pUY", Kryadi); + assert_has_tip(&[], &pu, Lat, &["punAti"]); + assert_has_ta(&[], &pu, Lat, &["punIte"]); + assert_has_tip(&[], &pu, Lut, &["pavitA"]); + + let lu = d("lUY", Kryadi); + assert_has_tip(&[], &lu, Lat, &["lunAti"]); + assert_has_ta(&[], &lu, Lat, &["lunIte"]); + + let str = d("stFY", Kryadi); + assert_has_ta(&[], &str, Lat, &["stfRIte"]); + assert_has_tip(&[], &str, Lit, &["tastAra"]); + assert_has_tas(&[], &str, Lit, &["tastaratuH"]); + assert_has_tip(&[], &str, Lut, &["staritA", "starItA"]); + assert_has_tip(&[], &str, VidhiLin, &["stfRIyAt"]); + assert_has_ta(&[], &str, VidhiLin, &["stfRIta"]); + assert_has_tip(&[], &str, AshirLin, &["stIryAt"]); + assert_has_ta(&[], &str, AshirLin, &["starizIzwa", "stIrzIzwa"]); + assert_has_tip(&[], &str, Lun, &["astArIt"]); + assert_has_tas(&[], &str, Lun, &["astArizwAm"]); + assert_has_ta(&[], &str, Lun, &["astarizwa", "astarIzwa", "astIrzwa"]); + + let kr = d("kFY", Kryadi); + assert_has_tip(&[], &kr, Lat, &["kfRAti"]); + assert_has_ta(&[], &kr, Lat, &["kfRIte"]); + assert_has_tip(&[], &kr, Lit, &["cakAra"]); + assert_has_ta(&[], &kr, Lit, &["cakare"]); + + let vr = d("vFY", Kryadi); + assert_has_tip(&[], &vr, Lat, &["vfRAti"]); + assert_has_ta(&[], &vr, Lat, &["vfRIte"]); + assert_has_tip(&[], &vr, Lit, &["vavAra"]); + assert_has_ta(&[], &vr, Lit, &["vavare"]); + assert_has_tip(&[], &vr, Lut, &["varitA", "varItA"]); + assert_has_ta(&[], &vr, AshirLin, &["varizIzwa", "vUrzIzwa"]); + assert_has_tas(&[], &vr, Lun, &["avArizwAm"]); + assert_has_ta(&[], &vr, Lun, &["avarizwa", "avarIzwa", "avUrzwa"]); + + let dhu = d("DUY", Kryadi); + assert_has_tip(&[], &dhu, Lat, &["DunAti"]); + assert_has_ta(&[], &dhu, Lat, &["DunIte"]); + assert_has_sip(&[], &dhu, Lit, &["duDaviTa", "duDoTa"]); + // dudhUva seems justified. + assert_has_vas(&[], &dhu, Lit, &["duDuviva", "duDUva"]); + assert_has_tip(&[], &dhu, Lut, &["DotA", "DavitA"]); + assert_has_tip(&[], &dhu, Lun, &["aDAvIt"]); + assert_has_ta(&[], &dhu, Lun, &["aDavizwa", "aDozwa"]); + + let shr = d("SF", Kryadi); + assert_has_tas(&[], &shr, Lit, &["SaSratuH", "SaSaratuH"]); + assert_has_vas(&[], &shr, Lit, &["SaSariva", "SaSriva"]); + assert_has_tip(&[], &shr, Lut, &["SaritA", "SarItA"]); + assert_has_sip(&[], &shr, Lot, &["SfRIhi", "SfRItAt"]); + assert_has_tip(&[], &shr, AshirLin, &["SIryAt"]); + assert_has_tas(&[], &shr, Lun, &["aSArizwAm"]); + + let pr = d("pF", Kryadi); + assert_has_tas(&[], &pr, Lit, &["papratuH", "paparatuH"]); + assert_has_tip(&[], &pr, AshirLin, &["pUryAt"]); + + let mr = d("mF", Kryadi); + assert_has_tip(&[], &mr, Lat, &["mfRAti"]); + assert_has_tip(&[], &mr, Lit, &["mamAra"]); + + let dr = d("dF", Kryadi); + assert_has_tas(&[], &dr, Lit, &["dadaratuH", "dadratuH"]); + + let r = d("F", Kryadi); + assert_has_tip(&[], &r, Lat, &["fRAti"]); + assert_has_tip(&[], &r, Lit, &["arAYcakAra", "arAmbaBUva", "arAmAsa"]); + assert_has_tip(&[], &r, Lut, &["aritA", "arItA"]); + assert_has_tip(&[], &r, Lan, &["ArRAt"]); + assert_has_tas(&[], &r, Lan, &["ArRItAm"]); + assert_has_tip(&[], &r, AshirLin, &["IryAt"]); + assert_has_tip(&[], &r, Lun, &["ArIt"]); + assert_has_tas(&[], &r, Lun, &["ArizwAm"]); +} + +#[ignore] +#[test] +fn sk_2559() { + let jya = d("jyA\\", Kryadi); + assert_has_tip(&[], &jya, Lat, &["jinAti"]); + assert_has_tip(&[], &jya, Lit, &["jijyO"]); + assert_has_tas(&[], &jya, Lit, &["jijyatuH"]); + + let li = d("lI\\", Kryadi); + assert_has_tip(&[], &li, Lit, &["lalO", "lilAya"]); + assert_has_tip(&[], &li, Lut, &["lAtA", "letA"]); + + let vli = d("vlI\\", Kryadi); + assert_has_tip(&[], &vli, Lat, &["vlinAti"]); + + let jna = d("jYA\\", Kryadi); + assert_has_tip(&[], &jna, Lat, &["jAnAti"]); + + let bandh = d("ba\\nDa~", Kryadi); + assert_has_tip(&[], &bandh, Lat, &["baDnAti"]); + assert_has_sip(&[], &bandh, Lit, &["babanDiTa"]); + assert_has_tip(&[], &bandh, Lut, &["banDA"]); + assert_has_tas(&[], &bandh, Lut, &["banDArO"]); + assert_has_tip(&[], &bandh, Lrt, &["Bantsyati"]); + assert_has_sip(&[], &bandh, Lot, &["baDAna"]); + assert_has_tip(&[], &bandh, Lun, &["aBAnsIt"]); + assert_has_tas(&[], &bandh, Lun, &["abAnDAm"]); + assert_has_jhi(&[], &bandh, Lun, &["aBAntsu"]); + + let vr = d("vfN", Kryadi); + assert_has_ta(&[], &vr, Lat, &["vfRIte"]); + assert_has_ta(&[], &vr, Lit, &["vavre"]); + assert_has_thaas(&[], &vr, Lit, &["vavfze"]); + assert_has_dhvam(&[], &vr, Lit, &["vavfQve"]); + assert_has_tip(&[], &vr, Lut, &["varitA", "varItA"]); + assert_has_tip(&[], &vr, Lun, &["avarizwa", "avarIzwa", "avfta"]); + + let shranth = d("SranTa~", Kryadi); + assert_has_tip(&[], &shranth, Lat, &["SraTnAti"]); + assert_has_tas(&[], &shranth, Lit, &["SreTatuH"]); + assert_has_jhi(&[], &shranth, Lit, &["SreTuH"]); + assert_has_sip(&[], &shranth, Lit, &["SreTiTa", "SaSrATa"]); + + let kunth = d("kunTa~", Kryadi); + assert_has_tip(&[], &kunth, Lat, &["kuTnAti"]); + assert_has_tip(&[], &kunth, Lit, &["cukunTa"]); + + assert_has_tip(&[], &kunth, Lit, &["cukoTa"]); + + let mrd = d("mfda~", Kryadi); + assert_has_tip(&[], &mrd, Lat, &["mfdnAti"]); + assert_has_sip(&[], &mrd, Lot, &["mfdAna"]); + + let mrd = d("mfqa~", Kryadi); + assert_has_tip(&[], &mrd, Lat, &["mfqRAti"]); + + let gudh = d("guDa~", Kryadi); + assert_has_tip(&[], &gudh, Lat, &["guDnAti"]); + + let kush = d("kuza~", Kryadi); + assert_has_tip(&[], &kush, Lat, &["kuzRAti"]); + assert_has_tip(&[], &kush, Lut, &["kozitA"]); +} + +#[ignore] +#[test] +fn sk_2561() { + let khav = d("Kava~", Kryadi); + assert_has_tip(&[], &khav, Lat, &["KOnAti"]); + assert_has_tip(&[], &khav, Lit, &["caKAva"]); + assert_has_tip(&[], &khav, Lut, &["KavitA"]); + assert_has_sip(&[], &khav, Lot, &["KOnIhi", "KOnItAt"]); + + let heth = d("heWa~", Kryadi); + assert_has_tip(&[], &heth, Lat, &["hiWRAti"]); + + let grah = d("graha~^", Kryadi); + assert_has_tip(&[], &grah, Lat, &["gfhRAti"]); + assert_has_ta(&[], &grah, Lat, &["gfhRIte"]); +} + +#[test] +fn sk_2562() { + let grah = d("graha~^", Kryadi); + assert_has_tip(&[], &grah, Lut, &["grahItA"]); + assert_has_tip(&[], &grah, AshirLin, &["gfhyAt"]); + assert_has_ta(&[], &grah, AshirLin, &["grahIzIzwa"]); + assert_has_tip(&[], &grah, Lun, &["agrahIt"]); + assert_has_tas(&[], &grah, Lun, &["agrahIzwAm"]); + assert_has_ta(&[], &grah, Lun, &["agrahIzwa"]); + assert_has_aataam(&[], &grah, Lun, &["agrahIzAtAm"]); + assert_has_jha(&[], &grah, Lun, &["agrahIzata"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_52.rs b/vidyut-prakriya/tests/kaumudi_52.rs new file mode 100644 index 0000000..bf68224 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_52.rs @@ -0,0 +1,74 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2563() { + let cur = d("cura~", Curadi); + assert_has_tip(&[], &cur, Lat, &["corayati"]); +} + +#[ignore] +#[test] +fn sk_2564() { + let cur = d("cura~", Curadi); + assert_has_ta(&[], &cur, Lat, &["corayate"]); + assert_has_tip( + &[], + &cur, + Lat, + &["corayAYcakAra", "corayAmbaBUva", "corayAmAsa"], + ); + assert_has_tip(&[], &cur, Lut, &["corayitA"]); + assert_has_tip(&[], &cur, AshirLin, &["coryAt"]); + assert_has_ta(&[], &cur, AshirLin, &["corayizIzwa"]); + assert_has_tip(&[], &cur, Lun, &["acUcurat"]); + assert_has_ta(&[], &cur, Lun, &["acUcurata"]); + + let cint = d("citi~", Curadi); + assert_has_tip(&[], &cint, Lat, &["cintayati"]); + assert_has_tip(&[], &cint, Lun, &["acicintat"]); + assert_has_tip(&[], &cint, AshirLin, &["cintyAt"]); + assert_has_ta_k(&[], &cint, Lat, &["cintyate"]); + + // TODO: cintati, etc. +} + +#[ignore] +#[test] +fn sk_2565() { + let pid = d("pIqa~", Curadi); + assert_has_tip(&[], &pid, Lun, &["apipIqat", "apIpiqat"]); + + let badh = d("baDa~", Curadi); + assert_has_tip(&[], &badh, Lat, &["bADayati"]); + + let pr = d("pF", Curadi); + assert_has_tip(&[], &pr, Lat, &["pArayati"]); + // TODO: parati? +} + +#[test] +fn sk_2566() { + let prath = d("praTa~", Curadi); + assert_has_tip(&[], &prath, Lun, &["apapraTat"]); + + let prth = d("pfTa~", Curadi); + assert_has_tip(&[], &prth, Lat, &["parTayati"]); +} + +#[test] +fn skip_sk_2569() {} + +#[test] +fn sk_2574() { + // TODO: add more + + // ac-Adi dhatus with can-pratyaya and ak-lopa + // TODO: why does the SK have AndaDat and not AndiDat? + assert_has_lun_p(&[], &d("anDa", Curadi), &["AndaDat"]); + assert_has_lun_p(&[], &d("anka", Curadi), &["AYcakat"]); + assert_has_lun_p(&[], &d("anga", Curadi), &["AYjagat"]); + assert_has_lun_p(&[], &d("vyaya", Curadi), &["avavyayat"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_53.rs b/vidyut-prakriya/tests/kaumudi_53.rs new file mode 100644 index 0000000..95cc487 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_53.rs @@ -0,0 +1,72 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2576() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &nic(&bhu), Lat, &["BAvayati"]); + assert_has_ta(&[], &nic(&bhu), Lat, &["BAvayate"]); + assert_has_tip( + &[], + &nic(&bhu), + Lit, + &["BAvayAYcakAra", "BAvayAmbaBUva", "BAvayAmAsa"], + ); +} + +#[test] +fn sk_2577() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &nic(&bhu), Lun, &["abIBavat"]); + + let pu = d("pUY", Kryadi); + assert_has_tip(&[], &nic(&pu), Lun, &["apIpavat"]); + + let mu = d("mUN", Bhvadi); + assert_has_tip(&[], &nic(&mu), Lun, &["amImavat"]); + + let yu = d("yu", Adadi); + assert_has_tip(&[], &nic(&yu), Lun, &["ayIyavat"]); + + let ru = d("ru", Adadi); + assert_has_tip(&[], &nic(&ru), Lun, &["arIravat"]); + + let lu = d("lUY", Kryadi); + assert_has_tip(&[], &nic(&lu), Lun, &["alIlavat"]); + + let ju = d("ju", Adadi); + assert_has_tip(&[], &nic(&ju), Lun, &["ajIjavat"]); +} + +#[ignore] +#[test] +fn sk_2578() { + let sru = d("sru\\", Bhvadi); + assert_has_tip(&[], &nic(&sru), Lun, &["asisravat", "asusravat"]); + + let shas = d("SAsu~", Adadi); + assert_has_tip(&[], &nic(&shas), Lun, &["aSaSAsat"]); + + let dhauk = d("QOkf~\\", Bhvadi); + assert_has_tip(&[], &nic(&dhauk), Lun, &["aquQOkat"]); + + // TODO: how to derive acIcakAsat? + // sanvallaGuni -> sanyataH? But if so, why is cakAs laGu? + let cakas = d("cakAsf~", Adadi); + assert_has_tip(&[], &nic(&cakas), Lun, &["acacakAsat"]); + + let cur = d("cura~", Curadi); + assert_has_tip(&[], &cur, Lun, &["acUcurat"]); +} + +#[ignore] +#[test] +fn sk_2579() { + let i = d("i\\N", Adadi); + assert_has_tip(&["aDi"], &nic(&i), Lun, &["aDyajIgapat", "aDyApipat"]); +} + +#[test] +fn skip_sk_2581() {} diff --git a/vidyut-prakriya/tests/kaumudi_54.rs b/vidyut-prakriya/tests/kaumudi_54.rs new file mode 100644 index 0000000..e4fa91d --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_54.rs @@ -0,0 +1,168 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2609() { + let rud = d("rudi~r", Adadi); + assert_has_tip(&[], &san(&rud), Lat, &["rurudizati"]); + + let vid = d("vida~", Adadi); + assert_has_tip(&[], &san(&vid), Lat, &["vividizati"]); + + let mush = d("muza~", Kryadi); + assert_has_tip(&[], &san(&mush), Lat, &["mumuzizati"]); +} + +#[test] +fn sk_2610() { + let grah = d("graha~^", Kryadi); + assert_has_tip(&[], &san(&grah), Lat, &["jiGfkzati"]); + + let svap = d("Yizva\\pa~", Adadi); + assert_has_tip(&[], &san(&svap), Lat, &["suzupsati"]); +} + +#[ignore] +#[test] +fn sk_2611() { + let prach = d("pra\\Ca~", Tudadi); + assert_has_tip(&[], &san(&prach), Lat, &["pipfcCizati"]); + + let kr = d("kF", Tudadi); + assert_has_tip(&[], &san(&kr), Lat, &["cikarizati"]); + + let gr = d("gF", Tudadi); + assert_has_tip(&[], &san(&gr), Lat, &["jigarizati", "jigalizati"]); + + let dr = d("df\\N", Tudadi); + assert_has_ta(&[], &san(&dr), Lat, &["didarizate"]); + + let dhr = d("Df\\N", Tudadi); + assert_has_ta(&[], &san(&dhr), Lat, &["diDarizate"]); +} + +#[test] +fn sk_2612() { + let bhu = d("BU", Bhvadi); + assert_has_tip(&[], &san(&bhu), Lat, &["buBUzati"]); + + let di = d("dI\\N", Divadi); + assert_has_ta(&[], &san(&di), Lat, &["didIzate"]); +} + +#[ignore] +#[test] +fn sk_2613() { + let guh = d("guhU~^", Bhvadi); + assert_has_tip(&[], &san(&guh), Lat, &["juGukzati"]); + + let bhid = d("Bi\\di~^r", Rudhadi); + assert_has_tip(&[], &san(&bhid), Lat, &["biBitsati"]); + + let yaj = d("ya\\ja~^", Bhvadi); + assert_has_ta(&[], &san(&yaj), Lat, &["yiyakzate"]); + + let vrdh = d("vfDu~\\", Bhvadi); + assert_has_ta(&[], &san(&vrdh), Lat, &["vivarDizate"]); + + let trnh = d("tfnhU~", Tudadi); + assert_has_tip(&[], &san(&trnh), Lat, &["titfkzati", "titfMhizati"]); +} + +#[test] +fn sk_2614() { + let ji = d("ji\\", Bhvadi); + assert_has_tip(&[], &san(&ji), Lat, &["jigIzati"]); + + let ci = d("ci\\Y", Svadi); + assert_has_tip(&[], &san(&ci), Lat, &["cikIzati", "cicIzati"]); + + let han = d("ha\\na~", Adadi); + assert_has_tip(&[], &san(&han), Lat, &["jiGAMsati"]); +} + +#[ignore] +#[test] +fn sk_2615() { + let gam = d("ga\\mx~", Bhvadi); + assert_has_tip(&[], &san(&gam), Lat, &["jigamizati"]); + + let i = d("i\\R", Adadi); + assert_has_tip(&["aDi"], &san(&i), Lat, &["aDijigamizati"]); + assert_has_ta_k(&[], &san(&gam), Lat, &["jigAMsyate"]); + assert_has_ta_k(&["aDi"], &san(&i), Lat, &["aDijigAMsyate"]); + assert_has_ta_k(&[], &san(&gam), Lat, &["jigaMsyate"]); + assert_has_ta_k(&["sam"], &san(&gam), Lat, &["saMjigaMsyate"]); +} + +#[test] +fn sk_2616() { + let i = d("i\\N", Adadi); + assert_has_ta(&["aDi"], &san(&i), Lat, &["aDijigAMsate"]); +} + +#[test] +fn sk_2617() { + let dyut = d("dyuta~\\", Bhvadi); + assert_has_ta(&[], &san(&dyut), Lat, &["didyutizate", "didyotizate"]); + + let ruc = d("ruca~\\", Bhvadi); + assert_has_ta(&[], &san(&ruc), Lat, &["rurucizate", "rurocizate"]); + + // lileKizati is from KV 1.2.26. + let likh = d("liKa~", Tudadi); + assert_has_tip(&[], &san(&likh), Lat, &["liliKizati", "lileKizati"]); + + // dudyUzati is from SK 2618. + let div = d("divu~", Divadi); + assert_has_tip(&[], &san(&div), Lat, &["didevizati", "dudyUzati"]); + + let vrt = d("vftu~\\", Bhvadi); + assert_has_ta(&[], &san(&vrt), Lat, &["vivartizate"]); + + let ish = d("iza~", Divadi); + assert_has_tip(&[], &san(&ish), Lat, &["ezizizati"]); +} + +#[test] +fn sk_2618() { + let vrt = d("vftu~\\", Bhvadi); + assert_has_ta(&[], &san(&vrt), Lat, &["vivartizate"]); + + let siv = d("zivu~", Divadi); + assert_has_tip(&[], &san(&siv), Lat, &["susyUzati", "sisevizati"]); +} + +#[test] +fn skip_sk_2619() {} + +#[ignore] +#[test] +fn sk_2620() { + let aap = d("A\\px~", Svadi); + assert_has_tip(&[], &san(&aap), Lat, &["Ipsati"]); + + let rdh = d("fDu~", Svadi); + assert_has_tip(&[], &san(&rdh), Lat, &["Irtsati", "ardiDizati"]); + + let bhrasj = d("Bra\\sja~^", Tudadi); + assert_has_tip( + &[], + &san(&bhrasj), + Lat, + &["biBrajjizati", "biBarjizati", "biBrakzati", "biBarkzati"], + ); +} + +#[test] +fn sk_2622() { + let tan = d("tanu~^", Tanadi); + assert_has_tip( + &[], + &san(&tan), + Lat, + &["titAMsati", "titaMsati", "titanizati"], + ); +} diff --git a/vidyut-prakriya/tests/kaumudi_55.rs b/vidyut-prakriya/tests/kaumudi_55.rs new file mode 100644 index 0000000..6a382d7 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_55.rs @@ -0,0 +1,239 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn skip_sk_2629() {} + +#[test] +fn sk_2630() { + let bhu = d("BU", Bhvadi); + assert_has_ta(&[], &yan(&bhu), Lat, &["boBUyate"]); + assert_has_ta( + &[], + &yan(&bhu), + Lit, + &["boBUyAYcakre", "boBUyAmAsa", "boBUyAmbaBUva"], + ); + assert_has_ta(&[], &yan(&bhu), Lun, &["aboBUyizwa"]); + + let ruc = d("ruca~\\", Bhvadi); + assert_has_ta(&[], &yan(&ruc), Lat, &["rorucyate"]); + + let shubh = d("SuBa~\\", Bhvadi); + assert_has_ta(&[], &yan(&shubh), Lat, &["SoSuByate"]); + + let suca = d("sUca", Curadi); + assert_has_ta(&[], &yan(&suca), Lat, &["sosUcyate"]); + + let sutra = d("sUtra", Curadi); + assert_has_ta(&[], &yan(&sutra), Lat, &["sosUtryate"]); + + let mutra = d("mUtra", Curadi); + assert_has_ta(&[], &yan(&mutra), Lat, &["momUtryate"]); +} + +#[test] +fn sk_2631() { + let suc = &d("sUca", Curadi); + assert_has_ta( + &[], + &yan(&suc), + Lit, + &["sosUcAYcakre", "sosUcAmbaBUva", "sosUcAmAsa"], + ); + assert_has_ta(&[], &yan(&suc), Lut, &["sosUcitA"]); + + let sutra_yan = d("sUtra", Curadi); + assert_has_ta(&[], &yan(&sutra_yan), Lut, &["sosUtritA"]); + + let mutra = d("mUtra", Curadi); + assert_has_ta(&[], &yan(&mutra), Lut, &["momUtritA"]); +} + +#[test] +fn sk_2632() { + let at = d("awa~", Bhvadi); + assert_has_ta(&[], &yan(&at), Lat, &["awAwyate"]); +} + +#[test] +fn sk_2633() { + let r = d("f\\", Juhotyadi); + assert_has_ta(&[], &yan(&r), Lat, &["arAryate"]); + assert_has_ta(&[], &yan(&r), Lut, &["arAritA"]); + + let ash = d("aSU~\\", Svadi); + assert_has_ta(&[], &yan(&ash), Lut, &["aSASitA"]); + + let urnu = d("UrRuY", Adadi); + assert_has_ta(&[], &yan(&urnu), Lat, &["UrRonUyate"]); + + let bhid = d("Bi\\di~^r", Rudhadi); + assert_has_ta(&[], &yan(&bhid), Lat, &["beBidyate"]); + assert_has_ta(&[], &yan(&bhid), Lut, &["beBiditA"]); +} + +#[test] +fn sk_2634() { + let vraj = d("vraja~", Bhvadi); + assert_has_ta(&[], &yan(&vraj), Lat, &["vAvrajyate"]); +} + +#[test] +fn sk_2635() { + let lup = d("lupa~", Divadi); + assert_has_ta(&[], &yan(&lup), Lat, &["lolupyate"]); + + let sad = d("za\\dx~", Bhvadi); + assert_has_ta(&[], &yan(&sad), Lat, &["sAsadyate"]); +} + +#[test] +fn skip_sk_2636() {} + +#[test] +fn sk_2637() { + // TODO: sk also has caMcUryate, paMPUlyate -- why? + let car = d("cara~", Bhvadi); + assert_has_ta(&[], &yan(&car), Lat, &["caYcUryate"]); + + let phal = d("YiPalA~", Bhvadi); + assert_has_ta(&[], &yan(&phal), Lat, &["pamPulyate"]); +} + +#[test] +fn sk_2638() { + let jap = d("japa~", Bhvadi); + assert_has_ta(&[], &yan(&jap), Lat, &["jaYjapyate"]); +} + +#[test] +fn sk_2639() { + let gr = d("gF", Tudadi); + assert_has_ta(&[], &yan(&gr), Lat, &["jegilyate"]); + + let da = d("qudA\\Y", Juhotyadi); + assert_has_ta(&[], &yan(&da), Lat, &["dedIyate"]); + + let pa = d("pA\\", Bhvadi); + assert_has_ta(&[], &yan(&pa), Lat, &["pepIyate"]); + + let so = d("zo\\", Divadi); + assert_has_ta(&[], &yan(&so), Lat, &["sezIyate"]); + + let shvi = d("wuo~Svi", Bhvadi); + assert_has_ta(&[], &yan(&shvi), Lat, &["SoSUyate", "SeSvIyate"]); + + let smr = d("smf", Bhvadi); + assert_has_ta(&[], &yan(&smr), Lat, &["sAsmaryate"]); + + let kr = d("qukf\\Y", Tanadi); + assert_has_ta(&[], &yan(&kr), Lat, &["cekrIyate"]); + + // saYcekrIyate is justified since suw-Agama is optional. + assert_has_ta(&["sam"], &yan(&kr), Lat, &["saYceskrIyate", "saYcekrIyate"]); +} + +#[test] +fn sk_2640() { + let sic = d("zi\\ca~^", Tudadi); + assert_has_ta(&["ni"], &yan(&sic), Lat, &["nisesicyate"]); +} + +#[test] +fn sk_2641() { + let ku = d("ku\\N", Bhvadi); + assert_has_ta(&[], &yan(&ku), Lat, &["kokUyate"]); +} + +#[test] +fn sk_2642() { + let vanc = d("vancu~", Bhvadi); + assert_has_ta(&[], &yan(&vanc), Lat, &["vanIvacyate"]); + + let srans = d("sransu~\\", Bhvadi); + assert_has_ta(&[], &yan(&srans), Lat, &["sanIsrasyate"]); +} + +#[test] +fn sk_2643() { + let yam = d("ya\\ma~", Bhvadi); + assert_has_ta(&[], &yan(&yam), Lat, &["yaMyamyate"]); + + let bham = d("BAma~\\", Bhvadi); + assert_has_ta(&[], &yan(&bham), Lat, &["bABAmyate"]); + + let jan = d("janI~\\", Divadi); + assert_has_ta(&[], &yan(&jan), Lat, &["jAjAyate", "jaYjanyate"]); + + let han = d("ha\\na~", Adadi); + assert_has_ta(&[], &yan(&han), Lat, &["jeGnIyate", "jaNGanyate"]); +} + +#[test] +fn sk_2644() { + let vrt = d("vftu~\\", Bhvadi); + assert_has_ta(&[], &yan(&vrt), Lat, &["varIvftyate"]); + + let nrt = d("nftI~", Divadi); + assert_has_ta(&[], &yan(&nrt), Lat, &["narInftyate"]); + + let grah = d("graha~^", Kryadi); + assert_has_ta(&[], &yan(&grah), Lat, &["jarIgfhyate"]); + + let klp = d("kfpU~\\", Bhvadi); + assert_has_ta(&[], &yan(&klp), Lat, &["calIkxpyate"]); + + let vrasc = d("o~vrascU~", Tudadi); + assert_has_ta(&[], &yan(&vrasc), Lat, &["varIvfScyate"]); + + let prach = d("pra\\Ca~", Tudadi); + assert_has_ta(&[], &yan(&prach), Lat, &["parIpfcCyate"]); +} + +#[test] +fn sk_2645() { + let svap = d("Yizva\\pa~", Adadi); + assert_has_ta(&[], &yan(&svap), Lat, &["sozupyate"]); + + let syam = d("syamu~", Bhvadi); + assert_has_ta(&[], &yan(&syam), Lat, &["sesimyate"]); + + let vye = d("vye\\Y", Bhvadi); + assert_has_ta(&[], &yan(&vye), Lat, &["vevIyate"]); +} + +#[test] +fn sk_2646() { + let vash = d("vaSa~", Adadi); + assert_has_ta(&[], &yan(&vash), Lat, &["vAvaSyate"]); +} + +#[test] +fn sk_2647() { + let cay = d("cAyf~^", Bhvadi); + assert_has_ta(&[], &yan(&cay), Lat, &["cekIyate"]); +} + +#[test] +fn sk_2648() { + let ghra = d("GrA\\", Bhvadi); + assert_has_ta(&[], &yan(&ghra), Lat, &["jeGrIyate"]); + + let dhma = d("DmA\\", Bhvadi); + assert_has_ta(&[], &yan(&dhma), Lat, &["deDmIyate"]); +} + +#[test] +fn sk_2649() { + let shi = d("SIN", Adadi); + assert_has_ta(&[], &yan(&shi), Lat, &["SASayyate"]); + + let dhauk = d("QOkf~\\", Bhvadi); + assert_has_ta(&[], &yan(&dhauk), Lat, &["qoQOkyate"]); + + let trauk = d("trOkf~\\", Bhvadi); + assert_has_ta(&[], &yan(&trauk), Lat, &["totrOkyate"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_60.rs b/vidyut-prakriya/tests/kaumudi_60.rs new file mode 100644 index 0000000..85ce4d6 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_60.rs @@ -0,0 +1,45 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2679() { + let as_ = d("Asa~\\", Adadi); + assert_has_ta(&[], &as_, Lat, &["Aste"]); + + let shi = d("SIN", Adadi); + assert_has_ta(&[], &shi, Lat, &["Sete"]); + + // TODO: are these supposed to be karmani here? + let bhu = &d("BU", Bhvadi); + assert_has_ta_k(&[], bhu, Lit, &["baBUve"]); + assert_has_ta_k(&["anu"], bhu, Lit, &["anubaBUve"]); +} + +#[test] +fn sk_2683() { + let vish = d("vi\\Sa~", Tudadi); + assert_has_lat(&["ni"], &vish, &["niviSate"]); +} + +#[test] +fn sk_2684() { + let kri = d("qukrI\\Y", Kryadi); + assert_has_lat(&["pari"], &kri, &["parikrIRIte"]); + assert_has_lat(&["vi"], &kri, &["vikrIRIte"]); + assert_has_lat(&["ava"], &kri, &["avakrIRIte"]); +} + +#[test] +fn sk_2685() { + let ji = d("ji\\", Bhvadi); + assert_has_lat(&["vi"], &ji, &["vijayate"]); + assert_has_lat(&["parA"], &ji, &["parAjayate"]); +} + +#[test] +fn sk_2699() { + let gam = d("ga\\mx~", Bhvadi); + assert_has_ta(&["sam"], &gam, Lat, &["saNgacCate"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_62.rs b/vidyut-prakriya/tests/kaumudi_62.rs new file mode 100644 index 0000000..de6ed3f --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_62.rs @@ -0,0 +1,212 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; + +#[test] +fn sk_2756() { + let bhu = d("BU", Bhvadi); + assert_has_ta_k(&[], &bhu, Lat, &["BUyate"]); + assert_has_ta_k(&[], &bhu, Lit, &["baBUve"]); +} + +#[test] +fn sk_2757() { + let bhu = d("BU", Bhvadi); + assert_has_ta_k(&[], &bhu, Lut, &["BAvitA", "BavitA"]); + assert_has_ta_k(&[], &bhu, Lrt, &["BAvizyate", "Bavizyate"]); + assert_has_ta_k(&[], &bhu, Lot, &["BUyatAm"]); + assert_has_ta_k(&[], &bhu, Lan, &["aBUyata"]); + assert_has_ta_k(&[], &bhu, VidhiLin, &["BUyeta"]); + assert_has_ta_k(&[], &bhu, AshirLin, &["BAvizIzwa", "BavizIzwa"]); +} + +#[test] +fn sk_2758() { + let bhu = d("BU", Bhvadi); + assert_has_ta_k(&["anu"], &bhu, Lat, &["anuBUyate"]); + assert_has_aataam_k(&["anu"], &bhu, Lat, &["anuBUyete"]); + assert_has_jha_k(&["anu"], &bhu, Lat, &["anuBUyante"]); + assert_has_thaas_k(&["anu"], &bhu, Lat, &["anuBUyase"]); + assert_has_iw_k(&["anu"], &bhu, Lat, &["anuBUye"]); + assert_has_ta_k(&["anu"], &bhu, Lun, &["anvaBAvi"]); + assert_has_aataam_k(&["anu"], &bhu, Lun, &["anvaBAvizAtAm", "anvaBavizAtAm"]); + + let bhu_nic = nic(&bhu); + assert_has_ta_k(&[], &bhu_nic, Lat, &["BAvyate"]); + assert_has_ta_k( + &[], + &bhu_nic, + Lit, + &["BAvayAYcakre", "BAvayAmbaBUve", "BAvayAmAse"], + ); + assert_has_ta_k(&[], &bhu_nic, Lut, &["BAvitA", "BAvayitA"]); + assert_has_ta_k(&[], &bhu_nic, Lrt, &["BAvizyate", "BAvayizyate"]); + assert_has_ta_k(&[], &bhu_nic, Lot, &["BAvyatAm"]); + assert_has_ta_k(&[], &bhu_nic, Lan, &["aBAvyata"]); + assert_has_ta_k(&[], &bhu_nic, VidhiLin, &["BAvyeta"]); + assert_has_ta_k(&[], &bhu_nic, AshirLin, &["BAvizIzwa", "BAvayizIzwa"]); + assert_has_ta_k(&[], &bhu_nic, Lun, &["aBAvi"]); + assert_has_aataam_k(&[], &bhu_nic, Lun, &["aBAvizAtAm", "aBAvayizAtAm"]); + + let bhu_yan = san(&bhu); + assert_has_ta_k(&[], &bhu_yan, Lat, &["buBUzyate"]); + assert_has_ta_k( + &[], + &bhu_yan, + Lit, + &["buBUzAYcakre", "buBUzAmbaBUve", "buBUzAmAse"], + ); + assert_has_ta_k(&[], &bhu_yan, Lut, &["buBUzitA"]); + assert_has_ta_k(&[], &bhu_yan, Lrt, &["buBUzizyate"]); + + let bhu_yan = yan(&bhu); + assert_has_ta_k(&[], &bhu_yan, Lat, &["boBUyyate"]); + + let bhu_yan_luk = yan_luk(&bhu); + assert_has_ta_k(&[], &bhu_yan_luk, Lat, &["boBUyate"]); + assert_has_ta_k( + &[], + &bhu_yan_luk, + Lit, + &["boBavAYcakre", "boBavAmbaBUve", "boBavAmAse"], + ); + assert_has_ta_k(&[], &bhu_yan_luk, Lut, &["boBAvitA", "boBavitA"]); + + let stu = d("zwu\\Y", Adadi); + assert_has_ta_k(&[], &stu, Lat, &["stUyate"]); + assert_has_ta_k(&[], &stu, Lit, &["tuzwuve"]); + assert_has_ta_k(&[], &stu, Lut, &["stAvitA", "stotA"]); + assert_has_ta_k(&[], &stu, Lrt, &["stAvizyate", "stozyate"]); + assert_has_ta_k(&[], &stu, Lun, &["astAvi"]); + assert_has_aataam_k(&[], &stu, Lun, &["astAvizAtAm", "astozAtAm"]); + + let r = d("f\\", Bhvadi); + assert_has_ta_k(&[], &r, Lat, &["aryate"]); + + let smr = d("smf\\", Bhvadi); + assert_has_ta_k(&[], &smr, Lat, &["smaryate"]); + assert_has_ta_k(&[], &smr, Lit, &["sasmare"]); + + assert_has_ta_k(&[], &r, Lut, &["AritA", "artA"]); + assert_has_ta_k(&[], &smr, Lut, &["smAritA", "smartA"]); + + let kr = d("qukf\\Y", Tanadi); + assert_has_ta_k(&["sam"], &kr, Lat, &["saMskriyate", "saNkriyate"]); + + let srans = d("sransu~\\", Bhvadi); + assert_has_ta_k(&[], &srans, Lat, &["srasyate"]); + + let yaj = d("ya\\ja~^", Bhvadi); + assert_has_ta_k(&[], &yaj, Lat, &["ijyate"]); + + let shi = d("SIN", Adadi); + assert_has_ta_k(&[], &shi, Lat, &["Sayyate"]); +} + +#[test] +fn sk_2759() { + let tan = d("tanu~^", Tanadi); + assert_has_ta_k(&[], &tan, Lat, &["tAyate", "tanyate"]); + + let jan = d("janI~\\", Divadi); + assert_has_ta_k(&[], &jan, Lat, &["jAyate", "janyate"]); +} + +#[test] +fn sk_2760() { + let daa = d("qudA\\Y", Juhotyadi); + assert_has_ta_k(&[], &daa, Lat, &["dIyate"]); + + let dhaa = d("quDA\\Y", Juhotyadi); + assert_has_ta_k(&[], &dhaa, Lat, &["DIyate"]); + + let glai = d("glE\\", Bhvadi); + assert_has_ta_k(&[], &glai, Lit, &["jagle"]); +} + +#[ignore] +#[test] +fn sk_2762() { + let x = d("Samu~", Divadi); + assert_has_tip(&[], &nic(&x), Lut, &["SAmitA", "SamitA", "SamayitA"]); + assert_has_ta( + &[], + &nic(&x), + Lrt, + &["SAmizyate", "Samizyate", "Samayizyate"], + ); + + assert_has_ta(&[], &nic(&x), Lat, &["SaMSamyate"]); + assert_has_ta( + &[], + &nic(&x), + Lut, + &["SaMSAmitA", "SaMSamitA", "SaMSamayitA"], + ); +} + +#[test] +fn sk_2763() { + let sham = d("Samu~", Bhvadi); + assert_has_ta_k(&[], &sham, Lun, &["aSami"]); + + let dam = d("damu~", Bhvadi); + assert_has_ta_k(&[], &dam, Lun, &["adami"]); + + let gam = d("ga\\mx~", Bhvadi); + assert_has_ta_k(&[], &gam, Lun, &["agAmi"]); + + let vad = d("vada~", Bhvadi); + assert_has_ta_k(&[], &vad, Lun, &["avAdi"]); + + let cam = d("camu~", Bhvadi); + assert_has_ta_k(&["AN"], &cam, Lun, &["AcAmi"]); + + let kam = d("kamu~\\", Bhvadi); + assert_has_ta_k(&[], &kam, Lun, &["akAmi"]); + + let vam = d("wuvama~", Bhvadi); + assert_has_ta_k(&[], &vam, Lun, &["avAmi"]); + + // aGAni is from SK 2761. + let han = d("ha\\na~", Adadi); + assert_has_ta_k(&[], &han, Lun, &["avaDi", "aGAni"]); + + let jagr = d("jAgf", Adadi); + assert_has_ta_k(&[], &jagr, Lun, &["ajAgAri"]); +} + +#[test] +fn sk_2764() { + let bhanj = d("Ba\\njo~", Rudhadi); + assert_has_ta_k(&[], &bhanj, Lun, &["aBAji", "aBaYji"]); +} + +#[test] +fn sk_2765() { + let labh = d("qula\\Ba~\\z", Bhvadi); + assert_has_ta_k(&[], &labh, Lun, &["alamBi", "alABi"]); + assert_has_ta_k(&["pra"], &labh, Lun, &["prAlamBi"]); + + let ni = d("RI\\Y", Bhvadi); + assert_has_ta_k(&[], &ni, Lat, &["nIyate"]); + + let hr = d("hf\\Y", Bhvadi); + assert_has_ta_k(&[], &hr, Lat, &["hriyate"]); + + let krsh = d("kf\\za~", Bhvadi); + assert_has_ta_k(&[], &krsh, Lat, &["kfzyate"]); + + let vah = d("va\\ha~^", Bhvadi); + assert_has_ta_k(&[], &vah, Lat, &["uhyate"]); + + let budh = d("bu\\Da~\\", Divadi); + assert_has_ta_k(&[], &nic(&budh), Lat, &["boDyate"]); + + let gam = d("ga\\mx~", Bhvadi); + assert_has_ta_k(&[], &gam, Lat, &["gamyate"]); + + let aas = d("Asa~\\", Bhvadi); + assert_has_ta_k(&[], &aas, Lat, &["Asyate"]); +} diff --git a/vidyut-prakriya/tests/unadi_sutras.rs b/vidyut-prakriya/tests/kaumudi_67.rs similarity index 85% rename from vidyut-prakriya/tests/unadi_sutras.rs rename to vidyut-prakriya/tests/kaumudi_67.rs index e893aad..953b5a2 100644 --- a/vidyut-prakriya/tests/unadi_sutras.rs +++ b/vidyut-prakriya/tests/kaumudi_67.rs @@ -6,7 +6,7 @@ use vidyut_prakriya::args::Gana::*; use vidyut_prakriya::args::*; #[test] -fn sutra_1_1() { +fn unadi_1_1() { assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::uR, &["kAru"]); assert_has_krdanta(&[], &d("pA\\", Bhvadi), Krt::uR, &["pAyu"]); assert_has_krdanta(&[], &d("vA\\", Adadi), Krt::uR, &["vAyu"]); @@ -19,20 +19,20 @@ fn sutra_1_1() { #[ignore] #[test] -fn sutra_1_5() { +fn unadi_1_5() { // TODO: not sure where to apply r --> l assert_has_krdanta(&[], &d("tF", Bhvadi), Krt::YuR, &["tAlu"]); } #[test] -fn sutra_1_45() { +fn unadi_1_45() { assert_has_krdanta(&[], &d("ava~", Bhvadi), Krt::wizac, &["aviza"]); // TODO: right mah? assert_has_krdanta(&[], &d("maha~", Bhvadi), Krt::wizac, &["mahiza"]); } #[test] -fn sutra_1_69() { +fn unadi_1_69() { use Krt::tun; assert_has_krdanta(&[], &d("zi\\Y", Svadi), tun, &["setu"]); assert_has_krdanta(&[], &d("tanu~^", Tanadi), tun, &["tantu"]); @@ -46,12 +46,12 @@ fn sutra_1_69() { } #[test] -fn sutra_1_77() { +fn unadi_1_77() { assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::katu, &["kratu"]); } #[test] -fn sutra_1_144() { +fn unadi_1_144() { use Krt::manin; assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), manin, &["karman"]); assert_has_krdanta(&[], &d("cara~", Bhvadi), manin, &["carman"]); @@ -63,7 +63,7 @@ fn sutra_1_144() { } #[test] -fn sutra_2_2() { +fn unadi_2_2() { assert_has_krdanta(&[], &d("ha\\na~", Adadi), Krt::kTan, &["haTa"]); assert_has_krdanta(&[], &d("kuza~", Kryadi), Krt::kTan, &["kuzWa"]); assert_has_krdanta(&[], &d("RI\\Y", Tanadi), Krt::kTan, &["nITa"]); @@ -71,7 +71,7 @@ fn sutra_2_2() { } #[test] -fn sutra_2_108() { +fn unadi_2_108() { assert_has_krdanta(&[], &d("arca~", Bhvadi), Krt::isi, &["arcis"]); assert_has_krdanta(&[], &d("I~Suci~^r", Divadi), Krt::isi, &["Socis"]); assert_has_krdanta(&[], &d("hu\\", Juhotyadi), Krt::isi, &["havis"]); @@ -81,8 +81,18 @@ fn sutra_2_108() { // TODO: id-anta? } +#[ignore] +#[test] +fn unadi_3_29() { + assert_has_krdanta(&[], &d("stana", Curadi), Krt::itnuc, &["stanayitnu"]); + assert_has_krdanta(&[], &nic(&d("hfza~", Divadi)), Krt::itnuc, &["harzayitnu"]); + // TODO: popayitnu? + assert_has_krdanta(&[], &d("gada", Curadi), Krt::itnuc, &["gadayitnu"]); + assert_has_krdanta(&[], &d("mada~", Curadi), Krt::itnuc, &["madayitnu"]); +} + #[test] -fn sutra_3_43() { +fn unadi_3_43() { assert_has_krdanta(&[], &d("i\\R", Adadi), Krt::kan, &["eka"]); assert_has_krdanta(&[], &d("YiBI\\", Juhotyadi), Krt::kan, &["Beka"]); assert_has_krdanta(&[], &d("kE\\", Tanadi), Krt::kan, &["kAka"]); @@ -93,7 +103,7 @@ fn sutra_3_43() { } #[test] -fn sutra_3_62() { +fn unadi_3_62() { // TODO: why not varza and tarza? // assert_has_krdanta(&[], &d("vF", Kryadi), Krt::sa, &["varsa"]); // assert_has_krdanta(&[], &d("tF", Bhvadi), Krt::sa, &["tarsa"]); @@ -104,12 +114,12 @@ fn sutra_3_62() { } #[test] -fn sutra_3_70() { +fn unadi_3_70() { assert_has_krdanta(&[], &d("aSU~\\", Svadi), Krt::sara, &["akzara"]); } #[test] -fn sutra_3_86() { +fn unadi_3_86() { assert_has_krdanta(&[], &d("hase~", Bhvadi), Krt::tan, &["hasta"]); assert_has_krdanta(&[], &d("mf\\N", Tanadi), Krt::tan, &["marta"]); assert_has_krdanta(&[], &d("gF", Tudadi), Krt::tan, &["garta"]); @@ -124,13 +134,21 @@ fn sutra_3_86() { } #[test] -fn sutra_3_126() { +fn unadi_3_96() { + assert_has_krdanta(&[], &d("Sru\\", Bhvadi), Krt::Ayya, &["SravAyya"]); + assert_has_krdanta(&[], &d("dakza~\\", Bhvadi), Krt::Ayya, &["dakzAyya"]); + assert_has_krdanta(&[], &d("spfha", Curadi), Krt::Ayya, &["spfhayAyya"]); + assert_has_krdanta(&[], &d("gfha", Curadi), Krt::Ayya, &["gfhayAyya"]); +} + +#[test] +fn unadi_3_126() { assert_has_krdanta(&[], &d("jF", Kryadi), Krt::Jac, &["jaranta"]); assert_has_krdanta(&[], &d("vi\\Sa~", Tudadi), Krt::Jac, &["veSanta"]); } #[test] -fn sutra_3_127() { +fn unadi_3_127() { assert_has_krdanta(&[], &d("ru\\ha~", Bhvadi), Krt::Jac, &["rohanta"]); assert_has_krdanta(&[], &d("wunadi~", Bhvadi), Krt::Jac, &["nandanta"]); assert_has_krdanta(&[], &d("jIva~", Tudadi), Krt::Jac, &["jIvanta"]); @@ -138,38 +156,38 @@ fn sutra_3_127() { } #[test] -fn sutra_3_128() { +fn unadi_3_128() { assert_has_krdanta(&[], &d("tF", Bhvadi), Krt::Jac, &["taranta"]); assert_has_krdanta(&[], &d("BU", Bhvadi), Krt::Jac, &["Bavanta"]); assert_has_krdanta(&[], &d("va\\ha~^", Bhvadi), Krt::Jac, &["vahanta"]); assert_has_krdanta(&[], &d("va\\sa~", Bhvadi), Krt::Jac, &["vasanta"]); assert_has_krdanta(&[], &d("BAsf~\\", Bhvadi), Krt::Jac, &["BAsanta"]); assert_has_krdanta(&[], &d("sA\\Da~", Svadi), Krt::Jac, &["sADanta"]); - assert_has_krdanta(&[], &d("gaqi~", Bhvadi), Krt::Jac, &["gaRqanta"]); - assert_has_krdanta(&[], &d("maqi~\\", Tudadi), Krt::Jac, &["maRqanta"]); + assert_has_krdanta(&[], &nic(&d("gaqi~", Bhvadi)), Krt::Jac, &["gaRqayanta"]); + assert_has_krdanta(&[], &nic(&d("maqi~\\", Tudadi)), Krt::Jac, &["maRqayanta"]); assert_has_krdanta(&[], &d("ji\\", Bhvadi), Krt::Jac, &["jayanta"]); // nandayanta? } #[test] -fn sutra_3_155() { +fn unadi_3_155() { assert_has_krdanta(&[], &d("pluza~", Kryadi), Krt::ksi, &["plukzi"]); assert_has_krdanta(&[], &d("kuza~", Kryadi), Krt::ksi, &["kukzi"]); assert_has_krdanta(&[], &d("Su\\za~", Divadi), Krt::ksi, &["Sukzi"]); } #[test] -fn sutra_3_156() { +fn unadi_3_156() { assert_has_krdanta(&[], &d("aSU~", Svadi), Krt::ksi, &["akzi"]); } #[test] -fn sutra_3_157() { +fn unadi_3_157() { assert_has_krdanta(&[], &d("izu~", Tudadi), Krt::ksu, &["ikzu"]); } #[test] -fn sutra_4_2() { +fn unadi_4_2() { assert_has_krdanta(&[], &d("f\\", Juhotyadi), Krt::katnic, &["ratni"]); assert_has_krdanta(&[], &d("tanu~^", Tanadi), Krt::yatuc, &["tanyatu"]); assert_has_krdanta(&[], &d("anjU~", Rudhadi), Krt::alic, &["aYjali"]); @@ -186,44 +204,44 @@ fn sutra_4_2() { } #[test] -fn sutra_4_6() { +fn unadi_4_6() { assert_has_krdanta(&[], &d("ga\\mx~", Bhvadi), Krt::ini, &["gamin"]); } #[test] -fn sutra_4_7() { +fn unadi_4_7() { assert_has_krdanta(&["AN"], &d("ga\\mx~", Bhvadi), Krt::ini, &["AgAmin"]); } #[test] -fn sutra_4_8() { +fn unadi_4_8() { assert_has_krdanta(&[], &d("BU", Bhvadi), Krt::ini, &["BAvin"]); } #[test] -fn sutra_4_9() { +fn unadi_4_9() { assert_has_krdanta(&["pra"], &d("zWA\\", Bhvadi), Krt::ini, &["prasTAyin"]); } #[ignore] #[test] -fn sutra_4_10() { +fn unadi_4_10() { assert_has_krdanta(&["parama"], &d("zWA\\", Bhvadi), Krt::ini, &["paramezWin"]); } #[ignore] #[test] -fn sutra_4_11() { +fn unadi_4_11() { assert_has_krdanta(&[], &d("maTi~", Bhvadi), Krt::ini, &["maTin"]); } #[test] -fn sutra_4_12() { +fn unadi_4_12() { assert_has_krdanta(&[], &d("patx~", Bhvadi), Krt::ini, &["paTin"]); } #[test] -fn sutra_4_54() { +fn unadi_4_54() { assert_has_krdanta(&[], &d("jF", Kryadi), Krt::kvinUnadi, &["jIrvi"]); assert_has_krdanta(&[], &d("SFY", Kryadi), Krt::kvinUnadi, &["SIrvi"]); assert_has_krdanta(&[], &d("stFY", Kryadi), Krt::kvinUnadi, &["stIrvi"]); @@ -231,23 +249,23 @@ fn sutra_4_54() { } #[test] -fn sutra_4_158() { +fn unadi_4_158() { assert_has_krdanta(&[], &d("vasa~\\", Adadi), Krt::zwran, &["vastra"]); assert_has_krdanta(&[], &d("asu~", Divadi), Krt::zwran, &["astra"]); assert_has_krdanta(&[], &d("Sasu~", Bhvadi), Krt::zwran, &["Sastra"]); } #[test] -fn sutra_5_68() { +fn unadi_5_68() { assert_has_krdanta(&[], &d("praTa~\\", Bhvadi), Krt::amac, &["praTama"]); } #[test] -fn sutra_5_69() { +fn unadi_5_69() { assert_has_krdanta(&[], &d("cara~", Bhvadi), Krt::amac, &["carama"]); } #[test] -fn sutra_5_70() { +fn unadi_5_70() { assert_has_krdanta(&[], &d("magi~", Bhvadi), Krt::alac, &["maNgala"]); } diff --git a/vidyut-prakriya/tests/kaumudi_8.rs b/vidyut-prakriya/tests/kaumudi_8.rs new file mode 100644 index 0000000..ce5437b --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_8.rs @@ -0,0 +1,360 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Gana::*; +use vidyut_prakriya::args::Lakara::*; +use vidyut_prakriya::args::Linga::*; + +#[test] +fn skip_sk_178_to_sk_186() {} + +#[test] +fn sk_187() { + assert_has_sup_1s("rAma", Pum, &["rAmaH"]); +} + +#[test] +fn sk_188() { + assert_has_sup_1d("rAma", Pum, &["rAmO"]); +} + +#[test] +fn skip_sk_189_to_sk_190() {} + +#[test] +fn sk_191() { + assert_has_sup_1p("rAma", Pum, &["rAmAH"]); +} + +#[test] +fn skip_sk_192() {} + +#[test] +fn sk_193() { + assert_has_sup_ss("rAma", Pum, &["rAma"]); + assert_has_sup_sd("rAma", Pum, &["rAmO"]); + assert_has_sup_sp("rAma", Pum, &["rAmAH"]); + assert_has_sup_ss("hari", Pum, &["hare"]); + assert_has_sup_ss("vizRu", Pum, &["vizRo"]); +} + +#[test] +fn sk_194() { + assert_has_sup_2s("rAma", Pum, &["rAmam"]); + assert_has_sup_2d("rAma", Pum, &["rAmO"]); +} + +#[test] +fn skip_sk_195_to_sk_197() {} + +#[test] +fn sk_198() { + assert_has_sup_2p("rAma", Pum, &["rAmAn"]); +} + +#[test] +fn skip_sk_199_to_sk_200() {} + +#[test] +fn sk_201() { + assert_has_sup_3s("rAma", Pum, &["rAmeRa"]); +} + +#[test] +fn sk_202() { + assert_has_sup_3d("rAma", Pum, &["rAmAByAm"]); +} + +#[test] +fn sk_203() { + assert_has_sup_3p("rAma", Pum, &["rAmEH"]); +} + +#[test] +fn sk_204() { + assert_has_sup_4s("rAma", Pum, &["rAmAya"]); + assert_has_sup_4d("rAma", Pum, &["rAmAByAm"]); +} + +#[test] +fn sk_205() { + assert_has_sup_4p("rAma", Pum, &["rAmeByaH"]); +} + +#[test] +fn sk_206() { + assert_has_sup_5s("rAma", Pum, &["rAmAt"]); + assert_has_sup_5d("rAma", Pum, &["rAmAByAm"]); + assert_has_sup_5p("rAma", Pum, &["rAmeByaH"]); + assert_has_sup_6s("rAma", Pum, &["rAmasya"]); +} + +#[test] +fn sk_207() { + assert_has_sup_6d("rAma", Pum, &["rAmayoH"]); +} + +#[test] +fn skip_sk_208() {} + +#[test] +fn sk_209() { + assert_has_sup_6p("rAma", Pum, &["rAmARAm"]); + assert_has_sup_7s("rAma", Pum, &["rAme"]); + assert_has_sup_7d("rAma", Pum, &["rAmayoH"]); +} + +#[test] +fn skip_sk_210_to_sk_211() {} + +#[ignore] +#[test] +fn sk_212() { + assert_has_sup_7p("rAma", Pum, &["rAmezu"]); + + assert_has_sup_1s("supis", Pum, &["supIH"]); + assert_has_sup_1d("supis", Pum, &["supisO"]); + assert_has_sup_1p("supis", Pum, &["supisaH"]); +} + +#[test] +fn skip_sk_213() {} + +#[test] +fn sk_214() { + assert_has_sup_1p("sarva", Pum, &["sarve"]); +} + +#[test] +fn sk_215() { + assert_has_sup_4s("sarva", Pum, &["sarvasmE"]); +} + +#[test] +fn sk_216() { + assert_has_sup_5s("sarva", Pum, &["sarvasmAt"]); +} + +#[test] +fn sk_217() { + assert_has_sup_6p("sarva", Pum, &["sarvezAm"]); + assert_has_sup_7s("sarva", Pum, &["sarvasmin"]); +} + +#[test] +fn sk_218() { + assert_has_sup_1p("pUrva", Pum, &["pUrve", "pUrvAH"]); + assert_has_sup_1p("dakziRa", Pum, &["dakziRe", "dakziRAH"]); + assert_has_sup_1p("uttara", Pum, &["uttare", "uttarAH"]); +} + +#[test] +fn sk_219() { + assert_has_sup_1p("sva", Pum, &["sve", "svAH"]); +} + +#[test] +fn sk_220() { + assert_has_sup_1p("antara", Pum, &["antare", "antarAH"]); +} + +#[test] +fn sk_221() { + assert_has_sup_5s("pUrva", Pum, &["pUrvasmAt", "pUrvAt"]); + assert_has_sup_7s("pUrva", Pum, &["pUrvasmin", "pUrve"]); +} + +#[test] +fn sk_228() { + assert_has_sup_1s("pAda", Pum, &["pAdaH"]); + assert_has_sup_1d("pAda", Pum, &["pAdO"]); + assert_has_sup_1p("pAda", Pum, &["pAdAH"]); + assert_has_sup_2s("pAda", Pum, &["pAdam"]); + assert_has_sup_2d("pAda", Pum, &["pAdO"]); + assert_has_sup_2p("pAda", Pum, &["padaH", "pAdAn"]); + assert_has_sup_3s("pAda", Pum, &["padA", "pAdena"]); +} + +#[test] +fn skip_sk_229_to_sk_231() {} + +#[test] +fn sk_232() { + assert_has_sup_2p("danta", Pum, &["dataH", "dantAn"]); + assert_has_sup_3s("danta", Pum, &["datA", "dantena"]); + assert_has_sup_3d("danta", Pum, &["dadByAm", "dantAByAm"]); + + assert_has_sup_2p("mAsa", Pum, &["mAsaH", "mAsAn"]); + assert_has_sup_3s("mAsa", Pum, &["mAsA", "mAsena"]); + assert_has_sup_3d("mAsa", Pum, &["mAByAm", "mAsAByAm"]); + assert_has_sup_3p("mAsa", Pum, &["mABiH", "mAsEH"]); +} + +#[test] +fn skip_sk_233_to_sk_234() {} + +#[test] +fn sk_235() { + assert_has_sup_2p("yUzan", Pum, &["yUzRaH"]); + assert_has_sup_3s("yUzan", Pum, &["yUzRA"]); +} + +#[test] +fn sk_236() { + assert_has_sup_3d("yUzan", Pum, &["yUzaByAm"]); + assert_has_sup_3p("yUzan", Pum, &["yUzaBiH"]); + assert_has_sup_4p("yUzan", Pum, &["yUzaByaH"]); +} + +#[test] +fn sk_237() { + assert_has_sup_7s("yUzan", Pum, &["yUzRi", "yUzaRi"]); +} + +#[test] +fn sk_239() { + assert_has_sup_1d("viSvapA", Pum, &["viSvapO"]); + assert_has_sup_1p("viSvapA", Pum, &["viSvapAH"]); +} + +#[test] +fn sk_241() { + assert_has_sup_1p("hari", Pum, &["harayaH"]); +} + +#[test] +fn sk_242() { + assert_has_sup_ss("hari", Pum, &["hare"]); + assert_has_sup_2s("hari", Pum, &["harim"]); + assert_has_sup_2d("hari", Pum, &["harI"]); + assert_has_sup_2p("hari", Pum, &["harIn"]); +} + +#[ignore] +#[test] +fn sk_243() { + assert_has_sup_4s("mati", Stri, &["mataye", "matyE"]); + assert_has_sup_4s("vAtapramI", Stri, &["vAtapramye"]); + assert_has_sup_4s("mAtf", Stri, &["mAtre"]); +} + +#[test] +fn sk_244() { + assert_has_sup_3s("hari", Pum, &["hariRA"]); + assert_has_sup_3s("mati", Stri, &["matyA"]); +} + +#[test] +fn sk_245() { + assert_has_sup_4s("hari", Pum, &["haraye"]); + assert_has_sup_4s("saKi", Pum, &["saKye"]); + assert_has_sup_4d("hari", Pum, &["hariByAm"]); +} + +#[test] +fn sk_246() { + assert_has_sup_6s("hari", Pum, &["hareH"]); + assert_has_sup_6d("hari", Pum, &["haryoH"]); + assert_has_sup_6p("hari", Pum, &["harIRAm"]); +} + +#[test] +fn sk_247() { + assert_has_sup_7s("hari", Pum, &["harO"]); + assert_has_sup_7d("hari", Pum, &["haryoH"]); + assert_has_sup_7p("hari", Pum, &["harizu"]); +} + +#[test] +fn skip_sk_248_to_sk_251() {} + +#[ignore] +#[test] +fn sk_252() { + // counterexamples + assert_has_sup_1s("grAmaRI", Pum, &["grAmaRIH"]); + assert_has_sup_1s("nizkOSAmbi", Pum, &["nizkOSAmbiH"]); + assert_has_sup_1s("atiKawva", Pum, &["atiKawvaH"]); + assert_has_tip(&[], &d("Bi\\di~^r", Rudhadi), Lun, &["aBEtsIt", "aBidat"]); + assert_has_tip(&[], &d("quBf\\Y", Juhotyadi), Lat, &["biBarti"]); + assert_has_tip(&[], &d("Bi\\di~^r", Rudhadi), Lit, &["biBeda"]); + assert_has_sup_1s("rAjan", Pum, &["rAjA"]); + + assert_has_sup_1s("saKi", Pum, &["saKA"]); + assert_has_sup_ss("saKi", Pum, &["saKe"]); +} + +#[test] +fn skip_sk_253() {} + +#[test] +fn sk_254() { + assert_has_sup_1d("saKi", Pum, &["saKAyO"]); + assert_has_sup_1p("saKi", Pum, &["saKAyaH"]); + assert_has_sup_2s("saKi", Pum, &["saKAyam"]); + assert_has_sup_2d("saKi", Pum, &["saKAyO"]); + assert_has_sup_3s("saKi", Pum, &["saKyA"]); + assert_has_sup_4s("saKi", Pum, &["saKye"]); +} + +#[test] +fn sk_255() { + assert_has_sup_5s("saKi", Pum, &["saKyuH"]); +} + +#[test] +fn skip_sk_258_to_sk_262() {} + +#[test] +fn skip_sk_274_to_sk_276() {} + +#[test] +fn skip_sk_284() { + assert_has_sup_1s("go", Pum, &["gOH"]); + assert_has_sup_1d("go", Pum, &["gAvO"]); + assert_has_sup_1p("go", Pum, &["gAvaH"]); +} + +#[test] +fn sk_285() { + // Counterexamples + assert_has_mip(&[], &d("ci\\Y", Svadi), Lan, &["acinavam"]); + assert_has_mip(&[], &d("zu\\Y", Svadi), Lan, &["asunavam"]); + + assert_has_sup_2s("go", Pum, &["gAm"]); + assert_has_sup_2d("go", Pum, &["gAvO"]); + assert_has_sup_2p("go", Pum, &["gAH"]); + assert_has_sup_4s("go", Pum, &["gave"]); + assert_has_sup_5s("go", Pum, &["goH"]); + assert_has_sup_6s("go", Pum, &["goH"]); + + assert_has_sup_1s("sudyo", Pum, &["sudyOH"]); + assert_has_sup_1d("sudyo", Pum, &["sudyAvO"]); + assert_has_sup_1p("sudyo", Pum, &["sudyAvaH"]); + + assert_has_sup_ss("BAnu", Pum, &["BAno"]); + assert_has_sup_1p("BAnu", Pum, &["BAnavaH"]); + + assert_has_sup_1s("smfto", Pum, &["smftOH"]); + assert_has_sup_1d("smfto", Pum, &["smftAvO"]); + assert_has_sup_1p("smfto", Pum, &["smftAvaH"]); + assert_has_sup_2s("smfto", Pum, &["smftAm"]); + assert_has_sup_2d("smfto", Pum, &["smftAvO"]); + assert_has_sup_2p("smfto", Pum, &["smftAH"]); +} + +#[test] +fn sk_286() { + assert_has_sup_1s("rE", Pum, &["rAH"]); + assert_has_sup_1p("rE", Pum, &["rAyaH"]); + assert_has_sup_2s("rE", Pum, &["rAyam"]); + assert_has_sup_2d("rE", Pum, &["rAyO"]); + assert_has_sup_2p("rE", Pum, &["rAyaH"]); + assert_has_sup_3s("rE", Pum, &["rAyA"]); + + assert_has_sup_1s("glO", Pum, &["glOH"]); + assert_has_sup_1d("glO", Pum, &["glAvO"]); + assert_has_sup_1p("glO", Pum, &["glAvaH"]); + assert_has_sup_2s("glO", Pum, &["glAvam"]); + assert_has_sup_2d("glO", Pum, &["glAvO"]); + assert_has_sup_2p("glO", Pum, &["glAvaH"]); +} diff --git a/vidyut-prakriya/tests/kaumudi_9.rs b/vidyut-prakriya/tests/kaumudi_9.rs new file mode 100644 index 0000000..2dbded4 --- /dev/null +++ b/vidyut-prakriya/tests/kaumudi_9.rs @@ -0,0 +1,48 @@ +extern crate test_utils; +use test_utils::*; +use vidyut_prakriya::args::Linga::*; + +#[test] +fn sk_309() { + assert_has_sup_1s("jYAna", Napumsaka, &["jYAnam"]); + assert_has_sup_ss("jYAna", Napumsaka, &["jYAna"]); +} + +#[test] +fn skip_sk_310() {} + +#[test] +fn sk_311() { + assert_has_sup_1d("jYAna", Napumsaka, &["jYAne"]); +} + +#[test] +fn skip_sk_312_to_sk_313() {} + +#[test] +fn sk_315() { + assert_has_sup_1p("jYAna", Napumsaka, &["jYAnAni"]); +} + +#[test] +fn skip_sk_316() {} + +#[test] +fn sk_319() { + assert_has_sup_1s("vAri", Napumsaka, &["vAri"]); +} + +#[ignore] +#[test] +fn sk_320() { + assert_has_sup_1d("vAri", Napumsaka, &["vAriRI"]); + assert_has_sup_1p("vAri", Napumsaka, &["vArIRi"]); + assert_has_sup_ss("vAri", Napumsaka, &["vAri", "vAre"]); + assert_has_sup_3s("vAri", Napumsaka, &["vAriRA"]); + assert_has_sup_4s("vAri", Napumsaka, &["vAriRe"]); + assert_has_sup_5s("vAri", Napumsaka, &["vAriRaH"]); + assert_has_sup_6d("vAri", Napumsaka, &["vAriRoH"]); + assert_has_sup_6p("vAri", Napumsaka, &["vArIRAm"]); + assert_has_sup_7s("vAri", Napumsaka, &["vArIRi"]); + assert_has_sup_7d("vAri", Napumsaka, &["vArIRoH"]); +} diff --git a/vidyut-prakriya/tests/pada_3_3.rs b/vidyut-prakriya/tests/pada_3_3.rs deleted file mode 100644 index f1e5596..0000000 --- a/vidyut-prakriya/tests/pada_3_3.rs +++ /dev/null @@ -1,159 +0,0 @@ -extern crate test_utils; -use test_utils::*; -use vidyut_prakriya::args::Gana::*; -use vidyut_prakriya::args::*; - -#[test] -fn sutra_3_3_1() { - assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::uR, &["kAru"]); - assert_has_krdanta(&[], &d("pA\\", Bhvadi), Krt::uR, &["pAyu"]); - assert_has_krdanta(&[], &d("vA\\", Adadi), Krt::uR, &["vAyu"]); - assert_has_krdanta(&[], &d("ji\\", Bhvadi), Krt::uR, &["jAyu"]); - assert_has_krdanta(&[], &d("qumi\\Y", Svadi), Krt::uR, &["mAyu"]); - assert_has_krdanta(&[], &d("zvada~\\", Bhvadi), Krt::uR, &["svAdu"]); - assert_has_krdanta(&[], &d("sA\\Da~", Svadi), Krt::uR, &["sADu"]); - assert_has_krdanta(&[], &d("aSU~\\", Svadi), Krt::uR, &["ASu"]); - - // For more specific uNAdi tests, see `unadi_sutras.rs` -} - -#[test] -fn sutra_3_3_2() { - assert_has_krdanta(&[], &d("vftu~\\", Bhvadi), Krt::manin, &["vartman"]); - assert_has_krdanta(&[], &d("cara~", Bhvadi), Krt::manin, &["carman"]); -} - -#[test] -fn sutra_3_3_3() { - use Krt::ini; - use Krt::GinuR; - use Krt::Rini; - let gam = d("ga\\mx~", Bhvadi); - assert_has_krdanta(&[], &gam, ini, &["gamin"]); - assert_has_krdanta(&["AN"], &gam, ini, &["AgAmin"]); - assert_has_krdanta(&["pra"], &d("zWA\\", Bhvadi), ini, &["prasTAyin"]); - // per nyAsa, these are from Rini. nyAsa also indicates that prasTAyin comes from Rini, but - // this seems like an error given Unadi 4.9. - assert_has_krdanta(&["prati"], &d("ru\\Di~^r", Rudhadi), Rini, &["pratiroDin"]); - assert_has_krdanta(&["prati"], &d("buDa~", Bhvadi), Rini, &["pratiboDin"]); - assert_has_krdanta(&["prati"], &d("yu\\Da~\\", Divadi), Rini, &["pratiyoDin"]); - assert_has_krdanta(&["prati"], &d("yu\\ji~^r", Rudhadi), GinuR, &["pratiyogin"]); - assert_has_krdanta(&["AN"], &d("yA\\", Adadi), Rini, &["AyAyin"]); -} - -#[test] -fn sutra_3_3_10() { - assert_has_krdanta(&[], &d("Bu\\ja~", Rudhadi), Krt::tumun, &["Boktum"]); -} - -#[test] -fn sutra_3_3_13() { - assert_has_lrt_p(&[], &d("qukf\\Y", Tanadi), &["karizyati"]); - assert_has_lrt_p(&[], &d("hf\\Y", Bhvadi), &["harizyati"]); -} - -#[test] -fn sutra_3_3_15() { - assert_has_lut_p(&[], &d("qukf\\Y", Tanadi), &["kartA"]); - assert_has_lut_p(&[], &d("Bu\\ja~", Rudhadi), &["BoktA"]); -} - -#[test] -fn sutra_3_3_16() { - assert_has_krdanta(&[], &d("pa\\da~\\", Divadi), Krt::GaY, &["pAda"]); - assert_has_krdanta(&[], &d("ru\\jo~", Tudadi), Krt::GaY, &["roga"]); - assert_has_krdanta(&[], &d("vi\\Sa~", Tudadi), Krt::GaY, &["veSa"]); - assert_has_krdanta(&[], &d("spf\\Sa~", Tudadi), Krt::GaY, &["sparSa"]); -} - -#[test] -fn sutra_3_3_17() { - assert_has_krdanta(&[], &d("sf\\", Bhvadi), Krt::GaY, &["sAra"]); -} - -#[test] -fn sutra_3_3_18() { - assert_has_krdanta(&[], &d("qupa\\ca~^z", Bhvadi), Krt::GaY, &["pAka"]); - assert_has_krdanta(&[], &d("tya\\ja~", Bhvadi), Krt::GaY, &["tyAga"]); - assert_has_krdanta(&[], &d("ra\\nja~^", Divadi), Krt::GaY, &["rAga", "raNga"]); -} - -#[test] -fn sutra_3_3_88() { - assert_has_krdanta(&[], &d("qupa\\ca~^z", Bhvadi), Krt::ktri, &["paktrima"]); - assert_has_krdanta(&[], &d("quva\\pa~^", Bhvadi), Krt::ktri, &["uptrima"]); - assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::ktri, &["kftrima"]); -} - -#[test] -fn sutra_3_3_89() { - assert_has_krdanta(&[], &d("wuvepf~\\", Bhvadi), Krt::aTuc, &["vepaTu"]); - assert_has_krdanta(&[], &d("wuo~Svi", Bhvadi), Krt::aTuc, &["SvayaTu"]); - assert_has_krdanta(&[], &d("wukzu", Adadi), Krt::aTuc, &["kzavaTu"]); -} - -#[test] -fn sutra_3_3_90() { - assert_has_krdanta(&[], &d("ya\\ja~^", Bhvadi), Krt::naN, &["yajYa"]); - assert_has_krdanta(&[], &d("quyAcf~^", Bhvadi), Krt::naN, &["yAcYA"]); - assert_has_krdanta(&[], &d("yatI~\\", Bhvadi), Krt::naN, &["yatna"]); - assert_has_krdanta(&[], &d("viCa~", Tudadi), Krt::naN, &["viSna"]); - assert_has_krdanta(&[], &d("pra\\Ca~", Tudadi), Krt::naN, &["praSna"]); - assert_has_krdanta(&[], &d("rakza~", Bhvadi), Krt::naN, &["rakzRa"]); -} - -#[test] -fn sutra_3_3_91() { - assert_has_krdanta(&[], &d("Yizva\\pa~", Adadi), Krt::nan, &["svapna"]); -} - -#[test] -fn sutra_3_3_94() { - assert_has_krdanta(&[], &d("qukf\\Y", Tanadi), Krt::ktin, &["kfti"]); - assert_has_krdanta(&[], &d("ci\\Y", Svadi), Krt::ktin, &["citi"]); - assert_has_krdanta(&[], &d("ma\\na~\\", Divadi), Krt::ktin, &["mati"]); - // TODO: others -} - -#[test] -fn sutra_3_3_102() { - assert_has_krdanta(&[], &san(&d("qukf\\Y", Tanadi)), Krt::a, &["cikIrzA"]); - assert_has_krdanta(&[], &san(&d("hf\\Y", Bhvadi)), Krt::a, &["jihIrzA"]); - // TODO: others -} - -#[test] -fn sutra_3_3_103() { - assert_has_krdanta(&[], &d("kuqi~\\", Bhvadi), Krt::a, &["kuRqA"]); - assert_has_krdanta(&[], &d("huqi~\\", Bhvadi), Krt::a, &["huRqA"]); - assert_has_krdanta(&[], &d("Iha~\\", Bhvadi), Krt::a, &["IhA"]); - assert_has_krdanta(&[], &d("Uha~\\", Bhvadi), Krt::a, &["UhA"]); - // guroH - assert_has_krdanta(&[], &d("Ba\\ja~^", Bhvadi), Krt::a, &[]); - // halaH - assert_has_krdanta(&[], &d("RI\\Y", Bhvadi), Krt::a, &[]); -} - -#[ignore] -#[test] -fn sutra_3_3_107() { - assert_has_krdanta(&[], &nic(&d("qukf\\Y", Tanadi)), Krt::yuc, &["kAraRA"]); - assert_has_krdanta(&[], &nic(&d("hf\\Y", Bhvadi)), Krt::yuc, &["hArRA"]); - assert_has_krdanta(&[], &nic(&d("Asa~\\", Adadi)), Krt::yuc, &["AsanA"]); - assert_has_krdanta(&[], &nic(&d("SranTa~", Kryadi)), Krt::yuc, &["SranTanA"]); -} - -#[test] -fn sutra_3_3_115() { - assert_has_krdanta(&[], &d("hase~", Bhvadi), Krt::lyuw, &["hasana"]); - assert_has_krdanta(&[], &d("SuBa~\\", Bhvadi), Krt::lyuw, &["SoBana"]); - assert_has_krdanta(&[], &d("jalpa~", Bhvadi), Krt::lyuw, &["jalpana"]); - assert_has_krdanta(&[], &d("SIN", Adadi), Krt::lyuw, &["Sayana"]); - assert_has_krdanta(&[], &d("Asa~\\", Adadi), Krt::lyuw, &["Asana"]); -} - -#[test] -fn sutra_3_3_120() { - assert_has_krdanta(&["ava"], &d("tF", Bhvadi), Krt::GaY, &["avatAra"]); - assert_has_krdanta(&["ava"], &d("stFY", Kryadi), Krt::GaY, &["avastAra"]); -} diff --git a/vidyut-prakriya/tests/regressions.rs b/vidyut-prakriya/tests/regressions.rs deleted file mode 100644 index 4d0301b..0000000 --- a/vidyut-prakriya/tests/regressions.rs +++ /dev/null @@ -1,63 +0,0 @@ -/* -Tests to verify that a regression has been fixed. - -These tests catch gaps in our test suite based on the Kashika-vrtti. So far, these tests come from -the Siddhanta-kaumudi. -*/ -extern crate test_utils; -use test_utils::*; -use vidyut_prakriya::args::Gana::*; -use vidyut_prakriya::args::Lakara::*; -use vidyut_prakriya::args::Purusha::*; -use vidyut_prakriya::args::Vacana::*; - -#[ignore] -#[test] -fn sk_2308() { - // Udit dhatus with Tal-pratyaya - let gupu = d("gupU~", Bhvadi); - assert_has_tinanta(&[], &gupu, Lit, Madhyama, Eka, &["jugopTa"]); - assert_has_tinanta(&[], &gupu, Lit, Uttama, Dvi, &["jugupva"]); - assert_has_tinanta(&[], &gupu, Lit, Uttama, Bahu, &["jugupma"]); -} - -#[test] -fn sk_2397() { - // akAravAn dhatus with Tal-pratyaya - let skand = d("ska\\ndi~r", Bhvadi); - assert_has_sip(&[], &skand, Lit, &["caskandiTa", "caskanTa", "caskantTa"]); -} - -#[test] -fn sk_2447() { - let urnu = d("UrRuY", Adadi); - assert_has_sip(&[], &urnu, Lit, &["UrRunaviTa", "UrRunuviTa"]); -} - -#[test] -fn sk_2574() { - // ac-Adi dhatus with can-pratyaya and ak-lopa - // TODO: why does the SK have AndaDat and not AndiDat? - assert_has_lun_p(&[], &d("anDa", Curadi), &["AndaDat"]); - assert_has_lun_p(&[], &d("anka", Curadi), &["AYcakat"]); - assert_has_lun_p(&[], &d("anga", Curadi), &["AYjagat"]); - assert_has_lun_p(&[], &d("vyaya", Curadi), &["avavyayat"]); -} - -#[test] -fn sk_2630() { - assert_has_lit( - &[], - &yan(&d("BU", Bhvadi)), - &["boBUyAYcakre", "boBUyAmAsa", "boBUyAmbaBUva"], - ); -} - -#[test] -fn sk_2758() { - assert_has_lit( - &[], - &san(&d("BU", Bhvadi)), - &["buBUzAYcakAra", "buBUzAmAsa", "buBUzAmbaBUva"], - ); -}