Jump to content

Module:Sandbox/AmazingJus

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AmazingJus (talk | contribs) at 12:32, 21 November 2023 (Created page with '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'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(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