diff options
author | Robert Alessi <alessi@robertalessi.net> | 2016-06-30 19:19:53 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2016-06-30 19:19:53 +0200 |
commit | 901646a7dc08022c61ca4180302ac58296ec5443 (patch) | |
tree | 446ff0996613aed22b8f4a23cb82d74791441a67 /arabluatex.lua | |
parent | 26bfc21e198b13bfe18ae1d39e02090769e4719b (diff) | |
download | arabluatex-901646a7dc08022c61ca4180302ac58296ec5443.tar.gz |
started implementing Buckwalter input scheme
Diffstat (limited to 'arabluatex.lua')
-rw-r--r-- | arabluatex.lua | 16 |
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) | |||
456 | return str | 456 | return str |
457 | end | 457 | end |
458 | 458 | ||
459 | function processvoc(str, rules) | 459 | local 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) | ||
467 | return str | ||
468 | end | ||
469 | |||
470 | function 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 |