Module:validate IPA

From Wiktionary, the free dictionary
Jump to navigation Jump to search

This module is going to be deleted.
Module:validate IPA is deprecated or has failed Wiktionary:Requests for deletion/Others.

local export = {}

local badchars = {
    [0x02A6] = true
}

function export.validate(frame)
    local args = frame:getParent().args
    local IPA = args[1]
    
    if contains_invalid_char(IPA) == false then
        return "[[Category:Pages with invalid IPA characters]]"
    end
end
    
function contains_invalid_char(str)
    for c in mw.ustring.gcodepoint(str) do
        if badchars[c] ~= nil then
            return false
        end
    end
    return true
end

return export