59 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
60 if ( isset( $grammarForms[
'os'][$case][$word] ) ) {
61 return $grammarForms[
'os'][$case][$word];
63 # Ending for the allative case
65 # Variable for 'j' between vowels
67 # Variable for "-" for not Ossetic words
72 # Checking if the $word is in plural form
73 if ( preg_match(
'/тæ$/u', $word ) ) {
74 $word = mb_substr( $word, 0, -1 );
76 } elseif ( preg_match(
"/[аæеёиоыэюя]$/u", $word ) ) {
77 # Works if $word is in singular form.
78 # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
80 } elseif ( preg_match(
"/у$/u", $word ) ) {
81 # Checking if $word ends on 'у'. 'У'
82 # can be either consonant 'W' or vowel 'U' in Cyrillic Ossetic.
83 # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
84 if ( !preg_match(
"/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
87 } elseif ( !preg_match(
"/[бвгджзйклмнопрстфхцчшщьъ]$/u", $word ) ) {
93 $ending = $hyphen . $jot .
'ы';
97 $ending = $hyphen . $jot .
'æн';
101 $ending = $hyphen . $end_allative;
106 $ending = $hyphen . $jot .
'æ';
108 $ending = $hyphen . $jot .
'æй';
116 $ending = $hyphen . $jot .
'ыл';
120 $ending = $hyphen . $jot .
'ау';
124 $ending = $hyphen .
'имæ';
127 return $word . $ending;