Module:User:ZxxZxxZ/headword

Hello, you have come here looking for the meaning of the word Module:User:ZxxZxxZ/headword. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:ZxxZxxZ/headword, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:ZxxZxxZ/headword in singular and plural. Everything you need to know about the word Module:User:ZxxZxxZ/headword you have here. The definition of the word Module:User:ZxxZxxZ/headword will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:ZxxZxxZ/headword, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.


local languages = mw.loadData("Module:languages")
local utilities = require("Module:useful stuff")
local links = require("Module:links")

local export = {}

-- The main entry point.
-- This is the only function that can be invoked from a template.
function export.main(frame)
    local args = frame:getParent().args
    PAGENAME = mw.title.getCurrentTitle().text
    NAMESPACE = mw.title.getCurrentTitle().nsText
    local ret = ""
    
    -- Language code
    local lang = args or error("Language code has not been specified. Please pass parameter 1 to the module invocation.")
    local langinfo = languages or error("The language code \"" .. lang .. "\" is not valid.")
    
    local alt = args; if alt == "" then alt = nil end
    
    local translit = args; if translit == "" then translit = nil end
    if not translit then
        translit = utilities.translit(lang, alt or PAGENAME)
    end
 
    local g1 = args
    if not g1 or g1 == "" then
        g1 = args
        if g1 == "" then g1 = nil end
    end
    local g2 = args; if g2 == "" then g2 = nil end
    local g3 = args; if g3 == "" then g3 = nil end
 
    local script = args; if script == "" then script = nil end 
    if not script then
        script = languages.scripts
    end
    
    local class = "headword"
    if script then
        class = class .. " " .. script
    end

    ret = utilities.annotate(head or PAGENAME, lang, "strong", class, translit, nil, {g1, g2, g3}, frame)

    for i = 3, 22, 2 do
        if args then
            if i ~= 3 then
                if args ~= "or" then
                    ret = ret .. ","
                end
                
                ret = ret .. " "
            end
            
            ret = ret .. "''" .. args .. "''"
            
            if args then
                ret = ret .. " " .. links.annotated_link(args, nil, lang, "strong", script)
            end
        end
    end
    
    -- Categories
    if NAMESPACE == "" then
        local categories = {}
        
        local pos = args; if pos == "" then pos = nil end
        if pos then
            -- Make the plural form of the part of speech
            if pos:find("x$") then
                pos = pos .. "es"
            elseif pos ~= "punctuation" or pos ~= "phrasebook" then
                pos = pos .. "s"
            end
            
            table.insert(categories, langinfo.names .. " " .. pos)
        end
        
        local cat2 = args; if cat2 == "" then cat2 = nil end
        if cat2 then
            table.insert(categories, langinfo.names .. " " .. cat2)
        end
        
        local cat3 = args; if cat3 == "" then cat3 = nil end
        if cat3 then
            table.insert(categories, langinfo.names .. " " .. cat3)
        end
        
        -- Add the categories with the appropriate sort key
        local sort_key = args; if sort_key == "" then sort_key = nil end
        for key, cat in ipairs(categories) do
            ret = ret .. "]"
        end
    end
    
    return ret
end

return export