Module:rad-IPA: Difference between revisions

Fixed irregular recognition
(Vowel resolution near completion)
(Fixed irregular recognition)
Line 1: Line 1:
--[[
Debug console test string:
=p.generate(mw.getCurrentFrame():newChild{title="whatever",args={"rjaovs"}})
]]
local export = {}
local export = {}
local getArgs = require('Module:Arguments').getArgs
local getArgs = require('Module:Arguments').getArgs
Line 121: Line 116:
data["!"] = data["."]
data["!"] = data["."]
data["?"] = data["."]
data["?"] = data["."]
local irregular = {
["eurú"] = "ørú",
["eurov"] = "ørov",
["heņre"] = "heņgre",
["nrao"] = "drao",
["ryņl"] = "ryņgl",
}


local valid_phone = {
local valid_phone = {
Line 171: Line 174:


function generate_IPA(word)
function generate_IPA(word)
local s = word
local s = mw.ustring.lower(word)
-- Replace irregulars --
for toReplace, ReplaceKey in pairs(irregular) do
if mw.ustring.match(s, toReplace) then
s = mw.ustring.gsub(s, toReplace, ReplaceKey)
mw.log("Irregular spelling <" .. toReplace .. "> recognised. Treating as <" .. ReplaceKey .. ">.")
end
end
local s_len = mw.ustring.len(s)
local s_len = mw.ustring.len(s)
IPA = {}
IPA = {}
Line 411: Line 424:


return export
return export
--[[
Debug console test string:
=p.generate(mw.getCurrentFrame():newChild{title="whatever",args={"rjaovs"}})
]]