Skip to content

Commit

Permalink
fix: imperative mood in lj/nj verbs
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Jun 23, 2024
1 parent 83bda63 commit fcea384
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 23 deletions.
8 changes: 4 additions & 4 deletions src/verb/__tests__/__snapshots__/imperfect.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8627,7 +8627,7 @@ exports[`verb imperfect 925 1`] = `
"bųdųt mlětì",
],
"gerund": "mlěťje",
"imperative": "melj, meljmȯ, meljte",
"imperative": "melji, meljimȯ, meljite",
"imperfect": [
"mlěh",
"mlěše",
Expand Down Expand Up @@ -106696,7 +106696,7 @@ exports[`verb imperfect 21575 1`] = `
"bųdųt slatì",
],
"gerund": "slańje",
"imperative": "šlj, šljmȯ, šljte",
"imperative": "šlji, šljimȯ, šljite",
"imperfect": [
"slah",
"slaše",
Expand Down Expand Up @@ -129382,7 +129382,7 @@ exports[`verb imperfect 26528 1`] = `
"bųdųt klåtì",
],
"gerund": "klåťje",
"imperative": "kolj, koljmȯ, koljte",
"imperative": "kolji, koljimȯ, koljite",
"imperfect": [
"klåh",
"klåše",
Expand Down Expand Up @@ -151569,7 +151569,7 @@ exports[`verb imperfect 33440 1`] = `
"bųdųt stlatì",
],
"gerund": "stlańje",
"imperative": "stelj, steljmȯ, steljte",
"imperative": "stelji, steljimȯ, steljite",
"imperfect": [
"stlah",
"stlaše",
Expand Down
26 changes: 13 additions & 13 deletions src/verb/__tests__/__snapshots__/perfect.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10843,7 +10843,7 @@ exports[`verb perfect 1912 1`] = `
"bųdųt poslatì",
],
"gerund": "poslańje",
"imperative": "pošlj, pošljmȯ, pošljte",
"imperative": "pošlji, pošljimȯ, pošljite",
"imperfect": [
"poslah",
"poslaše",
Expand Down Expand Up @@ -35134,7 +35134,7 @@ exports[`verb perfect 5620 1`] = `
"bųdųt smlětì",
],
"gerund": "smlěťje",
"imperative": "smelj, smeljmȯ, smeljte",
"imperative": "smelji, smeljimȯ, smeljite",
"imperfect": [
"smlěh",
"smlěše",
Expand Down Expand Up @@ -40959,7 +40959,7 @@ exports[`verb perfect 8123 1`] = `
"bųdųt izslatì",
],
"gerund": "izslańje",
"imperative": "izšlj, izšljmȯ, izšljte",
"imperative": "izšlji, izšljimȯ, izšljite",
"imperfect": [
"izslah",
"izslaše",
Expand Down Expand Up @@ -90362,7 +90362,7 @@ exports[`verb perfect 28032 1`] = `
"bųdųt naklåtì",
],
"gerund": "naklåťje",
"imperative": "nakolj, nakoljmȯ, nakoljte",
"imperative": "nakolji, nakoljimȯ, nakoljite",
"imperfect": [
"naklåh",
"naklåše",
Expand Down Expand Up @@ -97931,7 +97931,7 @@ exports[`verb perfect 29116 1`] = `
"bųdųt odslatì",
],
"gerund": "odslańje",
"imperative": "odšlj, odšljmȯ, odšljte",
"imperative": "odšlji, odšljimȯ, odšljite",
"imperfect": [
"odslah",
"odslaše",
Expand Down Expand Up @@ -107905,7 +107905,7 @@ exports[`verb perfect 30233 1`] = `
"bųdųt råzklåtì",
],
"gerund": "råzklåťje",
"imperative": "råzkolj, råzkoljmȯ, råzkoljte",
"imperative": "råzkolji, råzkoljimȯ, råzkoljite",
"imperfect": [
"råzklåh",
"råzklåše",
Expand Down Expand Up @@ -109361,7 +109361,7 @@ exports[`verb perfect 30321 1`] = `
"bųdųt råzmlětì",
],
"gerund": "råzmlěťje",
"imperative": "råzmelj, råzmeljmȯ, råzmeljte",
"imperative": "råzmelji, råzmeljimȯ, råzmeljite",
"imperfect": [
"råzmlěh",
"råzmlěše",
Expand Down Expand Up @@ -109847,7 +109847,7 @@ exports[`verb perfect 30361 1`] = `
"bųdųt råzslatì",
],
"gerund": "råzslańje",
"imperative": "råzšlj, råzšljmȯ, råzšljte",
"imperative": "råzšlji, råzšljimȯ, råzšljite",
"imperfect": [
"råzslah",
"råzslaše",
Expand Down Expand Up @@ -113876,7 +113876,7 @@ exports[`verb perfect 32007 1`] = `
"bųdųt zaklåtì",
],
"gerund": "zaklåťje",
"imperative": "zakolj, zakoljmȯ, zakoljte",
"imperative": "zakolji, zakoljimȯ, zakoljite",
"imperfect": [
"zaklåh",
"zaklåše",
Expand Down Expand Up @@ -113946,7 +113946,7 @@ exports[`verb perfect 32011 1`] = `
"bųdųt uklåtì",
],
"gerund": "uklåťje",
"imperative": "ukolj, ukoljmȯ, ukoljte",
"imperative": "ukolji, ukoljimȯ, ukoljite",
"imperfect": [
"uklåh",
"uklåše",
Expand Down Expand Up @@ -118389,7 +118389,7 @@ exports[`verb perfect 33446 1`] = `
"bųdųt postlatì",
],
"gerund": "postlańje",
"imperative": "postelj, posteljmȯ, posteljte",
"imperative": "postelji, posteljimȯ, posteljite",
"imperfect": [
"postlah",
"postlaše",
Expand Down Expand Up @@ -118528,7 +118528,7 @@ exports[`verb perfect 33452 1`] = `
"bųdųt råzstlatì",
],
"gerund": "råzstlańje",
"imperative": "råzstelj, råzsteljmȯ, råzsteljte",
"imperative": "råzstelji, råzsteljimȯ, råzsteljite",
"imperfect": [
"råzstlah",
"råzstlaše",
Expand Down Expand Up @@ -125060,7 +125060,7 @@ exports[`verb perfect 35147 1`] = `
"bųdųt prislatì",
],
"gerund": "prislańje",
"imperative": "prišlj, prišljmȯ, prišljte",
"imperative": "prišlji, prišljimȯ, prišljite",
"imperfect": [
"prislah",
"prislaše",
Expand Down
13 changes: 7 additions & 6 deletions src/verb/conjugationVerb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ function buildConditional(lpa: string, refl: string): string[] {
function build_imperative(pref: string, ps: string, refl: string): string {
let p2s = '';
const i = ps.length - 1;
const last = ps[i];
const penultimate = ps[i - 1];

if (ps == 'jes') {
p2s = 'bųď';
Expand All @@ -683,15 +685,14 @@ function build_imperative(pref: string, ps: string, refl: string): string {
p2s = pref + ps + 'j';
} else if (ps in irregular_stems) {
p2s = pref + ps + 'ď';
} else if (ps.charAt(i) == 'ĵ' || ps.charAt(i) == 'j') {
p2s = pref + ps;
} else if (
ps.charAt(i) == 'a' ||
ps.charAt(i) == 'e' ||
ps.charAt(i) == 'ě'
(last == 'ĵ' || last == 'j') &&
!(penultimate === 'l' || penultimate === 'n')
) {
p2s = pref + ps;
} else if (last == 'a' || last == 'e' || last == 'ě') {
p2s = pref + ps + 'j';
} else if (ps.charAt(i) == 'i') {
} else if (last == 'i') {
p2s = pref + ps;
} else {
p2s = pref + ps + 'i';
Expand Down

0 comments on commit fcea384

Please sign in to comment.