Module:rad-IPA: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 140: Line 140:
     ["zeus"] = "zøs",
     ["zeus"] = "zøs",
     ["zeud"] = "zød"
     ["zeud"] = "zød"
}
local initialism = {
["A"] = "a",
["Â"] = "â",
["B"] = "bâ",
["C"] = "câ",
["D"] = "dâ",
["Đ"] = "að",
["E"] = "e",
["F"] = "af",
["G"] = "gâ",
["H"] = "ha",
["I"] = "i",
["J"] = "ai",
["K"] = "kâ",
["Ķ"] = "kjâ",
["L"] = "al",
["M"] = "am",
["N"] = "an",
["Ņ"] = "aņ",
["O"] = "o",
["Ø"] = "ø",
["P"] = "pâ",
["Q"] = "ku",
["R"] = "ar",
["S"] = "as",
["Ș"] = "aș",
["T"] = "tâ",
["Þ"] = "aþ",
["U"] = "u",
["Û"] = "û",
["V"] = "au",
["W"] = "au",
["X"] = "ax",
["Y"] = "y",
["Z"] = "az"
}
}


Line 1,953: Line 1,990:
     local is_prefix = mw.ustring.sub(outputIPA, -1) == "-" or mw.ustring.sub(outputIPA, -1) == "·"
     local is_prefix = mw.ustring.sub(outputIPA, -1) == "-" or mw.ustring.sub(outputIPA, -1) == "·"
     local is_suffix = mw.ustring.sub(outputIPA, 1, 1) == "-"
     local is_suffix = mw.ustring.sub(outputIPA, 1, 1) == "-"
   
    -- process acronyms
    local acronym = mw.ustring.match(outputIPA, "[A-ZÀÁẢÂÈÌÍỈÒØÙÛÚỦÝỶỲŪ][A-ZÀÁẢÂÈÌÍỈÒØÙÛÚỦÝỶỲŪ]+")
    if acronym then
    local spellout = acronym
    for letter, name in pairs(initialism) do
    spellout = spellout:gsub("^" .. letter, name)
    spellout = spellout:gsub(letter, "·" .. name)
    mw.log(spellout)
    end
outputIPA = outputIPA:gsub(acronym, spellout)
end
   
    -- begin generation


     outputIPA = generate_IPA(outputIPA)
     outputIPA = generate_IPA(outputIPA)

Navigation menu