Module:pine-pron: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 62: Line 62:
word = gsub(word, "(" .. consonants .. ")·%1", "·%1%1")
word = gsub(word, "(" .. consonants .. ")·%1", "·%1%1")
word = gsub(word, "(" .. vowels .. ")(" .. consonants .. ")·v(" .. vowels .. ")", "%1·%2v%3")
word = gsub(word, "(" .. vowels .. ")(" .. consonants .. ")·v(" .. vowels .. ")", "%1·%2v%3")
word = gsub(word, "(" .. vowels .. ")t·([ʦʧ])(" .. vowels .. ")", "%1·t%2%3")
word = gsub(word, "·", ".")
words[i] = word
words[i] = word
end
end
return table.concat(words, " ")
term = table.concat(words, " ")
if not is_ipa then
term = gsub(term, "([ʦʧ])", {["ʦ"] = "ts", ["ʧ"] = "tṡ"})
end
return is_ipa and term or split(term, "·")
end
end


Line 94: Line 99:
term = gsub(term, "(.)%1", "%1ː"); term = gsub(term, "ng", "ŋː")
term = gsub(term, "(.)%1", "%1ː"); term = gsub(term, "ng", "ŋː")
-- final substitutions
local final_subs = {
local final_subs = {
["ʧ"] = "t͡ʃ",
["ʧ"] = "t͡ʃ",
Line 103: Line 107:
["ṇ"] = "n" .. c.ringbelow,
["ṇ"] = "n" .. c.ringbelow,
["ṛ"] = "r" .. c.ringbelow,
["ṛ"] = "r" .. c.ringbelow,
["·"] = ".",
}
}
term = gsub(term, "[ʧʦgƛṃṇṛ]", final_subs)
term = gsub(term, "[ʧʦgƛṃṇṛ·]", final_subs)
return term
return term