มอดูล:typing-aids/data helpers
หน้าตา
- This มอดูล lacks a documentation subpage. Please create it.
- Useful links: root page • root page’s subpages • links • transclusions • testcases • sandbox
local export = {}
function export.split_single_and_multi_char(repls)
local processed = {}
local single_char = {}
local multi_char = {}
processed[1] = multi_char
processed[2] = single_char
local decompose, ulen = mw.ustring.toNFD, mw.ustring.len
for pat, repl in pairs(repls) do
pat = decompose(pat)
if ulen(pat) == 1 then
single_char[pat] = repl
else
multi_char[pat] = repl
end
end
return processed
end
return export