ויקעברית wikivrit Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Recent Blog Posts
Wiki Content
Recently Changed Pages
Pesudo
Pesudo/Alphabet
ויקעברית
חלופון
Pesudo/Gizron
ויקעברית wikivrit Wiki
Pesudo/Months
איך אומרים
ויקעברית wikivrit Wiki
השם ישמור
טוב
אבולוציה
אבסטרקט
אג'נדה
אדמיניסטרטור
דפים עם קישורים שבורים לקבצים
Pesudo/Alphabet
בעבודה
תיבה
תיבה/תיעוד
הומור בתרבות היהודית
Community
עזרה
FANDOM
Games
Movies
TV
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
ויקעברית wikivrit Wiki
47
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Recent Blog Posts
Wiki Content
Recently Changed Pages
Pesudo
Pesudo/Alphabet
ויקעברית
חלופון
Pesudo/Gizron
ויקעברית wikivrit Wiki
Pesudo/Months
איך אומרים
ויקעברית wikivrit Wiki
השם ישמור
טוב
אבולוציה
אבסטרקט
אג'נדה
אדמיניסטרטור
דפים עם קישורים שבורים לקבצים
Pesudo/Alphabet
בעבודה
תיבה
תיבה/תיעוד
הומור בתרבות היהודית
Community
עזרה
עריכת הדף "
יחידה:ספרי קודש
"
Back to page
עריכת קוד מקור
גרסאות קודמות
Talk (0)
Edit Page
יחידה:ספרי קודש
אזהרה:
אינכם מחוברים לחשבון. כתובת ה־IP שלכם תוצג בפומבי אם תבצעו עריכות כלשהן. אם
תיכנסו לחשבון
או
תיצרו חשבון
, העריכות שלכם תיוחסנה לשם המשתמש שלכם ותקבלו גם יתרונות אחרים.
בדיקת אנטי־ספאם.
אין
למלא שדה זה!
function main(f) frame = f if mw.title.getCurrentTitle()["namespace"] == 3 -- no user conversation namespace then return end local input = require("יחידה:ספרי קודש/" .. frame.args["type"]) names = input[1] renames = input[2] data = input[3] syntax = input[4] numbered = input[5] checkparam = input[6] suggestions = input[7] morechecks = input[8] getnumbers = input[9] c = "[[קטגוריה: שגיאות קריאה לתבניות ספרי קודש]] " if mw.title.getCurrentTitle()["namespace"] == 2 or mw.title.getCurrentTitle()["namespace"] % 2 == 1 -- user or conversation namespace then c = "[[קטגוריה: שגיאות קריאה לתבניות ספרי קודש|*]] " end c = c .. " (בקריאה ל[[תבנית:" .. frame.args["type"] .. "]]) " fpar = frame.args["par"] or "" fpar1 = frame.args["par1"] or "" if frame.args["book"] == nil or frame.args["book"] == "" then aserror("חסר שם ה" .. syntax["book"]) end if frame.args["chapter"] == nil or frame.args["chapter"] == "" then aserror("חסר מספר " .. syntax["chapter"]) end local book = checkbook(frame.args["book"]) local bookdata = data[book] if find1(frame.args["chapter"] .. fpar .. fpar1, '"') > 0 or find1(frame.args["chapter"] .. fpar .. fpar1, "'") > 0 then aserror("יש להוריד את כל סימני ' " .. 'או " מתוך הפרמטרים') end if find1(frame.args["chapter"], '-') > 0 then aserror("יש לציין מספר " .. syntax["chapter"] .. " אחד בלבד, ניתן להפריד באמצעות |") end if find1(fpar .. fpar1, '-') > 0 then aserror("יש לציין מספר ".. syntax["par"] .. " אחד בלבד בכל פרמטר, ניתן להפריד באמצעות |") end local chapter = checknum(frame.args["chapter"]) local par, par1 if fpar == "" then par = 1 elseif getnumbers and tonumber(fpar) then par = tonumber(fpar) else par = checknum(fpar) end if fpar1 == "" then par1 = 2 elseif getnumbers and tonumber(fpar1) then par1 = tonumber(fpar1) else par1 = checknum(fpar1) end if chapter > #bookdata then aserror("אין " .. syntax["chapter"] .. " " .. frame.args["chapter"] .. " ב" .. syntax["book"] .. " " .. bookname) end if par > bookdata[chapter] and fpar ~= "" and frame.args["par"] ~= nil then aserror("אין " .. syntax["par"] .. " " .. fpar .. " ב" .. syntax["chapter"] .. " " .. frame.args["chapter"] .. " ב" .. syntax["book"] .. " " .. bookname) end if par1 > bookdata[chapter] and fpar1 ~= "" then aserror("אין " .. syntax["par"] .. " " .. fpar1 .. " ב" .. syntax["chapter"] .. " " .. frame.args["chapter"] .. " ב" .. syntax["book"] .. " " .. bookname) end if par1 == par and fpar1 ~= "" then aserror("שני הפרמטרים המציינים אותו מספר " .. syntax["par"]) end if par1 < par and fpar1 ~= "" then aserror("יש לשים את ה" .. syntax["pars"] .. " בסדר עולה") end if fpar == "" and fpar1 ~= "" then aserror("אין לציין " .. syntax["par"] .. " סיום ללא " .. syntax["par"] .. " התחלה") end local pframe = frame:getParent() if pframe ~= nil then if pframe.args[tostring(numbered + 1)] ~= nil then aserror("יש להעביר לכל היותר " .. numbered .. " פרמטרים") end for p, pp in pairs(pframe.args) do if not checkparam(p) then aserror('נמצא פרמטר לא בשימוש "' .. p .. '="') end end end if morechecks ~= nil then morechecks({book = bookname, chapter = chapter, fpar = fpar}) end end function checknum(hnum) if toheb(fromheb(hnum)) == hnum then return fromheb(hnum) end aserror("מספר עברי " .. hnum .. " לא מוכר") end function fromheb(num) local ans = 0 local str = num while len1(str) > 0 do if mw.ustring.byte(sub1(str, 1, 1)) == 226 then aserror("יש להקליד את כל התבנית מחדש") end if numberstable[sub1(str, 1, 1)] == nil then if sub1(str, 1, 1) == " " then aserror("רווח מיותר בתוך פרמטר " .. sub1(str, 1, 1)) else aserror("אות עברית לא ידועה " .. sub1(str, 1, 1)) end end --mw.ustring.byte(sub1(str, 1, 1)).." ".. mw.ustring.byte("ב")) ans = ans + numberstable[sub1(str, 1, 1)] str = sub1(str, 2, len1(str)) end return ans end function toheb(num) if num > 799 then aserror("המספר " .. num .. " גדול מדי") end local third = num % 10 local second = (((num - third) / 10) % 10) * 10 local first = num - third - second local firstdigit = tohebdigit(first) local seconddigit = tohebdigit(second) local thirddigit = tohebdigit(third) if second == 10 and third == 5 then seconddigit = "ט" thirddigit = "ו" end if second == 10 and third == 6 then seconddigit = "ט" thirddigit = "ז" end return firstdigit .. seconddigit .. thirddigit end function sub1(str, from, to) return mw.ustring.sub(str, from, to) end function find1(str, what, where) return mw.ustring.find(str, what, where, true) or 0 end function len1(s) if (s == nil) then return 0 end return mw.ustring.len(s) end numberstable = { ["א"] = 1, ["ב"] = 2, ["ג"] = 3, ["ד"] = 4, ["ה"] = 5, ["ו"] = 6, ["ז"] = 7, ["ח"] = 8, ["ט"] = 9, ["י"] = 10, ["כ"] = 20, ["ל"] = 30, ["מ"] = 40, ["נ"] = 50, ["ס"] = 60, ["ע"] = 70, ["פ"] = 80, ["צ"] = 90, ["ק"] = 100, ["ר"] = 200, ["ש"] = 300, ["ת"] = 400, ["תק"] = 500, ["תר"] = 600, ["תש"] = 700, ["תת"] = 800} function tohebdigit(digit) if digit == 0 then return "" end for d, dd in pairs(numberstable) do if digit == dd then return d end end aserror("ספרה" .. digit .. "לא נמצאה") end function checkbook(book) bookname = book local ans = 0 local str = book while len1(str) > 0 do if mw.ustring.byte(sub1(str, 1, 1)) == 226 then aserror("יש להקליד את כל התבנית מחדש") end str = sub1(str, 2, len1(str)) end for r, rr in pairs(renames) do if r == book then book = rr end end for n, nn in pairs(names) do if nn == book then return n end end if 1 == find1(book, syntax["book"] .. " ") then aserror('יש להשמיט את מילה "' .. syntax["book"] .. '" מתוך הפרמטר') end if suggestions[book] ~= nil then aserror("אין " .. syntax["book"] .. " " .. bookname .. ", האם הכוונה היא ל" .. suggestions[book] .. "?") end aserror("אין " .. syntax["book"] .. " " .. book) end function aserror(message) error(c .. message, 0) end return {main = main}
תקציר:
Please note that all contributions to the ויקעברית wikivrit Wiki are considered to be released under the CC-BY-SA
ביטול
עזרה בעריכה
(נפתח בחלון חדש)
Follow on IG
TikTok
Join Fan Lab