Module:Rare IA terms

local export = {}

local function trim(s) return s:match "^%s*(.-)%s*$" end

local function googles(x) local y = "%22" .. mw.uri.encode(x) .. "%22"	return "[//google.com/search?q=" .. y .. " Google] ([//google.com/search?tbm=bks&q=" .. y .. " Books] • [//groups.google.com/groups?sitesearch=groups.google.com&amp;q=" .. y .." Groups] • [//scholar.google.com/scholar?q=" .. y .. " Scholar])" end

function export.main(frame) data = mw.text.split(trim(frame.args[1]), "\n") local wikitext = "{| class='wikitable sortable'\n|-\n!Term!!Number!!Links\n" for i, j in ipairs(data) do		x, y = trim(j):match("^(.+) (%d+)$") local s = x:find(" ") x = x:gsub("<%/?s>", "") local link = "" .. x .. "" if s then link = " " .. x .. " " end wikitext = wikitext .. "|-\n| " .. link .. "||" .. y .. "|| class='plainlinks' | [https://archive.org/search.php?query=%22" .. mw.uri.encode(x) .. "%22&sin=TXT IA] • " .. googles(x) .. "\n" end return wikitext .. "|}" end

return export