Module:User:kc kennylau/cats

local export = {} local m_languages = require("Module:languages") local m_families = require("Module:families")

--To call this function: prefix_or_suffix

function export.prefix_or_suffix(frame) pagename = mw.title.getCurrentTitle.text pagename = mw.text.split(pagename,' ') n = #pagename result = '' else result = result .. '|pos=' .. mw.ustring.gsub(pagename[n-3],'s$','') .. '}}'	end return result end

--To call this function: deriv

function export.deriv(frame) pagename = mw.title.getCurrentTitle.text pagename = mw.text.split(pagename,' terms derived from ') from = m_languages.getByCanonicalName(pagename[1]):getCode to = m_languages.getByCanonicalName(pagename[2]) if to then to = to:getCode else to = m_families.getFamilyByCanonicalName(mw.ustring.gsub(pagename[2],' languages$','')):getCode end result = '' return result end

--To call this function: sv_compound

function export.sv_compound(frame) pagename = mw.ustring.gsub(mw.title.getCurrentTitle.text,'Swedish compounds with ','') return '' end

--To call this function: topiccat

function export.topiccat(frame) pagename = mw.title.getCurrentTitle.text pagename = mw.text.split(pagename,':') pagename = table.concat(pagename,'|') return '' end

return export