User:Rua/creationrules.js

Note – after saving, you may have to bypass your browser’s cache to see the changes.

  • Mozilla / Firefox / Safari: hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Command-R on a Macintosh);
  • Konqueror and Chrome: click Reload or press F5;
  • Opera: clear the cache in Tools → Preferences;
  • Internet Explorer: hold Ctrl while clicking Refresh, or press Ctrl-F5.

// <nowiki> This prevents the parser from processing the file and generating transclusions and categories for it.

/*
 * Language-specific entry generation rules for form-of entries, generated by [[WT:ACCEL]].
 * 
 * Each function has two parameters.
 * params holds the parameters given in the template.
 * entry holds the various parts of the entry to be created.
 * 
 * The function's task is to provide new values for some of the parts of the new entry.
 * In most cases, entry.def (the definition line) will be overridden, but the headword (entry.head)
 * or even the part-of-speech or language headers can be overridden if necessary.
 * 
 * If the function is not able to handle the current form for whatever reason, throw an exception:
 * throw new PreloadTextError();
 */

window.creation_rules = window.creation_rules || {};

// Generate the entry's text
window.generate_entry = function (params)
{
	try
	{
		var param = params.lang;
		
		if (!creation_rules[param])
			param = 'others';
		
		if (params.pos == 'cardinal number' || params.pos == 'ordinal number')
			pos = 'numeral';
		else
			pos = params.pos;
		
		var entry = {
			pronunc: null,
			pos_header: params.pos.charAt(0).toUpperCase() + params.pos.substr(1),
			head: '{{head|' + params.lang + '|' + pos + ' form' + (params.target != params.target_pagename ? '|head=' + params.target : '') + (params.transliteration ? ('|tr=' + params.transliteration) : '') + '}}',
			def: null,
			inflection: null,
			declension: null,
			conjugation: null };
		
		creation_rules[param](params, entry);
		
		return entry;
	}
	catch (e)
	{
		if (e instanceof PreloadTextError)
		{
			console.log(e.message);
			return false;
		}
		else
		{
			throw e;
		}
	}
};

// Afrikaans
creation_rules['af'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'diminutive': 'diminutive of',
			'present-participle':'present participle of',
			'past-participle':'past participle of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		switch (params.form)
		{
			case 'plural':
				entry.head = '{{head|' + params.lang + '|noun plural form}}';
				break;
			case 'diminutive':
				entry.head = '{{af-noun|s}}';
				break;
			default:
				entry.head = '{{head|' + params.lang + '|' + params.form.replace(/-/g, ' ') + '}}';
		}
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + (params.origin_transliteration ? '|tr=' + params.origin_transliteration : '') + '|lang=' + params.lang + '}}';
	};

// Asturian
creation_rules['ast'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of',
			'neuter':'neuter of',
			};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Azeri
creation_rules['az'] =
	function (params, entry)
	{
		var formparam = {
			'definite-plural':'def|p',
			'definite-accusative':'def|acc|s',
			'plural-definite-accusative':'def|acc|p',
			'dative':'dat|s',
			'plural-dative':'dat|p',
			'locative':'loc|s',
			'plural-locative':'loc|p',
			'ablative':'abl|s',
			'plural-ablative':'abl|p',
			'genitive':'def|gen|s',
			'plural-genitive':'def|gen|p'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{inflection of|' + params.origin + '||' + formparam[params.form] + '|lang=' + params.lang + '}}';
	};

// Bulgarian
creation_rules['bg'] =
	function (params, entry)
	{
		var formparam = {
			'singular-definite':'singular|definite',
			'singular-definite-subject':'singular|definite|subject',
			'singular-definite-object':'singular|definite|object',
			'plural-indefinite': 'plural|indefinite',
			'plural-definite': 'plural|definite',
			'count': 'count',
			'vocative': 'vocative'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{bg-noun form of|' + formparam[params.form] + '|noun=' + params.origin + '}}';
	};

// Catalan
creation_rules['ca'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Mandarin pinyin
creation_rules['cmn'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'pinyin-ts':
				entry.pos_header = 'Romanization';
				entry.head = '{{cmn-pinyin}}';
				entry.def = '{{pinyin reading of|' + params.origin + '}}';
				break;
			case 'pinyin-t':
				entry.pos_header = 'Romanization';
				entry.head = '{{cmn-pinyin}}';
				// the simplified form is passed through the gender parameter
				entry.def = '{{pinyin reading of|' + params.origin + '|' + params.transliteration + '}}';
				break;
			case 'pinyin-s':
				entry.pos_header = 'Romanization';
				entry.head = '{{cmn-pinyin}}';
				// the traditional form is passed through the gender parameter
				entry.def = '{{pinyin reading of|' + params.transliteration + '|' + params.origin + '}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Welsh
creation_rules['cy'] =
	function (params, entry)
	{
		var template = {
			'feminine-singular': 'feminine singular of',
			'plural': 'plural of',
			'equative': 'equative of',
			'comparative': 'comparative of',
			'superlative': 'superlative of',
			'nasal': 'nasal mutation of',
			'soft': 'soft mutation of',
			'aspirate': 'aspirate mutation of',
			'h-prothesis': 'h-prothesis of'
		};

		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural'){
			entry.head = '{{head|cy|noun plural form}}';
			entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=cy}}\n\n===Mutation===\n{{cy-mut-auto}}';
		}else if(params.form == 'nasal' || params.form == 'soft' || params.form == 'aspirate' || params.form == 'h-prothesis'){
			entry.head = '{{head|cy|mutated '+params.pos+'}}';
			entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=cy}}\n\n===Mutation===\n{{cy-mut-auto|' + params.origin + '}}';
		}else{
			entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=cy}}\n\n===Mutation===\n{{cy-mut-auto}}';
		}
	};

