58 if ( isset( $wgGrammarForms[
'os'][$case][$word] ) ) {
59 return $wgGrammarForms[
'os'][$case][$word];
61 # Ending for allative case
63 # Variable for 'j' beetwen vowels
65 # Variable for "-" for not Ossetic words
70 # CHecking if the $word is in plural form
71 if ( preg_match(
'/тæ$/u', $word ) ) {
72 $word = mb_substr( $word, 0, -1 );
75 # Works if $word is in singular form.
76 # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
77 elseif ( preg_match(
"/[аæеёиоыэюя]$/u", $word ) ) {
80 # Checking if $word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
81 # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
82 elseif ( preg_match(
"/у$/u", $word ) ) {
83 if ( !preg_match(
"/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
86 } elseif ( !preg_match(
"/[бвгджзйклмнопрстфхцчшщьъ]$/u", $word ) ) {
92 $ending = $hyphen . $jot .
'ы';
95 $ending = $hyphen . $jot .
'æн';
98 $ending = $hyphen . $end_allative;
102 $ending = $hyphen . $jot .
'æ';
104 $ending = $hyphen . $jot .
'æй';
110 $ending = $hyphen . $jot .
'ыл';
113 $ending = $hyphen . $jot .
'ау';
116 $ending = $hyphen .
'имæ';
119 return $word . $ending;