Module:rad-stem/templates: Difference between revisions

From Laenkea
Jump to navigation Jump to search
(Created page with "local export = {} local getArgs = require('Module:Arguments').getArgs local m_stem = require("Module:rad-stem") local m_links = require("Module:links") local m_parameters = require("Module:parameters") function get_stems(args) local shifted = {"noun", "case placeholder"} local i = 1 while args[i] do shifted[i+2] = args[i] i = i + 1 end return m_stem.getNounStem(shifted) end function export.sg_pl(frame) local args = getArgs(frame) local stems = get_stems...")
 
mNo edit summary
Line 22: Line 22:
local stems = get_stems(args)
local stems = get_stems(args)
mw.logObject(stems)
return stems.nom
end
end


Line 29: Line 29:
--[[
--[[
Debug console test string:
Debug console test string:
=p.sg_pl(mw.getCurrentFrame():newChild{title="whatever",args={"dv", "a^u", "n", "þ"}})
=p.sg_pl(mw.getCurrentFrame():newChild{title="whatever",args={"hv", "o~u^u", "þ"}})
]]--
]]--

Revision as of 00:11, 28 November 2023

Underlies:


local export = {}
local getArgs = require('Module:Arguments').getArgs

local m_stem = require("Module:rad-stem")
local m_links = require("Module:links")
local m_parameters = require("Module:parameters")

function get_stems(args)
	local shifted = {"noun", "case placeholder"}
	
	local i = 1
	while args[i] do
		shifted[i+2] = args[i]
		i = i + 1
	end
	
	return m_stem.getNounStem(shifted)
end

function export.sg_pl(frame)
	local args = getArgs(frame)
	local stems = get_stems(args)
	
	return stems.nom
end

return export

--[[
Debug console test string:
=p.sg_pl(mw.getCurrentFrame():newChild{title="whatever",args={"hv", "o~u^u", "þ"}})
]]--