Module:pine-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 47: Line 47:


local export = {}
local export = {}
function export.vowel_harmony(term)
local polarity = {
["au"] = "back", ["[ei]?u[oa]?"] = "back", ["o[ai]?"] = "back", ["[ủỏ]"] = "back",
["a[iy]"] = "front", ["ey"] = "front", ["ů[aei]?"] = "front", ["[ei]ů"] = "front", ["[ủỷả]"] = "front"
}
for pat, harmony in pairs(polarity) do
if find(term, pat) then return harmony end
end
return "neutral"
end


-- exportable to be used by [[Module:pine-noun]]
-- exportable to be used by [[Module:pine-noun]]
function export.syllabify_from_spelling(term)
function export.syllabify_from_spelling(term, is_ipa)
local vowels = "[" .. vowels_spelling .. "]"
local vowels = "[" .. vowels_spelling .. "]"
local consonants = consonants_spelling --lazy_consonants
local consonants = consonants_spelling --lazy_consonants
Line 72: Line 85:
end
end
return is_ipa and term or split(term, "·")
return term
end
end


function export.crux(term)
function export.crux(term)
term = export.syllabify_from_spelling(term)
term = export.syllabify_from_spelling(term, true)
-- default to short lax vowels
-- default to short lax vowels