Content deleted Content added
list words in names |
meh, no need to parse charinsert object as JSON |
||
Line 1:
local p = {}
local function get_all_codepoints(str)
local codepoint_set = {}▼
end▼
end▼
function p.show()
Line 7 ⟶ 17:
if not charinsert then return "Could not find charinsert" end
local codepoint_list = get_all_codepoints(charinsert)
▲ end
▲ local codepoint_set = {}
▲ for codepoint in mw.ustring.gcodepoint(menu) do
▲ if codepoint > 0x7F then
▲ codepoint_set[codepoint] = true
▲ end
▲ end
▲ local codepoint_list = require "Module:table".keysToList(codepoint_set)
local Unicode = require "Module:Unicode data"
local JSON = {}
local len = 0
for i, codepoint in ipairs(codepoint_list) do
local key_and_value = '"' .. codepoint .. '":"' .. Unicode.lookup_name(codepoint) .. '"'
if len + #key_and_value > 80 then
Line 59 ⟶ 34:
table.insert(JSON, key_and_value)
end
return "{" .. table.concat(JSON, ",") .. "}"
|