diff options
Diffstat (limited to 'arabluatex.lua')
-rw-r--r-- | arabluatex.lua | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arabluatex.lua b/arabluatex.lua index 35dccff..956f796 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -241,7 +241,7 @@ local function fullvoc(str) | |||
241 | return str | 241 | return str |
242 | end | 242 | end |
243 | 243 | ||
244 | local function fullvoceasy(str) | 244 | local function fullvoceasy(str, opt) |
245 | str = string.gsub(str, "\\arb(%b{})", function(inside) | 245 | str = string.gsub(str, "\\arb(%b{})", function(inside) |
246 | inside = string.sub(inside, 2, -2) | 246 | inside = string.sub(inside, 2, -2) |
247 | for i = 1,#hamzafveasy do | 247 | for i = 1,#hamzafveasy do |
@@ -253,8 +253,14 @@ local function fullvoceasy(str) | |||
253 | for i = 1,#trigraphsfveasy do | 253 | for i = 1,#trigraphsfveasy do |
254 | inside = string.gsub(inside, trigraphsfveasy[i].a, trigraphsfveasy[i].b) | 254 | inside = string.gsub(inside, trigraphsfveasy[i].a, trigraphsfveasy[i].b) |
255 | end | 255 | end |
256 | for i = 1,#digraphsfveasy do | 256 | if opt == "nosukun" then |
257 | inside = string.gsub(inside, digraphsfveasy[i].a, digraphsfveasy[i].b) | 257 | for i = 1,#digraphsfveasy do |
258 | inside = string.gsub(inside, digraphsfveasy[i].a, digraphsfveasy[i].b) | ||
259 | end | ||
260 | else | ||
261 | for i = 1,#digraphsfv do | ||
262 | inside = string.gsub(inside, digraphsfv[i].a, digraphsfv[i].b) | ||
263 | end | ||
258 | end | 264 | end |
259 | for i = 1,#singlefveasy do | 265 | for i = 1,#singlefveasy do |
260 | inside = string.gsub(inside, singlefveasy[i].a, singlefveasy[i].b) | 266 | inside = string.gsub(inside, singlefveasy[i].a, singlefveasy[i].b) |
@@ -477,7 +483,7 @@ function processvoc(str, rules, scheme) | |||
477 | if scheme == "buckwalter" then | 483 | if scheme == "buckwalter" then |
478 | str = processbuckw(str) | 484 | str = processbuckw(str) |
479 | else end | 485 | else end |
480 | if rules == "easy" then | 486 | if rules == "easy" or rules == "easynosukun" then |
481 | str = voceasy(str) | 487 | str = voceasy(str) |
482 | elseif rules == "dflt" then | 488 | elseif rules == "dflt" then |
483 | str = voc(str) | 489 | str = voc(str) |
@@ -496,7 +502,9 @@ function processfullvoc(str, rules, scheme) | |||
496 | str = processbuckw(str) | 502 | str = processbuckw(str) |
497 | else end | 503 | else end |
498 | if rules == "easy" then | 504 | if rules == "easy" then |
499 | str = fullvoceasy(str) | 505 | str = fullvoceasy(str, "sukun") |
506 | elseif rules == "easynosukun" then | ||
507 | str = fullvoceasy(str, "nosukun") | ||
500 | elseif rules == "dflt" then | 508 | elseif rules == "dflt" then |
501 | str = fullvoc(str) | 509 | str = fullvoc(str) |
502 | else end | 510 | else end |
@@ -513,7 +521,7 @@ function processnovoc(str, rules, scheme) | |||
513 | if scheme == "buckwalter" then | 521 | if scheme == "buckwalter" then |
514 | str = processbuckw(str) | 522 | str = processbuckw(str) |
515 | else end | 523 | else end |
516 | if rules == "easy" then | 524 | if rules == "easy" or rules == "easynosukun" then |
517 | str = novoceasy(str) | 525 | str = novoceasy(str) |
518 | elseif rules == "dflt" then | 526 | elseif rules == "dflt" then |
519 | str = novoc(str) | 527 | str = novoc(str) |
@@ -532,7 +540,7 @@ function processtrans(str, mode, rules, scheme) | |||
532 | str = processbuckw(str) | 540 | str = processbuckw(str) |
533 | else end | 541 | else end |
534 | if mode == "dmg" then | 542 | if mode == "dmg" then |
535 | if rules == "easy" then | 543 | if rules == "easy" or rules == "easynosukun" then |
536 | str = transdmgeasy(str) | 544 | str = transdmgeasy(str) |
537 | elseif rules == "dflt" then | 545 | elseif rules == "dflt" then |
538 | str = transdmg(str) | 546 | str = transdmg(str) |