Module:siwa-pron: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
local m_su = require("Module:string utilities") | local m_su = require("Module:string utilities") | ||
local m_table = require("Module:table") | local m_table = require("Module:table") | ||
local m_data = mw.loadData('Module:siwa-pron/data') | |||
local | local initial_clusters = m_data.initial_clusters_2 .. m_data.initial_clusters_3 .. m_data.initial_clusters_4 | ||
local internal_clusters = m_data.internal_clusters_2 .. m_data.internal_clusters_3 .. m_data.internal_clusters_4 .. m_data.internal_clusters_5 | |||
local rules = { | |||
{"ẻu", "øː"}, | {"ẻu", "øː"}, | ||
{"õu", "ɔ̃ː"}, | {"õu", "ɔ̃ː"}, | ||
Line 14: | Line 18: | ||
{"ủ", "uː"}, | {"ủ", "uː"}, | ||
{"ỷ", "yː"}, | {"ỷ", "yː"}, | ||
} | } | ||
local function separateSyllables(word) | |||
local syllables = {} | |||
local pattern = "(" .. internal_clusters .. ")?(aeiou)" | |||
m_table.insert(syllables, m_su.capturing_split(word, pattern)) | |||
return syllables | |||
end | |||
function export.show(frame) | function export.show(frame) |
Revision as of 18:42, 25 December 2020
- The following documentation is located at Module:siwa-pron/doc.[edit]
- Useful links: subpage list • links • transclusions • testcases • sandbox
local export = {}
local m_IPA = require("Module:IPA")
local m_su = require("Module:string utilities")
local m_table = require("Module:table")
local m_data = mw.loadData('Module:siwa-pron/data')
local initial_clusters = m_data.initial_clusters_2 .. m_data.initial_clusters_3 .. m_data.initial_clusters_4
local internal_clusters = m_data.internal_clusters_2 .. m_data.internal_clusters_3 .. m_data.internal_clusters_4 .. m_data.internal_clusters_5
local rules = {
{"ẻu", "øː"},
{"õu", "ɔ̃ː"},
{"ả", "æː"},
{"ẻ", "eː"},
{"ỉ", "iː"},
{"ỏ", "ʊː"},
{"ủ", "uː"},
{"ỷ", "yː"},
}
local function separateSyllables(word)
local syllables = {}
local pattern = "(" .. internal_clusters .. ")?(aeiou)"
m_table.insert(syllables, m_su.capturing_split(word, pattern))
return syllables
end
function export.show(frame)
local parent_args = frame:getParent().args
local params = {
[1] = { default = mw.title.getCurrentTitle().text},
}
local args = require("Module:parameters").process(parent_args, params)
local IPA_key = "IPA for Siwa"
local key_link = "[["..IPA_key.."|key]]"
local prefix = "[[w:IPA chart|IPA]]<sup>(" .. key_link .. ")</sup>: "
local accent="(\''Aingo\'') "
trans = "<span style=\"font-size:110%;font-family:Gentium,'DejaVu Sans','Segoe UI',sans-serif>[" .. args[1] .. "]</span>"
out = accent..prefix..trans
return out
end
return export