2 * Ossetian (Ирон) language functions
3 * @author Santhosh Thottingal
6 mediaWiki
.language
.convertGrammar = function ( word
, form
) {
7 var grammarForms
= mediaWiki
.language
.getData( 'os', 'grammarForms' ),
8 // Ending for allative case
10 // Variable for 'j' beetwen vowels
12 // Variable for "-" for not Ossetic words
14 // Variable for ending
17 if ( grammarForms
&& grammarForms
[ form
] ) {
18 return grammarForms
[ form
][ word
];
20 // Checking if the $word is in plural form
21 if ( word
.match( /тæ$/i ) ) {
22 word
= word
.slice( 0, -1 );
24 } else if ( word
.match( /[аæеёиоыэюя]$/i ) ) {
25 // Works if word is in singular form.
26 // Checking if word ends on one of the vowels: е, ё, и, о, ы, э, ю, я.
28 } else if ( word
.match( /у$/i ) ) {
29 // Checking if word ends on 'у'. 'У' can be either consonant 'W' or vowel 'U' in cyrillic Ossetic.
30 // Examples: {{grammar:genitive|аунеу}} = аунеуы, {{grammar:genitive|лæппу}} = лæппуйы.
32 if ( !word
.slice( -2, -1 ).match( /[аæеёиоыэюя]$/i ) ) {
35 } else if ( !word
.match( /[бвгджзйклмнопрстфхцчшщьъ]$/i ) ) {
41 ending
= hyphen
+ jot
+ 'ы';
44 ending
= hyphen
+ jot
+ 'æн';
47 ending
= hyphen
+ endAllative
;
51 ending
= hyphen
+ jot
+ 'æ';
53 ending
= hyphen
+ jot
+ 'æй';
57 ending
= hyphen
+ jot
+ 'ыл';
60 ending
= hyphen
+ jot
+ 'ау';
63 ending
= hyphen
+ 'имæ';