25 if ( isset( $grammarForms[
'hy'][$case][$word] ) ) {
26 return $grammarForms[
'hy'][$case][$word];
29 # These rules are not perfect, but they are currently only used for site names so it doesn't
30 # matter if they are wrong sometimes. Just add a special case for your site name if necessary.
32 # join and array_slice instead mb_substr
34 preg_match_all(
'/./us', $word, $ar );
35 if ( !preg_match(
"/[a-zA-Z_]/u", $word ) ) {
37 case 'genitive': # սեռական հոլով
38 if ( implode(
'', array_slice( $ar[0], -1 ) ) ==
'ա' ) {
39 $word = implode(
'', array_slice( $ar[0], 0, -1 ) ) .
'այի';
40 } elseif ( implode(
'', array_slice( $ar[0], -1 ) ) ==
'ո' ) {
41 $word = implode(
'', array_slice( $ar[0], 0, -1 ) ) .
'ոյի';
42 } elseif ( implode(
'', array_slice( $ar[0], -4 ) ) ==
'գիրք' ) {
43 $word = implode(
'', array_slice( $ar[0], 0, -4 ) ) .
'գրքի';
48 case 'dative': # Տրական հոլով
51 case 'accusative': # Հայցական հոլով