Module:mtev-pronunc: Difference between revisions

Melinoë (talk | contribs)
No edit summary
Melinoë (talk | contribs)
No edit summary
 
Line 112: Line 112:
local tt = {
local tt = {
-- vowels
-- vowels
["अ"] = "ɐ", ["आ"] = "ɑː", ["इ"] = "i", ["ई"] = "iː", ["उ"] = "u", ["ऊ"] = "uː", ["ऋ"] = "r̩", ["ॠ"] = "r̩ː",
["अ"] = "ɑ", ["आ"] = "ɑː", ["इ"] = "i", ["ई"] = "iː", ["उ"] = "u", ["ऊ"] = "uː",
["ऌ"] = "l̩", ["ॡ"] = "l̩ː", ["ए"] = "ɐj", ["ऐ"] = "ɑːj", ["ओ"] = "ɐw", ["औ"] = "ɑːw",  
["ए"] = "e", ["ऐ"] = "", ["ओ"] = "o", ["औ"] = "",  
-- visarga     
-- visarga     
["ः"] = "h",
["ः"] = "h",
Line 124: Line 124:
     --Vedic extensions
     --Vedic extensions
     ['ᳵ'] = "x", ['ᳶ'] = "ɸ",
     ['ᳵ'] = "x", ['ᳶ'] = "ɸ",
}
local accent_vowel = {
["ɐ"] = "ɐ́", ["ɑː"] = "ɑ́ː", ["i"] = "í", ["iː"] = "íː", ["u"] = "ú", ["uː"] = "úː", ["r̩"] = "ŕ̩", ["r̩ː"] = "ŕ̩ː",
["l̩"] = "ĺ̩", ["l̩ː"] = "ĺ̩ː", ["ɐj"] = "ɐ́j", ["ɑːj"] = "ɑ́ːj", ["ɐw"] = "ɐ́w", ["ɑːw"] = "ɑ́ːw",
}
}


Line 203: Line 198:
-- it is not necessary to include 'l' in the pattern for short vowels as it doesn't occur as a vowel in syllable coda and as consonantal 'l' would then be erroneously included
-- it is not necessary to include 'l' in the pattern for short vowels as it doesn't occur as a vowel in syllable coda and as consonantal 'l' would then be erroneously included
local short_vowel_patt = "^[ɐiur]" .. SYLLABIC .. "?" .. ACUTE .. "?$"
local short_vowel_patt = "^[ɑiur]" .. SYLLABIC .. "?" .. ACUTE .. "?$"


-- Classic stress accent
-- Classic stress accent
Line 259: Line 254:
text = gsub(
text = gsub(
text,
text,
"([ɐɑiurleo])(" .. SYLLABIC .. "?)(" .. ACUTE .. "?)(ː?)([jw]?)ṃ",
"([ɑiurleo])(" .. SYLLABIC .. "?)(" .. ACUTE .. "?)(ː?)([jw]?)ṃ",
"%1%2" .. NASAL .. "%3%4%5"
"%1%2" .. NASAL .. "%3%4%5"
)
)
Line 276: Line 271:
table.insert(t, consonants[c])
table.insert(t, consonants[c])
if not diacritics[chars[i + 1]] then
if not diacritics[chars[i + 1]] then
table.insert(t, "ɐ")
table.insert(t, "ɑ")
end
end
elseif c == "्" then
elseif c == "्" then
Line 294: Line 289:
word = gsub(word, "ɭ̆([.']?)ɦ", "%1ɭ̆ʱ")
word = gsub(word, "ɭ̆([.']?)ɦ", "%1ɭ̆ʱ")
-- chandrabindu
word = gsub(
word,
"([ɐɑiurleo])(" .. SYLLABIC .. "?)(" .. ACUTE .. "?)(ː?)([jw]?)m̐",
"%1%2" .. NASAL .. "%3%4%5"
)
return word
return word
end
end
Line 349: Line 338:


local superscript = {
local superscript = {
["ɐ"] = "ɐ̆",
["ɑ"] = "ɑ̆",
["ɑ"] = "ɑ̆",
["e"] = "ĕ",
["e"] = "ĕ",
Line 364: Line 352:
-- Classical
-- Classical
local cla_phnm = text
local cla_phnm = text
cla_phnm = gsub(cla_phnm, "[éóíúŕĺ" .. ACUTE .. "]", {
cla_phnm = gsub(cla_phnm, "[éóíú" .. ACUTE .. "]", {
["é"] = "e", ["ó"] = "o", ["í"] = "i", ["ú"] = "u",
["é"] = "e", ["ó"] = "o", ["í"] = "i",  
["ŕ"] = "r", ["ĺ"] = "l", [ACUTE] = ""
["ú"] = "u", [ACUTE] = ""
})
})
cla_phnm = gsub(cla_phnm, "ɐ(" .. NASAL .. "?)j", "e%1ː")
 
cla_phnm = gsub(cla_phnm, "ɐ(" .. NASAL .. "?)w", "o%1ː")
cla_phnm = gsub(cla_phnm, "ɑ(" .. NASAL .. "?)ː([jw])", "ɑ%1%2")
-- Add dental diacritic to t, d, tʰ, dʱ, n, l, s.
-- Add dental diacritic to t, d, tʰ, dʱ, n, l, s.
cla_phnm = gsub(
cla_phnm = gsub(
Line 385: Line 370:
local cla_phnt = abhinidhana_phonetic(cla_phnm)
local cla_phnt = abhinidhana_phonetic(cla_phnm)
-- cla_pron = gsub(cla_pron, "r̩(" .. NASAL .. "?)(" .. ACUTE .. "?)(ː?)", "ɾi%1%2%3")
-- cla_pron = gsub(cla_pron, "l̩(" .. NASAL .. "?)(" .. ACUTE .. "?)(ː?)", "l̪i%1%2%3")
cla_phnt = gsub(
cla_phnt = gsub(
cla_phnt,
cla_phnt,
"([ɐɑeoiu])(" .. NASAL .. "?)(ː?)([jw]?)h$",
"([ɑeoiu])(" .. NASAL .. "?)(ː?)([jw]?)h$",
function (vow, nas, length, glide)
function (vow, nas, length, glide)
return vow .. nas .. length .. glide .. "h" .. superscript[vow]
return vow .. nas .. length .. glide .. "h" .. superscript[vow]
Line 397: Line 380:
cla_phnt = gsub(
cla_phnt = gsub(
cla_phnt,
cla_phnt,
"([ɐɑeoiu])(" .. NASAL .. "?)(ː?)([jw]?)h ",
"([ɑeoiu])(" .. NASAL .. "?)(ː?)([jw]?)h ",
function (vow, nas, length, glide)
function (vow, nas, length, glide)
return vow .. nas .. length .. glide .. "h" .. superscript[vow] .. " "
return vow .. nas .. length .. glide .. "h" .. superscript[vow] .. " "