42 if ( isset( $wgGrammarForms[
'hy'][$case][$word] ) ) {
43 return $wgGrammarForms[
'hy'][$case][$word];
46 # These rules are not perfect, but they are currently only used for site names so it doesn't
47 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
49 # join and array_slice instead mb_substr
51 preg_match_all(
'/./us', $word, $ar );
52 if ( !preg_match(
"/[a-zA-Z_]/us", $word ) ) {
54 case 'genitive': # սեռական հոլով
55 if ( join(
'', array_slice( $ar[0], -1 ) ) ==
'ա' ) {
56 $word = join(
'', array_slice( $ar[0], 0, -1 ) ) .
'այի';
57 } elseif ( join(
'', array_slice( $ar[0], -1 ) ) ==
'ո' ) {
58 $word = join(
'', array_slice( $ar[0], 0, -1 ) ) .
'ոյի';
59 } elseif ( join(
'', array_slice( $ar[0], -4 ) ) ==
'գիրք' ) {
60 $word = join(
'', array_slice( $ar[0], 0, -4 ) ) .
'գրքի';
65 case 'dative': # Տրական հոլով
68 case 'accusative': # Հայցական հոլով
71 case 'instrumental': #
74 case 'prepositional': #
90 if ( !preg_match(
'/^\d{1,4}$/', $_ ) ) {
91 return strrev( (
string)preg_replace(
'/(\d{3})(?=\d)(?!\d*\.)/',
'$1,', strrev( $_ ) ) );