diff options
Diffstat (limited to 'arabluatex_trans.lua')
-rw-r--r-- | arabluatex_trans.lua | 72 |
1 files changed, 71 insertions, 1 deletions
diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua index e12eaa0..7820cd1 100644 --- a/arabluatex_trans.lua +++ b/arabluatex_trans.lua | |||
@@ -631,10 +631,78 @@ finaltrloc = { | |||
631 | 631 | ||
632 | -- arabica | 632 | -- arabica |
633 | 633 | ||
634 | hamzatrarabica = { -- ≠ from hamzatrloc: initial hamza has to be held | ||
635 | -- hard coded hamza | ||
636 | {a="|\"'", b="ʾ"}, | ||
637 | {a="A\"'", b="ʾA"}, | ||
638 | {a="[au]\"'", b="ʾ"}, | ||
639 | {a="w\"'", b="ʾ"}, | ||
640 | {a="i\"'", b="ʾ"}, | ||
641 | {a="y\"'", b="ʾ"}, | ||
642 | -- hamza takes tašdīd too | ||
643 | {a="''([Uu])", b="ʾʾ%1"}, | ||
644 | {a="''([Aa])", b="ʾʾ%1"}, | ||
645 | {a="''([Ii])", b="ʾʾ%1"}, | ||
646 | -- initial long u and i (for a, see below) | ||
647 | {a="%'%_U", b="U"}, | ||
648 | {a="%'%_I", b="I"}, | ||
649 | -- taḫfīfu 'l-hamza | ||
650 | {a="^'u'([^uaiUAI])", b="U%1"}, | ||
651 | {a="(%W)'u'([^uaiUAI])", b="%1U%2"}, | ||
652 | {a="'u'([^uaiUAI])", b="ʾU"}, | ||
653 | {a="^'i'([^uaiUAI])", b="I%1"}, | ||
654 | {a="(%W)'i'([^uaiUAI])", b="%1I%2"}, | ||
655 | {a="'i'([^uaiUAI])", b="ʾI"}, | ||
656 | -- madda (historic writing below) | ||
657 | {a="^(')(A)", b="%2"}, | ||
658 | {a="(%W)(')(A)", b="%1%3"}, | ||
659 | {a="^'a'([^uaiUAI])", b="A%1"}, | ||
660 | {a="(%W)'a'([^uaiUAI])", b="%1A%2"}, | ||
661 | {a="'a'([^uaiUAI])", b="A%1"}, | ||
662 | {a="^'a?A", b="A"}, | ||
663 | {a="(%W)'a?A", b="%1A"}, | ||
664 | {a="'a?A", b="ʾA"}, | ||
665 | {a="(A)(')(i)$", b="%1ʾ%3"}, | ||
666 | {a="(A)(')(i)(%W)", b="%1ʾ%3%4"}, | ||
667 | {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda | ||
668 | {a="(A)(')", b="%1ʾ"}, -- historic madda | ||
669 | -- initial (needs both ^ and %W patterns): | ||
670 | -- hold it for now (see below, beginning of digraphs table) | ||
671 | {a="^(')([ua])", b="@%2"}, | ||
672 | {a="^(')(i)", b="@%2"}, | ||
673 | {a="(%W)(')([ua])", b="%1@%3"}, | ||
674 | {a="(%W)(')(i)", b="%1@%3"}, | ||
675 | -- final | ||
676 | {a="([Iy])(')(aN)$", b="%1ʾ%3"}, | ||
677 | {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"}, | ||
678 | {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"}, | ||
679 | {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"}, | ||
680 | {a="([UI])(')([uai])$", b="%1ʾ%3"}, | ||
681 | {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"}, | ||
682 | -- middle | ||
683 | {a="(U)(')", b="%1ʾ"}, | ||
684 | {a="([Iy])(')", b="%1ʾ"}, | ||
685 | {a="([^uai])(')([uU])", b="%1ʾ%3"}, | ||
686 | {a="([^uai])(')([aA])", b="%1ʾ%3"}, | ||
687 | {a="([^uai])(')([iI])", b="%1ʾ%3"}, | ||
688 | {a="(u)(')([uU])", b="%1ʾ%3"}, | ||
689 | {a="(u)(')([aA])", b="%1ʾ%3"}, | ||
690 | {a="(u)(')([iI])", b="%1ʾ%3"}, | ||
691 | {a="(a)(')([aA])", b="%1ʾ%3"}, | ||
692 | {a="(a)(')([uU])", b="%1ʾ%3"}, | ||
693 | {a="(a)(')([iI])", b="%1ʾ%3"}, | ||
694 | {a="(i)(')([aA])", b="%1ʾ%3"}, | ||
695 | {a="(i)(')([uU])", b="%1ʾ%3"}, | ||
696 | {a="(i)(')([iI])", b="%1ʾ%3"}, | ||
697 | {a="(a)(')([^uaiUAI])", b="%1ʾ%3"}, | ||
698 | {a="(u)(')([^uaiUAI])", b="%1ʾ%3"}, | ||
699 | {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} | ||
700 | } | ||
701 | |||
634 | trigraphstrarabica = { -- trigraphs or more | 702 | trigraphstrarabica = { -- trigraphs or more |
635 | -- 'llatI / 'llad_I | 703 | -- 'llatI / 'llad_I |
636 | {a="^'ll(a)([%_]?[dt])", b="ll%1%2"}, | 704 | {a="^'ll(a)([%_]?[dt])", b="ll%1%2"}, |
637 | {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p | 705 | {a="([%-%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p |
638 | -- al- + lām | 706 | -- al- + lām |
639 | {a="^(a)l%-(l)", b="%1l-%2"}, | 707 | {a="^(a)l%-(l)", b="%1l-%2"}, |
640 | {a="(%s)(a)l%-(l)", b="%1%2l-%3"}, | 708 | {a="(%s)(a)l%-(l)", b="%1%2l-%3"}, |
@@ -682,6 +750,8 @@ trigraphstrarabica = { -- trigraphs or more | |||
682 | } | 750 | } |
683 | 751 | ||
684 | digraphstrarabica = { | 752 | digraphstrarabica = { |
753 | {a="([uai]%-)(\"?[uai])", b="%1"}, -- hyphen + initial alif without hamza | ||
754 | {a="@", b=""}, -- remove the tag before the former hamza | ||
685 | -- discard the ʾiʿrāb hyphen (begin) | 755 | -- discard the ʾiʿrāb hyphen (begin) |
686 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, | 756 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, |
687 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, | 757 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, |