aboutsummaryrefslogtreecommitdiff
path: root/arabluatex.dtx
AgeCommit message (Collapse)Author
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
2017-12-30a typo in the documentationRobert Alessi
2017-12-08commented out l.153 in arabluatex.dtx as the bug in dox has been fixedRobert Alessi
2017-11-06documentation update: \aemph* should be used to have the stroke printed over ↵Robert Alessi
the abjad number outside Arabic environments
2017-10-25a typo in the documentationRobert Alessi
2017-10-24a few additional remarks in the documentation; updated to v1.9.2v1.9.2Robert Alessi
2017-10-23done documenting for v1.9.2Robert Alessi
2017-10-23documenting the features to be included in v1.9.2Robert Alessi
2017-09-06bugfix: wrong redefinition of \aemph*Robert Alessi
2017-09-05new 'starred' \aemph* command which always puts the stroke over its argumentRobert Alessi
2017-09-05\aemph now outputs \underline instead of \overline in any of the ↵Robert Alessi
transliteration modes
2017-08-16bugfix: wrong vertical spacing at the end of the arabverse environmentRobert Alessi
2017-07-28updated to v1.9.1v1.9.1Robert Alessi
2017-07-07simplify the code of \LR|RLfootnote{}Robert Alessi
2017-07-05one additional point in the documentationv1.9Robert Alessi
2017-07-05a typoRobert Alessi
2017-07-04a typoRobert Alessi
2017-07-04documentation updated; getting close to v1.9Robert Alessi
2017-07-03the documentation now needs to be updatedRobert Alessi
2017-07-02new command \MkArbBreak{} for inserting user-defined single argument ↵Robert Alessi
commands in Arabic environments
2017-07-02some more examples of hamzah + pr. suffix in the documentationRobert Alessi
2017-06-30hamzah + pr. suffix: the carrier must pass into yāʾ before īRobert Alessi
2017-06-29li + art. + initial lām is to be transliterated as in 'li-l-lisāni' in dmg ↵Robert Alessi
mode. start updating the documentation
2017-06-26bugfix: initial hamzah after hyphen was broken; a couple of typosRobert Alessi
2017-06-25final yāʾ without dots, \textcolor: updating the documentationRobert Alessi
2017-06-25basic support for \textcolor in Arabic environmentRobert Alessi
2017-06-25get the rid of \arbcolor which is not actually neededRobert Alessi
2017-06-24new command \arbcolor which does the same as \textcolor in Arabic environmentsRobert Alessi
2017-06-20udpated to v.1.8.5Robert Alessi
2017-06-20additional Persian characters: documentation updatedRobert Alessi
2017-06-15a typo in the documentationRobert Alessi
2017-05-11babel-french: \frenchsetup is intended to replace \frenchbsetup; update the ↵Robert Alessi
documentation
2017-05-06updated to v1.8.4v1.8.4Robert Alessi
2017-04-27a typo in arabluatex.bibv1.8.3Robert Alessi
2017-04-27updated to v.1.8.3Robert Alessi
2017-04-02this is v1.8.2v1.8.2Robert Alessi
2017-04-02updated checksum and documentationRobert Alessi
2017-04-02new \Cap command that does the same as \cap but is never discarded; it is ↵Robert Alessi
used internally to protect \cap when it is necessary
2017-04-01the implementation of the 'arabica' transliteration needed more work; a ↵v1.8.1Robert Alessi
couple of bugs also found their way into v1.8 in the process
2017-03-30rephrased one sentence. this is v1.8v1.8Robert Alessi
2017-03-30arabica: updated documentationRobert Alessi
2017-03-18upgraded to v1.7.3v1.7.3Robert Alessi
2017-03-15upgraded to v1.7.2; a few additional explanatory notes in the documentationv1.7.2Robert Alessi
2017-03-15a few modifications in the .el style file; institutional email added in the ↵Robert Alessi
documentation
2017-03-14added affiliationRobert Alessi
2017-03-13moving the BT system to notabug.orgRobert Alessi
2017-03-06added one line above the copyright notice to give the name of the program ↵Robert Alessi
and a brief idea of what it does
2017-03-06the documentation is now PDF/A 1b compliant, and is licensed under the ↵Robert Alessi
Creative Commons Attribution-ShareAlike 4.0 International License
2017-01-08bugfixes: 'quoting' after a consonant did not take away the sukūn in ↵v1.7.1Robert Alessi
'default' fullvoc mode; long vowels were not shortened before 'llaḏī in dmg mode; a bit of tidy-up in the documentation
29 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
--[[
This file is part of the `arabluatex' package

ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX
Copyright (C) 2016--2017  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="ؤ(%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"},   
   -- madda (historic writing below)
   {a="'a'([^uaiUAI])", b="آ%1"},
   {a="([^uiUI])\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   {a="^\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="آ%1"},
   {a="(%W)\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   {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"},
   {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="(')(I%p?)$", b="إ%2"}, -- affix pr. 1st person sg.
   {a="(')(I)(%p?%s)", b="إ%2%3"}, -- affix pr. 1st person sg.
   {a="([^uai])(')([uai]N?%p?)$", b="%1ء%3"},
   {a="([^uai])(')([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ؤْ"},
   {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أْ"},
   {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ئْ"},
   {a="(i)(')(%p?%s)", 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="ؤ(%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"},   
   -- madda (historic writing below)
   {a="'a'([^uaiUAI])", b="آ%1"},
   {a="([^uiUI])\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   {a="^\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="آ%1"},
   {a="(%W)\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"},
   --easy (begin)
   {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"},
   {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="(')(I%p?)$", b="إ%2"}, -- affix pr. 1st person sg.
   {a="(')(I)(%p?%s)", b="إ%2%3"}, -- affix pr. 1st person sg.
   {a="([^uai])(')([uai]N?%p?)$", b="%1ء%3"},
   {a="([^uai])(')([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ؤْ"},
   {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أْ"},
   {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ئْ"},
   {a="(i)(')(%p?%s)", 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 = { -- 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ً%3%4%4"},
   {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"},
   {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)
   -- 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ً%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)
   {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"},
   {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"}, --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
   {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
   {a="([%(%[%|%<%s%-o])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, --p
   -- assim. art. + solar consonant
   {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
   {a="([%(%[%|%<%s%-o])(a)([%_%^%.]?[tdrzsn])%-", 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
   {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(%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)
   -- '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
   {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"},
   {a="([%(%[%|%<%s%-o])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, --p
   -- assim. art. + solar consonant
   {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"},
   {a="([%(%[%|%<%s%-o])(a)([%_%^%.]?[tdrzsn])%-", 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
   {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(%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