Module:auto cat: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
Tag: Manual revert
No edit summary
Line 1: Line 1:
local export = {}
local export = {}


local function get_language_and_label(title)
local auto_categories = {
local find_by_name = require("Module:languages").find_by_name
{match = "Rhymes:{{language}}/{{rhyme}}", parents = {"Rhymes:{{language}}"}},
local language, label
{match = "Rhymes:{{language}}", parents = {"Rhymes"}},
{match = "{{language}} terms derived from {{source}}", parents = {"Terms derived from {{source}}", "{{language}} derived terms"}},
local words = mw.text.split(title, " ")
{match = "{{language}} terms inherited from {{source}}", parents = {"Terms inherited from {{source}}", "{{language}} inherited terms"}},
for i = 1, #words do
{match = "{{language}} terms borrowed from {{source}}", parents = {"Terms borrowed from {{source}}", "{{language}} borrowed terms"}},
name = table.concat(words, " ", 1, i)
{match = "{{language}} terms derived from the {{source}} root {{root}}", parents = {"{{language}} terms by {{source}} root", "Terms derived from the {{source}} root {{root}}"}}
label = table.concat(words, " ", i + 1)
}
language = find_by_name(name)
if language then break end
end
return language, label
end


return export
return export

Navigation menu