// Danish
creation_rules['da'] =
	function (params, entry)
	{
		var template = {
			'singular-definite':'singular definite of',
			'plural-indefinite': 'plural indefinite of',
			'plural-definite': 'plural definite of',
			
			'genitive-singular-indefinite':'genitive singular indefinite of',
			'genitive-singular-definite':'genitive singular definite of',
			'genitive-plural-indefinite': 'genitive plural indefinite of',
			'genitive-plural-definite': 'genitive plural definite of',
			
			'imperative':'imperative of',
			'present':'present tense of',
			'past':'past tense of',
			'past-participle':'past participle of',
			'passive':'passive of',
			'passive-past':'passive past tense of',
			'present-participle':'present participle of',
			'gerund':'gerund of',
			
			'e-form':'e-form of',
			'neuter':'neuter singular of',
			'comparative':'comparative of',
			'superlative-predicative':'superlative predicative of',
			'superlative-attributive':'superlative attributive of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// German
creation_rules['de'] =
	function (params, entry)
	{
		entry.def = '{{' + params.form.replace(/-/g, ' ') + ' of|' + params.origin + '|lang=' + params.lang + '}}';
		
		if (params.form == "diminutive")
		{
			entry.declension = "{{de-decl-noun-n|s}}";
			entry.head = "{{de-noun|n|"+params.target+"s|"+params.target+"}}";
		}
		else if (params.form == "zu")
		{
			entry.def = '{{de-zu-infinitive of|' + params.origin + '}}';
		}
	};

// English
creation_rules['en'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'comparative':
				entry.head = '{{head|' + params.lang + '|' + params.pos + ' comparative form}}';
				entry.def = '{{en-comparative of|' + params.origin + (params.pos != 'adjective' ? '|POS=' + params.pos : '') + '}}';
				break;
			case 'superlative':
				entry.head = '{{head|' + params.lang + '|' + params.pos + ' superlative form}}';
				entry.def = '{{en-superlative of|' + params.origin + (params.pos != 'adjective' ? '|POS=' + params.pos : '') + '}}';
				break;
			case 'third-person-singular':
				entry.head = '{{head|' + params.lang + '|verb form}}';
				entry.def = '{{en-third-person singular of|' + params.origin + '}}';
				break;
			case 'present-participle':
				entry.head = '{{head|' + params.lang + '|present participle}}';
				entry.def = '{{present participle of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			case 'simple-past':
				entry.head = '{{head|' + params.lang + '|verb form}}';
				entry.def = '{{en-simple past of|' + params.origin + '}}';
				break;
			case 'simple-past-and-participle':
				entry.head = '{{head|' + params.lang + '|verb form}}';
				entry.def = '{{en-past of|' + params.origin + '}}';
				break;
			case 'past-participle':
				entry.head = '{{head|' + params.lang + '|past participle}}';
				entry.def = '{{past participle of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			case 'plural':
				entry.head = '{{head|' + params.lang + '|noun plural form}}';
				entry.def = '{{plural of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			case 'proper-noun-plural':
				entry.head = '{{head|' + params.lang + '|proper noun plural form}}';
				entry.def = '{{plural of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Esperanto
creation_rules['eo'] =
	function (params, entry)
	{
		var index = params.origin.indexOf(' de ');
		var word = (index != -1)? params.origin.substr(0, index) : params.origin;
		var stem = word.substr(0, word.length - 1);
		var ending = word.substr(word.length - 1);
		
		if (ending == 'j'){
			stem = 'original=' + params.origin + '|';
			ending = word.substr(word.length - 2, 1);
		}
		
		if (index != -1)
			stem = 'original=' + params.origin + '|';
		
		if (ending != 'o' && ending != 'a' && ending != 'i')
			throw new PreloadTextError('The Esperanto word "' + params.origin + '" does not end in -o or -a or -i or -oj or -aj (index = ' + index + ', word = ' + word + ', stem = ' + stem + ', ending = ' + ending + ').');

		if (ending == 'i')
			ending = '';
		
		var formparam = {
			'uncountable-accusative':'n|unc=yes',
			'plural'                :'j' + (params.pos == 'proper noun' ? '-proper' : ''),
			'accusative'            :'n' + (params.pos == 'proper noun' ? '-properpl' : ''),
			'accusative-plural'     :'jn' + (params.pos == 'proper noun' ? '-properpl' : ''),
			'present'               :'as',
			'past'                  :'is',
			'future'                :'os',
			'conditional'           :'us',
			'volitive'              :'u',
		};
		
		var inflection = formparam[params.form];
		if (!inflection)
			inflection = params.form
		
		if (params.pos != 'proper noun')
			entry.head = '{{eo-head}}';
		
		// if inflection:match("^[aio]n?t[aeo]$") then
		if( inflection.length > 0 && ((inflection.charAt(0) == 'a') || (inflection.charAt(0) == 'i') || (inflection.charAt(0) == 'o')) ){
			if( inflection.length > 1 && ((inflection.charAt(1) == 'n')) ){
				if( inflection.length > 2 && ((inflection.charAt(2) == 't')) ){
					if( inflection.length > 3 && ((inflection.charAt(3) == 'a') || (inflection.charAt(3) == 'e') || (inflection.charAt(3) == 'o')) ){
						switch(inflection.charAt(3)){
							case 'a':
								entry.pos_header = 'Adjective';
								break;
							case 'e':
								entry.pos_header = 'Adverb';
								break;
							case 'o':
								entry.pos_header = 'Noun';
								break;
						}
						entry.head = '{{eo-part}}';
						// elseif inflection:match("^[aio]n?t[aeo]j?n?$") then
						if( inflection.length > 4 && ((inflection.charAt(4) == 'j'))){
							if( inflection.length > 5 && ((inflection.charAt(5) == 'n'))){
								entry.head = '{{eo-part-form}}';
							}else if( inflection.length == 5 ){
								entry.head = '{{eo-part-form}}';
							}
						}else if( inflection.length > 4 && ((inflection.charAt(4) == 'n'))){
							entry.head = '{{eo-part-form}}';
						}
					}
				}
			}else{
				if( inflection.length > 1 && ((inflection.charAt(1) == 't')) ){
					if( inflection.length > 2 && ((inflection.charAt(2) == 'a') || (inflection.charAt(2) == 'e') || (inflection.charAt(2) == 'o')) ){
						switch(inflection.charAt(2)){
							case 'a':
								entry.pos_header = 'Adjective';
								break;
							case 'e':
								entry.pos_header = 'Adverb';
								break;
							case 'o':
								entry.pos_header = 'Noun';
								break;
						}
						entry.head = '{{eo-part}}';
						// elseif inflection:match("^[aio]n?t[aeo]j?n?$") then
						if( inflection.length > 3 && ((inflection.charAt(3) == 'j'))){
							if( inflection.length > 4 && ((inflection.charAt(4) == 'n'))){
								entry.head = '{{eo-part-form}}';
							}else if( inflection.length == 4 ){
								entry.head = '{{eo-part-form}}';
							}
						}else if( inflection.length > 3 && ((inflection.charAt(3) == 'n'))){
							entry.head = '{{eo-part-form}}';
						}
					}
				}
			}
		}
		
		entry.def = '{{eo-form of|' + stem + '|' + ending + inflection + '}}';
	};

// Spanish
creation_rules['es'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Persian
creation_rules['fa'] =
	function (params, entry)
	{
		var formparam = {
			'comparative':'c',
			'superlative':'s'};
		
		if (!formparam[params.form] || params.pos != 'adjective')
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{fa-adj form of|' + formparam[params.form] + '|' + params.origin + '}}';
	};

// Finnish
creation_rules['fi'] =
	function (params, entry)
	{
		var headparam = {};
		var formparam = {
			'plural-nominative':'case=nominative|pl=plural',
			'singular-genitive':'case=genitive|pl=singular',
			'plural-genitive':'case=genitive|pl=plural',
			'singular-partitive':'case=partitive|pl=singular',
			'plural-partitive':'case=partitive|pl=plural',
			'singular-inessive':'case=inessive|pl=singular',
			'plural-inessive':'case=inessive|pl=plural',
			'singular-elative':'case=elative|pl=singular',
			'plural-elative':'case=elative|pl=plural',
			'singular-illative':'case=illative|pl=singular',
			'plural-illative':'case=illative|pl=plural',
			'singular-adessive':'case=adessive|pl=singular',
			'plural-adessive':'case=adessive|pl=plural',
			'singular-ablative':'case=ablative|pl=singular',
			'plural-ablative':'case=ablative|pl=plural',
			'singular-allative':'case=allative|pl=singular',
			'plural-allative':'case=allative|pl=plural',
			'singular-essive':'case=essive|pl=singular',
			'plural-essive':'case=essive|pl=plural',
			'singular-translative':'case=translative|pl=singular',
			'plural-translative':'case=translative|pl=plural',
			'plural-instructive':'case=instructive|pl=plural',
// 			'plural-comitative':'case=comitative|pl=plural', // needs alt forms
			'singular-abessive':'case=abessive|pl=singular',
			'plural-abessive':'case=abessive|pl=plural'};

		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
        entry.head = '{{head|' + params.lang + '|' + (headparam[params.form] || params.pos + ' form') + '}}';
		entry.def = '{{fi-form of|' + params.origin + '|' + formparam[params.form] + '}}';
	};
	
// Faroese
creation_rules['fo'] =
	function (params, entry)
	{
		var inflection = {
			'nominative-sg-def':'nom|s|def',
			'nominative-pl-indef':'nom|p|indef',
			'nominative-pl-def':'nom|p|def',
			'accusative-sg-indef':'acc|s|indef',
			'accusative-sg-def':'acc|s|def',
			'accusative-pl-indef':'acc|p|indef',
			'accusative-pl-def':'acc|p|def',
			'dative-sg-indef':'dat|s|indef',
			'dative-sg-def':'dat|s|def',
			'dative-pl-indef':'dat|p|indef',
			'dative-pl-def':'dat|p|def',
			'genitive-sg-indef':'gen|s|indef',
			'genitive-sg-def':'gen|s|def',
			'genitive-pl-indef':'gen|p|indef',
			'genitive-pl-def':'gen|p|def'
		};
		
		if (!inflection[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{inflection of|' + params.origin + '||' + inflection[params.form] + '|lang=fo}}';
	};

// French
creation_rules['fr'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Middle French
creation_rules['frm'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Scottish Gaelic
creation_rules['gd'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'plural':
				entry.def = '{{plural of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			case 'genitive':
				entry.def = '{{genitive singular of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			case 'genitive-and-plural':
				entry.def =
					'{{genitive singular of|' + params.origin + '|lang=' + params.lang + '}}' +
					'\n# {{plural of|' + params.origin + '|lang=' + params.lang + '}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Galician
creation_rules['gl'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Manx
creation_rules['gv'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'genitive':'genitive singular of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Hebrew
creation_rules['he'] =
	function (params, entry)
	{
		var formparam = {
			'plural':'|n=p|s=i',
			'construct':'|n=s|s=c',
			'plural-construct':'|n=p|s=c'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{he-Form of noun|' + params.origin_pagename + (params.origin != params.origin_pagename ? '|wv=' + params.origin : '') + formparam[params.form] + '}}';
	};

// Hungarian
creation_rules['hu'] =
	function (params, entry)
	{
		if (params.form == 'comparative' || params.form == 'superlative')
		{
			entry.head = '{{head|' + params.lang + '|' + params.pos + ' ' + params.form + ' form}}';
			entry.def = '{{' + params.form + ' of' + (params.pos != 'adjective' ? '|POS=' + params.pos : '') + '|' + params.origin + '|lang=' + params.lang + '}}';
		}
		else
		{
			var formparam = {
				'nominative-singular' : 'nom|s',
				'accusative-singular' : 'acc|s',
				'dative-singular' : 'dat|s',
				'instrumental-singular' : 'ins|s',
				'causal-final-singular' : 'cfin|s',
				'translative-singular' : 'tran|s',
				'terminative-singular' : 'term|s',
				'essive-formal-singular' : 'efor|s',
				'essive-modal-singular' : 'emod|s',
				'inessive-singular' : 'ine|s',
				'superessive-singular' : 'spe|s',
				'adessive-singular' : 'ade|s',
				'illative-singular' : 'ill|s',
				'sublative-singular' : 'sbl|s',
				'allative-singular' : 'all|s',
				'elative-singular' : 'ela|s',
				'delative-singular' : 'del|s',
				'ablative-singular' : 'abl|s',
				
				'nominative-plural' : 'nom|p',
				'accusative-plural' : 'acc|p',
				'dative-plural' : 'dat|p',
				'instrumental-plural' : 'ins|p',
				'causal-final-plural' : 'cfin|p',
				'translative-plural' : 'tran|p',
				'terminative-plural' : 'term|p',
				'essive-formal-plural' : 'efor|p',
				'essive-modal-plural' : 'emod|p',
				'inessive-plural' : 'ine|p',
				'superessive-plural' : 'spe|p',
				'adessive-plural' : 'ade|p',
				'illative-plural' : 'ill|p',
				'sublative-plural' : 'sbl|p',
				'allative-plural' : 'all|p',
				'elative-plural' : 'ela|p',
				'delative-plural' : 'del|p',
				'ablative-plural' : 'abl|p'
			};
			
			if (!formparam[params.form])
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
			
			entry.def = '{{inflection of|' + params.origin + '||' + formparam[params.form] + '|lang=' + params.lang + '}}';
		}
	};

// Ido
creation_rules['io'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Italian
creation_rules['it'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Japanese
creation_rules['ja'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'romanized':
				entry.pos_header = 'Romanization';
				entry.head = '{{ja-romaji}}';
				entry.def = '{{ja-romanization of|' + params.origin + '}}';
				break;
			case 'kana-noun':
				entry.pos_header = 'Noun';
				if (params.transliteration)
					entry.head = '{{ja-noun|' + params.transliteration.replace(/-/g," ") + '}}';
				else
					entry.head = '{{ja-noun}}';
				entry.def = '{{ja-def|' + params.origin + '}} {{rfdef|lang=ja}}';
				break;
			case 'kana-proper-noun':
				entry.pos_header = 'Proper noun';
				if (params.transliteration)
					entry.head = '{{ja-pos|proper|' + params.transliteration.replace(/-/g," ") + '}}';
				else
					entry.head = '{{ja-pos|proper}}';
				entry.def = '{{ja-def|' + params.origin + '}} {{rfdef|lang=ja}}';
				break;
			case 'kana-verb':
				entry.pos_header = 'Verb';
				if (params.transliteration)
					entry.head = '{{ja-verb|' + params.transliteration.replace(/-/g," ") + '}}';
				else
					entry.head = '{{ja-verb}}';
				entry.def = '{{ja-def|' + params.origin + '}} {{rfdef|lang=ja}}';
				break;
			case 'kana-adjective':
				entry.pos_header = 'Adjective';
				if (params.transliteration)
					entry.head = '{{ja-adj|' + params.transliteration.replace(/-/g," ") + '}}';
				else
					entry.head = '{{ja-adj}}';
				entry.def = '{{ja-def|' + params.origin + '}} {{rfdef|lang=ja}}';
				break;
			case 'kana-adverb':
				entry.pos_header = 'Adverb';
				if (params.transliteration)
					entry.head = '{{ja-pos|adverb|' + params.transliteration.replace(/-/g," ") + '}}';
				else
					entry.head = '{{ja-pos|adverb}}';
				entry.def = '{{ja-def|' + params.origin + '}} {{rfdef|lang=ja}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Lojban rafsi
creation_rules['jbo'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'rafsi':
				entry.pos_header = 'Rafsi';
				entry.head = '{{jbo-rafsi}}';
				entry.def = '{{jbo-rafsi of|' + params.origin + '}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Kurdish
creation_rules['ku'] =
	function (params, entry)
	{
		var template = {
			'comparative':'comparative of',
			'superlative':'superlative of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.head = '{{head|' + params.lang + '|' + params.pos + ' ' + params.form + ' form}}';
		entry.def = '{{' + template[params.form] + (params.pos != 'adjective' ? '|POS=' + params.pos : '') + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Latvian (only nouns)
creation_rules['lv'] =
	function (params, entry)
	{
		var formparam = {
			'plural-nominative':'nom|p',
			'singular-genitive':'gen|s',
			'plural-genitive':'gen|p',
			'singular-dative':'dat|s',
			'plural-dative':'dat|p',
			'singular-accusative':'acc|s',
			'plural-accusative':'acc|p',
			'singular-instrumental':'ins|s',
			'plural-instrumental':'ins|p',
			'singular-locative':'loc|s',
			'plural-locative':'loc|p',
			'singular-vocative':'voc|s',
			'plural-vocative':'voc|p'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{lv-inflection of|' + params.origin + '|' + formparam[params.form] + '}}';
	};

// Moksha
creation_rules['mdf'] =
	function (params, entry)
	{
		var formparam = {
			'indefinite-plural-nominative':'indef|p|nom',
			'indefinite-singular-genitive':'indef|s|gen',
			'indefinite-plural-genitive':'indef|p|gen',
			'indefinite-singular-dative':'indef|s|dat',
			'indefinite-plural-dative':'indef|p|dat',
			'indefinite-singular-ablative':'indef|s|abl',
			'indefinite-plural-ablative':'indef|p|abl',
			'indefinite-singular-inessive':'indef|s|ine',
			'indefinite-plural-inessive':'indef|p|ine',
			'indefinite-singular-elative':'indef|s|ela',
			'indefinite-plural-elative':'indef|p|ela',
			'indefinite-singular-illative':'indef|s|ill',
			'indefinite-plural-illative':'indef|p|ill',
			'indefinite-singular-prolative':'indef|s|prolative',
			'indefinite-plural-prolative':'indef|p|prolative',
			'indefinite-singular-comparative':'indef|s|comparative',
			'indefinite-plural-comparative':'indef|p|comparative',
			'indefinite-singular-translative':'indef|s|tra',
			'indefinite-plural-translative':'indef|p|tra',
			'indefinite-singular-abessive':'indef|s|abe',
			'indefinite-plural-abessive':'indef|p|abe',
			'indefinite-singular-causative':'indef|s|causative',
			'indefinite-plural-causative':'indef|p|causative',
			'definite-singular-nominative':'def|s|nom',
			'definite-plural-nominative':'def|p|nom',
			'definite-singular-genitive':'def|s|gen',
			'definite-plural-genitive':'def|p|gen',
			'definite-singular-dative':'def|s|dat',
			'definite-plural-dative':'def|p|dat',

			'possessive':'possessive',

			'first-person-singular-copulative':'1|s|copulative',
			'second-person-singular-copulative':'2|s|copulative',
			'third-person-singular-copulative':'3|s|copulative',
			'first-person-plural-copulative':'1|p|copulative',
			'second-person-plural-copulative':'2|p|copulative',
			'third-person-plural-copulative':'3|p|copulative',

			'first-person-singular-present-indicative':'1|s|pres|ind',
			'second-person-singular-present-indicative':'2|s|pres|ind',
			'third-person-singular-present-indicative':'3|s|pres|ind',
			'first-person-plural-present-indicative':'1|p|pres|ind',
			'second-person-plural-present-indicative':'2|p|pres|ind',
			'third-person-plural-present-indicative':'3|p|pres|ind',

			'first-person-singular-past-indicative':'1|s|past|ind',
			'second-person-singular-past-indicative':'2|s|past|ind',
			'third-person-singular-past-indicative':'3|s|past|ind',
			'first-person-plural-past-indicative':'1|p|past|ind',
			'second-person-plural-past-indicative':'2|p|past|ind',
			'third-person-plural-past-indicative':'3|p|past|ind',

			'first-person-singular-subjunctive':'1|s|sub',
			'second-person-singular-subjunctive':'2|s|sub',
			'third-person-singular-subjunctive':'3|s|sub',
			'first-person-plural-subjunctive':'1|p|sub',
			'second-person-plural-subjunctive':'2|p|sub',
			'third-person-plural-subjunctive':'3|p|sub',

			'second-person-singular-imperative':'2|s|imp',
			'second-person-plural-imperative':'2|p|imp',

			'connegative':'connegative',
			'gerund-connegative':'gerund|connegative'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{inflection of|' + params.origin + '||' + formparam[params.form] + '|lang=' + params.lang + '}}';
	};

// Erzya
creation_rules['myv'] =
	function (params, entry)
	{
		var formparam = {
			'indefinite-plural-nominative':'indef|p|nom',
			'indefinite-singular-genitive':'indef|s|gen',
			'indefinite-plural-genitive':'indef|p|gen',
			'indefinite-singular-dative':'indef|s|dat',
			'indefinite-plural-dative':'indef|p|dat',
			'indefinite-singular-ablative':'indef|s|abl',
			'indefinite-plural-ablative':'indef|p|abl',
			'indefinite-singular-inessive':'indef|s|ine',
			'indefinite-plural-inessive':'indef|p|ine',
			'indefinite-singular-elative':'indef|s|ela',
			'indefinite-plural-elative':'indef|p|ela',
			'indefinite-singular-illative':'indef|s|ill',
			'indefinite-plural-illative':'indef|p|ill',
			'indefinite-singular-prolative':'indef|s|prolative',
			'indefinite-plural-prolative':'indef|p|prolative',
			'indefinite-singular-comparative':'indef|s|comparative',
			'indefinite-plural-comparative':'indef|p|comparative',
			'indefinite-singular-translative':'indef|s|tra',
			'indefinite-plural-translative':'indef|p|tra',
			'indefinite-singular-abessive':'indef|s|abe',
			'indefinite-plural-abessive':'indef|p|abe',
			'definite-singular-nominative':'def|s|nom',
			'definite-plural-nominative':'def|p|nom',
			'definite-singular-genitive':'def|s|gen',
			'definite-plural-genitive':'def|p|gen',
			'definite-singular-dative':'def|s|dat',
			'definite-plural-dative':'def|p|dat',
			'definite-singular-ablative':'def|s|abl',
			'definite-plural-ablative':'def|p|abl',
			'definite-singular-inessive':'def|s|ine',
			'definite-plural-inessive':'def|p|ine',
			'definite-singular-elative':'def|s|ela',
			'definite-plural-elative':'def|p|ela',
			'definite-singular-illative':'def|s|ill',
			'definite-plural-illative':'def|p|ill',
			'definite-singular-prolative':'def|s|prolative',
			'definite-plural-prolative':'def|p|prolative',
			'definite-singular-comparative':'def|s|comparative',
			'definite-plural-comparative':'def|p|comparative',
			'definite-singular-translative':'def|s|tra',
			'definite-plural-translative':'def|p|tra',
			'definite-singular-abessive':'def|s|abe',
			'definite-plural-abessive':'def|p|abe'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{inflection of|' + params.origin + '||' + formparam[params.form] + '|lang=' + params.lang + '}}';
	};

// Neapolitan
creation_rules['nap'] =
	function (params, entry)
	{
		var template = {
			'plural': 'plural of',
			'feminine-singular': 'feminine singular of',
			'masculine-plural': 'masculine plural of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Classical Nahuatl
creation_rules['nci'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.head = '{{head|' + params.lang + '|noun plural form' + (params.target != params.target_pagename ? '|head=' + params.target : '') + '}}';
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Dutch
creation_rules['nl'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'plural':
				entry.head = '{{head|nl|noun plural form}}';
				entry.def = '{{nl-noun form of|pl|' + params.origin + '}}';
				break;
			case 'diminutive':
				entry.head = '{{nl-noun-dim}}';
				entry.def = '{{nl-noun form of|dim|' + params.origin + '}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Norwegian
creation_rules['no'] =
	function (params, entry)
	{
		var template = {
			'singular-definite':'singular definite of',
			'plural-indefinite': 'plural indefinite of',
			'plural-definite': 'plural definite of',
			
			'genitive-singular-indefinite':'genitive singular definite of',
			'genitive-singular-definite':'genitive singular definite of',
			'genitive-plural-indefinite': 'genitive plural indefinite of',
			'genitive-plural-definite': 'genitive plural definite of',
			
			'imperative':'imperative of',
			'present':'present tense of',
			'past':'past tense of',
			'past-participle':'past participle of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.form == "imperative")
			entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '|nocat=1}}';
		else
			entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	}

// Bokmål and Nynorsk
creation_rules['nb'] = creation_rules['no']
creation_rules['nn'] = creation_rules['no']

// Old Norse
creation_rules['non'] =
	function (params, entry)
	{
		var inflection = {
			'nom-sing-def':'nom|s|def',
			'nom-plur-indef':'nom|p|indef',
			'nom-plur-def':'nom|p|def',
			'acc-sing-indef':'acc|s|indef',
			'acc-sing-def':'acc|s|def',
			'acc-plur-indef':'acc|p|indef',
			'acc-plur-def':'acc|p|def',
			'dat-sing-indef':'dat|s|indef',
			'dat-sing-def':'dat|s|def',
			'dat-plur-indef':'dat|p|indef',
			'dat-plur-def':'dat|p|def',
			'gen-sing-indef':'gen|s|indef',
			'gen-sing-def':'gen|s|def',
			'gen-plur-indef':'gen|p|indef',
			'gen-plur-def':'gen|p|def'
		};
		
		if (!inflection[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{inflection of|' + params.origin + '||' + inflection[params.form] + '|lang=non}}';
	};

// Chichewa
creation_rules["ny"] =
	function (params, entry)
	{
		entry.head = '{{head|' + params.lang + '|noun plural form|head=' + params.target + '|g=' + params.gender + '}}';
		entry.def = '{{plural of|' + params.origin + '|lang=' + params.lang + '}}';
	};
	
// Occitan
creation_rules['oc'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Polish
creation_rules['pl'] =
	function (params, entry)
	{
		var template = {
			'comparative':'comparative of',
			'superlative':'superlative of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.head = '{{head|' + params.lang + '|' + params.pos + ' ' + params.form + ' form}}';
		entry.def = '{{' + template[params.form] + (params.pos != 'adjective' ? '|POS=' + params.pos : '') + '|' + params.origin + '|lang=' + params.lang + '}}';
		entry.pronunc = '* {{pl-IPA-auto}}';
		if (params.pos === 'adjective')
			entry.declension = '{{pl-decl-adj-auto}}'
	};

// Portuguese
creation_rules['pt'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Romansch
creation_rules['rm'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Romanian
creation_rules['ro'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Gallo
creation_rules['roa-gal'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Guernésiais
creation_rules['roa-grn'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Jèrriais
creation_rules['roa-jer'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Norman
creation_rules['roa-nor'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Russian
creation_rules['ru'] =
	function (params, entry)
	{
		var template = {
			'comparative':'comparative of',
		}
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'adverb' && params.form == 'comparative')
			entry.head = '{{ru-adv|' + params.target + '}}';
		
		entry.def = '{{' + template[params.form] + (params.pos != 'adjective' ? '|POS=' + params.pos : '') + '|' + params.origin + '|lang=' + params.lang + '}}';
		entry.pronunc = '* {{ru-IPA|' + params.target + '}}';
	}

// Sicilian
creation_rules['scn'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Northern Sami
creation_rules['se'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'comparative':
			case 'superlative':
				entry.head = "{{head|" + params.lang + "|" + params.pos + " " + params.form + " form" + (params.target != params.target_pagename ? "|head=" + params.target : "") + "}}";
				
				// If there is a comma in the head, assume it has multiple accented variants.
				// Add a link with an alternative display form instead.
				entry.def =
					"{{" + params.form + " of" +
					(params.pos != "adjective" ? "|POS=" + params.pos : "") +
					"|" + params.origin +
					"|lang=" + params.lang + "}}";
				
				// If it's an adjective, add an inflection table request
				if (params.pos == "adjective")
					entry.inflection = "{{rfinfl|" + params.lang + "|adjective}}";
				
				break;
			default:
				if (/\|poss$/.test(params.form))
				{
					entry.head = "{{head|" + params.lang + "|" + params.pos + " possessive form" + (params.target != params.target_pagename ? "|head=" + params.target : "") + "}}";
					entry.inflection = "{{rfinfl|" + params.lang + "|" + params.pos + "}}";
				}
				
				entry.def = "{{inflection of|" + params.origin + "||" + params.form + "|lang=" + params.lang + "}}";
				break;
		}
	}

// Pite Sami
creation_rules['sje'] =
	function (params, entry)
	{
		entry.def = '{{inflection of|' + params.origin + '||' + params.form + '|lang=' + params.lang + '}}';
	}

// Lule Sami
creation_rules['smj'] =
	function (params, entry)
	{
		entry.def = '{{inflection of|' + params.origin + '||' + params.form + '|lang=' + params.lang + '}}';
	}

// Skolt Sami
creation_rules['sms'] =
	function (params, entry)
	{
		entry.def = '{{inflection of|' + params.origin + '||' + params.form + '|lang=' + params.lang + '}}';
	}

// Slovak
creation_rules['sk'] =
	function (params, entry)
	{
		var template = {
			'adj':'sk-adj-form',
			'adj-poss':'sk-adj-form-poss'
		};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '}}';
	};

// Slovene
creation_rules['sl'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'comparative':
			case 'superlative':
				entry.pronunc = '{{rfp|lang=sl}}';
				entry.head = '{{sl-' + (params.pos == 'adverb' ? 'adv' : 'adj') + '-' + (params.form == 'comparative' ? 'comp' : 'sup') + '|' + params.target + '}}';
				
				// If there is a comma in the head, assume it has multiple accented variants.
				// Add a link with an alternative display form instead.
				entry.def =
					'{{' + params.form + ' of' +
					(params.pos != 'adjective' ? '|POS=' + params.pos : '') +
					(params.origin.indexOf(',') != -1 ? '|' + params.origin_pagename : '') +
					'|' + params.origin +
					'|lang=sl}}';
				
				// If it's an adjective, add a declension table
				if (params.pos == 'adjective')
				{
					var stem = params.target.substr(0, params.target.length - 1);
					var ending = params.target.substr(params.target.length - 1);
					
					// Adjective comparatives and superlatives must always end in -i
					if (ending != 'i')
						throw new PreloadTextError('The Slovene comparative/superlative "' + params.target + '" does not end in -i.');
					entry.declension = '{{sl-decl-adj|' + stem + '|def=1}}';
				}
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	}

// Swedish
creation_rules['sv'] =
	function (params, entry)
	{
		var template = {
			'positive/n':'sv-adj-form-abs-indef-n',
			'positive/m':'sv-adj-form-abs-def-m',
			'positive-definite/':'sv-adj-form-abs-def',
			'positive-plural/':'sv-adj-form-abs-pl',
			'comparative/':'sv-' + (params.pos == 'adjective' ? 'adj' : 'adv') + '-form-comp',
			'superlative-attributive/m':'sv-adj-form-sup-attr-m',
			'superlative-attributive-definite/':'sv-adj-form-sup-attr',
			'superlative-attributive-plural/':'sv-adj-form-sup-attr-pl',
			'superlative-predicative/':'sv-adj-form-sup-pred',
			'superlative/':'sv-adv-form-sup'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{' + template[params.form + '/' + params.gender] + '|' + params.origin + '}}';
	}

// Swahili
creation_rules['sw'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.head = '{{head|' + params.lang + '|noun plural form}}';
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Tajik
creation_rules['tg'] =
	function (params, entry)
	{
		var formparam = {
			'comparative':'c',
			'superlative':'s'};
		
		if (!formparam[params.form] || params.pos != 'adjective')
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{tg-adj form of|' + formparam[params.form] + '|' + params.origin + '}}';
	};

// Turkish
creation_rules['tr'] =
	function (params, entry)
	{
		var formparam = {
			'definite-plural':'def|p',
			'definite-accusative':'def|acc|s',
			'plural-definite-accusative':'def|acc|p',
			'dative':'dat|s',
			'plural-dative':'dat|p',
			'locative':'loc|s',
			'plural-locative':'loc|p',
			'ablative':'abl|s',
			'plural-ablative':'abl|p',
			'genitive':'def|gen|s',
			'plural-genitive':'def|gen|p'};
		
		if (!formparam[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		entry.def = '{{inflection of|' + params.origin + '||' + formparam[params.form] + '|lang=' + params.lang + '}}';
	}

// Venetian
creation_rules['vec'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine-singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Volapük
creation_rules['vo'] =
	function (params, entry)
	{
		entry.def = '{{inflection of|' + params.origin + '||' + params.form.replace(/-/g, '|') + '|lang=' + params.lang + '}}';
	};

// Walloon
creation_rules['wa'] =
	function (params, entry)
	{
		var template = {
			'plural':'plural of',
			'masculine-plural': 'masculine plural of',
			'feminine singular':'feminine singular of',
			'feminine-plural': 'feminine plural of'};
		
		if (!template[params.form])
			throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		
		if (params.pos == 'noun' && params.form == 'plural')
			entry.head = '{{head|' + params.lang + '|noun plural form}}';
		
		entry.def = '{{' + template[params.form] + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// Yiddish
creation_rules['yi'] =
	function (params, entry)
	{
		switch (params.form)
		{
			case 'plural':
				entry.head = '{{head|' + params.lang + '|noun plural form' + (params.transliteration ? '|tr=' + params.transliteration : '') + '}}';
				entry.def = '{{plural of|' + params.origin + (params.origin_transliteration ? '|tr=' + params.origin_transliteration : '') + '|lang=' + params.lang + '}}';
				break;
			case 'past-participle':
				entry.head = '{{head|' + params.lang + '|past participle' + (params.transliteration ? '|tr=' + params.transliteration : '') + '}}';
				entry.def = '{{past participle of|' + params.origin + (params.origin_transliteration ? '|tr=' + params.origin_transliteration : '') + '|lang=' + params.lang + '}}';
				break;
			case 'inflected':
				entry.head = '{{head|' + params.lang + '|' + params.pos + ' form' + (params.transliteration ? '|tr=' + params.transliteration : '') + '}}';
				entry.def = '{{yi-inflected form of|' + params.origin + (params.origin_transliteration ? '|tr=' + params.origin_transliteration : '') + '}}';
				break;
			default:
				throw new PreloadTextError('No rule for "' + params.form + '" in language "' + params.lang + '".');
		}
	};

// Others
creation_rules['others'] =
	function (params, entry)
	{
		params.form = params.form.replace(/-/g, ' ');
		params.form += ' of';
		
		entry.def = '{{' + params.form + '|' + params.origin + '|lang=' + params.lang + '}}';
	};

// </nowiki>