local export = {}
local IPA_modifier_apostrophe = mw.ustring.char(0x02BC)
local IPA_primary_stress = mw.ustring.char(0x02C8)
local IPA_secondary_stress = mw.ustring.char(0x02CC)
local IPA_tie_bar_top = mw.ustring.char(0x0361)
local IPA_tie_bar_below = mw.ustring.char(0x035C)
local IPA_modifier_triangular_colon = mw.ustring.char(0x2D0)
-- List of the combining characters used in Lushootseed
local combining_caron = mw.ustring.char(0x30C) -- (Only used in x wedge)
local small_z = mw.ustring.char(0x1DBB) -- (Only used in d raised z)
local small_w = mw.ustring.char(0x2B7) -- (Used in all 'raised w' letters)
local comma_above = mw.ustring.char(0x313)
local comma_above_right = mw.ustring.char(0x315) -- (Used in glottalized L and glottalized barred lambda)
local small_turned_e = mw.ustring.char(0x01DD) -- schwa lookalike
local lut_to_IPA = {
= IPA_primary_stress,
= IPA_secondary_stress,
= '.',
= IPA_modifier_triangular_colon,
= IPA_modifier_apostrophe,
= IPA_modifier_apostrophe,
= small_w,
= 'ɑ',
= 'ə',
= 'ə',
= 'i',
= 'u',
= 'ʔ',
= 'b',
= 't' .. IPA_tie_bar_top .. 's',
= 't' .. IPA_tie_bar_top .. 'ʃ',
= 't' .. IPA_tie_bar_top .. 'ʃ', -- č is preferred
= 'd',
= 'd' .. IPA_tie_bar_top .. 'z',
= 'ɡ',
= 'h',
= 'd' .. IPA_tie_bar_top .. 'ʒ',
= 'k',
= 'l',
= 'ɬ',
= 't' .. IPA_tie_bar_top .. 'ɬ',
= 'm',
= 'n',
= 'p',
= 'q',
= 's',
= 'ʃ',
= 'ʃ', -- š is preferred
= 't',
= 'w',
= 'x',
= 'χ',
= 'j'
}
-- Convert Lushootseed string into IPA
-- Also, convert apostrophe and comma into primary and secondary stress markers
local function convert_IPA(lut_string)
local pattern = "[ʔaəiubcdqkcghǰlɬƛpsšcčtwxy',.:" .. comma_above ..
small_turned_e .. comma_above_right .. small_w ..
"]?"
local result = ""
for letter in mw.ustring.gmatch(lut_string, pattern) do
--result = result .. letter .. ' '
result = result .. lut_to_IPA
end
return result
end
function export.lut_IPA( frame )
local params = {
= {list = true, allow_holes = true}
}
local err = nil
local args = frame:getParent().args
local term = args
if not term then
term = mw.title.getCurrentTitle().text
end
local items = {}
table.insert(items, { pron = '/' .. convert_IPA(term) .. '/'})
local lang = require("Module:languages").getByCode("lut")
mw.log(items)
return require("Module:IPA").format_IPA_full { lang = lang, items = items }
end
return export