Module:kilta-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 23: Line 23:
foo, bar = match(foo, "^."), match(bar, "^.") -- sort out the letter
foo, bar = match(foo, "^."), match(bar, "^.") -- sort out the letter
return foo == bar and true or false
return foo == bar and true or false
end
local function syllabicize(term)
local syllable = "(" .. consonants .. "*" .. vowels .. "ː?" .. consonants .. "-)"
term = term:gsub(syllable, ".%1.")
term = term:gsub("^%.", "")
term = term:gsub("%.$", "")
term = term:gsub("%.+", ".")
term = term:gsub("%.([nlɾs])([pβmtʧkxʷʞƕː])", "%1.%2")
term = term:gsub("%.([tmnlɾs])$", "%1")
return term
end
end


Line 67: Line 52:
{"ꜷ", "au"}, {"ꜽ", "ai"},
{"ꜷ", "au"}, {"ꜽ", "ai"},
}
}
local function syllabify(term)
local syllable = "(" .. consonants .. "ː?*" .. vowels .. "ː?" .. consonants .. "-)"
term = term:gsub(syllable, ".%1.")
term = term:gsub("^%.", "")
term = term:gsub("%.$", "")
term = term:gsub("%.+", ".")
term = term:gsub("%.([nlɾs])([pβmtʧkxʷʞƕː])", "%1.%2")
term = term:gsub("%.([tmnlɾs])$", "%1")
return term
end


function export.crux(term)
function export.crux(term)
Line 76: Line 76:
end
end
phonemic = syllabicize(phonemic)
phonemic = syllabify(phonemic)
phonetic = phonemic
phonetic = phonemic