Module:mtev-pronunc: Difference between revisions
No edit summary |
No edit summary |
||
| Line 112: | Line 112: | ||
local tt = { | local tt = { | ||
-- vowels | -- vowels | ||
["अ"] = " | ["अ"] = "ɑ", ["आ"] = "ɑː", ["इ"] = "i", ["ई"] = "iː", ["उ"] = "u", ["ऊ"] = "uː", | ||
["ए"] = "e", ["ऐ"] = "eː", ["ओ"] = "o", ["औ"] = "oː", | |||
-- visarga | -- visarga | ||
["ः"] = "h", | ["ः"] = "h", | ||
| Line 124: | Line 124: | ||
--Vedic extensions | --Vedic extensions | ||
['ᳵ'] = "x", ['ᳶ'] = "ɸ", | ['ᳵ'] = "x", ['ᳶ'] = "ɸ", | ||
} | } | ||
| 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 = "^[ | 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]?)ṃ", | ||
"%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ɭ̆ʱ") | ||
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, "[ | cla_phnm = gsub(cla_phnm, "[éóíú" .. ACUTE .. "]", { | ||
["é"] = "e", ["ó"] = "o", ["í"] = "i", ["ú"] = "u | ["é"] = "e", ["ó"] = "o", ["í"] = "i", | ||
["ú"] = "u", [ACUTE] = "" | |||
}) | }) | ||
-- 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_phnt = gsub( | cla_phnt = gsub( | ||
cla_phnt, | cla_phnt, | ||
"([ | "([ɑ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 ", | ||
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] .. " " | ||