Module:pine-pron: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 11: | Line 11: | ||
local c = require("Module:languages/data").chars | local c = require("Module:languages/data").chars | ||
local m_IPA = require("Module:IPA") | local m_IPA = require("Module:IPA") | ||
local laxen = { | |||
["y"] = "ʏ", ["i"] = "ɪ", ["ů"] = "œ", ["e"] = "ɛ", | |||
["u"] = "ʊ", ["o"] = "ɔ", ["a"] = "ɑ", | |||
} | |||
local long_vowels = { | local long_vowels = { | ||
["ả"] = "æː", ["ẻ"] = "eː", ["ỉ"] = "iː", | ["ả"] = "æː", ["ẻ"] = "eː", ["ỉ"] = "iː", | ||
["ỏ"] = "oː", ["ủ"] = "uː", ["ỷ"] = "yː", | ["ỏ"] = "oː", ["ủ"] = "uː", ["ỷ"] = "yː", | ||
} | } | ||
| Line 26: | Line 26: | ||
function export.crux(term) | function export.crux(term) | ||
-- default to short lax vowels | -- default to short lax vowels | ||
term = term:gsub("[aeiouyů]", laxen) | --term = term:gsub("[aeiouyů]", laxen) | ||
-- long vowels | -- long vowels | ||
term = term:gsub("[ảẻỉỏủỷ]" | term = term:gsub("[ảẻỉỏủỷ]", long_vowels) | ||
term = term:gsub("ɔɑ", "ɑː"); term = term:gsub("ɛœ", "øː") | term = term:gsub("ɔɑ", "ɑː"); term = term:gsub("ɛœ", "øː") | ||
-- diphthongized vowels | -- diphthongized vowels | ||
Revision as of 23:55, 17 November 2025
- The following documentation is located at Module:pine-pron/doc.[edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
local sub = mw.ustring.sub
local find = mw.ustring.find
local gmatch = mw.ustring.gmatch
local gsub = mw.ustring.gsub
local match = mw.ustring.match
local u = mw.ustring.char
local split = mw.text.split
local gsplit = mw.text.gsplit
local lang = require("Module:languages").getByCode("pine")
local c = require("Module:languages/data").chars
local m_IPA = require("Module:IPA")
local laxen = {
["y"] = "ʏ", ["i"] = "ɪ", ["ů"] = "œ", ["e"] = "ɛ",
["u"] = "ʊ", ["o"] = "ɔ", ["a"] = "ɑ",
}
local long_vowels = {
["ả"] = "æː", ["ẻ"] = "eː", ["ỉ"] = "iː",
["ỏ"] = "oː", ["ủ"] = "uː", ["ỷ"] = "yː",
}
local export = {}
function export.crux(term)
-- default to short lax vowels
--term = term:gsub("[aeiouyů]", laxen)
-- long vowels
term = term:gsub("[ảẻỉỏủỷ]", long_vowels)
term = term:gsub("ɔɑ", "ɑː"); term = term:gsub("ɛœ", "øː")
-- diphthongized vowels
term = term:gsub("ʊɔ", "ʊu"); term = term:gsub("œɑ", "øy"); term = term:gsub("œɛ", "ʏy")
-- labiodiphthongized vowels
term = term:gsub("vʏy", "ᶣy"); term = term:gsub("vøy", "ᶣø"); term = term:gsub("vʊu", "ʷu")
term = term:gsub("^ᶣ", "ɥ"); term = term:gsub("^ʷ", "w")
return term
end
function export.show(frame)
local parent_args = frame:getParent().args
local params = {
[1] = { default = mw.title.getCurrentTitle().nsText == 'Template' and "Niṡkullit" or mw.title.getCurrentTitle().text },
}
local args = require("Module:parameters").process(parent_args, params)
local term = mw.ustring.lower(args[1])
local pronunciations = {
{pron = "[" .. term .. "]"}
}
return "* " .. m_IPA.format_IPA_full{lang = lang, items = pronunciations}
end
return export