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 ( implode(
'', array_slice( $ar[0], -1 ) ) ==
'ա' ) {
56 $word = implode(
'', array_slice( $ar[0], 0, -1 ) ) .
'այի';
57 } elseif ( implode(
'', array_slice( $ar[0], -1 ) ) ==
'ո' ) {
58 $word = implode(
'', array_slice( $ar[0], 0, -1 ) ) .
'ոյի';
59 } elseif ( implode(
'', array_slice( $ar[0], -4 ) ) ==
'գիրք' ) {
60 $word = implode(
'', array_slice( $ar[0], 0, -4 ) ) .
'գրքի';
65 case 'dative': # Տրական հոլով
68 case 'accusative': # Հայցական հոլով