aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-06-17issues #346 and #361 in font loader are now fixedRobert Alessi
2016-06-15corrected wrong ʾiʿrāb after t or TRobert Alessi
2016-06-08bugfix: take out sukūn in case of assimilation rule was wrongRobert Alessi
2016-06-08Arabic dot was wrongRobert Alessi
2016-06-07correction of a couple of typos in the documentationRobert Alessi
2016-06-06workaround for a bug (#349) in font loaderRobert Alessi
2016-06-04correction of a typo in docRobert Alessi
2016-05-28specified checksum. this is v1.3v1.3Robert Alessi
2016-05-28cleaned up the code (tmp tags)Robert Alessi
2016-05-28done implementing ʾiʿrāb ġayr munṣarif, done documenting. getting ↵Robert Alessi
close to v1.3
2016-05-25ʾalifu 'l-waṣli was many times vocalized, which is wrong. corrected.Robert Alessi
2016-05-25implementation of ʾiʿrāb ġayr munṣarif (dmg mode)Robert Alessi
2016-05-19done implementing and documenting \arbupRobert Alessi
2016-05-18first implementation of \arbup viz. superscript tanwīn in |dmg| modeRobert Alessi
2016-05-17new bug tracker own websiteRobert Alessi
2016-05-09specified checksum. this is v1.2v1.2Robert Alessi
2016-05-08done documenting the 'easy' featureRobert Alessi
2016-05-08done implementing 'easy' rules setRobert Alessi
2016-05-08first implementation of 'easy' rules setRobert Alessi
2016-05-07redefine \abjad in case polyglossia Arabic is loadedRobert Alessi
2016-05-07force 'novoc' mode with abjad numbersRobert Alessi
2016-04-27arabluatex.bib is now included in arabluatex.dtxv1.1.1Robert Alessi
2016-04-27correct checksum specified for release v1.1v1.1Robert Alessi
2016-04-27license: upgrade from GPLv2 to GPLv3 --> arabluatex v1.1Robert Alessi
2016-04-27updated documentation on the new \abjad commandRobert Alessi
2016-04-26included .bib in dtx fileRobert Alessi
2016-04-26implementation of abjad numbering in Lua, so that polyglossia no longer be ↵Robert Alessi
needed (this is much more flexible)
2016-04-21Merge branch 'master' of ssh.robertalessi.net:git/arabluatexRobert Alessi
2016-04-21alif maq.sūra is to be small letter a with dot below and macron in dmgRobert Alessi
2016-04-21alif maq.sūra is to be small letter a with dot below and macron id dmgRobert Alessi
2016-04-16taḫfīfu 'l-hamzati: updated the documentationRobert Alessi
2016-04-16taḫfīfu 'l-hamzati was missing: added in all tablesRobert Alessi
2016-04-07rtl was mixed up with ltr in the description of \LRRobert Alessi
2016-04-06updated documentation with dev and bug reports URLsRobert Alessi
2016-04-05updated README.texRobert Alessi
2016-04-05.md and .html files are now standaloneRobert Alessi
2016-04-05makefile: remove header_attributes from README.mdRobert Alessi
2016-04-05better instructions on how to install files into a directory where LaTeX can ↵Robert Alessi
find them
2016-04-04updated README.md with references to notabug.orgRobert Alessi
2016-04-04added README.md (compiled from README.tex)Robert Alessi
2016-04-04updated README.tex with 'Lua\LaTeX\ and unicode \textcopyrightRobert Alessi
2016-04-04added about.html compiled from README.tex for my git repositoryRobert Alessi
2016-04-02updated makefile (local and clean rules)Robert Alessi
2016-04-01updated makefile: *.lua files do not have to go into source/Robert Alessi
2016-03-31correction of a typo (wrong date in .sty)v1.0.1Robert Alessi
2016-03-31minor update of the documentation (csquotes)Robert Alessi
2016-03-30a missing comma in the doc. This is it.v1.0Robert Alessi
2016-03-30tanwin and trigraphs were inverted in all of the tablesRobert Alessi
2016-03-30wrong ʾalif mamdūda + hamza + u in voc and fullvocRobert Alessi
2016-03-30updated arabluatex.dtx with author and title informations for inclusion in ↵Robert Alessi
the pdf
>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 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015
--[[
This file is part of the `arabluatex' package

ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX
Copyright (C) 2016--2018  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"},
   -- next lines for ʾalif alone
   {a="(%.A)([uai]?)l%-(%^n)", b="ا%2ل%3"}, --additional (^n is lunar)
   {a="([%(%[%|%<%s%-O])(%.A)([uai]?)l%-(%^n)", b="%1ا%3%4"}, --additional (^n is lunar) --p
   {a="(%.A)([uai]?)l%-([%_%^%.]?[tdrzsnc])", b="ا%2ل%3%3"},
   {a="([%(%[%|%<%s%-O])(%.A)([uai]?)l%-([%_%^%.]?[tdrzsnc])", b="%1ا%3ل%4%4"}, --p
   {a="%.A", b="ا"},
   -- 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="ؤ(%p*)$", b="ؤْ%1"},
   {a="ؤ(%p*%s)", b="ؤْ%1"},
   {a="أ([^uaiUAI])", b="أْ%1"},
   {a="أ(%p*)$", b="أْ%1"},
   {a="أ(%p*%s)", b="أْ%1"},
   {a="ئ([^uaiUAI])", b="ئْ%1"},
   {a="ئ(%p*)$", b="ئْ%1"},
   {a="ئ(%p*%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"},
   {a="([wf]a)%-\'([^uaiUAIl][^%-])", b="%1أْ%2"},
   {a="^u'([^uaiUAI])", b="اU%1"},
   {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1اU%2"},
   {a="^i'([^uaiUAI])", b="اI%1"},
   {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1اI%2"},
   -- madda (historic writing below)
   {a="'a'([^uaiUAI])", b="آ%1"},
   {a="([^uiyUI])\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   {a="^\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="آ%1"},
   {a="\'a?A(O[%_%^%.]?[%`%'btjghxdrzsfqklmnywAY]-O)", b="آ"},
   {a="(%W)\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   {a="(A)(O%'[%S]-O)", b="آ"},
   {a="(A)(')(uN?%p*)$", b="aآء%3"},
   {a="(A)(')(uN?)(%p*%s)", b="aآء%3%4"},
   {a="(A)(')(iN?%p*)$", b="aآء%3"},
   {a="(A)(')(iN?)(%p*%s)", b="aآء%3%4"},
   {a="(A)(')([iI])", 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)
   -- 'aw: the diphthong is to be resolved into 'awi' (next 8 lines)
   {a="^('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
   {a="(%W)('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
   {a="^('aw)(O)([%(%[%|%<]?\"?[uai])([%S]-O)", b="%1i"},
   {a="(%W)('aw)(O)([%(%[%|%<]?\"?[uai])([%S]-O)", b="%1%2i"},
   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
   -- then the 'initial' rules for the remaining cases
   {a="^(')([ua])", b="أ%2"},
   {a="^(')(i)", b="إ%2"},
   -- consider replacing initial %W with [%s%(%[%<%-]:
   --   {a="(%W)(')([ua])", b="%1أ%3"},
   --   {a="(%W)(')(i)", b="%1إ%3"},
   {a="([%s%(%[%<%-])(')([ua])", b="%1أ%3"},
   {a="([%s%(%[%<%-])(')(i)", b="%1إ%3"},
   -- final
   -- mi'aT is special orthography (unlike ^say'aN and .zim'aN):
   -- {a="(%^sa%.?[yY])(\"?%|?)(%')(aN)", b="%1%2ئ%4"}, --new
   -- {a="(.zi?m)(%')(aN)", b="%1ئ%3"}, --new
   {a="(mi)(%')(a[Tt])", b="%1ائ%3"},
   {a="(mi)(%')(aN%_?[AY])", b="%1أ%3"},
   -- final hamzah is on the line after a letter of prolongation or a
   -- consonant with sukūn
   {a="([^Auai])(')(\"?[uai]N?)(%p*)$", b="%1ء%3%4"}, --new
   {a="([^Auai])(')(\"?[uai]N?)(%p*%s)", b="%1ء%3%4"},
-- u
   {a="(u)(')([uai]N?%p*)$", b="%1ؤ%3"},
   {a="(u)(')([uai]N?)(%p*%s)", b="%1ؤ%3%4"},
   {a="(u)(')(%p*)$", b="%1ؤْ%3"},
   {a="(u)(')(%p*%s)", b="%1ؤْ%3"},
-- a
   {a="(a)(')(A%p*)$", b="%1آ"},
   {a="(a)(')(A)(%p*%s)", b="%1آ%4"},
   {a="(a)(')([u]N?%p*)$", b="%1أ%3"},
   {a="(a)(')([u]N?)(%p*%s)", b="%1أ%3%4"},
   {a="(a)(')(a%p*)$", b="%1أ%3"},
   {a="(a)(')(a)(%p*%s)", b="%1أ%3%4"},
   {a="(a)(')(aN%p*)$", b="%1أً"},
   {a="(a)(')(aN)(%p*%s)", b="%1أً%4"},
   {a="(a)(')([i]N?%p*)$", b="%1إ%3"},
   {a="(a)(')([i]N?)(%p*%s)", b="%1إ%3%4"},
   {a="(a)(')(%p*)$", b="%1أْ%3"},
   {a="(a)(')(%p*%s)", b="%1أْ%3"},
-- i
   {a="(i)(')([uai]N?%p*)$", b="%1ئ%3"},
   {a="(i)(')([uai]N?)(%p*%s)", b="%1ئ%3%4"},
   {a="(i)(')(%p*)$", b="%1ئْ%3"},
   {a="(i)(')(%p*%s)", b="%1ئْ%3"},
--
   -- middle
   {a="([UIwy])(')", b="%1ء"}, --new
   -- {a="([Iy])(')", b="%1ئ"}, --included in the above line
   {a="([^uai])(')([uU])", b="%1ؤ%3"},
   {a="([^uai])(')(%_?[aAY])", b="%1أ%3"},
   {a="([^uai])(')([iI])", b="%1ئ%3"},
   {a="(u)(')([uU])", b="%1ؤ%3"},
   {a="(u)(')(%_?[aAY])", b="%1ؤ%3"},
   {a="(u)(')([iI])", b="%1ئ%3"},
   {a="(a)(')(%_?[aAY])", b="%1أ%3"},
   {a="(a)(')([uU])", b="%1ؤ%3"},
   {a="(a)(')([iI])", b="%1ئ%3"},
   {a="(i)(')(%_?[aAY])", 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"},
   -- next lines for ʾalif alone
   {a="(%.A)([uai]?)l%-(%^n)", b="ا%2ل%3"}, --additional (^n is lunar)
   {a="([%(%[%|%<%s%-O])(%.A)([uai]?)l%-(%^n)", b="%1ا%3%4"}, --additional (^n is lunar) --p
   {a="(%.A)([uai]?)l%-([%_%^%.]?[tdrzsnc])", b="ا%2ل%3%3"},
   {a="([%(%[%|%<%s%-O])(%.A)([uai]?)l%-([%_%^%.]?[tdrzsnc])", b="%1ا%3ل%4%4"}, --p
   {a="%.A", b="ا"},
   -- 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="ؤ(%p*)$", b="ؤْ%1"},
   {a="ؤ(%p*%s)", b="ؤْ%1"},
   {a="أ([^uaiUAI])", b="أْ%1"},
   {a="أ(%p*)$", b="أْ%1"},
   {a="أ(%p*%s)", b="أْ%1"},
   {a="ئ([^uaiUAI])", b="ئْ%1"},
   {a="ئ(%p*)$", b="ئْ%1"},
   {a="ئ(%p*%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"},
   {a="([wf]a)%-\'([^uaiUAIl][^%-])", b="%1أْ%2"},
   {a="^u'([^uaiUAI])", b="اU%1"},
   {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1اU%2"},
   {a="^i'([^uaiUAI])", b="اI%1"},
   {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1اI%2"},
   -- madda (historic writing below)
   {a="'a'([^uaiUAI])", b="آ%1"},
   {a="([^uiyUI])\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   {a="^\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="آ%1"},
   {a="\'a?A(O[%_%^%.]?[%`%'btjghxdrzsfqklmnywAY]-O)", b="آ"},
   {a="(%W)\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   --easy (begin)
   {a="(A)(O%'[%S]-O)", b="ا"},
   {a="(A)(')(uN?%p*)$", b="aاء%3"},
   {a="(A)(')(uN?)(%p*%s)", b="aاء%3%4"},
   {a="(A)(')(iN?%p*)$", b="aاء%3"},
   {a="(A)(')(iN?)(%p*%s)", b="aاء%3%4"},
   {a="(A)(')([iI])", 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)
   -- 'aw: the diphthong is to be resolved into 'awi' (next 8 lines)
   {a="^('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
   {a="(%W)('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
   {a="^('aw)(O)([%(%[%|%<]?\"?[uai])([%S]-O)", b="%1i"},
   {a="(%W)('aw)(O)([%(%[%|%<]?\"?[uai])([%S]-O)", b="%1%2i"},
   {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
   {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
   {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
   {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
   -- then the 'initial' rules for the remaining cases
   {a="^(')([ua])", b="أ%2"},
   {a="^(')(i)", b="إ%2"},
   -- consider replacing initial %W with [%s%(%[%<%-]:
   --   {a="(%W)(')([ua])", b="%1أ%3"},
   --   {a="(%W)(')(i)", b="%1إ%3"},
   {a="([%s%(%[%<%-])(')([ua])", b="%1أ%3"},
   {a="([%s%(%[%<%-])(')(i)", b="%1إ%3"},
   -- final
   -- mi'aT is special orthography (unlike ^say'aN and .zim'aN)
   -- {a="(%^sa%.?[yY])(\"?%|?)(%')(aN)", b="%1%2ئ%4"}, --new
   -- {a="(.zi?m)(%')(aN)", b="%1ئ%3"}, --new
   {a="(mi)(%')(a[Tt])", b="%1ائ%3"},
   {a="(mi)(%')(aN%_?[AY])", b="%1أ%3"},
   -- easy (begin)
   -- The Munjid says that such words as radI'aN do not have the
   -- hamzah alone on the line, so take out the following two lines
   -- (final hamzah is on the line after a letter of prolongation or a
   -- consonant with sukūn)
   -- {a="([^Auai])(')(\"?[uai]N?)(%p*)$", b="%1ء%3%4"}, --new
   -- {a="([^Auai])(')(\"?[uai]N?)(%p*%s)", b="%1ء%3%4"},
   {a="([^Auai])(')(\"?aN)(%p*)$", b="%1ئ%3%4"}, --new
   {a="([^Auai])(')(\"?aN)(%p*%s)", b="%1ئ%3%4"}, --new
   {a="([^uai])(')(\"?a)(%p*)$", b="%1ء%3%4"}, --new
   {a="([^uai])(')(\"?a)(%p*%s)", b="%1ء%3%4"}, --new
   {a="([^uai])(')(\"?[ui]N?)(%p*)$", b="%1ء%3%4"}, --new
   {a="([^uai])(')(\"?[ui]N?)(%p*%s)", b="%1ء%3%4"}, --new
   --easy (end)
-- u
   {a="(u)(')([uai]N?%p*)$", b="%1ؤ%3"},
   {a="(u)(')([uai]N?)(%p*%s)", b="%1ؤ%3%4"},
   {a="(u)(')(%p*)$", b="%1ؤْ%3"},
   {a="(u)(')(%p*%s)", b="%1ؤْ%3"},
-- a
   {a="(a)(')(A%p*)$", b="%1آ"},
   {a="(a)(')(A)(%p*%s)", b="%1آ%4"},
   {a="(a)(')([u]N?%p*)$", b="%1أ%3"},
   {a="(a)(')([u]N?)(%p*%s)", b="%1أ%3%4"},
   {a="(a)(')(a%p*)$", b="%1أ%3"},
   {a="(a)(')(a)(%p*%s)", b="%1أ%3%4"},
   {a="(a)(')(aN%p*)$", b="%1أً"},
   {a="(a)(')(aN)(%p*%s)", b="%1أً%4"},
   {a="(a)(')([i]N?%p*)$", b="%1إ%3"},
   {a="(a)(')([i]N?)(%p*%s)", b="%1إ%3%4"},
   {a="(a)(')(%p*)$", b="%1أْ%3"},
   {a="(a)(')(%p*%s)", b="%1أْ%3"},
-- i
   {a="(i)(')([uai]N?%p*)$", b="%1ئ%3"},
   {a="(i)(')([uai]N?)(%p*%s)", b="%1ئ%3%4"},
   {a="(i)(')(%p*)$", b="%1ئْ%3"},
   {a="(i)(')(%p*%s)", b="%1ئْ%3"},
--
   -- middle
   {a="([Uw])(')", b="%1ء"}, --new
   {a="([Iy])(')", b="%1ئ"}, --easy
   {a="([^uai])(')([uU])", b="%1ؤ%3"},
   {a="([^uai])(')(%_?[aAY])", b="%1أ%3"},
   {a="([^uai])(')([iI])", b="%1ئ%3"},
   {a="(u)(')([uU])", b="%1ؤ%3"},
   {a="(u)(')(%_?[aAY])", b="%1ؤ%3"},
   {a="(u)(')([iI])", b="%1ئ%3"},
   {a="(a)(')(%_?[aAY])", b="%1أ%3"},
   {a="(a)(')([uU])", b="%1ؤ%3"},
   {a="(a)(')([iI])", b="%1ئ%3"},
   {a="(i)(')(%_?[aAY])", 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 = { -- with assimilations (\SetArbDflt*)
   -- assimilations (begin)
   {a="(O[%S]-)(%-?[uai]N[UI]?)(O)([rlmnwy])", b="%4%4"},
   {a="(%-?[uai]NU)(%s)([rlmnwy])", b="%1%2%3%3"},
   -- assimilations (end)
   {a="(O[%S]-)(%-?[uai]N[UI]?)(O)([uai])", b="ٱ"},
   {a="%-?(uNU)(%s)([uai])", b="%1%2ٱ"},
   {a="%-?(aNU)(%s)([uai])", b="%1%2ٱ"},
   {a="%-?(iNU)(%s)([uai])", b="%1%2ٱ"},
   {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="(O[%S]-)(%-?aN)(_A)(O)([rlmnwy])", b="%5%5"},
   {a="(O[%S]-)(%-?aN)(Y)(O)([rlmnwy])", b="%5%5"},
   {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%2%3%4%4"}, --new
   {a="([^TA])%-?(aN)(%s)([rlmnwy])", b="%1ًا%3%4%4"},
   {a="%-?(iNI?)(%s)([rlmnwy])", b="ٍ%2%3%3"},
   -- assimilations (end)
   {a="(O[%S]-)(%-?aN)(_A)(O)([uai])", b="ٱ"},
   {a="(O[%S]-)(%-?aN)(Y)(O)([uai])", b="ٱ"},
   -- 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%2"}, --new
   {a="([^TA])%-?(\"aN)", b="%1ا"},
   {a="%-?(\"iNI?)", b=""},
   -- quoted tanwīn (end)
   {a="%-?(uN)", b="ٌ"},
   {a="(B)%-?(aN)", b="%1ً"},
   -- needed by \arbcolor:
   {a="%-?(aN)(O[%S]-%_AO)", b="ً"},
   {a="%-?(aN)(O[%S]-YO)", b="ً"},
   {a="(O[%S]-TO)%-?(aN)", b="ً"},
   {a="(O[%S]-)([اآ])(ء)(O)%-?(aN)", b="ً"}, --new
   {a="(O[%S]-[^TA]O)%-?(aN)", b="ًا"},
   --
   {a="%-?(aN)(_A)", b="ًى"},
   {a="%-?(aN)(Y)", b="ًى"},
   {a="(T)%-?(aN)", b="%1ً"},
   {a="([اآ])(ء)%-?(aN)", b="%1%2ً"}, --new
   {a="([^TA])%-?(aN)", b="%1ًا"},
   {a="%-?(iNI?)", b="ٍ"}
}

tanwinfveasy = { -- no assimilations (see below)
   -- assimilations (begin)
--easy   {a="(O[%S]-)(%-?[uai]N[UI]?)(O)([rlmnwy])", b="%4%4"},
--easy   {a="(%-?[uai]NU)(%s)([rlmnwy])", b="%1%2%3%3"},
   -- assimilations (end)
   {a="(O[%S]-)(%-?[uai]N[UI]?)(O)([uai])", b="ٱ"},
   {a="%-?(uNU)(%s)([uai])", b="%1%2ٱ"},
   {a="%-?(aNU)(%s)([uai])", b="%1%2ٱ"},
   {a="%-?(iNU)(%s)([uai])", b="%1%2ٱ"},
   {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="(O[%S]-)(%-?aN)(_A)(O)([rlmnwy])", b="%5%5"},
--easy   {a="(O[%S]-)(%-?aN)(Y)(O)([rlmnwy])", b="%5%5"},
--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%2%3%4%4"}, --new
--easy   {a="([^TA])%-?(aN)(%s)([rlmnwy])", b="%1ًا%3%4%4"},
--easy   {a="%-?(iNI?)(%s)([rlmnwy])", b="ٍ%2%3%3"},
   -- assimilations (end)
   {a="(O[%S]-)(%-?aN)(_A)(O)([uai])", b="ٱ"},
   {a="(O[%S]-)(%-?aN)(Y)(O)([uai])", b="ٱ"},
   -- 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%2"}, --new
   {a="([^TA])%-?(\"aN)", b="%1ا"},
   {a="%-?(\"iNI?)", b=""},
   -- quoted tanwīn (end)
   {a="%-?(uN)", b="ٌ"},
   {a="(B)%-?(aN)", b="%1ً"},
   -- needed by \arbcolor:
   {a="%-?(aN)(O[%S]-%_AO)", b="ً"},
   {a="%-?(aN)(O[%S]-YO)", b="ً"},
   {a="(O[%S]-TO)%-?(aN)", b="ً"},
   {a="(O[%S]-)([اآ])(ء)(O)%-?(aN)", b="ً"}, --new
   {a="(O[%S]-[^TA]O)%-?(aN)", b="ًا"},
   --
   {a="%-?(aN)(_A)", b="ًى"},
   {a="%-?(aN)(Y)", b="ًى"},
   {a="(T)%-?(aN)", b="%1ً"},
   {a="([اآ])(ء)%-?(aN)", b="%1%2ً"}, --new
   {a="([^TA])%-?(aN)", b="%1ًا"},
   {a="%-?(iNI?)", b="ٍ"}
}

trigraphsfv = { -- trigraphs or more
   -- ʾalif al-waṣl: put it back on with \arbnull
   {a="(O[%S]-)([%'a]l%-)(O)(\"?[uai])", b="ٱ"},
   -- 'llatI / 'llad_I
   {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"},
   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"}, --p
   -- law: the diphthong is to be resolved into 'awi' (next 8 lines)
   {a="^(law)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
   {a="(%W)(law)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
   {a="^(law)(O)(\"?[uai])([%S]-O)", b="%1i"},
   {a="(%W)(law)(O)(\"?[uai])([%S]-O)", b="%1%2i"},
   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
   -- al- + lām
   {a="^(a)l%-(l)", b="ا%1ل%2%2"},
   {a="([%(%[%|%<%s%-O])(a)l%-(l)", b="%1ا%2ل%3%3"}, --p
   -- al- + solar consonant ('c' and '^n' are additional characters)
   {a="^(a)l%-(%^n)", b="ا%1ل%2"}, -- ^n is lunar
   {a="([%(%[%|%<%s%-O])(a)l%-(%^n)", b="%1ا%2ل%3"}, -- ^n is lunar --p
   {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="ا%1ل%2%2"},
   {a="([%(%[%|%<%s%-O])(a)l%-([%_%^%.]?[tdrzsnc])", b="%1ا%2ل%3%3"}, --p
   -- assim. art. + solar consonant ('c' and '^n' are additional characters)
   {a="^(a)(%^n)%-", b="ا%1ل"}, -- ^n is lunar
   {a="([%(%[%|%<%s%-O])(a)(%^n)%-", b="%1ا%2ل"}, -- ^n is lunar --p
   {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="ا%1ل%2"},
   {a="([%(%[%|%<%s%-O])(a)([%_%^%.]?[tdrzsnc])%-", b="%1ا%2ل%3"}, --p
   -- al- + initial unstable hamza
   {a="^(a)l%-(\"?[uai])", b="ا%1ل%2ٱ"},
   {a="([%(%[%|%<%s%-O])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"}, --p
   -- 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%-O])(a)l%-", b="%1ا%2لْ"}, --p
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="awuا"},
   {a="(aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1u"},
   {a="(ay)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
   {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
   -- ('c' and '^n' are additional characters)
   {a="'l%-(%^n)", b="ٱل%1"}, -- ^n is lunar
   {a="'l%-([%_%^%.]?[tdrzsnc])", b="ٱل%1%1"},
   -- li-/la- + art. + lām
   {a="l([ai])%-l%-(l)", b="ل%1%2%2"},
   -- assim. art. with waṣla + solar consonant
   -- ('c' and '^n' are additional characters)
   {a="'(%^n)%-", b="ٱل"}, -- ^n is lunar
   {a="'([%_%^%.]?[tdrzsnc])%-", b="ٱل%1"},
   -- li-/la- + art. + solar consonant is a special orthography
   -- ('c' and '^n' are additional characters)
   {a="l([ai])%-l%-(%^n)", b="ل%1ل%2"}, -- ^n is lunar
   {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="ل%1ل%2%2"},
   -- li-/la- + assim. art. + solar consonant is a special orthography
   -- ('c' and '^n' are additional characters)
   {a="l([ai])%-(%^n)%-(%^n)", b="ل%1ل%3"}, -- ^n is lunar
   {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", 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(%p*)$", b="uو%1"},
   {a="uU(%p*%s)", b="uو%1"},
   {a="aU(%p*)$", b="aو%1"},
   {a="aU(%p*%s)", b="aو%1"},
   {a="iU(%p*)$", b="iو%1"},
   {a="iU(%p*%s)", 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ي"}
}

-- idgham/assimilation rules for trigraphs apply here : see voc lua
-- file.

trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs)
   -- ʾalif al-waṣl: put it back on with \arbnull
   {a="(O[%S]-)([%'a]l%-)(O)(\"?[uai])", b="ٱ"},
   -- 'llatI / 'llad_I
   {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"},
   {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"}, --p
   -- law: the diphthong is to be resolved into 'awi' (next 8 lines)
   {a="^(law)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
   {a="(%W)(law)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
   {a="^(law)(O)(\"?[uai])([%S]-O)", b="%1i"},
   {a="(%W)(law)(O)(\"?[uai])([%S]-O)", b="%1%2i"},
   {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
   {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
   {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"},
   {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"},
   -- al- + lām
   {a="^(a)l%-(l)", b="ا%1ل%2%2"},
   {a="([%(%[%|%<%s%-O])(a)l%-(l)", b="%1ا%2ل%3%3"}, --p
   -- al- + solar consonant ('c' and '^n' are additional characters)
   {a="^(a)l%-(%^n)", b="ا%1ل%2"}, -- ^n is lunar
   {a="([%(%[%|%<%s%-O])(a)l%-(%^n)", b="%1ا%2ل%3"}, -- ^n is lunar --p
   {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="ا%1ل%2%2"},
   {a="([%(%[%|%<%s%-O])(a)l%-([%_%^%.]?[tdrzsnc])", b="%1ا%2ل%3%3"}, --p
   -- assim. art. + solar consonant ('c' and '^n' are additional characters)
   {a="^(a)(%^n)%-", b="ا%1ل"}, -- ^n is lunar
   {a="([%(%[%|%<%s%-O])(a)(%^n)%-", b="%1ا%2ل"}, -- ^n is lunar --p
   {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="ا%1ل%2"},
   {a="([%(%[%|%<%s%-O])(a)([%_%^%.]?[tdrzsnc])%-", b="%1ا%2ل%3"}, --p
   -- al- + initial unstable hamza
   {a="^(a)l%-(\"?[uai])", b="ا%1ل%2ٱ"},
   {a="([%(%[%|%<%s%-O])(a)l%-(\"?[uai])", b="%1ا%2ل%3ٱ"}, --p
   -- 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%-O])(a)l%-", b="%1ا%2لْ"}, --p
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="awuا"},
   {a="(aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1u"},
   {a="(ay)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
   {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
   -- ('c' and '^n' are additional characters)
   {a="'l%-(%^n)", b="ٱل%1"}, -- ^n is lunar
   {a="'l%-([%_%^%.]?[tdrzsnc])", b="ٱل%1%1"},
   -- li-/la- + art. + lām
   {a="l([ai])%-l%-(l)", b="ل%1%2%2"},
   -- assim. art. with waṣla + solar consonant
   -- ('c' and '^n' are is an additional characters)
   {a="'(%^n)%-", b="ٱل"}, -- ^n is lunar
   {a="'([%_%^%.]?[tdrzsnc])%-", b="ٱل%1"},
   -- li-/la- + art. + solar consonant is a special orthography
   -- ('c' and '^n' are additional characters)
   {a="l([ai])%-l%-(%^n)", b="ل%1ل%2"}, -- ^n is lunar
   {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="ل%1ل%2%2"},
   -- li-/la- + assim. art. + solar consonant is a special orthography
   -- ('c and '^n' are additional characters)
   {a="l([ai])%-(%^n)%-(%^n)", b="ل%1ل%3"}, -- ^n is lunar
   {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", 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(%p*)$", b="uو%1"},
   {a="uU(%p*%s)", b="uو%1"},
   {a="aU(%p*)$", b="aو%1"},
   {a="aU(%p*%s)", b="aو%1"},
   {a="iU(%p*)$", b="iو%1"},
   {a="iU(%p*%s)", 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ي"}
}

digraphsfvidgham = {
   -- ʾ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ٱ"}, --p
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(O)(\"?[uai])([%S]-O)", b="awuا"},
   {a="(aW)(%s)([%(%[%|%<]?)(\"?[uai])", b="awuا%2%3ٱ"}, --p
   {a="(aw)(O)(\"?[uai])([%S]-O)", b="%1u"},
   {a="(aw)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1u%2%3ٱ"}, --p
   {a="(ay)(O)(\"?[uai])([%S]-O)", b="%1i"},
   {a="(ay)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1i%2%3ٱ"}, --p
   -- hyphen + initial alif without hamza
   --   {a="([uai]%-)(\"?[uai])", b="%1ٱ"},
   {a="([uai]%-)(\"?[uai])([%^%_%.%`]?)([%aأإؤئ])", b="%1ٱ%3%4"},
   -- initial alif without hamza (next 4 lines)
   {a="(O[%S]-)([uaiUAIY])(O)(\"?[uai])", b="ٱ"},
   {a="([%_]?[uaiUAIY])(%s[%(%[%|%<]?)(\"?[uai])", b="%1%2ٱ"}, --p
   {a="^([%(%[%|%<]?)(\"?[uai])", b="%1ا%2"}, --p
   {a="(%s)([%(%[%|%<]?)(\"?[uai])", b="%1%2ا%3"}, --p
   {a="%-%-", b="ـ"},
   {a="ؤؤ", b="ؤّ"},
   {a="أأ", b="أّ"},
   {a="ئئ", b="ئّ"},
   {a="bb", b="بّ"},
   {a="BB", b="ـّ"},
   {a="([%_%^%.])([tghdsz])([tghdsz])", b="%1%2|%3"},
   -- same as above for additional characters:
   {a="([%_%^%.])([cn])([cn])", b="%1%2|%3"},
   {a="tt", b="تّ"},
   {a="%_t%_t", b="ثّ"},
   {a="jj", b="جّ"},
   {a="%^g%^g", b="جّ"},
   {a="%.h%.h", 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="يّ"},
   {a="%.y%.y", b="ىّ"},
   -- additional characters + šaddah (begin)
   {a="pp", b="پّ"},
   {a="vv", b="ڤّ"},
   {a="gg", b="گّ"},
   {a="%^c%^c", b="چّ"},
   {a="%^z%^z", b="ژّ"},
   {a="%^n%^n", b="ڭّ"},
   -- additional characters + šaddah (end)
   -- sukūn begin
   -- first, take out hyphen if any (next two lines):
   {a="([ai]Y)%-([uaiUAI])", b="%1%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p*)$", b="%1ْ%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p*%s)", b="%1ْ%2"},
   {a="([ai]Y)([%_]?[^%_uaiUAIYًٌٍ])", 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="%.y", b="ى"},
   -- additional characters (begin)
   {a="%^c", b="چ"},
   {a="%^z", b="ژ"},
   {a="%^n", b="ڭ"},
   -- additional characters (end)
   {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="ڊ"}
}

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ٱ"}, --p
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(O)(\"?[uai])([%S]-O)", b="awuا"},
   {a="(aW)(%s)([%(%[%|%<]?)(\"?[uai])", b="awuا%2%3ٱ"}, --p
   {a="(aw)(O)(\"?[uai])([%S]-O)", b="%1u"},
   {a="(aw)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1u%2%3ٱ"}, --p
   {a="(ay)(O)(\"?[uai])([%S]-O)", b="%1i"},
   {a="(ay)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1i%2%3ٱ"}, --p
   -- hyphen + initial alif without hamza
   --   {a="([uai]%-)(\"?[uai])", b="%1ٱ"},
   {a="([uai]%-)(\"?[uai])([%^%_%.%`]?)([%aأإؤئ])", b="%1ٱ%3%4"},
   -- initial alif without hamza (next 4 lines)
   {a="(O[%S]-)([uaiUAIY])(O)(\"?[uai])", b="ٱ"},
   {a="([%_]?[uaiUAIY])(%s[%(%[%|%<]?)(\"?[uai])", b="%1%2ٱ"}, --p
   {a="^([%(%[%|%<]?)(\"?[uai])", b="%1ا%2"}, --p
   {a="(%s)([%(%[%|%<]?)(\"?[uai])", b="%1%2ا%3"}, --p
   {a="%-%-", b="ـ"},
   {a="ؤؤ", b="ؤّ"},
   {a="أأ", b="أّ"},
   {a="ئئ", b="ئّ"},
   {a="bb", b="بّ"},
   {a="BB", b="ـّ"},
   {a="([%_%^%.])([tghdsz])([tghdsz])", b="%1%2|%3"},
   -- same as above for additional characters:
   {a="([%_%^%.])([cn])([cn])", b="%1%2|%3"},
   {a="tt", b="تّ"},
   {a="%_t%_t", b="ثّ"},
   {a="jj", b="جّ"},
   {a="%^g%^g", b="جّ"},
   {a="%.h%.h", 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="يّ"},
   {a="%.y%.y", b="ىّ"},
   -- additional characters + šaddah (begin)
   {a="pp", b="پّ"},
   {a="vv", b="ڤّ"},
   {a="gg", b="گّ"},
   {a="%^c%^c", b="چّ"},
   {a="%^z%^z", b="ژّ"},
   {a="%^n%^n", b="ڭّ"},
   -- additional characters + šaddah (end)
   -- sukūn begin
   -- first, take out hyphen if any (next two lines):
   {a="([ai]Y)%-([uaiUAI])", b="%1%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p*)$", b="%1ْ%2"},
   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p*%s)", b="%1ْ%2"},
   {a="([ai]Y)([%_]?[^%_uaiUAIYًٌٍ])", 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="%.y", b="ى"},
   -- additional characters (begin)
   {a="%^c", b="چ"},
   {a="%^z", b="ژ"},
   {a="%^n", b="ڭ"},
   -- additional characters (end)
   {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 differences 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ٱ"}, --p
   -- diphthongs to be resolved before ʾalif conjunctionis
   {a="(aW)(O)(\"?[uai])([%S]-O)", b="awuا"},
   {a="(aW)(%s)([%(%[%|%<]?)(\"?[uai])", b="awuا%2%3ٱ"}, --p
   {a="(aw)(O)(\"?[uai])([%S]-O)", b="%1u"},
   {a="(aw)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1u%2%3ٱ"}, --p
   {a="(ay)(O)(\"?[uai])([%S]-O)", b="%1i"},
   {a="(ay)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1i%2%3ٱ"}, --p
   -- hyphen + initial alif without hamza
   -- {a="([uai]%-)(\"?[uai])", b="%1ٱ"},
   {a="([uai]%-)(\"?[uai])([%^%_%.%`]?)([%aأإؤئ])", b="%1ٱ%3%4"},
   -- initial alif without hamza (next 4 lines)
   {a="(O[%S]-)([uaiUAIY])(O)(\"?[uai])", b="ٱ"},
   {a="([%_]?[uaiUAIY])(%s[%(%[%|%<]?)(\"?[uai])", b="%1%2ٱ"}, --p
   {a="^([%(%[%|%<]?)(\"?[uai])", b="%1ا%2"}, --p
   {a="(%s)([%(%[%|%<]?)(\"?[uai])", b="%1%2ا%3"}, --p
   {a="%-%-", b="ـ"},
   {a="ؤؤ", b="ؤّ"},
   {a="أأ", b="أّ"},
   {a="ئئ", b="ئّ"},
   {a="bb", b="بّ"},
   {a="BB", b="ـّ"},
   {a="([%_%^%.])([tghdsz])([tghdsz])", b="%1%2|%3"},
   -- same as above for additional characters:
   {a="([%_%^%.])([cn])([cn])", b="%1%2|%3"},
   {a="tt", b="تّ"},
   {a="%_t%_t", b="ثّ"},
   {a="jj", b="جّ"},
   {a="%^g%^g", b="جّ"},
   {a="%.h%.h", 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="يّ"},
   {a="%.y%.y", b="ىّ"},
   -- additional characters + šaddah (begin)
   {a="pp", b="پّ"},
   {a="vv", b="ڤّ"},
   {a="gg", b="گّ"},
   {a="%^c%^c", b="چّ"},
   {a="%^z%^z", b="ژّ"},
   {a="%^n%^n", b="ڭّ"},
   -- additional characters + šaddah (end)
   -- 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 (next two lines):
--   {a="([ai]Y)%-([uaiUAI])", b="%1%2"},
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"},
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p*)$", b="%1ْ%2"},
--   {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p*%s)", b="%1ْ%2"},
--   {a="([ai]Y)([%_]?[^%_uaiUAIYًٌٍ])", 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="%.y", b="ى"},
   -- additional characters (begin)
   {a="%^c", b="چ"},
   {a="%^z", b="ژ"},
   {a="%^n", b="ڭ"},
   -- additional characters (end)
   {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="ة"},
   -- additional characters (begin)
   {a="p", b="پ"},
   {a="v", b="ڤ"},
   {a="g", b="گ"},
   -- additional characters (end)
   {a="\"$", b=""},
   {a="\"(%W)", b="%1"},
   {a="\"([^uaiUAI])", b="%1"},
   {a="o", b="ْ"}, -- hard-coded sukūn
   {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="ة"},
   -- additional characters (begin)
   {a="p", b="پ"},
   {a="v", b="ڤ"},
   {a="g", b="گ"},
   -- additional characters (end)
   -- 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="ـ"},
}