diff options
author | Robert Alessi <alessi@robertalessi.net> | 2016-11-30 17:32:18 +0100 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2016-12-01 10:44:10 +0100 |
commit | 07ec135217f9cf9c2cf4117ec5a6d65b8e1a4236 (patch) | |
tree | 506d8553ff6e77964f9341f2898f59be185d5c9f | |
parent | ce7f9bd4560092f3dfcd1716443bbbfafe1dae6c (diff) | |
download | arabluatex-07ec135217f9cf9c2cf4117ec5a6d65b8e1a4236.tar.gz |
new option \SetArbDflt* for applying the assimilation rules for these are not applied by default anymore
-rw-r--r-- | arabluatex.dtx | 13 | ||||
-rw-r--r-- | arabluatex.lua | 108 | ||||
-rw-r--r-- | arabluatex_fullvoc.lua | 119 | ||||
-rw-r--r-- | arabluatex_trans.lua | 60 | ||||
-rw-r--r-- | arabluatex_voc.lua | 9 |
5 files changed, 183 insertions, 126 deletions
diff --git a/arabluatex.dtx b/arabluatex.dtx index 0c5d2a1..4bd9057 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx | |||
@@ -2751,17 +2751,28 @@ wa-ya.sIru ta.hta 'l-jild-i | |||
2751 | % \arb[trans]{sukUn} that is generated, while the starred version | 2751 | % \arb[trans]{sukUn} that is generated, while the starred version |
2752 | % \cs{SetArbEasy*} takes it away. Default complex rules can be set | 2752 | % \cs{SetArbEasy*} takes it away. Default complex rules can be set |
2753 | % back at any point of the document with \cs{SetArbDflt}. | 2753 | % back at any point of the document with \cs{SetArbDflt}. |
2754 | % \begin{macro}{\SetArbDflt*} | ||
2755 | % \changes{v1.6}{2016/11/30}{This starred version applies the | ||
2756 | % assimilation rules (\arb[trans]{al-'id.gAm}) in addition to what | ||
2757 | % \cs{SetArbDflt} already does.} As of v1.6, \package{arabluatex} | ||
2758 | % does not applies any more the assimilation rules that are laid on | ||
2759 | % \vref{ref:assimilation}; a new starred version \cs{SetArbDflt*} is | ||
2760 | % now available to the user should he wish to apply them. | ||
2754 | % \begin{macrocode} | 2761 | % \begin{macrocode} |
2755 | \def\al@arb@rules{dflt} | 2762 | \def\al@arb@rules{dflt} |
2756 | \NewDocumentCommand{\SetArbEasy}{s}{% | 2763 | \NewDocumentCommand{\SetArbEasy}{s}{% |
2757 | \IfBooleanTF{#1} | 2764 | \IfBooleanTF{#1} |
2758 | {\def\al@arb@rules{easynosukun}} | 2765 | {\def\al@arb@rules{easynosukun}} |
2759 | {\def\al@arb@rules{easy}}} | 2766 | {\def\al@arb@rules{easy}}} |
2760 | \NewDocumentCommand{\SetArbDflt}{}{\def\al@arb@rules{dflt}} | 2767 | \NewDocumentCommand{\SetArbDflt}{s}{% |
2768 | \IfBooleanTF{#1} | ||
2769 | {\def\al@arb@rules{idgham}} | ||
2770 | {\def\al@arb@rules{dflt}}} | ||
2761 | % \end{macrocode} | 2771 | % \end{macrocode} |
2762 | % \end{macro} | 2772 | % \end{macro} |
2763 | % \end{macro} | 2773 | % \end{macro} |
2764 | % \end{macro} | 2774 | % \end{macro} |
2775 | % \end{macro} | ||
2765 | % \begin{macro}{\SetTranslitFont} | 2776 | % \begin{macro}{\SetTranslitFont} |
2766 | % \changes{v1.4}{2016/07/05}{For selecting a specific font for | 2777 | % \changes{v1.4}{2016/07/05}{For selecting a specific font for |
2767 | % transliterated texts} By default, the font that is used for | 2778 | % transliterated texts} By default, the font that is used for |
diff --git a/arabluatex.lua b/arabluatex.lua index 38fe87b..07968c0 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -146,18 +146,29 @@ local function takeoutcapetc(str) | |||
146 | return str | 146 | return str |
147 | end | 147 | end |
148 | 148 | ||
149 | local function voc(str) | 149 | local function voc(str, rules) |
150 | str = string.gsub(str, "\\arb(%b{})", function(inside) | 150 | str = string.gsub(str, "\\arb(%b{})", function(inside) |
151 | inside = string.sub(inside, 2, -2) | 151 | inside = string.sub(inside, 2, -2) |
152 | for i = 1,#hamza do | 152 | for i = 1,#hamza do |
153 | inside = string.gsub(inside, hamza[i].a, hamza[i].b) | 153 | inside = string.gsub(inside, hamza[i].a, hamza[i].b) |
154 | end | 154 | end |
155 | for i = 1,#tanwin do | 155 | if rules == "idgham" then |
156 | inside = string.gsub(inside, tanwin[i].a, tanwin[i].b) | 156 | for i = 1,#tanwin do |
157 | inside = string.gsub(inside, tanwin[i].a, tanwin[i].b) | ||
158 | end | ||
159 | else | ||
160 | for i = 1,#tanwineasy do | ||
161 | inside = string.gsub(inside, tanwineasy[i].a, tanwineasy[i].b) | ||
162 | end | ||
157 | end | 163 | end |
158 | for i = 1,#trigraphs do | 164 | for i = 1,#trigraphs do |
159 | inside = string.gsub(inside, trigraphs[i].a, trigraphs[i].b) | 165 | inside = string.gsub(inside, trigraphs[i].a, trigraphs[i].b) |
160 | end | 166 | end |
167 | if rules == "idgham" then | ||
168 | for i = 1,#idgham do | ||
169 | inside = string.gsub(inside, idgham[i].a, idgham[i].b) | ||
170 | end | ||
171 | end | ||
161 | for i = 1,#digraphs do | 172 | for i = 1,#digraphs do |
162 | inside = string.gsub(inside, digraphs[i].a, digraphs[i].b) | 173 | inside = string.gsub(inside, digraphs[i].a, digraphs[i].b) |
163 | end | 174 | end |
@@ -218,20 +229,37 @@ local function voceasy(str) | |||
218 | return str | 229 | return str |
219 | end | 230 | end |
220 | 231 | ||
221 | local function fullvoc(str) | 232 | local function fullvoc(str, rules) |
222 | str = string.gsub(str, "\\arb(%b{})", function(inside) | 233 | str = string.gsub(str, "\\arb(%b{})", function(inside) |
223 | inside = string.sub(inside, 2, -2) | 234 | inside = string.sub(inside, 2, -2) |
224 | for i = 1,#hamzafv do | 235 | for i = 1,#hamzafv do |
225 | inside = string.gsub(inside, hamzafv[i].a, hamzafv[i].b) | 236 | inside = string.gsub(inside, hamzafv[i].a, hamzafv[i].b) |
226 | end | 237 | end |
227 | for i = 1,#tanwinfv do | 238 | if rules == "idgham" then |
228 | inside = string.gsub(inside, tanwinfv[i].a, tanwinfv[i].b) | 239 | for i = 1,#tanwinfv do |
240 | inside = string.gsub(inside, tanwinfv[i].a, tanwinfv[i].b) | ||
241 | end | ||
242 | else | ||
243 | for i = 1,#tanwinfveasy do | ||
244 | inside = string.gsub(inside, tanwinfveasy[i].a, tanwinfveasy[i].b) | ||
245 | end | ||
229 | end | 246 | end |
230 | for i = 1,#trigraphsfv do | 247 | for i = 1,#trigraphsfv do |
231 | inside = string.gsub(inside, trigraphsfv[i].a, trigraphsfv[i].b) | 248 | inside = string.gsub(inside, trigraphsfv[i].a, trigraphsfv[i].b) |
232 | end | 249 | end |
233 | for i = 1,#digraphsfv do | 250 | if rules == "idgham" then |
234 | inside = string.gsub(inside, digraphsfv[i].a, digraphsfv[i].b) | 251 | for i = 1,#idgham do |
252 | inside = string.gsub(inside, idgham[i].a, idgham[i].b) | ||
253 | end | ||
254 | end | ||
255 | if rules == "idgham" then | ||
256 | for i = 1,#digraphsfvidgham do | ||
257 | inside = string.gsub(inside, digraphsfvidgham[i].a, digraphsfvidgham[i].b) | ||
258 | end | ||
259 | else | ||
260 | for i = 1,#digraphsfv do | ||
261 | inside = string.gsub(inside, digraphsfv[i].a, digraphsfv[i].b) | ||
262 | end | ||
235 | end | 263 | end |
236 | for i = 1,#singlefv do | 264 | for i = 1,#singlefv do |
237 | inside = string.gsub(inside, singlefv[i].a, singlefv[i].b) | 265 | inside = string.gsub(inside, singlefv[i].a, singlefv[i].b) |
@@ -254,7 +282,7 @@ local function fullvoc(str) | |||
254 | return str | 282 | return str |
255 | end | 283 | end |
256 | 284 | ||
257 | local function fullvoceasy(str, opt) | 285 | local function fullvoceasy(str, rules) |
258 | str = string.gsub(str, "\\arb(%b{})", function(inside) | 286 | str = string.gsub(str, "\\arb(%b{})", function(inside) |
259 | inside = string.sub(inside, 2, -2) | 287 | inside = string.sub(inside, 2, -2) |
260 | for i = 1,#hamzafveasy do | 288 | for i = 1,#hamzafveasy do |
@@ -266,7 +294,7 @@ local function fullvoceasy(str, opt) | |||
266 | for i = 1,#trigraphsfveasy do | 294 | for i = 1,#trigraphsfveasy do |
267 | inside = string.gsub(inside, trigraphsfveasy[i].a, trigraphsfveasy[i].b) | 295 | inside = string.gsub(inside, trigraphsfveasy[i].a, trigraphsfveasy[i].b) |
268 | end | 296 | end |
269 | if opt == "nosukun" then | 297 | if rules == "nosukun" then |
270 | for i = 1,#digraphsfveasy do | 298 | for i = 1,#digraphsfveasy do |
271 | inside = string.gsub(inside, digraphsfveasy[i].a, digraphsfveasy[i].b) | 299 | inside = string.gsub(inside, digraphsfveasy[i].a, digraphsfveasy[i].b) |
272 | end | 300 | end |
@@ -368,7 +396,7 @@ local function novoceasy(str) | |||
368 | return str | 396 | return str |
369 | end | 397 | end |
370 | 398 | ||
371 | local function transdmg(str) | 399 | local function transdmg(str, rules) |
372 | str = string.gsub(str, "\\arb(%b{})", function(inside) | 400 | str = string.gsub(str, "\\arb(%b{})", function(inside) |
373 | inside = string.sub(inside, 2, -2) | 401 | inside = string.sub(inside, 2, -2) |
374 | for i = 1,#hamzatrdmg do | 402 | for i = 1,#hamzatrdmg do |
@@ -380,40 +408,10 @@ local function transdmg(str) | |||
380 | for i = 1,#trigraphstrdmg do | 408 | for i = 1,#trigraphstrdmg do |
381 | inside = string.gsub(inside, trigraphstrdmg[i].a, trigraphstrdmg[i].b) | 409 | inside = string.gsub(inside, trigraphstrdmg[i].a, trigraphstrdmg[i].b) |
382 | end | 410 | end |
383 | for i = 1,#digraphstrdmg do | 411 | if rules == "idgham" then |
384 | inside = string.gsub(inside, digraphstrdmg[i].a, digraphstrdmg[i].b) | 412 | for i = 1,#idghamtrdmg do |
385 | end | 413 | inside = string.gsub(inside, idghamtrdmg[i].a, idghamtrdmg[i].b) |
386 | for i = 1,#singletrdmg do | 414 | end |
387 | inside = string.gsub(inside, singletrdmg[i].a, singletrdmg[i].b) | ||
388 | end | ||
389 | for i = 1,#longvtrdmg do | ||
390 | inside = string.gsub(inside, longvtrdmg[i].a, longvtrdmg[i].b) | ||
391 | end | ||
392 | for i = 1,#shortvtrdmg do | ||
393 | inside = string.gsub(inside, shortvtrdmg[i].a, shortvtrdmg[i].b) | ||
394 | end | ||
395 | for i = 1,#punctuationtr do | ||
396 | inside = string.gsub(inside, punctuationtr[i].a, punctuationtr[i].b) | ||
397 | end | ||
398 | for i = 1,#nulltr do | ||
399 | inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) | ||
400 | end | ||
401 | return string.format("\\txtrans{%s}", inside) | ||
402 | end) | ||
403 | return str | ||
404 | end | ||
405 | |||
406 | local function transdmgeasy(str) | ||
407 | str = string.gsub(str, "\\arb(%b{})", function(inside) | ||
408 | inside = string.sub(inside, 2, -2) | ||
409 | for i = 1,#hamzatrdmg do | ||
410 | inside = string.gsub(inside, hamzatrdmg[i].a, hamzatrdmg[i].b) | ||
411 | end | ||
412 | for i = 1,#tanwintrdmg do | ||
413 | inside = string.gsub(inside, tanwintrdmg[i].a, tanwintrdmg[i].b) | ||
414 | end | ||
415 | for i = 1,#trigraphstrdmgeasy do | ||
416 | inside = string.gsub(inside, trigraphstrdmgeasy[i].a, trigraphstrdmgeasy[i].b) | ||
417 | end | 415 | end |
418 | for i = 1,#digraphstrdmg do | 416 | for i = 1,#digraphstrdmg do |
419 | inside = string.gsub(inside, digraphstrdmg[i].a, digraphstrdmg[i].b) | 417 | inside = string.gsub(inside, digraphstrdmg[i].a, digraphstrdmg[i].b) |
@@ -498,8 +496,8 @@ function processvoc(str, rules, scheme) | |||
498 | else end | 496 | else end |
499 | if rules == "easy" or rules == "easynosukun" then | 497 | if rules == "easy" or rules == "easynosukun" then |
500 | str = voceasy(str) | 498 | str = voceasy(str) |
501 | elseif rules == "dflt" then | 499 | elseif rules == "dflt" or rules == "idgham" then |
502 | str = voc(str) | 500 | str = voc(str, rules) |
503 | else end | 501 | else end |
504 | str = unprotectarb(str) | 502 | str = unprotectarb(str) |
505 | return str | 503 | return str |
@@ -518,8 +516,8 @@ function processfullvoc(str, rules, scheme) | |||
518 | str = fullvoceasy(str, "sukun") | 516 | str = fullvoceasy(str, "sukun") |
519 | elseif rules == "easynosukun" then | 517 | elseif rules == "easynosukun" then |
520 | str = fullvoceasy(str, "nosukun") | 518 | str = fullvoceasy(str, "nosukun") |
521 | elseif rules == "dflt" then | 519 | elseif rules == "dflt" or rules == "idgham" then |
522 | str = fullvoc(str) | 520 | str = fullvoc(str, rules) |
523 | else end | 521 | else end |
524 | str = unprotectarb(str) | 522 | str = unprotectarb(str) |
525 | return str | 523 | return str |
@@ -536,7 +534,7 @@ function processnovoc(str, rules, scheme) | |||
536 | else end | 534 | else end |
537 | if rules == "easy" or rules == "easynosukun" then | 535 | if rules == "easy" or rules == "easynosukun" then |
538 | str = novoceasy(str) | 536 | str = novoceasy(str) |
539 | elseif rules == "dflt" then | 537 | elseif rules == "dflt" or rules == "idgham" then |
540 | str = novoc(str) | 538 | str = novoc(str) |
541 | else end | 539 | else end |
542 | str = unprotectarb(str) | 540 | str = unprotectarb(str) |
@@ -551,16 +549,12 @@ function processtrans(str, mode, rules, scheme) | |||
551 | str = holdcmd(str) | 549 | str = holdcmd(str) |
552 | if scheme == "buckwalter" then | 550 | if scheme == "buckwalter" then |
553 | str = processbuckw(str) | 551 | str = processbuckw(str) |
554 | else end | 552 | end |
555 | if mode == "dmg" then | 553 | if mode == "dmg" then |
556 | if rules == "easy" or rules == "easynosukun" then | 554 | str = transdmg(str, rules) |
557 | str = transdmgeasy(str) | ||
558 | elseif rules == "dflt" then | ||
559 | str = transdmg(str) | ||
560 | else end | ||
561 | elseif mode == "loc" then | 555 | elseif mode == "loc" then |
562 | str = transloc(str) | 556 | str = transloc(str) |
563 | else end | 557 | end |
564 | str = unprotectarb(str) | 558 | str = unprotectarb(str) |
565 | return str | 559 | return str |
566 | end | 560 | end |
diff --git a/arabluatex_fullvoc.lua b/arabluatex_fullvoc.lua index ff2ef35..898aecd 100644 --- a/arabluatex_fullvoc.lua +++ b/arabluatex_fullvoc.lua | |||
@@ -341,11 +341,12 @@ trigraphsfv = { -- trigraphs or more | |||
341 | -- words ending in -āT with silent wāw/yāʾ | 341 | -- words ending in -āT with silent wāw/yāʾ |
342 | {a="(_a)UA", b="%1وا"}, | 342 | {a="(_a)UA", b="%1وا"}, |
343 | {a="(_a)U", b="%1و"}, | 343 | {a="(_a)U", b="%1و"}, |
344 | {a="(_a)I", b="%1ي"}, | 344 | {a="(_a)I", b="%1ي"} |
345 | -- assimilations | ||
346 | {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} | ||
347 | } | 345 | } |
348 | 346 | ||
347 | -- idgham/assimilation rules for trigraphs apply here : see voc lua | ||
348 | -- file. | ||
349 | |||
349 | trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs) | 350 | trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs) |
350 | -- 'llatI / 'llad_I | 351 | -- 'llatI / 'llad_I |
351 | {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"}, | 352 | {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"}, |
@@ -397,12 +398,10 @@ trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs) | |||
397 | -- words ending in -āT with silent wāw/yāʾ | 398 | -- words ending in -āT with silent wāw/yāʾ |
398 | {a="(_a)UA", b="%1وا"}, | 399 | {a="(_a)UA", b="%1وا"}, |
399 | {a="(_a)U", b="%1و"}, | 400 | {a="(_a)U", b="%1و"}, |
400 | {a="(_a)I", b="%1ي"}, | 401 | {a="(_a)I", b="%1ي"} |
401 | -- assimilations | ||
402 | --easy {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} | ||
403 | } | 402 | } |
404 | 403 | ||
405 | digraphsfv = { | 404 | digraphsfvidgham = { |
406 | -- iʿrāb: straight double quote must be discarded | 405 | -- iʿrāb: straight double quote must be discarded |
407 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, | 406 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, |
408 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, | 407 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, |
@@ -504,6 +503,108 @@ digraphsfv = { | |||
504 | {a="%^d", b="ڊ"} | 503 | {a="%^d", b="ڊ"} |
505 | } | 504 | } |
506 | 505 | ||
506 | digraphsfv = { | ||
507 | -- iʿrāb: straight double quote must be discarded | ||
508 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, | ||
509 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, | ||
510 | {a="(%-)(\"?At[ui])(%p?%s)", b="%2%3"}, | ||
511 | {a="(%-)(\"?At[ui])(%p?)$", b="%2%3"}, | ||
512 | {a="(%-)(\"?Ani)(%p?%s)", b="%2%3"}, | ||
513 | {a="(%-)(\"?Ani)(%p?)$", b="%2%3"}, | ||
514 | {a="(%-)(\"?ayni)(%p?%s)", b="%2%3"}, | ||
515 | {a="(%-)(\"?ayni)(%p?)$", b="%2%3"}, | ||
516 | {a="(%-)(\"?[uai])(%p?%s)", b="%2%3"}, | ||
517 | {a="(%-)(\"?[uai])(%p?)$", b="%2%3"}, | ||
518 | -- ʾiʿrāb (end) | ||
519 | -- initial straight double quote gives a connective ʾalif | ||
520 | {a="^\"[uai]", b="ٱ"}, | ||
521 | {a="([%s%-])\"[uai]", b="%1ٱ"}, | ||
522 | -- diphthongs to be resolved before ʾalif conjunctionis | ||
523 | {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"}, | ||
524 | {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"}, | ||
525 | {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"}, | ||
526 | {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza | ||
527 | -- initial alif without hamza | ||
528 | {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"}, | ||
529 | {a="^([uai])", b="ا%1"}, -- initial alif without hamza | ||
530 | {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza | ||
531 | {a="%-%-", b="ـ"}, | ||
532 | {a="ؤؤ", b="ؤّ"}, | ||
533 | {a="أأ", b="أّ"}, | ||
534 | {a="ئئ", b="ئّ"}, | ||
535 | {a="bb", b="بّ"}, | ||
536 | {a="BB", b="ـّ"}, | ||
537 | {a="(%_)([thd])([thd])", b="%1%2|%3"}, | ||
538 | {a="tt", b="تّ"}, | ||
539 | {a="%_t%_t", b="ثّ"}, | ||
540 | {a="jj", b="جّ"}, | ||
541 | {a="%^g%^g", b="جّ"}, | ||
542 | {a="%.h%.h", b="حّ"}, | ||
543 | {a="xx", b="خّ"}, | ||
544 | {a="%_h%_h", b="خّ"}, | ||
545 | {a="dd", b="دّ"}, | ||
546 | {a="%_d%_d", b="ذّ"}, | ||
547 | {a="rr", b="رّ"}, | ||
548 | {a="zz", b="زّ"}, | ||
549 | {a="ss", b="سّ"}, | ||
550 | {a="%^s%^s", b="شّ"}, | ||
551 | {a="%.s%.s", b="صّ"}, | ||
552 | {a="%.d%.d", b="ضّ"}, | ||
553 | {a="%.t%.t", b="طّ"}, | ||
554 | {a="%.z%.z", b="ظّ"}, | ||
555 | {a="%`%`", b="عّ"}, | ||
556 | {a="%.g%.g", b="غّ"}, | ||
557 | {a="ff", b="فّ"}, | ||
558 | {a="qq", b="قّ"}, | ||
559 | {a="kk", b="كّ"}, | ||
560 | {a="ll", b="لّ"}, | ||
561 | {a="mm", b="مّ"}, | ||
562 | {a="nn", b="نّ"}, | ||
563 | {a="hh", b="هّ"}, | ||
564 | {a="ww", b="وّ"}, | ||
565 | {a="yy", b="يّ"}, | ||
566 | -- sukūn begin | ||
567 | -- first, take out hyphen if any: | ||
568 | {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"}, | ||
569 | {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"}, | ||
570 | {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, | ||
571 | {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIYًٌٍ])", b="%1ْ%2"}, | ||
572 | -- take out sukūn in cases of assimilation | ||
573 | -- {a="(n)(ْ)(%s)(ر)", b="%1%3%4"}, | ||
574 | -- {a="(n)(ْ)(%s)(و)", b="%1%3%4"}, | ||
575 | -- {a="(n)(ْ)(%s)(ي)", b="%1%3%4"}, | ||
576 | -- {a="(n)(ْ)(%s)(ل)", b="%1%3%4"}, | ||
577 | -- {a="(n)(ْ)(%s)(م)", b="%1%3%4"}, | ||
578 | -- {a="(n)(ْ)(%s)(ن)", b="%1%3%4"}, | ||
579 | -- {a="ْ\"", b="\""}, | ||
580 | -- sukūn end | ||
581 | {a="_t", b="ث"}, | ||
582 | {a="%^g", b="ج"}, | ||
583 | {a="%.h", b="ح"}, | ||
584 | {a="_h", b="خ"}, | ||
585 | {a="_d", b="ذ"}, | ||
586 | {a="%^s", b="ش"}, | ||
587 | {a="%.s", b="ص"}, | ||
588 | {a="%.d", b="ض"}, | ||
589 | {a="%.t", b="ط"}, | ||
590 | {a="%.z", b="ظ"}, | ||
591 | {a="%.g", b="غ"}, | ||
592 | {a="(U)(A)", b="%1ا"}, | ||
593 | {a="WA", b="وْا"}, | ||
594 | {a="(a)W\"", b="%1وا"}, | ||
595 | {a="(a)W", b="%1وْا"}, | ||
596 | {a="_A", b="aى"}, | ||
597 | {a="_u", b="ٗ"}, | ||
598 | {a="_a", b="ٰ"}, | ||
599 | {a="_i", b="ٖ"}, | ||
600 | {a="%.b", b="ٮ"}, | ||
601 | {a="%.f", b="ڡ"}, | ||
602 | {a="%.q", b="ٯ"}, | ||
603 | {a="%.k", b="ک"}, | ||
604 | {a="%.n", b="ں"}, | ||
605 | {a="%^d", b="ڊ"} | ||
606 | } | ||
607 | |||
507 | digraphsfveasy = { -- see the differences under 'easy' marker below | 608 | digraphsfveasy = { -- see the differences under 'easy' marker below |
508 | -- iʿrāb: straight double quote must be discarded | 609 | -- iʿrāb: straight double quote must be discarded |
509 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, | 610 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, |
@@ -574,7 +675,9 @@ digraphsfveasy = { -- see the differences under 'easy' marker below | |||
574 | -- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, | 675 | -- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, |
575 | -- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIًٌٍ])", b="%1ْ%2"}, | 676 | -- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIًٌٍ])", b="%1ْ%2"}, |
576 | -- take out sukūn in cases of assimilation | 677 | -- take out sukūn in cases of assimilation |
577 | -- {a="(n)(ْ)(%s)([روي])", b="%1%3%4"}, | 678 | -- {a="(n)(ْ)(%s)(ر)", b="%1%3%4"}, |
679 | -- {a="(n)(ْ)(%s)(و)", b="%1%3%4"}, | ||
680 | -- {a="(n)(ْ)(%s)(ي)", b="%1%3%4"}, | ||
578 | -- {a="(n)(ْ)(%s)([ل])", b="%1%3%4"}, | 681 | -- {a="(n)(ْ)(%s)([ل])", b="%1%3%4"}, |
579 | -- {a="(n)(ْ)(%s)([م])", b="%1%3%4"}, | 682 | -- {a="(n)(ْ)(%s)([م])", b="%1%3%4"}, |
580 | -- {a="(n)(ْ)(%s)([ن])", b="%1%3%4"}, | 683 | -- {a="(n)(ْ)(%s)([ن])", b="%1%3%4"}, |
diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua index 87c85e9..981810f 100644 --- a/arabluatex_trans.lua +++ b/arabluatex_trans.lua | |||
@@ -205,65 +205,13 @@ trigraphstrdmg = { -- trigraphs or more | |||
205 | -- words ending in -āT with silent wāw/yāʾ | 205 | -- words ending in -āT with silent wāw/yāʾ |
206 | {a="(_a)UA", b="A"}, | 206 | {a="(_a)UA", b="A"}, |
207 | {a="(_a)U", b="A"}, | 207 | {a="(_a)U", b="A"}, |
208 | {a="(_a)I", b="A"}, | 208 | {a="(_a)I", b="A"} |
209 | -- assimilations | ||
210 | {a="(n)(}?)(%s)([rlmnwy])", b="%4%2%3%4"} | ||
211 | } | 209 | } |
212 | 210 | ||
213 | trigraphstrdmgeasy = { -- see the differences below under 'easy' tag | 211 | idghamtrdmg = { |
214 | -- 'llatI / 'llad_I | ||
215 | {a="^'ll(a)([%_]?[dt])", b="'ll%1%2"}, | ||
216 | {a="(%s)'ll(a)([%_]?[dt])", b="%1'll%2%3"}, | ||
217 | -- al- + lām | ||
218 | {a="^(a)l%-(l)", b="%1l-%2"}, | ||
219 | {a="([%s%-])(a)l%-(l)", b="%1%2l-%3"}, | ||
220 | -- al- + solar consonant | ||
221 | {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2-%2"}, | ||
222 | {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2%3-%3"}, | ||
223 | -- assim. art. + solar consonant | ||
224 | {a="^(a)([%_%^%.]?[tdrzsn])%-", b="%1%2-"}, | ||
225 | {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1%2%3-"}, | ||
226 | -- al- + initial unstable hamza | ||
227 | {a="^(a)l%-([uai])", b="%1l-%2"}, | ||
228 | {a="([%s%-])(a)l%-([uai])", b="%1%2l-%3"}, | ||
229 | -- li-/la- + art. + initial unstable hamza is a special orthography | ||
230 | {a="l([ai])%-l%-([uai])", b="l%1-l-%2"}, | ||
231 | -- al- + lunar consonant (i.e. what remains) | ||
232 | {a="^(a)l%-", b="%1l-"}, | ||
233 | {a="([%s%-])(a)l%-", b="%1%2l-"}, | ||
234 | -- diphthongs to be resolved before ʾalif conjunctionis | ||
235 | {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"}, | ||
236 | {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"}, | ||
237 | -- art. with waṣla + lām | ||
238 | {a="'l%-(l)", b="'l-%1"}, | ||
239 | -- art. with waṣla + solar consonant | ||
240 | {a="'l%-([%_%^%.]?[tdrzsn])", b="'%1-%1"}, | ||
241 | -- li-/la- + art. + lām | ||
242 | {a="l([ai])%-l%-(l)", b="l%1-%2%2"}, | ||
243 | -- assim. art. with waṣla + solar consonant | ||
244 | {a="'([%_%^%.]?[tdrzsn])%-", b="'%1-"}, | ||
245 | -- li-/la- + art. + solar consonant is a special orthography | ||
246 | {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%2"}, | ||
247 | -- li-/la- + assim. art. + solar consonant is a special orthography | ||
248 | {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%3"}, | ||
249 | -- art. with waṣla + initial unstable hamza | ||
250 | {a="'l%-([uai])", b="'l-%1"}, | ||
251 | -- art. with waṣla + lunar consonant (i.e. what remains) | ||
252 | {a="'l%-", b="'l-"}, | ||
253 | -- the silent wāw | ||
254 | {a="uU$", b="u"}, | ||
255 | {a="uU(%W)", b="u%1"}, | ||
256 | {a="aU$", b="a"}, | ||
257 | {a="aU(%W)", b="a%1"}, | ||
258 | {a="iU$", b="i"}, | ||
259 | {a="iU(%W)", b="i%1"}, | ||
260 | -- words ending in -āT with silent wāw/yāʾ | ||
261 | {a="(_a)UA", b="A"}, | ||
262 | {a="(_a)U", b="A"}, | ||
263 | {a="(_a)I", b="A"} | ||
264 | -- assimilations | 212 | -- assimilations |
265 | --easy {a="(n)(%s)([rlmnwy])", b="%3%2%3"} | 213 | {a="(n)(}?)(%s)([rlmnwy])", b="%4%2%3%4"} |
266 | } | 214 | } |
267 | 215 | ||
268 | digraphstrdmg = { | 216 | digraphstrdmg = { |
269 | {a="([uai]%-)(\"?[uai])", b="%1'"}, -- hyphen + initial alif without hamza | 217 | {a="([uai]%-)(\"?[uai])", b="%1'"}, -- hyphen + initial alif without hamza |
diff --git a/arabluatex_voc.lua b/arabluatex_voc.lua index 8f71e52..ddd8fda 100644 --- a/arabluatex_voc.lua +++ b/arabluatex_voc.lua | |||
@@ -467,7 +467,10 @@ trigraphs = { -- trigraphs or more | |||
467 | -- words ending in -āT with silent wāw/yāʾ | 467 | -- words ending in -āT with silent wāw/yāʾ |
468 | {a="(_a)UA", b="%1وا"}, | 468 | {a="(_a)UA", b="%1وا"}, |
469 | {a="(_a)U", b="%1و"}, | 469 | {a="(_a)U", b="%1و"}, |
470 | {a="(_a)I", b="%1ي"}, | 470 | {a="(_a)I", b="%1ي"} |
471 | } | ||
472 | |||
473 | idgham = { | ||
471 | -- assimilations | 474 | -- assimilations |
472 | {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} | 475 | {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} |
473 | } | 476 | } |
@@ -529,9 +532,7 @@ trigraphseasy = { -- differences marked below with 'easy' | |||
529 | -- words ending in -āT with silent wāw/yāʾ | 532 | -- words ending in -āT with silent wāw/yāʾ |
530 | {a="(_a)UA", b="%1وا"}, | 533 | {a="(_a)UA", b="%1وا"}, |
531 | {a="(_a)U", b="%1و"}, | 534 | {a="(_a)U", b="%1و"}, |
532 | {a="(_a)I", b="%1ي"}, | 535 | {a="(_a)I", b="%1ي"} |
533 | -- assimilations | ||
534 | --easy {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} | ||
535 | } | 536 | } |
536 | 537 | ||
537 | digraphs = { | 538 | digraphs = { |