48 if ( isset( $grammarForms[
'os'][$case][$word] ) ) {
49 return $grammarForms[
'os'][$case][$word];
51 # Ending for the allative case
53 # Variable for 'j' between vowels
55 # Variable for "-" for not Ossetic words
60 # Checking if the $word is in plural form
61 if ( preg_match(
'/тæ$/u', $word ) ) {
62 $word = mb_substr( $word, 0, -1 );
64 } elseif ( preg_match(
"/[аæеёиоыэюя]$/u", $word ) ) {
65 # Works if $word is in singular form.
66 # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
68 } elseif ( preg_match(
"/у$/u", $word ) ) {
69 # Checking if $word ends on 'у'. 'У'
70 # can be either consonant 'W' or vowel 'U' in Cyrillic Ossetic.
71 # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
72 if ( !preg_match(
"/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
75 } elseif ( !preg_match(
"/[бвгджзйклмнопрстфхцчшщьъ]$/u", $word ) ) {
81 $ending = $hyphen . $jot .
'ы';
85 $ending = $hyphen . $jot .
'æн';
89 $ending = $hyphen . $end_allative;
94 $ending = $hyphen . $jot .
'æ';
96 $ending = $hyphen . $jot .
'æй';
104 $ending = $hyphen . $jot .
'ыл';
108 $ending = $hyphen . $jot .
'ау';
112 $ending = $hyphen .
'имæ';
115 return $word . $ending;