Module:auto cat: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(I DID IT!!! (Made %p for part of speech functional))
Tag: Reverted
No edit summary
Tag: Reverted
Line 1: Line 1:
local export = {}
local export = {}
local d_languages = mw.loadData("Module:languages/data")
local d_languages = mw.loadData("Module:languages/data")
local d_pos = {
local d = mw.loadData("Module:auto cat/data")
    "adjectives",
local d_cats, d_pos = d.cats, d.pos
    "adverbs",
"articles",
    "conjunctions",
    "determiners",
    "interjections",
"nouns",
    "numerals",
    "particles",
    "phrases",
    "postpositions",
    "prepositions",
    "pronouns",
    "proper nouns",
    "symbols",
    "verbs",
}


-- Alternative to mw.ustring.gsub that is neater to call in code
-- Alternative to mw.ustring.gsub that is neater to call in code
Line 120: Line 104:
local function hydrate_patterns()
local function hydrate_patterns()
     local out_patterns = {}
     local out_patterns = {}
     for _, p_data in ipairs(mw.loadData("Module:auto cat/data")) do
     for _, p_data in ipairs(d_cats) do
         local p_template, p_categories = p_data[1], p_data[2]
         local p_template, p_categories = p_data[1], p_data[2]
         local p_lua = replace(sanitize(p_template), {["%%s"] = "(..-)"})
         local p_lua = replace(sanitize(p_template), {["%%s"] = "(..-)"})