local p =
function p.show(frame) local page = frame.args[1] or "User:Erutuon/Unicode/DerivedCoreProperties.txt" local text = assert(mw.title.new(page):getContent) local defaultIgnorable = text :match("Derived Property: Default_Ignorable_Code_Point.-(%f[^\n]%x%x%x%x.-)%s*\n# Total code points") local singles, ranges =, for codePoint1, codePoint2 in defaultIgnorable:gmatch("%f[^\n%z](%x+)%.?%.?(%x*)") do codePoint1, codePoint2 = tonumber(codePoint1, 16), tonumber(codePoint2, 16) local lastRange = ranges[#ranges] if lastRange and lastRange[2]
data.defaultIgnorable =
return data
local Array = require "Module:array" local printedRanges = Array for _, range in ipairs(ranges) do local low, high, script_code = unpack(range) printedRanges:insert(('\t\t,'):format(low, high)) end local printedSingles = Array for codepoint in require 'Module:TableTools'.sortedPairs(singles) do printedSingles:insert(('\t\t[0x%05X] = true,'):format(codepoint)) end local data = template :gsub('%.%.%.', printedSingles:concat('\n'), 1) :gsub('%.%.%.', printedRanges:concat('\n'), 1) return dataend
local Unicode_data = require "Module:Unicode data/sandbox"local fun = require "Module:fun"local m_table = require "Module:TableTools"
local function errorf(level, ...) if type(level)
function p.search_for_language_codes(frame) local page_name = frame.args[1] or "English language" local success, title_object = pcall(mw.title.new, page_name) if not (success and title_object) then mw.logf("Could not make title object for '%s'.", page_name) return end local content = title_object:getContent local language_codes = for lang_template in content:gmatch "