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