Module:he-roots-missing

local p = {}

local CEDHL = require("Module:R:CEDHL") local HWSS = require("Module:R:he:HWSSRoot") local utilities = require("Module:he-utilities") local missing_roots = require("Module:he-roots-missing/data")

local function min(a, b)	if a <= b then return a	else return b	end end

function p.row(root) local root_no_dashes = root:gsub("־", "") local root_shin = root:gsub("שׁ" ,"ש"):gsub("שׂ", "ש") local root_shin_no_dashes = root_no_dashes:gsub("שׁ" ,"ש"):gsub("שׂ", "ש") local root_romanized = utilities.romanized_root({args={root_no_dashes}}) local r = " "

-- Root r = r		.. " "		.. root		.. " ("		.. root_romanized		.. ") "

-- Category local cat = "Hebrew terms belonging to the root " .. root local size = mw.getCurrentFrame:preprocess("") r = r		.. " "		.. size		.. " entries "

-- HTD local HTD_root = root:gsub("ה$", "י") local HTD_root_no_dashes = root_no_dashes:gsub("ה$", "י") local HTD_root_romanized = root_romanized:gsub("h$", "y") r = r		.. " " .. "[https://terms.hebrew-academy.org.il/Home/Advanced?SearchBy=2&SearchType=3&SearchString=" .. HTD_root_no_dashes .. " "			.. HTD_root .. "] "

local altform = "" if HTD_root ~= root then altform = mw.uri.encode("\n===Alternative forms===\n* \n") end -- Pealim r = r .. " "	local length = mw.ustring.len(root_shin_no_dashes) if length 4 then r = r .. "—"	else r = r .. "[ " .. root .. "]"	end r = r .. " "

-- CEDHL local CEDHL_page = CEDHL.page_number({args={root_no_dashes}}) r = r		.. " " .. "[https://www.sefaria.org/search?q=" .. root_no_dashes .. "&tpathFilters=Reference%2FDictionary%2FKlein%20Dictionary " .. root_no_dashes .. "] (?) "		.. "[https://archive.org/details/AComprehensiveEtymologicalDictionaryOfTheHebrewLanguageErnestKlein1987OCR/page/n" .. (15+CEDHL_page) .. " page " .. CEDHL_page .. "] (?)"		.. " "

-- HWSS local HWSS_root = HWSS.hebrew_to_normalized_latin(root_no_dashes) local HWSS_page = HWSS.page_number({args={root_no_dashes}}) r = r		.. " " .. HWSS_root .. " (?) "		.. "[https://archive.org/details/murtonen-hebrew-in-its-west-semitic-setting-part-i-1989/page/" .. HWSS_page .. " page " .. HWSS_page .. "] (?)"		.. " "

r = r		.. " [https://en.wiktionary.org/?action=edit&preload=Template:he-root-preload&title=" .. root_shin .. "&preloadparams%5b%5d=" -- $1 .. root .. "&preloadparams%5b%5d=" -- $2 .. root_romanized .. "&preloadparams%5b%5d=" -- $3 .. HTD_root .. "&preloadparams%5b%5d=" -- $4 .. root_no_dashes .. "&preloadparams%5b%5d=" -- $5 .. CEDHL_page .. "&preloadparams%5b%5d=&preloadparams%5b%5d=" -- $7 .. HWSS_page .. "&preloadparams%5b%5d=" -- $8 .. altform .. " preload]" .. " "

r = r .. " "	return r end

function p.table(frame) local pagination = frame.args[1] local output = "" local i = 250*(pagination-1) + 1 while i <= min(250*pagination, #missing_roots) do output = output .. p.row(missing_roots[i]) i = i + 1 end return frame:preprocess(output) end

return p