Module:siwa-pron: Difference between revisions
No edit summary |
No edit summary |
||
| Line 17: | Line 17: | ||
--obsolete ligatures and L with stroke used to remove two-character hassle. will replace later | --obsolete ligatures and L with stroke used to remove two-character hassle. will replace later | ||
local consonant = "[ | local consonant = "[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥɾlɬłʣjwʦʔ]" .. UNRELEASED .. "?" | ||
local front_vowel = "iɪyeøɛœæa" | local front_vowel = "iɪyeøɛœæa" | ||
local back_vowel = "uɔ" .. NASALIZED .. "?ɑʊ" | local back_vowel = "uɔ" .. NASALIZED .. "?ɑʊ" | ||
local vowel = "[" .. front_vowel .. back_vowel .. "]" | local vowel = "[" .. front_vowel .. back_vowel .. "]" | ||
local stpattern = "·?ˈ[mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥɾlɬłʣjwʦįų⁽ʰ⁾ʔː]*"..UNRELEASED.."?[iɪyeøɛœæauɔɑʊ][mnɲŋpbtdcɟkɡʔvðsɕxɣhʨʥɾlɬłʣjwʦʔ]*"..UNRELEASED.."ː?" | |||
local function open_to_closed(v) | local function open_to_closed(v) | ||
| Line 75: | Line 76: | ||
}, | }, | ||
{ | { | ||
["·"] = "", --remove morpheme separator | |||
}, | |||
} | |||
local stressed_rules = { | |||
{ | |||
["h"] = "ʔ", ["gi"] = "jː", ["hh"] = "hː" | |||
}, | }, | ||
} | } | ||
function export.morphemes(word) | function export.morphemes(word) | ||
local | local pss = {} | ||
if gmatch(word,"·") then | if gmatch(word,"·") then | ||
pss = split(word,"·") | |||
end | end | ||
for i, m in ipairs( | for i, m in ipairs(pss) do | ||
if m_sm.suffix[m] and gmatch(table.concat( | if m_sm.suffix[m] and gmatch(table.concat(pss),"[ˈˌ]") then | ||
elseif m_sm.prefix[m] then | elseif m_sm.prefix[m] then | ||
pss[i] = "ˌ" .. pss[i] | |||
else | else | ||
pss[i] = "ˈ" .. pss[i] | |||
end | end | ||
end | end | ||
return table.concat( | return table.concat(pss,"·") | ||
end | end | ||
| Line 124: | Line 116: | ||
end | end | ||
end | end | ||
for _, srule in ipairs(stressed_rules) do | |||
for regex, replacement in pairs(srule) do | |||
term = gmatch(term, spattern) | |||
term = gsub(term, regex, replacement) | |||
end | |||
end | |||
table.insert(IPA, term) | table.insert(IPA, term) | ||