Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 

















Module:IPAc-en/data






Afrikaans
ि
Արեւմտահայերէն
Azərbaycanca
تۆرکجه
Basa Bali

 / Bân-lâm-gú

Bikol Central
Bosanski
Cebuano
Cymraeg
فارسی


Hausa
Hrvatski
Ilokano
Íslenska
Jawa
Kurdî
Ladin
ि

Māori

مصرى

Bahasa Melayu
Монгол


ି
Oʻzbekcha / ўзбекча


Português
Qaraqalpaqsha
Scots
Simple English
Slovenščina
کوردی
Српски / srpski
Srpskohrvatski / српскохрватски
Sunda
ி
 

Türkçe
Tiếng Vit
Winaray


 

Edit links
 









Module
Talk
 

















Read
View source
View history
 








Tools
   


Actions  



Read
View source
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 




In other projects  



Meta-Wiki
Wikiquote
 
















Appearance
   

 





Permanently protected module

From Wikipedia, the free encyclopedia
 

< Module:IPAc-en

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

local PRONUNCIATION_MODULE = 'Module:IPAc-en/pronunciation'
local PHONEME_MODULE = 'Module:IPAc-en/phonemes'

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

local function main()
 local pronunciation = makeData(require(PRONUNCIATION_MODULE))
 local phonemes = makeData(require(PHONEME_MODULE))

 -- Check that no pronunciation keys are also contained in the phonemes
 -- data. This would cause silent, hard-to-debug errors if it went
 -- unchecked, so  make it cause a big red error message instead.
 for id in pairs(pronunciation) do
  if phonemes[id] then
   error(string.format(
    "duplicate ID '%s' found in %s and %s",
    id,
    PRONUNCIATION_MODULE,
    PHONEME_MODULE
   ))
  end
 end

 return {
  pronunciation = pronunciation,
  phonemes = phonemes,
 }
end

return main()

Retrieved from "https://en.wikipedia.org/w/index.php?title=Module:IPAc-en/data&oldid=667617239"

Categories: 
Modules subject to page protection
IPA-related modules
Hidden category: 
Wikipedia template-protected modules
 



This page was last edited on 19 June 2015, at 11:38 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



Privacy policy

About Wikipedia

Disclaimers

Contact Wikipedia

Code of Conduct

Developers

Statistics

Cookie statement

Mobile view



Wikimedia Foundation
Powered by MediaWiki