MediaWiki  1.23.6
LanguageTyv.php
Go to the documentation of this file.
1 <?php
31 class LanguageTyv extends Language {
40  function convertGrammar( $word, $case ) {
41  global $wgGrammarForms;
42  if ( isset( $wgGrammarForms['tyv'][$case][$word] ) ) {
43  return $wgGrammarForms['tyv'][$case][$word];
44  }
45 
46  // Set up some constants...
47  $allVowels = array( "е", "и", "э", "ө", "ү", "а", "ё", "о", "у", "ы", "ю", "я", "a", "e", "i", "o", "ö", "u", "ü", "y" );
48  $frontVowels = array( "е", "и", "э", "ө", "ү", "e", "i", "ö", "ü" );
49  $backVowels = array( "а", "ё", "о", "у", "ы", "ю", "я", "a", "o", "u", "y" );
50  $unroundFrontVowels = array( "е", "и", "э", "e", "i" );
51  $roundFrontVowels = array( "ө", "ү", "ö", "ü" );
52  $unroundBackVowels = array( "а", "ы", "я", "a", "y" );
53  $roundBackVowels = array( "ё", "о", "у", "ю", "o", "u" );
54  //$voicedPhonemes = array( "д", "б", "з", "ж", "г", "d", "b", "z", "g" );
55  $unvoicedPhonemes = array( "т", "п", "с", "ш", "к", "ч", "х", "t", "p", "s", "k", "x" );
56  $directiveUnvoicedStems = array( "т", "п", "с", "ш", "к", "ч", "х", "л", "м", "н", "ң", "t", "p", "s", "k", "x", "l", "m", "n", "ŋ" );
57  $directiveVoicedStems = array( "д", "б", "з", "ж", "г", "р", "й", "d", "b", "z", "g", "r", "j" );
58 
59  //$allSonants = array("л", "м", "н", "ң", "р", "й");
60  //$allNasals = array("м", "н", "ң");
61 
62  //Put the word in a form we can play with since we're using UTF-8
63  preg_match_all( '/./us', $word, $ar );
64 
65  $wordEnding = $ar[0][count( $ar[0] ) - 1]; // Here's the last letter in the word
66  $wordReversed = array_reverse( $ar[0] ); // Here's an array with the order of the letters in the word reversed so we can find a match quicker *shrug*
67 
68  // Find the last vowel in the word
69  $wordLastVowel = null;
70  foreach ( $wordReversed as $xvalue ) {
71  foreach ( $allVowels as $yvalue ) {
72  if ( strcmp( $xvalue, $yvalue ) == 0 ) {
73  $wordLastVowel = $xvalue;
74  break;
75  } else {
76  continue;
77  }
78  }
79  if ( $wordLastVowel !== null ) {
80  break;
81  } else {
82  continue;
83  }
84  }
85 
86  // Now convert the word
87  switch ( $case ) {
88  case "genitive":
89  if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
90  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
91  $word = implode( "", $ar[0] ) . "түң";
92  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
93  $word = implode( "", $ar[0] ) . "тиң";
94  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
95  $word = implode( "", $ar[0] ) . "туң";
96  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
97  $word = implode( "", $ar[0] ) . "тың";
98  } else {
99  }
100  } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
101  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
102  $word = implode( "", $ar[0] ) . "дүң";
103  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
104  $word = implode( "", $ar[0] ) . "диң";
105  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
106  $word = implode( "", $ar[0] ) . "дуң";
107  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
108  $word = implode( "", $ar[0] ) . "дың";
109  } else {
110  }
111  } else {
112  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
113  $word = implode( "", $ar[0] ) . "нүң";
114  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
115  $word = implode( "", $ar[0] ) . "ниң";
116  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
117  $word = implode( "", $ar[0] ) . "нуң";
118  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
119  $word = implode( "", $ar[0] ) . "ның";
120  } else {
121  }
122  }
123  break;
124  case "dative":
125  if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
126  if ( in_array( $wordLastVowel, $frontVowels ) ) {
127  $word = implode( "", $ar[0] ) . "ке";
128  } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
129  $word = implode( "", $ar[0] ) . "ка";
130  } else {
131  }
132  } else {
133  if ( in_array( $wordLastVowel, $frontVowels ) ) {
134  $word = implode( "", $ar[0] ) . "ге";
135  } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
136  $word = implode( "", $ar[0] ) . "га";
137  } else {
138  }
139  }
140  break;
141  case "accusative":
142  if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
143  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
144  $word = implode( "", $ar[0] ) . "тү";
145  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
146  $word = implode( "", $ar[0] ) . "ти";
147  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
148  $word = implode( "", $ar[0] ) . "ту";
149  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
150  $word = implode( "", $ar[0] ) . "ты";
151  } else {
152  }
153  } elseif ( $wordEnding === "л" || $wordEnding === "l" ) {
154  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
155  $word = implode( "", $ar[0] ) . "дү";
156  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
157  $word = implode( "", $ar[0] ) . "ди";
158  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
159  $word = implode( "", $ar[0] ) . "ду";
160  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
161  $word = implode( "", $ar[0] ) . "ды";
162  } else {
163  }
164  } else {
165  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
166  $word = implode( "", $ar[0] ) . "нү";
167  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
168  $word = implode( "", $ar[0] ) . "ни";
169  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
170  $word = implode( "", $ar[0] ) . "ну";
171  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
172  $word = implode( "", $ar[0] ) . "ны";
173  } else {
174  }
175  }
176  break;
177  case "locative":
178  if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
179  if ( in_array( $wordLastVowel, $frontVowels ) ) {
180  $word = implode( "", $ar[0] ) . "те";
181  } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
182  $word = implode( "", $ar[0] ) . "та";
183  } else {
184  }
185  } else {
186  if ( in_array( $wordLastVowel, $frontVowels ) ) {
187  $word = implode( "", $ar[0] ) . "де";
188  } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
189  $word = implode( "", $ar[0] ) . "да";
190  } else {
191  }
192  }
193  break;
194  case "ablative":
195  if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
196  if ( in_array( $wordLastVowel, $frontVowels ) ) {
197  $word = implode( "", $ar[0] ) . "тен";
198  } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
199  $word = implode( "", $ar[0] ) . "тан";
200  } else {
201  }
202  } else {
203  if ( in_array( $wordLastVowel, $frontVowels ) ) {
204  $word = implode( "", $ar[0] ) . "ден";
205  } elseif ( in_array( $wordLastVowel, $backVowels ) ) {
206  $word = implode( "", $ar[0] ) . "дан";
207  } else {
208  }
209  }
210  break;
211  case "directive1":
212  if ( in_array( $wordEnding, $directiveVoicedStems ) ) {
213  $word = implode( "", $ar[0] ) . "же";
214  } elseif ( in_array( $wordEnding, $directiveUnvoicedStems ) ) {
215  $word = implode( "", $ar[0] ) . "че";
216  } else {
217  }
218  break;
219  case "directive2":
220  if ( in_array( $wordEnding, $unvoicedPhonemes ) ) {
221  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
222  $word = implode( "", $ar[0] ) . "түве";
223  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
224  $word = implode( "", $ar[0] ) . "тиве";
225  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
226  $word = implode( "", $ar[0] ) . "туве";
227  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
228  $word = implode( "", $ar[0] ) . "тыве";
229  } else {
230  }
231  } else {
232  if ( in_array( $wordLastVowel, $roundFrontVowels ) ) {
233  $word = implode( "", $ar[0] ) . "дүве";
234  } elseif ( in_array( $wordLastVowel, $unroundFrontVowels ) ) {
235  $word = implode( "", $ar[0] ) . "диве";
236  } elseif ( in_array( $wordLastVowel, $roundBackVowels ) ) {
237  $word = implode( "", $ar[0] ) . "дуве";
238  } elseif ( in_array( $wordLastVowel, $unroundBackVowels ) ) {
239  $word = implode( "", $ar[0] ) . "дыве";
240  } else {
241  }
242  }
243  break;
244  default:
245  break;
246  }
247  return $word;
248  }
249 }
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
LanguageTyv
Tyvan localization (Тыва дыл)
Definition: LanguageTyv.php:31
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
LanguageTyv\convertGrammar
convertGrammar( $word, $case)
Grammatical transformations, needed for inflected languages Invoked by putting {{grammar:case|word}} ...
Definition: LanguageTyv.php:40
as
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
Definition: distributors.txt:9
Language
Internationalisation code.
Definition: Language.php:74