Module:pine-pron: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Undo revision 478954 by Sware (talk))
No edit summary
Line 12: Line 12:
local m_IPA = require("Module:IPA")
local m_IPA = require("Module:IPA")


local vowels_spelling = "aeiouyůảẻỉỏủỷv"
local vowels_spelling = "aeiouyůảẻỉỏủỷ"
local vowels = "[aɑæɔoʊuʏyɛœøiɪe]"
local vowels = "[aɑæɔoʊuʏyɛœøiɪe]"
local lazy_consonants = "[^" .. vowels_spelling .."]"
local lazy_consonants = "[^" .. vowels_spelling .."]"
Line 23: Line 23:


local long_vowels = {
local long_vowels = {
["a"] = "æː", ["e"] = "eː", ["i"] = "iː",
["o"] = "oː", ["u"] = "uː", ["y"] = "yː",
["ả"] = "æː", ["ẻ"] = "eː", ["ỉ"] = "iː",
["ả"] = "æː", ["ẻ"] = "eː", ["ỉ"] = "iː",
["ỏ"] = "oː", ["ủ"] = "uː", ["ỷ"] = "yː",
["ỏ"] = "oː", ["ủ"] = "uː", ["ỷ"] = "yː",
Line 73: Line 71:
word = gsub(word, "·(" .. consonants .. ")(" .. consonants .. "+)", "%1·%2")
word = gsub(word, "·(" .. consonants .. ")(" .. consonants .. "+)", "%1·%2")
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, "·", ".")
words[i] = word
words[i] = word
end
end
Line 82: Line 82:
function export.crux(term)
function export.crux(term)
term = export.syllabify_from_spelling(term)
term = export.syllabify_from_spelling(term)
local debug_syllables = true
local debug_syllables = false
if debug_syllables then
if debug_syllables then
return term
return term
Line 90: Line 90:
term = gsub(term, "[aeiouy]", laxen); term = gsub(term, "ů", "œ")
term = gsub(term, "[aeiouy]", laxen); term = gsub(term, "ů", "œ")
-- long vowels
-- long vowels
local nfd_term = mw.ustring.toNFD(term)
term = gsub(term, "([ảẻỉỏủỷ])", long_vowels)
nfd_term = gsub(nfd_term, "([aeiouy])" .. c.hook, function(v)
return long_vowels[v] or long_vowels[v .. c.hook]
end)
term = mw.ustring.toNFC(nfd_term)
term = gsub(term, "ɔɑ", "ɑː"); term = gsub(term, "ɛœ", "øː")
term = gsub(term, "ɔɑ", "ɑː"); term = gsub(term, "ɛœ", "øː")
-- diphthongized vowels
-- diphthongized vowels

Navigation menu