2 * Finnish (Suomi) language functions
3 * @author Santhosh Thottingal
6 mw.language.convertGrammar = function ( word, form ) {
7 const grammarForms = mw.language.getData( 'fi', 'grammarForms' );
8 if ( grammarForms && grammarForms[ form ] ) {
9 return grammarForms[ form ][ word ];
13 let aou = /[aou][^äöy]*$/i.test( word );
14 const origWord = word;
15 if ( /wiki$/i.test( word ) ) {
18 // append i after final consonant
19 if ( /[bcdfghjklmnpqrstvwxz]$/i.test( word ) ) {
28 word += ( aou ? 'sta' : 'stä' );
31 word += ( aou ? 'a' : 'ä' );
34 // Double the last letter and add 'n'
35 word += word.slice( -1 ) + 'n';
38 word += ( aou ? 'ssa' : 'ssä' );