aboutsummaryrefslogtreecommitdiff
path: root/arabluatex_voc.lua
AgeCommit message (Expand)Author
2018-06-24cleaned up the lua codeRobert Alessi
2018-06-24additional rules for putting back on ʾalif al-waṣl with \arbnull{}Robert Alessi
2018-06-23documentation updated. a few arbnull rules were needed in voc and fullvocRobert Alessi
2018-06-18color support: added new rulesRobert Alessi
2018-06-16added hard-coded short vowels in voc, novoc and trans rulesRobert Alessi
2018-06-16hard-coded sukūn 2/2Robert Alessi
2018-06-16added hard-coded sukūnRobert Alessi
2018-06-16\arbcolor[]{} is now able to colorize everything, down to the diacritics!Robert Alessi
2018-06-10sorted arbmarks table by descending length orderRobert Alessi
2018-06-09arbmarks table: insert \arabicfont before Arabic unicode codepointRobert Alessi
2018-03-31%p? was not enough as a word boundary. replaced with %p*Robert Alessi
2018-03-29\arbmarks{} first checks if its argument is defined in the arbmarks tableRobert Alessi
2018-03-29added Arabic marks: U+FDF5, U+FDFARobert Alessi
2018-03-29new command \arbmark{} for inserting any additional Arabic markRobert Alessi
2018-03-27start encoding the honorificsRobert Alessi
2018-01-02\cap{} was already defined in math mode, oh dear! replaced with \uc{}Robert Alessi
2018-01-02new command \prname{}; updated copyright datesRobert Alessi
2018-01-01loc and \cap{}: less rules were neededRobert Alessi
2018-01-01some more correctionsRobert Alessi
2018-01-01adapted \cap{} for loc conventionRobert Alessi
2018-01-01a typo in arabluatex_voc.luaRobert Alessi
2018-01-01rewriting \cap{} from scratch. added new table lcucRobert Alessi
2017-09-08such words as hay'At should not have the maddahRobert Alessi
2017-08-05much work was needed on the final hamzah. in such words as ^say'aN, \SetArbDf...Robert Alessi
2017-08-04added dual and plural of miʾatunRobert Alessi
2017-08-04the strange spelling of miʾatun has been addedRobert Alessi
2017-08-02the Munjid says that such words as radI'aN do not have the hamzah alone on th...Robert Alessi
2017-08-02still wrong. hopefully fixed nowRobert Alessi
2017-08-02the rule set in the preceding commit was incomplete. fixedRobert Alessi
2017-08-01new rule: [wf]a-' may be used in imperatives should one wish to reject the in...Robert Alessi
2017-08-01more work on the rules of taḫfīf al-hamzahRobert Alessi
2017-08-01new rule: hyphen + initial alif without hamza followed by hamzaRobert Alessi
2017-07-28modified 'voc' and 'trans' rules accordinglyRobert Alessi
2017-06-30hamzah + pr. suffix: the carrier must pass into yāʾ before īRobert Alessi
2017-06-28issue <??> for any [%^%_] left unprocessed instead of issuing a 'missing $ in...Robert Alessi
2017-06-26put '.A[uai]?l-' into the lunar/solar mechanismRobert Alessi
2017-06-26bugfix: sukūn quoting in 'easy' rules put an additional sukūn instead of ta...Robert Alessi
2017-06-26bugfix: initial hamzah after hyphen was broken; a couple of typosRobert Alessi
2017-06-25'aY' may be used to encode consonant yāʾ without dots (as in qaY'uN); '.y' ...Robert Alessi
2017-06-24'iY' may be used to encode final yāʾ without dotsRobert Alessi
2017-06-20addition of six Persian charactersRobert Alessi
2017-05-06bugfix: the double consonants tt gg hh dd ss zz must not output a šaddah whe...Robert Alessi
2017-01-08updated copyright date and checksumRobert Alessi
2017-01-07bugfix: final hamzah was not parsed correctly in some particular casesRobert Alessi
2016-12-24arabnull: done documenting; some corrections; checksum updated. getting close...Robert Alessi
2016-12-24a bit of tidy-up in the codeRobert Alessi
2016-12-24arbnulls inserted in fullvoc table; some additional corrections in the other ...Robert Alessi
2016-12-23arbnulls inserted in voc tableRobert Alessi
2016-12-22arbnulls inserted in trans tableRobert Alessi
2016-12-21starting to work on \arbnull to put back on contextual analysis in case it is...Robert Alessi
>415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
--[[
This file is part of the `arabluatex' package

ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX
Copyright (C) 2016  Robert Alessi

Please send error reports and suggestions for improvements to Robert
Alessi <alessi@robertalessi.net>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see
<http://www.gnu.org/licenses/>.
--]]

hamzafv = {
   -- next line for ʾiʿrāb hyphen
   {a="(')(%-)([uaiUAI])", b="%1%3"},
   -- hard coded hamza
   {a="|\"'", b="ء"},
   {a="A\"'", b="آ"},
   {a="[au]\"'", b="أ"},
   {a="w\"'", b="ؤ"},
   {a="i\"'", b="إ"},
   {a="y\"'", b="ئ"},
   {a="ؤ([^uaiUAI])", b="ؤْ%1"},
   {a="ؤ$", b="ؤْ"},
   {a="ؤ(%s)", b="ؤْ%1"},
   {a="أ([^uaiUAI])", b="أْ%1"},
   {a="أ$", b="أْ"},
   {a="أ(%s)", b="أْ%1"},
   {a="ئ([^uaiUAI])", b="ئْ%1"},
   {a="ئ$", b="ئْ"},
   {a="ئ(%s)", b="ئْ%1"},
   -- hamza takes tašdīd too
   {a="''([Uu])", b="ؤؤ%1"},
   {a="''([Aa])", b="أأ%1"},
   {a="''([Ii])", b="ئئ%1"},
   -- inseparable adverbial particle 'a- + 'a
   {a="\'(a)%-\'(a)", b="أ%1اأ%2"},
   -- initial long u and i (for a, see below)
   {a="%'%_U", b="أU"},
   {a="%'%_I", b="إI"},
   -- taḫfīfu 'l-hamza
   {a="'u'([^uaiUAI])", b="أU%1"},
   {a="'i'([^uaiUAI])", b="إI%1"},   
   -- madda (historic writing below)
   {a="'a'([^uaiUAI])", b="آ%1"},
   {a="([^uiUI])\'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="%1آ%2"},
   {a="^\'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="آ%1"},
   {a="(%W)\'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="%1آ%2"},
   {a="(A)(')(uN?)$", b="aآء%3"},
   {a="(A)(')(uN?)(%W)", b="aآء%3%4"},
   {a="(A)(')(iN?)$", b="aآء%3"},
   {a="(A)(')(iN?)(%W)", b="aآء%3%4"},
   {a="(A)(')(i)", b="aآئ%3"}, -- historic madda
   {a="(A)(')(u)", b="aآؤ%3"}, -- historic madda
   {a="(A)(')", b="aآء"}, -- historic madda
   -- initial (needs both ^ and %W patterns)
   {a="^(')([ua])", b="أ%2"},
   {a="^(')(i)", b="إ%2"},
   {a="(%W)(')([ua])", b="%1أ%3"},
   {a="(%W)(')(i)", b="%1إ%3"},
   -- final
   -- ^say'aN and .zim'aN are special orthographies
   {a="(%^say)(%')(aN)", b="%1ئ%3"},
   {a="(.zi?m)(%')(aN)", b="%1ئ%3"},
   {a="([^uai])(')([uai]N?)$", b="%1ء%3"},
   {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"},
-- u
   {a="(u)(')([uai]N?)$", b="%1ؤ%3"},
   {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"},
   {a="(u)(')$", b="%1ؤْ"},
   {a="(u)(')(%W)", b="%1ؤْ%3"},
-- a
   {a="(a)(')(A)$", b="%1آ"},
   {a="(a)(')(A)(%W)", b="%1آ%4"},
   {a="(a)(')([u]N?)$", b="%1أ%3"},
   {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"},
   {a="(a)(')(a)$", b="%1أ%3"},
   {a="(a)(')(a)(%W)", b="%1أ%3%4"},
   {a="(a)(')(aN)$", b="%1أً"},
   {a="(a)(')(aN)(%W)", b="%1أً%4"},
   {a="(a)(')([i]N?)$", b="%1إ%3"},
   {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"},
   {a="(a)(')$", b="%1أْ"},
   {a="(a)(')(%W)", b="%1أْ%3"},
-- i
   {a="(i)(')([uai]N?)$", b="%1ئ%3"},
   {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"},
   {a="(i)(')$", b="%1ئْ"},
   {a="(i)(')(%W)", b="%1ئْ%3"},
--
   -- middle
   {a="(U)(')", b="%1ء"},
   {a="([Iy])(')", b="%1ئ"},
   {a="([^uai])(')([uU])", b="%1ؤ%3"},
   {a="([^uai])(')([aA])", b="%1أ%3"},
   {a="([^uai])(')([iI])", b="%1ئ%3"},
   {a="(u)(')([uU])", b="%1ؤ%3"},
   {a="(u)(')([aA])", b="%1ؤ%3"},
   {a="(u)(')([iI])", b="%1ئ%3"},
   {a="(a)(')([aA])", b="%1أ%3"},
   {a="(a)(')([uU])", b="%1ؤ%3"},
   {a="(a)(')([iI])", b="%1ئ%3"},
   {a="(i)(')([aA])", b="%1ئ%3"},
   {a="(i)(')([uU])", b="%1ئ%3"},
   {a="(i)(')([iI])", b="%1ئ%3"},
   {a="(a)(')([^uaiUAI])", b="%1أْ%3"},
   {a="(u)(')([^uaiUAI])", b="%1ؤْ%3"},
   {a="(i)(')([^uaiUAI])", b="%1ئْ%3"}
}

hamzafveasy = { -- differences marked below with 'easy'
   -- next line for ʾiʿrāb hyphen
   {a="(')(%-)([uaiUAI])", b="%1%3"},
   -- hard coded hamza
   {a="|\"'", b="ء"},
   {a="A\"'", b="آ"},
   {a="[au]\"'", b="أ"},
   {a="w\"'", b="ؤ"},
   {a="i\"'", b="إ"},
   {a="y\"'", b="ئ"},
   {a="ؤ([^uaiUAI])", b="ؤْ%1"},
   {a="ؤ$", b="ؤْ"},
   {a="ؤ(%s)", b="ؤْ%1"},
   {a="أ([^uaiUAI])", b="أْ%1"},
   {a="أ$", b="أْ"},
   {a="أ(%s)", b="أْ%1"},
   {a="ئ([^uaiUAI])", b="ئْ%1"},
   {a="ئ$", b="ئْ"},
   {a="ئ(%s)", b="ئْ%1"},
   -- hamza takes tašdīd too
   {a="''([Uu])", b="ؤؤ%1"},
   {a="''([Aa])", b="أأ%1"},
   {a="''([Ii])", b="ئئ%1"},
   -- inseparable adverbial particle 'a- + 'a
   {a="\'(a)%-\'(a)", b="أ%1اأ%2"},
   -- initial long u and i (for a, see below)
   {a="%'%_U", b="أU"},
   {a="%'%_I", b="إI"},
   -- taḫfīfu 'l-hamza
   {a="'u'([^uaiUAI])", b="أU%1"},
   {a="'i'([^uaiUAI])", b="إI%1"},   
   -- madda (historic writing below)
   {a="'a'([^uaiUAI])", b="آ%1"},
   {a="([^uiUI])\'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="%1آ%2"},
   {a="^\'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="آ%1"},
   {a="(%W)\'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="%1آ%2"},
   --easy (begin)
   {a="(A)(')(uN?)$", b="aاء%3"},
   {a="(A)(')(uN?)(%W)", b="aاء%3%4"},
   {a="(A)(')(iN?)$", b="aاء%3"},
   {a="(A)(')(iN?)(%W)", b="aاء%3%4"},
   {a="(A)(')(i)", b="aائ%3"}, -- historic madda
   {a="(A)(')(u)", b="aاؤ%3"}, -- historic madda
   {a="(A)(')", b="aاء"}, -- historic madda
   --easy (end)
   -- initial (needs both ^ and %W patterns)
   {a="^(')([ua])", b="أ%2"},
   {a="^(')(i)", b="إ%2"},
   {a="(%W)(')([ua])", b="%1أ%3"},
   {a="(%W)(')(i)", b="%1إ%3"},
   -- final
   -- ^say'aN and .zim'aN are special orthographies
   {a="(%^say)(%')(aN)", b="%1ئ%3"},
   {a="(.zi?m)(%')(aN)", b="%1ئ%3"},
   {a="([^uai])(')([uai]N?)$", b="%1ء%3"},
   {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"},
-- u
   {a="(u)(')([uai]N?)$", b="%1ؤ%3"},
   {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"},
   {a="(u)(')$", b="%1ؤْ"},
   {a="(u)(')(%W)", b="%1ؤْ%3"},
-- a
   {a="(a)(')(A)$", b="%1آ"},
   {a="(a)(')(A)(%W)", b="%1آ%4"},
   {a="(a)(')([u]N?)$", b="%1أ%3"},
   {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"},
   {a="(a)(')(a)$", b="%1أ%3"},
   {a="(a)(')(a)(%W)", b="%1أ%3%4"},
   {a="(a)(')(aN)$", b="%1أً"},
   {a="(a)(')(aN)(%W)", b="%1أً%4"},
   {a="(a)(')([i]N?)$", b="%1إ%3"},
   {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"},
   {a="(a)(')$", b="%1أْ"},
   {a="(a)(')(%W)", b="%1أْ%3"},
-- i
   {a="(i)(')([uai]N?)$", b="%1ئ%3"},
   {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"},
   {a="(i)(')$", b="%1ئْ"},
   {a="(i)(')(%W)", b="%1ئْ%3"},
--
   -- middle
   {a="(U)(')", b="%1ء"},
   {a="([Iy])(')", b="%1ئ"},
   {a="([^uai])(')([uU])", b="%1ؤ%3"},
   {a="([^uai])(')([aA])", b="%1أ%3"},
   {a="([^uai])(')([iI])", b="%1ئ%3"},
   {a="(u)(')([uU])", b="%1ؤ%3"},
   {a="(u)(')([aA])", b="%1ؤ%3"},
   {a="(u)(')([iI])", b="%1ئ%3"},
   {a="(a)(')([aA])", b="%1أ%3"},
   {a="(a)(')([uU])", b="%1ؤ%3"},
   {a="(a)(')([iI])", b="%1ئ%3"},
   {a="(i)(')([aA])", b="%1ئ%3"},
   {a="(i)(')([uU])", b="%1ئ%3"},
   {a="(i)(')([iI])", b="%1ئ%3"},
   {a="(a)(')([^uaiUAI])", b="%1أْ%3"},
   {a="(u)(')([^uaiUAI])", b="%1ؤْ%3"},
   {a="(i)(')([^uaiUAI])", b="%1ئْ%3"}
}

tanwinfv = {
   {a="%-?uNU", b="ٌو"},
   {a="%-?aNU", b="ًوا"},
   {a="%-?iNU", b="ٍو"},
   {a="%-?([uai]N)(%s)([uai])", b="%1%2ٱ"},
   {a="%-?(aN[%_]?[AY])(%s)([uai])", b="%1%2ٱ"},
   -- assimilations (begin)
   {a="%-?(uN)(%s)([rlmnwy])", b="ٌ%2%3%3"},
   {a="%-?(aN)(_A)(%s)([rlmnwy])", b="ًى%3%4%4"},
   {a="%-?(aN)(Y)(%s)([rlmnwy])", b="ًى%3%4%4"},
   {a="(T)%-?(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"},
   {a="(ء)%-?(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"},
   {a="([^TA])%-?(aN)(%s)([rlmnwy])", b="%1ًا%3%4%4"},
   {a="%-?(iNI?)(%s)([rlmnwy])", b="ٍ%2%3%3"},
   -- assimilations (end)
   -- quoted tanwīn (begin)
   {a="%-?(\"uN)", b=""},
   {a="(B)%-?(\"aN)", b="%1"},
   {a="%-?(\"aN)(_A)", b="ى"},
   {a="%-?(\"aN)(Y)", b="ى"},
   {a="(T)%-?(\"aN)", b="%1"},
   {a="(ء)%-?(\"aN)", b="%1"},
   {a="([^TA])%-?(\"aN)", b="%1ا"},
   {a="%-?(\"iNI?)", b=""},
   -- quoted tanwīn (end)
   {a="%-?(uN)", b="ٌ"},
   {a="(B)%-?(aN)", b="%1ً"},
   {a="%-?(aN)(_A)", b="ًى"},
   {a="%-?(aN)(Y)", b="ًى"},
   {a="(T)%-?(aN)", b="%1ً"},
   {a="(ء)%-?(aN)", b="%1ً"},
   {a="([^TA])%-?(aN)", b="%1ًا"},
   {a="%-?(iNI?)", b="ٍ"}
}

tanwinfveasy = { -- no assimilations (see below)
   {a="%-?uNU", b="ٌو"},
   {a="%-?aNU", b="ًوا"},
   {a="%-?iNU", b="ٍو"},
   {a="%-?([uai]N)(%s)([uai])", b="%1%2ٱ"},
   {a="%-?(aN[%_]?[AY])(%s)([uai])", b="%1%2ٱ"},
   -- assimilations (begin)
--easy   {a="%-?(uN)(%s)([rlmnwy])", b="ٌ%2%3%3"},
--easy   {a="%-?(aN)(_A)(%s)([rlmnwy])", b="ًى%3%4%4"},
--easy   {a="%-?(aN)(Y)(%s)([rlmnwy])", b="ًى%3%4%4"},
--easy   {a="(T)%-?(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"},
--easy   {a="(ء)%-?(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"},
--easy   {a="([^TA])%-?(aN)(%s)([rlmnwy])", b="%1ًا%3%4%4"},
--easy   {a="%-?(iNI?)(%s)([rlmnwy])", b="ٍ%2%3%3"},
   -- assimilations (end)
   -- quoted tanwīn (begin)
   {a="%-?(\"uN)", b=""},
   {a="(B)%-?(\"aN)", b="%1"},
   {a="%-?(\"aN)(_A)", b="ى"},
   {a="%-?(\"aN)(Y)", b="ى"},
   {a="(T)%-?(\"aN)", b="%1"},
   {a="(ء)%-?(\"aN)", b="%1"},
   {a="([^TA])%-?(\"aN)", b="%1ا"},
   {a="%-?(\"iNI?)", b=""},
   -- quoted tanwīn (end)
   {a="%-?(uN)", b="ٌ"},
   {a="(B)%-?(aN)", b="%1ً"},
   {a="%-?(aN)(_A)", b="ًى"},
   {a="%-?(aN)(Y)", b="ًى"},
   {a="(T)%-?(aN)", b="%1ً"},
   {a="(ء)%-?(aN)", b="%1ً"},
   {a="([^TA])%-?(aN)", b="%1ًا"},
   {a="%-?(iNI?)", b="ٍ"}
}

trigraphsfv = { -- trigraphs or more
   -- 'llatI / 'llad_I
   {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"},
   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"},
   -- al- + lām
   {a="^(a)l%-(l)", b="ا%1ل%2%2"},
   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"},
   -- al- + solar consonant
   {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"},
   -- assim. art. + solar consonant
   {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"},
   -- al- + initial unstable hamza
   {a="^(a)l%-(\"?[uai])", b="ا%1ل%2ٱ"},
   {a="([%s%-])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"},
   -- li-/la + art. + initial unstable hamza is a special orthography
   {a="l([ai])%-l%-(\"?[uai])", b="ل%1ل%2ٱ"},
   -- al- + lunar consonant (i.e. what remains)
   {a="^(a)l%-", b="ا%1لْ"},
   {a="([%s%-])(a)l%-", b="%1ا%2لْ"},
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"},
   {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
   {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
   -- art. with waṣla + lām
   {a="'l%-(l)", b="ٱل%1%1"},
   -- art. with waṣla + solar consonant
   {a="'l%-([%_%^%.]?[tdrzsn])", b="ٱل%1%1"},
   -- li-/la- + art. + lām
   {a="l([ai])%-l%-(l)", b="ل%1%2%2"},
   -- assim. art. with waṣla + solar consonant
   {a="'([%_%^%.]?[tdrzsn])%-", b="ٱل%1"},
   -- li-/la- + art. + solar consonant is a special orthography
   {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="ل%1ل%2%2"},
   -- li-/la- + assim. art. + solar consonant is a special orthography
   {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="ل%1ل%3%3"},
   -- art. with waṣla + initial unstable hamza
   {a="'l%-(\"?[uai])", b="ٱل%1ٱ"},
   -- art. with waṣla + lunar consonant (i.e. what remains)
   {a="'l%-", b="ٱلْ"},
   -- the silent wāw
   {a="uU$", b="uو"},
   {a="uU(%W)", b="uو%1"},
   {a="aU$", b="aو"},
   {a="aU(%W)", b="aو%1"},
   {a="iU$", b="iو"},
   {a="iU(%W)", b="iو%1"},
   -- words ending in -āT with silent wāw/yāʾ
   {a="(_a)UA", b="%1وا"},
   {a="(_a)U", b="%1و"},
   {a="(_a)I", b="%1ي"},
   -- assimilations
   {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"}
}

trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs)
   -- 'llatI / 'llad_I
   {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"},
   {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"},
   -- al- + lām
   {a="^(a)l%-(l)", b="ا%1ل%2%2"},
   {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"},
   -- al- + solar consonant
   {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
   {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"},
   -- assim. art. + solar consonant
   {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
   {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"},
   -- al- + initial unstable hamza
   {a="^(a)l%-(\"?[uai])", b="ا%1ل%2ٱ"},
   {a="([%s%-])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"},
   -- li-/la + art. + initial unstable hamza is a special orthography
   {a="l([ai])%-l%-(\"?[uai])", b="ل%1ل%2ٱ"},
   -- al- + lunar consonant (i.e. what remains)
   {a="^(a)l%-", b="ا%1لْ"},
   {a="([%s%-])(a)l%-", b="%1ا%2لْ"},
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"},
   {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
   {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
   -- art. with waṣla + lām
   {a="'l%-(l)", b="ٱل%1%1"},
   -- art. with waṣla + solar consonant
   {a="'l%-([%_%^%.]?[tdrzsn])", b="ٱل%1%1"},
   -- li-/la- + art. + lām
   {a="l([ai])%-l%-(l)", b="ل%1%2%2"},
   -- assim. art. with waṣla + solar consonant
   {a="'([%_%^%.]?[tdrzsn])%-", b="ٱل%1"},
   -- li-/la- + art. + solar consonant is a special orthography
   {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="ل%1ل%2%2"},
   -- li-/la- + assim. art. + solar consonant is a special orthography
   {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="ل%1ل%3%3"},
   -- art. with waṣla + initial unstable hamza
   {a="'l%-(\"?[uai])", b="ٱل%1ٱ"},   
   -- art. with waṣla + lunar consonant (i.e. what remains)
   {a="'l%-", b="ٱلْ"},
   -- the silent wāw
   {a="uU$", b="uو"},
   {a="uU(%W)", b="uو%1"},
   {a="aU$", b="aو"},
   {a="aU(%W)", b="aو%1"},
   {a="iU$", b="iو"},
   {a="iU(%W)", b="iو%1"},
   -- words ending in -āT with silent wāw/yāʾ
   {a="(_a)UA", b="%1وا"},
   {a="(_a)U", b="%1و"},
   {a="(_a)I", b="%1ي"},
   -- assimilations
--easy   {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"}
}

digraphsfv = {
   -- iʿrāb: straight double quote must be discarded
   {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"},
   {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"},
   {a="(%-)(\"?At[ui])(%p?%s)", b="%2%3"},
   {a="(%-)(\"?At[ui])(%p?)$", b="%2%3"},
   {a="(%-)(\"?Ani)(%p?%s)", b="%2%3"},
   {a="(%-)(\"?Ani)(%p?)$", b="%2%3"},
   {a="(%-)(\"?ayni)(%p?%s)", b="%2%3"},
   {a="(%-)(\"?ayni)(%p?)$", b="%2%3"},
   {a="(%-)(\"?[uai])(%p?%s)", b="%2%3"},
   {a="(%-)(\"?[uai])(%p?)$", b="%2%3"},
   -- ʾiʿrāb (end)
   -- initial straight double quote gives a connective ʾalif
   {a="^\"[uai]", b="ٱ"},
   {a="([%s%-])\"[uai]", b="%1ٱ"},
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"},
   {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"},
   {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"},
   {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza
   -- initial alif without hamza
   {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"},
   {a="^([uai])", b="ا%1"},      -- initial alif without hamza
   {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza
   {a="%-%-", b="ـ"},
   {a="ؤؤ", b="ؤّ"},
   {a="أأ", b="أّ"},
   {a="ئئ", b="ئّ"},
   {a="bb", b="بّ"},
   {a="BB", b="ـّ"},
   {a="(%_)([thd])([thd])", b="%1%2|%3"},
   {a="tt", b="تّ"},
   {a="%_t%_t", b="ثّ"},
   {a="jj", b="جّ"},
   {a="%^g%^g", b="جّ"},
   {a="xx", b="خّ"},
   {a="%_h%_h", b="خّ"},
   {a="dd", b="دّ"},
   {a="%_d%_d", b="ذّ"},
   {a="rr", b="رّ"},
   {a="zz", b="زّ"},
   {a="ss", b="سّ"},
   {a="%^s%^s", b="شّ"},
   {a="%.s%.s", b="صّ"},
   {a="%.d%.d", b="ضّ"},
   {a="%.t%.t", b="طّ"},
   {a="%.z%.z", b="ظّ"},
   {a="%`%`", b="عّ"},
   {a="%.g%.g", b="غّ"},
   {a="ff", b="فّ"},
   {a="qq", b="قّ"},
   {a="kk", b="كّ"},
   {a="ll", b="لّ"},
   {a="mm", b="مّ"},
   {a="nn", b="نّ"},
   {a="hh", b="هّ"},
   {a="ww", b="وّ"},
   {a="yy", b="يّ"},
   -- sukūn begin
   -- first, take out hyphen if any:
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIYًٌٍ])", b="%1ْ%2"},
   -- take out sukūn in cases of assimilation
   {a="(n)(ْ)(%s)(ر)", b="%1%3%4"},
   {a="(n)(ْ)(%s)(و)", b="%1%3%4"},
   {a="(n)(ْ)(%s)(ي)", b="%1%3%4"},
   {a="(n)(ْ)(%s)(ل)", b="%1%3%4"},
   {a="(n)(ْ)(%s)(م)", b="%1%3%4"},
   {a="(n)(ْ)(%s)(ن)", b="%1%3%4"},
   {a=\"", b="\""},
   -- sukūn end
   {a="_t", b="ث"},
   {a="%^g", b="ج"},
   {a="%.h", b="ح"},
   {a="_h", b="خ"},
   {a="_d", b="ذ"},
   {a="%^s", b="ش"},
   {a="%.s", b="ص"},
   {a="%.d", b="ض"},
   {a="%.t", b="ط"},
   {a="%.z", b="ظ"},
   {a="%.g", b="غ"},
   {a="(U)(A)", b="%1ا"},
   {a="WA", b="وْا"},
   {a="(a)W\"", b="%1وا"},
   {a="(a)W", b="%1وْا"},
   {a="_A", b="aى"},
   {a="_u", b="ٗ"},
   {a="_a", b="ٰ"},
   {a="_i", b="ٖ"},
   {a="%.b", b="ٮ"},
   {a="%.f", b="ڡ"},
   {a="%.q", b="ٯ"},
   {a="%.k", b="ک"},
   {a="%.n", b="ں"},
   {a="%^d", b="ڊ"}
}

digraphsfveasy = { -- see the diffenrences under 'easy' marker below
   -- iʿrāb: straight double quote must be discarded
   {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"},
   {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"},
   {a="(%-)(\"?At[ui])(%p?%s)", b="%2%3"},
   {a="(%-)(\"?At[ui])(%p?)$", b="%2%3"},
   {a="(%-)(\"?Ani)(%p?%s)", b="%2%3"},
   {a="(%-)(\"?Ani)(%p?)$", b="%2%3"},
   {a="(%-)(\"?ayni)(%p?%s)", b="%2%3"},
   {a="(%-)(\"?ayni)(%p?)$", b="%2%3"},
   {a="(%-)(\"?[uai])(%p?%s)", b="%2%3"},
   {a="(%-)(\"?[uai])(%p?)$", b="%2%3"},
   -- ʾiʿrāb (end)
   -- initial straight double quote gives a connective ʾalif
   {a="^\"[uai]", b="ٱ"},
   {a="([%s%-])\"[uai]", b="%1ٱ"},
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"},
   {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"},
   {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"},
   {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza
   -- initial alif without hamza
   {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"},
   {a="^([uai])", b="ا%1"},      -- initial alif without hamza
   {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza
   {a="%-%-", b="ـ"},
   {a="ؤؤ", b="ؤّ"},
   {a="أأ", b="أّ"},
   {a="ئئ", b="ئّ"},
   {a="bb", b="بّ"},
   {a="BB", b="ـّ"},
   {a="(%_)([thd])([thd])", b="%1%2|%3"},
   {a="tt", b="تّ"},
   {a="%_t%_t", b="ثّ"},
   {a="jj", b="جّ"},
   {a="%^g%^g", b="جّ"},
   {a="xx", b="خّ"},
   {a="%_h%_h", b="خّ"},
   {a="dd", b="دّ"},
   {a="%_d%_d", b="ذّ"},
   {a="rr", b="رّ"},
   {a="zz", b="زّ"},
   {a="ss", b="سّ"},
   {a="%^s%^s", b="شّ"},
   {a="%.s%.s", b="صّ"},
   {a="%.d%.d", b="ضّ"},
   {a="%.t%.t", b="طّ"},
   {a="%.z%.z", b="ظّ"},
   {a="%`%`", b="عّ"},
   {a="%.g%.g", b="غّ"},
   {a="ff", b="فّ"},
   {a="qq", b="قّ"},
   {a="kk", b="كّ"},
   {a="ll", b="لّ"},
   {a="mm", b="مّ"},
   {a="nn", b="نّ"},
   {a="hh", b="هّ"},
   {a="ww", b="وّ"},
   {a="yy", b="يّ"},
   -- sukūn begin ('easy' needs these rules to be taken out); but
   -- first take out every previously generated sukūn by hamza rules,
   -- so there be no need to edit them:
   {a="ْ", b=""}, 
   -- first, take out hyphen if any:
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"},
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"},
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"},
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIًٌٍ])", b="%1ْ%2"},
   -- take out sukūn in cases of assimilation
--   {a="(n)(ْ)(%s)([روي])", b="%1%3%4"},
--   {a="(n)(ْ)(%s)([ل])", b="%1%3%4"},
--   {a="(n)(ْ)(%s)([م])", b="%1%3%4"},
--   {a="(n)(ْ)(%s)([ن])", b="%1%3%4"},
--   {a="ْ\"", b="\""},
   -- sukūn end
   {a="_t", b="ث"},
   {a="%^g", b="ج"},
   {a="%.h", b="ح"},
   {a="_h", b="خ"},
   {a="_d", b="ذ"},
   {a="%^s", b="ش"},
   {a="%.s", b="ص"},
   {a="%.d", b="ض"},
   {a="%.t", b="ط"},
   {a="%.z", b="ظ"},
   {a="%.g", b="غ"},
   {a="(U)(A)", b="%1ا"},
   {a="WA", b="وْا"},
   {a="(a)W\"", b="%1وا"},
   {a="(a)W", b="%1وْا"},
   {a="_A", b="aى"},
   {a="_u", b="ٗ"},
   {a="_a", b="ٰ"},
   {a="_i", b="ٖ"},
   {a="%.b", b="ٮ"},
   {a="%.f", b="ڡ"},
   {a="%.q", b="ٯ"},
   {a="%.k", b="ک"},
   {a="%.n", b="ں"},
   {a="%^d", b="ڊ"}
}

singlefv = {
   {a="b", b="ب"},
   {a="t", b="ت"},
   {a="j", b="ج"},
   {a="x", b="خ"},
   {a="d", b="د"},
   {a="r", b="ر"},
   {a="z", b="ز"},
   {a="s", b="س"},
   {a="f", b="ف"},
   {a="`", b="ع"},
   {a="f", b="ف"},
   {a="q", b="ق"},
   {a="k", b="ك"},
   {a="l", b="ل"},
   {a="m", b="م"},
   {a="n", b="ن"},
   {a="h", b="ه"},
   {a="w", b="و"},
   {a="y", b="ي"},
   {a="T", b="ة"},
   {a="\"$", b=""},
   {a="\"(%W)", b="%1"},
   {a="\"([^uaiUAI])", b="%1"},
   {a="([^0-9])%-([^0-9])", b="%1%2"},
   {a="B", b="ـ"},
}

singlefveasy = { -- see the differences under 'easy' tag below
   {a="b", b="ب"},
   {a="t", b="ت"},
   {a="j", b="ج"},
   {a="x", b="خ"},
   {a="d", b="د"},
   {a="r", b="ر"},
   {a="z", b="ز"},
   {a="s", b="س"},
   {a="f", b="ف"},
   {a="`", b="ع"},
   {a="f", b="ف"},
   {a="q", b="ق"},
   {a="k", b="ك"},
   {a="l", b="ل"},
   {a="m", b="م"},
   {a="n", b="ن"},
   {a="h", b="ه"},
   {a="w", b="و"},
   {a="y", b="ي"},
   {a="T", b="ة"},
   -- easy (begin): \" needs to put back the sukūn
   {a="\"$", b="ْ"},
   {a="\"(%W)", b="ْ%1"},
   {a="\"([^uaiUAI])", b="ْ%1"},
   -- easy (end)
   {a="([^0-9])%-([^0-9])", b="%1%2"},
   {a="B", b="ـ"},
}