Module:qhv-noun: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 8: Line 8:
local syllables = require("Module:qhv-pron").write_stress
local syllables = require("Module:qhv-pron").write_stress
local alldata = require('Module:qhv-noun/data')
local alldata = require('Module:qhv-noun/data')
local PAGENAME = mw.title.getCurrentTitle().text
local PAGENAME = gsub(mw.title.getCurrentTitle().text, "%s", " ")
local NAMESPACE = mw.title.getCurrentTitle().nsText
local NAMESPACE = mw.title.getCurrentTitle().nsText


Line 41: Line 41:
local decl = number .. "-" .. class
local decl = number .. "-" .. class
return decl, {sub(word, 1, -(#endings_reverse[decl] + 1))}
return decl, {sub(word, 1, -(#endings_reverse[decl] + 1))}
elseif word:find("illa$") then
return "-illa", {sub(word, 1, -2)}
elseif word == "skorlūs" then
return "3-s-h", {sub(word, 1, -2)}
elseif reanalyzed then
elseif reanalyzed then
for ending, decl in pairs(reanalyzed_endings) do
for ending, decl in pairs(reanalyzed_endings) do
Line 98: Line 102:
pass.head = parent_args["head"] or nil
pass.head = parent_args["head"] or nil
pass.proper = parent_args["proper"] and true or false
pass.proper = parent_args["proper"] and true or false
pass.nocat = parent_args["nocat"] and true or false
-- Generate the forms
-- Generate the forms
Line 183: Line 188:
|}]=]
|}]=]


return (gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl)) .. require("Module:utilities").format_categories(lang, pass.categories)
 
return gsub(wikicode, "{{{([a-z0-9_]+)}}}", repl) .. (not pass.nocat and require("Module:utilities").format_categories(pass.categories, lang) or "")
end
end




return export
return export