Prijeđi na sadržaj

Modul:Leksemi

Izvor: Wječnik

Documentation for this module may be created at Modul:Leksemi/doc

local p = {}

function p.leksem(frame)
	local modArg=mw.getCurrentFrame().args
	local args = mw.getCurrentFrame():getParent().args
	if (modArg['1'] == 'ime') then
		if args['N'] ~= '' and args['N'] ~= nil then
			url = '?form_representation='..args['N']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['G']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['D']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['A']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['V']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['L']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['I']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Nmn']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Gmn']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Dmn']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Amn']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Vmn']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Lmn']:gsub('[%p%c%s]', '')
			..'&form_representation='..args['Imn']:gsub('[%p%c%s]', '')
			..'&generated_via=hr.wiktionary%20script%20by%20User:Ivi104'

			return 'Odaberite JEDAN GUMB!\n\n'
			..'[https://lexeme-forms.toolforge.org/template/croatian-noun-masculine/'.. url ..' Popuni leksem (muški rod)]<br/>'
			..'[https://lexeme-forms.toolforge.org/template/croatian-noun-feminine/'.. url ..' Popuni leksem (ženski rod)]<br/>'
			..'[https://lexeme-forms.toolforge.org/template/croatian-noun-neuter/'.. url ..' Popuni leksem (srednji rod)]<br/>'
		else return ''
		end
	else -- drugi predložak
		if (modArg['1'] == 'broj') then
			
			if args['1'] ~= '' and args['1'] ~= nil then
				url = '?form_representation='..args['1']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['3']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['5']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['7']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['9']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['11']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['13']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['2']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['4']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['6']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['8']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['10']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['12']:gsub('[%p%c%s]', '')
				..'&form_representation='..args['14']:gsub('[%p%c%s]', '')
				..'&generated_via=hr.wiktionary%20script%20by%20User:Ivi104'
	
				return 'Odaberite JEDAN GUMB!\n\n'
				..'[https://lexeme-forms.toolforge.org/template/croatian-noun-masculine/'.. url ..' Popuni leksem (muški rod)]<br/>'
				..'[https://lexeme-forms.toolforge.org/template/croatian-noun-feminine/'.. url ..' Popuni leksem (ženski rod)]<br/>'
				..'[https://lexeme-forms.toolforge.org/template/croatian-noun-neuter/'.. url ..' Popuni leksem (srednji rod)]<br/>'
			else return ''
			end
		end
	end
end

return p