aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.lua
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2016-06-30 19:19:53 +0200
committerRobert Alessi <alessi@robertalessi.net>2016-06-30 19:19:53 +0200
commit901646a7dc08022c61ca4180302ac58296ec5443 (patch)
tree446ff0996613aed22b8f4a23cb82d74791441a67 /arabluatex.lua
parent26bfc21e198b13bfe18ae1d39e02090769e4719b (diff)
downloadarabluatex-901646a7dc08022c61ca4180302ac58296ec5443.tar.gz
started implementing Buckwalter input scheme
Diffstat (limited to 'arabluatex.lua')
-rw-r--r--arabluatex.lua16
1 files changed, 15 insertions, 1 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 3e574cf..9134ce5 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -456,12 +456,26 @@ local function transloc(str)
456return str 456return str
457end 457end
458 458
459function processvoc(str, rules) 459local function processbuckw(str)
460 str = string.gsub(str, "\\arb(%b{})", function(inside)
461 inside = string.sub(inside, 2, -2)
462 for i = 1,#buckwalter do
463 inside = string.gsub(inside, buckwalter[i].a, buckwalter[i].b)
464 end
465 return string.format("\\arb{%s}", inside)
466 end)
467return str
468end
469
470function processvoc(str, rules, scheme)
460 str = "\\arb{".. str.."}" 471 str = "\\arb{".. str.."}"
461 str = takeoutcapetc(str) 472 str = takeoutcapetc(str)
462 str = protectarb(str) 473 str = protectarb(str)
463 str = breakcmd(str) 474 str = breakcmd(str)
464 str = holdcmd(str) 475 str = holdcmd(str)
476 if scheme == "buckwalter" then
477 str = processbuckw(str)
478 else end
465 if rules == "easy" then 479 if rules == "easy" then
466 str = voceasy(str) 480 str = voceasy(str)
467 elseif rules == "dflt" then 481 elseif rules == "dflt" then