မဝ်ဂျူ:scripts/data: အရာမတၞဟ်ခြာ အကြာ မူတၞဟ်ဂမၠိုင်

Content deleted Content added
မကလေၚ်ပလီုထောံ95929နူကဵု咽頭べさ (ဓရီုကျာ)မပလေဝ်ဒါန်လဝ်
ဒစင်: ဟွံပ
No edit summary
ဒစင်: မကလေၚ်ပလေဝ်ဒါန်လဝ်
လာင် ၃-
style definitons for the script in [[MediaWiki:Common.css]].
]=]
local concat = table.concat
local insert = table.insert
local remove = table.remove
local select = select
local sort = table.sort
local u = require("Module:string utilities").char
 
------------------------------------------------------------------------------------
--
-- Helper functions
--
------------------------------------------------------------------------------------
 
-- Note: a[2] > b[2] means opens are sorted before closes if otherwise equal.
local function sort_ranges(a, b)
return a[1] < b[1] or a[1] == b[1] and a[2] > b[2]
end
 
-- Returns the union of two or more range tables.
local function union(...)
local ranges = {}
for i = 1, select("#", ...) do
local argt = select(i, ...)
for j, v in ipairs(argt) do
insert(ranges, {v, j % 2 == 1 and 1 or -1})
end
end
sort(ranges, sort_ranges)
local ret, i = {}, 0
for _, range in ipairs(ranges) do
i = i + range[2]
if i == 0 and range[2] == -1 then -- close
insert(ret, range[1])
elseif i == 1 and range[2] == 1 then -- open
if ret[#ret] and range[1] <= ret[#ret] + 1 then
remove(ret) -- merge adjacent ranges
else
insert(ret, range[1])
end
end
end
return ret
end
 
-- Adds the `characters` key, which is determined by a script's `ranges` table.
local function process_ranges(sc)
local ranges, chars = sc.ranges, {}
for i = 2, #ranges, 2 do
if ranges[i] == ranges[i - 1] then
insert(chars, u(ranges[i]))
else
insert(chars, u(ranges[i - 1]))
if ranges[i] > ranges[i - 1] + 1 then
insert(chars, "-")
end
insert(chars, u(ranges[i]))
end
end
sc.characters = concat(chars)
ranges.n = #ranges
return sc
end
 
------------------------------------------------------------------------------------
--
-- Data
--
------------------------------------------------------------------------------------
 
local u = mw.ustring.char
local m = {}
 
Line ၃၉၄ ⟶ ၄၆၁:
characters = "Ͱ-ϡϰ-Ͽ",
systems = {"alphabet"},
ranges = {
0x0342, 0x0342,
0x0345, 0x0345,
0x0370, 0x0377,
0x037A, 0x037F,
0x0384, 0x038A,
0x038C, 0x038C,
0x038E, 0x03A1,
0x03A3, 0x03E1,
0x03F0, 0x03FF,
0x1D26, 0x1D2A,
0x1D5D, 0x1D61,
0x1D66, 0x1D6A,
0x1DBF, 0x1DBF,
0x2126, 0x2127,
0x2129, 0x2129,
0x213C, 0x2140,
0xAB65, 0xAB65,
0x10140, 0x1018E,
0x101A0, 0x101A0,
0x1D200, 0x1D245,
},
capitalized = true,
}
 
ကလေၚ်သီကေတ်လဝ် နူ "https://mnw.wiktionary.org/wiki/မဝ်ဂျူ:scripts/data"