33 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
35 if ( isset( $grammarForms[
'сu'][$case][$word] ) ) {
36 return $grammarForms[
'сu'][$case][$word];
39 # These rules are not perfect, but they are currently only used for
40 # site names, so it doesn't matter if they are wrong sometimes.
41 # Just add a special case for your site name if necessary.
43 # join and array_slice instead mb_substr
45 preg_match_all(
'/./us', $word, $ar );
46 if ( !preg_match(
"/[a-zA-Z_]/u", $word ) ) {
48 case 'genitive': # родительный падеж
54 if ( implode(
'', array_slice( $ar[0], -2 ) ) ==
'ї' ) {
55 return implode(
'', array_slice( $ar[0], 0, -2 ) ) .
'їѩ';
58 case 'accusative': # винительный падеж