42 if ( isset( $wgGrammarForms[
'tyv'][$case][$word] ) ) {
43 return $wgGrammarForms[
'tyv'][$case][$word];
47 $allVowels = [
"е",
"и",
"э",
"ө",
"ү",
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
48 $frontVowels = [
"е",
"и",
"э",
"ө",
"ү" ];
49 $backVowels = [
"а",
"ё",
"о",
"у",
"ы",
"ю",
"я" ];
50 $unroundFrontVowels = [
"е",
"и",
"э" ];
51 $roundFrontVowels = [
"ө",
"ү" ];
52 $unroundBackVowels = [
"а",
"ы",
"я" ];
53 $roundBackVowels = [
"ё",
"о",
"у",
"ю" ];
54 $unvoicedPhonemes = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х" ];
55 $directiveUnvoicedStems = [
"т",
"п",
"с",
"ш",
"к",
"ч",
"х",
"л",
"м",
"н",
"ң" ];
56 $directiveVoicedStems = [
"д",
"б",
"з",
"ж",
"г",
"р",
"й" ];
59 preg_match_all(
'/./us', $word, $ar );
62 $wordEnding = $ar[0][count( $ar[0] ) - 1];
66 $wordReversed = array_reverse( $ar[0] );
69 $wordLastVowel = null;
70 foreach ( $wordReversed
as $xvalue ) {
71 foreach ( $allVowels
as $yvalue ) {
72 if ( strcmp( $xvalue, $yvalue ) == 0 ) {
73 $wordLastVowel = $xvalue;
80 if ( $wordLastVowel !== null ) {
90 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
91 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
92 $word = implode(
"", $ar[0] ) .
"түң";
93 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
94 $word = implode(
"", $ar[0] ) .
"тиң";
95 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
96 $word = implode(
"", $ar[0] ) .
"туң";
97 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
98 $word = implode(
"", $ar[0] ) .
"тың";
101 } elseif ( $wordEnding ===
"л" ) {
102 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
103 $word = implode(
"", $ar[0] ) .
"дүң";
104 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
105 $word = implode(
"", $ar[0] ) .
"диң";
106 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
107 $word = implode(
"", $ar[0] ) .
"дуң";
108 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
109 $word = implode(
"", $ar[0] ) .
"дың";
113 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
114 $word = implode(
"", $ar[0] ) .
"нүң";
115 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
116 $word = implode(
"", $ar[0] ) .
"ниң";
117 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
118 $word = implode(
"", $ar[0] ) .
"нуң";
119 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
120 $word = implode(
"", $ar[0] ) .
"ның";
126 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
127 if ( in_array( $wordLastVowel, $frontVowels ) ) {
128 $word = implode(
"", $ar[0] ) .
"ке";
129 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
130 $word = implode(
"", $ar[0] ) .
"ка";
134 if ( in_array( $wordLastVowel, $frontVowels ) ) {
135 $word = implode(
"", $ar[0] ) .
"ге";
136 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
137 $word = implode(
"", $ar[0] ) .
"га";
143 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
144 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
145 $word = implode(
"", $ar[0] ) .
"тү";
146 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
147 $word = implode(
"", $ar[0] ) .
"ти";
148 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
149 $word = implode(
"", $ar[0] ) .
"ту";
150 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
151 $word = implode(
"", $ar[0] ) .
"ты";
154 } elseif ( $wordEnding ===
"л" ) {
155 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
156 $word = implode(
"", $ar[0] ) .
"дү";
157 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
158 $word = implode(
"", $ar[0] ) .
"ди";
159 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
160 $word = implode(
"", $ar[0] ) .
"ду";
161 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
162 $word = implode(
"", $ar[0] ) .
"ды";
166 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
167 $word = implode(
"", $ar[0] ) .
"нү";
168 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
169 $word = implode(
"", $ar[0] ) .
"ни";
170 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
171 $word = implode(
"", $ar[0] ) .
"ну";
172 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
173 $word = implode(
"", $ar[0] ) .
"ны";
179 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
180 if ( in_array( $wordLastVowel, $frontVowels ) ) {
181 $word = implode(
"", $ar[0] ) .
"те";
182 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
183 $word = implode(
"", $ar[0] ) .
"та";
187 if ( in_array( $wordLastVowel, $frontVowels ) ) {
188 $word = implode(
"", $ar[0] ) .
"де";
189 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
190 $word = implode(
"", $ar[0] ) .
"да";
196 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
197 if ( in_array( $wordLastVowel, $frontVowels ) ) {
198 $word = implode(
"", $ar[0] ) .
"тен";
199 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
200 $word = implode(
"", $ar[0] ) .
"тан";
204 if ( in_array( $wordLastVowel, $frontVowels ) ) {
205 $word = implode(
"", $ar[0] ) .
"ден";
206 } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
207 $word = implode(
"", $ar[0] ) .
"дан";
213 if ( in_array( $wordEnding, $directiveVoicedStems ) ) {
214 $word = implode(
"", $ar[0] ) .
"же";
215 } elseif ( in_array( $wordEnding, $directiveUnvoicedStems ) ) {
216 $word = implode(
"", $ar[0] ) .
"че";
221 if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
222 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
223 $word = implode(
"", $ar[0] ) .
"түве";
224 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
225 $word = implode(
"", $ar[0] ) .
"тиве";
226 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
227 $word = implode(
"", $ar[0] ) .
"туве";
228 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
229 $word = implode(
"", $ar[0] ) .
"тыве";
233 if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
234 $word = implode(
"", $ar[0] ) .
"дүве";
235 } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
236 $word = implode(
"", $ar[0] ) .
"диве";
237 } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
238 $word = implode(
"", $ar[0] ) .
"дуве";
239 } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
240 $word = implode(
"", $ar[0] ) .
"дыве";
convertGrammar($word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
when a variable name is used in a it is silently declared as a new local masking the global
Tyvan localization (Тыва дыл)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
$wgGrammarForms
Some languages need different word forms, usually for different cases.