Module:User:Saltmarsh

Definition from Wiktionary, the free dictionary
Jump to: navigation, search
This is a private module sandbox of Saltmarsh, for their own experimentation. Items in this module may be added and removed at Saltmarsh's discretion; do not rely on this module's stability.
local p = {}

local elt = require("Module:el-translit")

function p.test1(frame)
    local hword = "αβγ"
    local tr_frame = elt.tr(hword)
    local args = tr_frame.args
--    local hword_tr = args[1]
    return args[1]
end

-- ================================

function p.test2(frame)
    local pframe = frame:getParent()
    local args = pframe.args
    if not args[1] then
        return "1st parameter missing!"
        end
    local hword_in = args[1]
    local len = 0
    if type(hword_in) == "string" then
        len = mw.ustring.len(hword_in)
        end
    local hword_stem = mw.ustring.sub( hword_in, 1, len - 2 )
    local hword_out = hword_stem .. "ός"
    return hword_in .. " -> '''" .. hword_out .. "''' ''m'' (''" .. "translit" .. "'', ''f'' [["  .. hword_stem .. "ή]], ''n'' [[" .. hword_stem .. "ό]])"
end

return p