42 MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
43 if ( isset( $grammarForms[
'hy'][$case][$word] ) ) {
44 return $grammarForms[
'hy'][$case][$word];
47 # These rules are not perfect, but they are currently only used for site names so it doesn't
48 # matter if they are wrong sometimes. Just add 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], -1 ) ) ==
'ա' ) {
57 $word = implode(
'', array_slice( $ar[0], 0, -1 ) ) .
'այի';
58 } elseif ( implode(
'', array_slice( $ar[0], -1 ) ) ==
'ո' ) {
59 $word = implode(
'', array_slice( $ar[0], 0, -1 ) ) .
'ոյի';
60 } elseif ( implode(
'', array_slice( $ar[0], -4 ) ) ==
'գիրք' ) {
61 $word = implode(
'', array_slice( $ar[0], 0, -4 ) ) .
'գրքի';
66 case 'dative': # Տրական հոլով
69 case 'accusative': # Հայցական հոլով