Module:ábḫ-ipa/remake: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 50: | Line 50: | ||
["s"] = "ɕ", | ["s"] = "ɕ", | ||
["z"] = "θ", | ["z"] = "θ", | ||
}}, {"jh", "ʑ"}, {"j", "ɲ"}, {"y", "j"}, {" | }}, {"jh", "ʑ"}, {"j", "ɲ"}, {"y", "j"}, {"", ""}, {"", ""}, | ||
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | ||
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, | ||
Line 59: | Line 59: | ||
function export.test(frame) | function export.test(frame) | ||
local word = frame.args[1] | local word = frame.args[1] | ||
local letters = word:split("") | |||
for _, rule in ipairs(rules) do | for _, letter in ipairs(letters) do | ||
for _, rule in ipairs(rules) do | |||
word = word:gsub(rule[1], rule[2]) | |||
end | |||
end | end | ||
Revision as of 23:04, 9 April 2021
- The following documentation is located at Module:ábḫ-ipa/remake/doc.[edit]
- Useful links: root page • root page's subpages • links • transclusions • testcases • sandbox
--[[
Hi! If you ever happen to read this, I'm trying to friendly *deobfuscate* your module.
I've learned some Scribunto Lua the hard way, after months of messing with it for Avendonian, Siwa, and High Valyrian modules.
You can check out my Module:siwa-pron and Module:qhv-pron if you're curious; let's say it took me many many
attempts to make them functional :þ. Thanks for adding your language to Linguifex, cheers!
]]
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 PAGENAME = mw.title.getCurrentTitle().text
local CIRCUMFLEX = u(0x0302)
local HACEK = u(0x030C)
local ACUTE = u(0x0301)
local NONSYLL = u(0x032F)
local DENTAL = u(0x032A)
local SYLL = u(0x030D)
local export = {}
local composer = {
["s"] = "s",
}
local vowels = "[aäeɛʊiɪɔɐ]"
local tones = "[ˆˇ´]"
local rules = {
{"á", "a´"},
{"aá", "aaˇ"}, {"áa", "aaˆ"}, {"ií", "iiˇ"}, {"íi", "iiˆ"},
{"eí", "eːˇi"}, {"oú", "oːˇu"}, {"aa", "aː"}, {"ii", "iː"}, {"o", "ɔ"},
{"(" .. vowels .. "ː?" .. tones .. "?).", "%1ɪ" .. NONSYLL}, {"(" .. vowels .. "ː?" .. tones .. "?o)", "%1" .. NONSYLL},
{"(" .. vowels .. "ː?" .. tones .. "?)u", "%1ʊ" .. NONSYLL},
{".", {
["r"] = "ɺ",
["b"] = "β",
["g"] = "ɡ", -- double- to single-storey
["o"] = "ɔ",
["a"] = "ä",
["ḫ"] = "x",
["s"] = "ɕ",
["z"] = "θ",
}}, {"jh", "ʑ"}, {"j", "ɲ"}, {"y", "j"}, {"", ""}, {"", ""},
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""},
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""},
{"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"", ""}, {"´", "˦"}, {"ˆ", "˥˩"}, {"ˇ", "˩˥"},
}
function export.test(frame)
local word = frame.args[1]
local letters = word:split("")
for _, letter in ipairs(letters) do
for _, rule in ipairs(rules) do
word = word:gsub(rule[1], rule[2])
end
end
return word
end
return export