Module:User:Erutuon/05
Appearance
- The following documentation is located at Module:User:Erutuon/05/documentation. [edit]
- Useful links: root page • root page’s subpages • links • transclusions • testcases • user page • user talk page • userspace
ᾰ̓́γω (3 non-combining characters long), ἀθῡμῐ́ᾱ (6 non-combining characters long)
local export = {}
local isCombining = require("Module:Unicode data").is_combining
local function getLength(str)
local length = 0
for codepoint in mw.ustring.gcodepoint(str) do
if not isCombining(codepoint) then
length = length + 1
end
end
return length
end
local function displayLength(str)
return str .. " (" .. getLength(str) .. " non-combining characters long)"
end
function export.show(frame)
local output = {}
for i, arg in ipairs(frame.args or {}) do
table.insert(output, displayLength(arg))
end
return table.concat(output, ", ")
end
return export