10,794
edits
TheNightAvl (talk | contribs) (Added rhyme) |
TheNightAvl (talk | contribs) (Added nasalisation to phonetic realisation) |
||
Line 171: | Line 171: | ||
consonant[temp] = true | consonant[temp] = true | ||
end | end | ||
local velar = { | |||
["k"] = true, ["ɡ"] = true, ["ɣ"] = true, ["ŋ"] = true, | |||
-- allophones -- | |||
["x"] = true, | |||
} | |||
local obstruent = { | local obstruent = { | ||
Line 185: | Line 193: | ||
local obstruent_voiced = { | local obstruent_voiced = { | ||
["b"] = true | ["b"] = true, ["d"] = true, ["ð"] = true, ["dz"] = true, | ||
["dʒ"] = true | ["dʒ"] = true, ["ɡ"] = true, ["ɣ"] = true, | ||
["v"] = true, | |||
["z"] = true, ["ʒ"] = true, | |||
["z"] = true, ["ʒ"] = true | |||
} | } | ||
Line 336: | Line 343: | ||
} | } | ||
local CN = continuant | local CN = continuant | ||
local fricative = { -- excludes [h] | |||
["ç"] = true, ["ð"] = true, | |||
["f"] = true, ["ɣ"] = true, | |||
["l"] = true, ["r"] = true, ["s"] = true, ["ʃ"] = true, | |||
["v"] = true, | |||
["z"] = true, ["ʒ"] = true, ["θ"] = true, | |||
-- allophones -- | |||
["x"] = true, | |||
} | |||
-- VOWEL GROUPS -- | -- VOWEL GROUPS -- | ||
Line 362: | Line 381: | ||
local long = { | local long = { | ||
["aː"] = true, ["aːː"] = true, ["æː"] = true, ["ai"] = true, ["au"] = true, | |||
["eː"] = true, ["ei"] = true | ["eː"] = true, ["ei"] = true, ["ɤi"] = true, | ||
["iː"] = true, ["iːː"] = true, ["iːe"] = true, ["ia"] = true, ["ie"] = true, ["oː"] = true, | ["iː"] = true, ["iːː"] = true, ["iːe"] = true, ["ia"] = true, ["ie"] = true, ["oː"] = true, | ||
["œa"] = true, ["øi"] = true, ["ɔː"] = true, ["ɔa"] = true, | |||
["ɔi"] = true | ["ɔi"] = true, ["uː"] = true, ["uːː"] = true, ["uːo"] = true, ["ua"] = true, | ||
["uo"] = true | ["uo"] = true, | ||
} | } | ||
local weak = { | local weak = { | ||
["a"] = | ["ɤ"] = true, ["i"] = true, | ||
["eː"] = | } | ||
["iː"] = | |||
["œ"] = | -- allophonic only -- | ||
["ɔi"] = | local nasalise = { | ||
["uo"] = | ["a"] = "ãˑ", ["aː"] = "ãːˑ", ["aːː"] = "ãːːˑ", ["æː"] = "æ̃ːˑ", ["ai"] = "ãˑĩ", ["au"] = "ãˑũ", | ||
["eː"] = "ẽːˑ", ["ei"] = "ẽˑĩ", ["ɛ"] = "ɛ̃ˑ", ["ɤ"] = "ɤ̃ˑ", ["ɤi"] = "ɤ̃ˑĩ", ["i"] = "ĩˑ", | |||
["iː"] = "ĩːˑ", ["iːː"] = "ĩːːˑ", ["iːe"] = "ĩːˑẽ", ["ia"] = "ĩˑã", ["ie"] = "ĩˑẽ", ["oː"] = "õːˑ", | |||
["œ"] = "œ̃ˑ", ["œa"] = "œ̃ˑã", ["øi"] = "ø̃ˑĩ", ["ɔ"] = "ɔ̃ˑ", ["ɔː"] = "ɔ̃ːˑ", ["ɔa"] = "ɔ̃ˑã", | |||
["ɔi"] = "ɔ̃ˑĩ", ["u"] = "ũˑ", ["uː"] = "ũːˑ", ["uːː"] = "ũːːˑ", ["uːo"] = "ũːˑõ", ["ua"] = "ũˑã", | |||
["uo"] = "ũˑõ", ["y"] = "ỹˑ", | |||
} | } | ||
Line 792: | Line 816: | ||
-- PHONETIC RESOLUTION -- | -- PHONETIC RESOLUTION -- | ||
if phon == true then | if phon == true then | ||
if p_current == "h" and not vowel[p_next] then | if p_current == "h" and not vowel[p_next] then -- hC | ||
mw.log("phon = true:") | mw.log("phon = true:") | ||
p_Convert("x") | |||
elseif p_current == "h" and p_next == "j" then | elseif p_current == "h" and p_next == "j" then | ||
mw.log("phon = true:") | mw.log("phon = true:") | ||
p_Convert("ç") | |||
p_RemoveNext() | p_RemoveNext() | ||
end | end | ||
end | |||
-- Resolution of NK -- | |||
if p_current == "n" and velar[p_next] then | |||
mw.log("n + velar cluster found.") | |||
p_Resolve("ŋ") | |||
end | end | ||
Line 1,307: | Line 1,339: | ||
end | end | ||
function syllables_to_string(syllables) | function syllables_to_string(syllables, phon) | ||
local output = "" | local output = "" | ||
Line 1,320: | Line 1,352: | ||
-- add hiatus marker -- | -- add hiatus marker -- | ||
if syllables[i+1] then | if syllables[i+1] then | ||
if syllables[i]["coda"] == nil and marked_hiatus[syllables[i]["nucleus"]] and syllables[i+1]["onset"] == nil then | if syllables[i]["coda"] == nil and marked_hiatus[syllables[i]["nucleus"]] and syllables[i+1]["onset"] == nil and type(syllables[i+1]) == "table" then | ||
syllables[i]["coda"] = {"."} | syllables[i]["coda"] = {"."} | ||
mw.log("Hiatus marked between syllables " .. i .. " and " .. i+1 .. ".") | mw.log("Hiatus marked between syllables " .. i .. " and " .. i+1 .. ".") | ||
end | |||
end | |||
-- phonetic nasalisation -- | |||
if phon then | |||
local function get_nasal(check) | |||
if check then | |||
mw.log("Phonetic nasalisation in syllable " .. i .. ": " .. syllables[i]["nucleus"] .. " → " .. nasalise[syllables[i]["nucleus"]]) | |||
syllables[i]["nucleus"] = nasalise[syllables[i]["nucleus"]] | |||
table.remove(syllables[i]["coda"], 1) | |||
end | |||
end | |||
if syllables[i]["coda"][1] == "n" then | |||
if fricative[syllables[i]["coda"][2]] then | |||
get_nasal(true) | |||
elseif syllables[i]["coda"][2] == nil and fricative[syllables[i+1]["onset"][1]] then | |||
get_nasal(true) | |||
end | |||
elseif syllables[i]["coda"][1] == "ŋ" then | |||
if syllables[i]["coda"][2] == "h" or syllables[i]["coda"][2] == "x" or syllables[i]["coda"][2] == "ɣ" then | |||
get_nasal(true) | |||
elseif syllables[i]["coda"][2] == nil and (syllables[i+1]["onset"][1] == "h" or syllables[i+1]["onset"][1] == "x" or syllables[i+1]["onset"][1] == "ɣ") then | |||
get_nasal(true) | |||
end | |||
end | end | ||
end | end | ||
Line 1,397: | Line 1,459: | ||
outputIPA = get_stress(outputIPA) | outputIPA = get_stress(outputIPA) | ||
outputIPA = resolve_syllables(outputIPA) | outputIPA = resolve_syllables(outputIPA) | ||
outputIPA = syllables_to_string(outputIPA) | outputIPA = syllables_to_string(outputIPA, parameters["phon"]) | ||
if parameters["rhyme"] then | if parameters["rhyme"] then |