Jump to content

Module:Sandbox/AmazingJus

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Jonesey95 (talk | contribs) at 13:43, 15 November 2024 (Jonesey95 moved page Module:User:AmazingJus to Module:Sandbox/AmazingJus without leaving a redirect: move to standard location for user test modules). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local export = {}

local gsub = mw.ustring.gsub
local function lc(str)
	return mw.getLanguage("(insert lang here)"):lc(str)
end

-- IPA transcription
function export.toIPA(entry)
	-- get user input as a table
	if type(entry) == "table" then
		entry = entry.args[1]
	end

	entry = lc(entry) -- make all text lowercase
	entry = " " .. entry .. " " -- make all word borders have a space

	-- rest of code goes here

	return mw.text.trim(entry)
end

return export