58 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
59 if ( isset( $grammarForms[
'os'][$case][$word] ) ) {
60 return $grammarForms[
'os'][$case][$word];
62 # Ending for the allative case
64 # Variable for 'j' between vowels
66 # Variable for "-" for not Ossetic words
71 # Checking if the $word is in plural form
72 if ( preg_match(
'/тæ$/u', $word ) ) {
73 $word = mb_substr( $word, 0, -1 );
75 } elseif ( preg_match(
"/[аæеёиоыэюя]$/u", $word ) ) {
76 # Works if $word is in singular form.
77 # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
79 } elseif ( preg_match(
"/у$/u", $word ) ) {
80 # Checking if $word ends on 'у'. 'У'
81 # can be either consonant 'W' or vowel 'U' in Cyrillic Ossetic.
82 # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
83 if ( !preg_match(
"/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
86 } elseif ( !preg_match(
"/[бвгджзйклмнопрстфхцчшщьъ]$/u", $word ) ) {
92 $ending = $hyphen . $jot .
'ы';
96 $ending = $hyphen . $jot .
'æн';
100 $ending = $hyphen . $end_allative;
105 $ending = $hyphen . $jot .
'æ';
107 $ending = $hyphen . $jot .
'æй';
115 $ending = $hyphen . $jot .
'ыл';
119 $ending = $hyphen . $jot .
'ау';
123 $ending = $hyphen .
'имæ';
126 return $word . $ending;