Skip to content

Commit

Permalink
fix(noun): -ec in vocative
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Nov 11, 2024
1 parent 11f0a70 commit 31cbf5d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/noun/declensionNoun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function declensionNoun(

if (add && noun !== add) {
noun = markFluentVowel(noun, add);
} else if (originGender === 'masculine') {
} else {
noun = inferFluentVowel(noun);
}

Expand Down Expand Up @@ -393,13 +393,17 @@ function locative_sg(root: string, gender: string) {
return result;
}

const EC_ENDING = /[eėè]c$/;

function vocative_sg(nom_sg: string, root: string, gender: string) {
let result = '';
if (gender == 'm1' || gender == 'm2') {
if (nom_sg.lastIndexOf('ec') == nom_sg.length - 2) {
if (EC_ENDING.test(nom_sg)) {
result = root.substring(0, root.length - 2) + 'če';
} else if (root.lastIndexOf('ь') == root.length - 1) {
result = root + 'u';
} else if (root.lastIndexOf('čk') == root.length - 2) {
result = root + 'u';
} else if (root.lastIndexOf('k') == root.length - 1) {
result = root.substring(0, root.length - 1) + 'če';
} else if (root.lastIndexOf('g') == root.length - 1) {
Expand Down

0 comments on commit 31cbf5d

Please sign in to comment.