aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.lua
diff options
context:
space:
mode:
Diffstat (limited to 'arabluatex.lua')
-rw-r--r--arabluatex.lua44
1 files changed, 42 insertions, 2 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index eb0d55c..3b0ed5e 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -312,6 +312,42 @@ local function novoc(str)
312return str 312return str
313end 313end
314 314
315local function novoceasy(str)
316 str = string.gsub(str, "\\arb(%b{})", function(inside)
317 inside = string.sub(inside, 2, -2)
318 for i = 1,#hamzaeasy do
319 inside = string.gsub(inside, hamzaeasy[i].a, hamzaeasy[i].b)
320 end
321 for i = 1,#tanwinnv do
322 inside = string.gsub(inside, tanwinnv[i].a, tanwinnv[i].b)
323 end
324 for i = 1,#trigraphsnv do
325 inside = string.gsub(inside, trigraphsnv[i].a, trigraphsnv[i].b)
326 end
327 for i = 1,#digraphs do
328 inside = string.gsub(inside, digraphs[i].a, digraphs[i].b)
329 end
330 for i = 1,#single do
331 inside = string.gsub(inside, single[i].a, single[i].b)
332 end
333 for i = 1,#longvnv do
334 inside = string.gsub(inside, longvnv[i].a, longvnv[i].b)
335 end
336 for i = 1,#shortvnv do
337 inside = string.gsub(inside, shortvnv[i].a, shortvnv[i].b)
338 end
339 for i = 1,#punctuation do
340 inside = string.gsub(inside, punctuation[i].a, punctuation[i].b)
341 end
342 for i = 1,#null do
343 inside = string.gsub(inside, null[i].a, null[i].b)
344 end
345 inside = indnum(inside)
346 return string.format("\\txarb{%s}", inside)
347 end)
348return str
349end
350
315local function transdmg(str) 351local function transdmg(str)
316 str = string.gsub(str, "\\arb(%b{})", function(inside) 352 str = string.gsub(str, "\\arb(%b{})", function(inside)
317 inside = string.sub(inside, 2, -2) 353 inside = string.sub(inside, 2, -2)
@@ -450,13 +486,17 @@ function processfullvoc(str, rules)
450return str 486return str
451end 487end
452 488
453function processnovoc(str) 489function processnovoc(str, rules)
454 str = "\\arb{".. str.."}" 490 str = "\\arb{".. str.."}"
455 str = takeoutcapetc(str) 491 str = takeoutcapetc(str)
456 str = protectarb(str) 492 str = protectarb(str)
457 str = breakcmd(str) 493 str = breakcmd(str)
458 str = holdcmd(str) 494 str = holdcmd(str)
459 str = novoc(str) 495 if rules == "easy" then
496 str = novoceasy(str)
497 elseif rules == "dflt" then
498 str = novoc(str)
499 else end
460 str = unprotectarb(str) 500 str = unprotectarb(str)
461return str 501return str
462end 502end