Jump to content

Module:IPAc-en/data

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Mr. Stradivarius (talk | contribs) at 06:28, 17 June 2015 (process pronunciation data as well). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- This module processes data for [[Module:IPAc-en]]. It is intended to be
-- loaded with mw.loadData.

local function makeData(oldData)
	local newData = {}
	for id, old in pairs(oldData) do
		local new = {}
		for k, v in pairs(old) do
			if k ~= 'aliases' then
				new[k] = v
			end
		end
		newData[id] = new
		if old.aliases then
			for i, alias in ipairs(old.aliases) do
				newData[alias] = new
			end			
		end
	end
	return newData
end

return {
	pronunciation = makeData(require('Module:IPAc-en/pronunciation')),
	tooltips = makeData(require('Module:IPAc-en/tooltips'))
}