Module:kilta-pron: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 14: Line 14:
local m_IPA = require("Module:IPA")
local m_IPA = require("Module:IPA")


local consonants = "[pβmtsnɾlʧkxʷqhyʤɡbvdː]"
local consonants = "[pβmtsnɾlʧkxqhyʤɡbvd]"
local vowels = "[aeiouáéíóúəïüʔ]"
local vowels = "[aeiouáéíóúəïüë]"


local export = {}
local export = {}
Line 27: Line 27:
local phonemic_rules = {
local phonemic_rules = {
{"%-$", ""}, {"%-", " "},
{"%-$", ""}, {"%-", " "},
{"h", "x"}, {"hw", "h"}, {"kw", "q"}, {"ch", "ʧ"}, {"au", "ü"}, {"ai", "ï"},
{"h", "x"}, {"xw", "h"}, {"kw", "q"}, {"ch", "ʧ"}, {"au", "ü"}, {"ai", "ï"},
{"v", "β"}, {"r", "ɾ"},  
{"v", "β"}, {"r", "ɾ"},  
Line 61: Line 61:
local function syllabify(term)
local function syllabify(term)
local iskolan = term == "kolaːn"
local iskolan = term == "kolaːn"
local syllable = "(" .. consonants .. "?)(" .. vowels .. ")(" .. consonants .. "-)"
term = gsub(term, syllable, ".%1.")
term = term:gsub("([pβmtsnɾlʧkxʷqhyʤɡbvdː])ː", "%1·%1")
local syllables = split(term, ".")
term = term:gsub("q·q", "k·q")
term = term:gsub("^([aeiouáéíóúəïüʔ])", "%1·")
term = term:gsub("([pβmtsnɾlʧkxʷqhː]*[aeiouáéíóúəïü][pmtsnɾlʧkqː]-)", "·%1·")
--term = term:gsub("([pβmtsnɾlʧkxʷqhyʤɡbvdː]*[aeiouáéíóúəïüʔ][pβmtsnɾlʧkxʷqhyʤɡbvdː]-)", "·%1·")
--term = term:gsub("^·", "")
--term = term:gsub("·$", "")
--term = term:gsub("··+", "·")
--term = term:gsub("·([nlɾs])([pβmtʧkxʷqƕː])", "%1·%2")
--term = term:gsub("·([tmnlɾs])$", "%1")
--term = term:gsub("·([pβmtsnɾlʧkxʷqhyʤɡbvdː])·", "%1·")
local syllables = split(term, "·")
if iskolan then
if iskolan then
Line 83: Line 72:
end
end
return table.concat(syllables, "·")
return table.concat(syllables, ".")
end
end