Skip to content

Commit

Permalink
fix: declension of words "obuv" and "žolv" repaired
Browse files Browse the repository at this point in the history
  • Loading branch information
ru-danko authored and noomorph committed Jun 23, 2024
1 parent bbdaf6f commit e7cdeff
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/noun/declensionNoun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { declensionAdjective } from '../adjective';
import { inferFluentVowel, markFluentVowel } from '../common';
import type { Noun } from '../partOfSpeech';
import { VOWELS } from '../substitutions';
import { removeBrackets, replaceStringAt } from '../utils';
import { establishGender } from './establishGender';

Expand Down Expand Up @@ -284,9 +285,7 @@ function nominative_sg(noun: string, root: string, gender: string) {
if (gender == 'f2') {
result = root;
}
if (gender == 'f3' && root.endsWith('v')) {
result = root.substring(0, root.length - 1) + 'ȯv';
} else if (gender == 'f3') {
if (gender == 'f3') {
result = noun;
} else if (gender == 'm3' && root == 'dn') {
result = 'den / denj';
Expand Down Expand Up @@ -362,7 +361,11 @@ function instrumental_sg(root: string, gender: string) {
result = root + 'ojų';
} else if (gender == 'f2') {
result = root + 'jų';
} else if (gender == 'f3' && root.endsWith('v')) {
} else if (
gender == 'f3' &&
root.endsWith('v') &&
!VOWELS.has(root.slice(-2, -1))
) {
result = root.substring(0, root.length - 1) + 'ȯvjų';
} else if (gender == 'f3') {
result = root + 'jų';
Expand Down

0 comments on commit e7cdeff

Please sign in to comment.