MediaWiki  1.23.6
LanguageOs.php
Go to the documentation of this file.
1 <?php
30 class LanguageOs extends Language {
31 
56  function convertGrammar( $word, $case ) {
57  global $wgGrammarForms;
58  if ( isset( $wgGrammarForms['os'][$case][$word] ) ) {
59  return $wgGrammarForms['os'][$case][$word];
60  }
61  # Ending for allative case
62  $end_allative = 'мæ';
63  # Variable for 'j' beetwen vowels
64  $jot = '';
65  # Variable for "-" for not Ossetic words
66  $hyphen = '';
67  # Variable for ending
68  $ending = '';
69 
70  # CHecking if the $word is in plural form
71  if ( preg_match( '/тæ$/u', $word ) ) {
72  $word = mb_substr( $word, 0, -1 );
73  $end_allative = 'æм';
74  }
75  # Works if $word is in singular form.
76  # Checking if $word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
77  elseif ( preg_match( "/[аæеёиоыэюя]$/u", $word ) ) {
78  $jot = 'й';
79  }
80  # Checking if $word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
81  # Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
82  elseif ( preg_match( "/у$/u", $word ) ) {
83  if ( !preg_match( "/[аæеёиоыэюя]$/u", mb_substr( $word, -2, 1 ) ) ) {
84  $jot = 'й';
85  }
86  } elseif ( !preg_match( "/[бвгджзйклмнопрстфхцчшщьъ]$/u", $word ) ) {
87  $hyphen = '-';
88  }
89 
90  switch ( $case ) {
91  case 'genitive':
92  $ending = $hyphen . $jot . 'ы';
93  break;
94  case 'dative':
95  $ending = $hyphen . $jot . 'æн';
96  break;
97  case 'allative':
98  $ending = $hyphen . $end_allative;
99  break;
100  case 'ablative':
101  if ( $jot == 'й' ) {
102  $ending = $hyphen . $jot . 'æ';
103  } else {
104  $ending = $hyphen . $jot . 'æй';
105  }
106  break;
107  case 'inessive':
108  break;
109  case 'superessive':
110  $ending = $hyphen . $jot . 'ыл';
111  break;
112  case 'equative':
113  $ending = $hyphen . $jot . 'ау';
114  break;
115  case 'comitative':
116  $ending = $hyphen . 'имæ';
117  break;
118  }
119  return $word . $ending;
120  }
121 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
LanguageOs
Ossetian (Ирон)
Definition: LanguageOs.php:30
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
LanguageOs\convertGrammar
convertGrammar( $word, $case)
Convert from the nominative form of a noun to other cases Invoked with {{grammar:case|word}}.
Definition: LanguageOs.php:56
Language
Internationalisation code.
Definition: Language.php:74