2 * Ossetian (Ирон) language functions
3 * @author Santhosh Thottingal
7 mediaWiki.language.convertGrammar = function( word, form ) {
8 var grammarForms = mw.language.getData( 'os', 'grammarForms' );
9 if ( grammarForms && grammarForms[form] ) {
10 return grammarForms[form][word] ;
12 // Ending for allative case
13 var end_allative = 'мæ';
14 // Variable for 'j' beetwen vowels
16 // Variable for "-" for not Ossetic words
18 // Variable for ending
20 // Checking if the $word is in plural form
21 if ( word.match( /тæ$/i ) ) {
22 word = word.substring( 0, word.length - 1 );
25 // Works if word is in singular form.
26 // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
27 else if ( word.match( /[аæеёиоыэюя]$/i ) ) {
30 // Checking if word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
31 // Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
32 else if ( word.match( /у$/i ) ) {
33 if ( ! word.substring( word.length-2, word.length-1 ).match( /[аæеёиоыэюя]$/i ) ) {
36 } else if ( !word.match( /[бвгджзйклмнопрстфхцчшщьъ]$/i ) ) {
42 ending = hyphen + jot + 'ы';
45 ending = hyphen + jot + 'æн';
48 ending = hyphen + end_allative;
52 ending = hyphen + jot + 'æ';
55 ending = hyphen + jot + 'æй';
59 ending = hyphen + jot + 'ыл';
62 ending = hyphen + jot + 'ау';
65 ending = hyphen + 'имæ';