Module:User:JohnC5/RigVedaTool

local export = {} local lang = require("Module:languages").getByCode("sa") local m_scripts = require("Module:scripts") local U = mw.ustring.char local match = mw.ustring.match local gsub = mw.ustring.gsub

local acute = U(0x301) local acute_tone = U(0x341)

function export.reformat(frame) local text = frame.args[1] local out = {} for i, line in ipairs(mw.text.split(text, "\n")) do		if match(line, "^[0-9]") then local num = {} for _, n in ipairs(mw.text.split(match(line, "^([0-9%.]*)"), "%.")) do				num[#num + 1] = tonumber(n) end table.insert(out, " " .. table.concat(num, ".") .. "  ") elseif match(line, "Transcription") or match(line, "Devanagari") then -- drop line else line = gsub(mw.ustring.toNFD(line), acute_tone, acute) table.insert(out, line) end end return table.concat(out, " ") end

return export