diff options
Diffstat (limited to 'arabluatex.lua')
-rw-r--r-- | arabluatex.lua | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/arabluatex.lua b/arabluatex.lua index 931b239..2d5ccd2 100644 --- a/arabluatex.lua +++ b/arabluatex.lua | |||
@@ -670,7 +670,8 @@ function cap(str) | |||
670 | body = string.sub(body, 2, -2) | 670 | body = string.sub(body, 2, -2) |
671 | return string.format("%s", body) | 671 | return string.format("%s", body) |
672 | end) | 672 | end) |
673 | str = string.gsub(str, "(%s)(bn)([uai])", "%1{%2}%3") -- protect bn[uai] | 673 | -- protect bn[uai] (next line): |
674 | str = string.gsub(str, "(%s)(%'?bn)", "%1{%2}") | ||
674 | if string.find(str, "[^\\]%-['`ʾʿ]") then | 675 | if string.find(str, "[^\\]%-['`ʾʿ]") then |
675 | str = string.gsub(str, "([^\\]%-['`])(%a)", "%1\\MakeUppercase{%2}") | 676 | str = string.gsub(str, "([^\\]%-['`])(%a)", "%1\\MakeUppercase{%2}") |
676 | str = string.gsub(str, "([^\\]%-ʿ)(%a)", "%1\\MakeUppercase{%2}") | 677 | str = string.gsub(str, "([^\\]%-ʿ)(%a)", "%1\\MakeUppercase{%2}") |
@@ -680,24 +681,21 @@ function cap(str) | |||
680 | str = string.gsub(str, "([^\\]%-)(%a)", "%1\\MakeUppercase{%2}") | 681 | str = string.gsub(str, "([^\\]%-)(%a)", "%1\\MakeUppercase{%2}") |
681 | end | 682 | end |
682 | if string.find(str, "^['`ʾʿ]") then | 683 | if string.find(str, "^['`ʾʿ]") then |
683 | str = string.gsub(str, "^(['`])(%a)", "%1\\MakeUppercase{%2}") | 684 | str = string.gsub(str, "^(['`])(%a)([^%-])", "%1\\MakeUppercase{%2}%3") |
684 | str = string.gsub(str, "^(ʿ)(%a)", "%1\\MakeUppercase{%2}") | 685 | str = string.gsub(str, "^(ʿ)(%a)([^%-])", "%1\\MakeUppercase{%2}%3") |
685 | str = string.gsub(str, "^(ʾ)(%a)", "%1\\MakeUppercase{%2}") | 686 | str = string.gsub(str, "^(ʾ)(%a)([^%-])", "%1\\MakeUppercase{%2}%3") |
686 | end | 687 | end |
687 | if string.find(str, "%s['`ʾʿ]") then | 688 | if string.find(str, "%s['`ʾʿ]") then |
688 | -- str = string.gsub(str, "(%s['`])(%a)", "%1\\MakeUppercase{%2}") | 689 | str = string.gsub(str, "(%s['`])(%a)([^%-])", "%1\\MakeUppercase{%2}%3") |
689 | str = string.gsub(str, "(%sʿ)(%a)", "%1\\MakeUppercase{%2}") | 690 | str = string.gsub(str, "(%sʿ)(%a)([^%-])", "%1\\MakeUppercase{%2}%3") |
690 | str = string.gsub(str, "(%sʾ)(%a)", "%1\\MakeUppercase{%2}") | 691 | str = string.gsub(str, "(%sʾ)(%a)([^%-])", "%1\\MakeUppercase{%2}%3") |
691 | end | 692 | end |
692 | if string.find(str, "%s[btṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwy]") then | 693 | if string.find(str, "%s[ibtṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwyč]") then |
693 | str = string.gsub(str, "(%s)([btṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwy])", "%1\\MakeUppercase{%2}") | 694 | str = string.gsub(str, "(%s)([ibtṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwyč])", "%1\\MakeUppercase{%2}") |
694 | end | 695 | end |
695 | if string.find(str, "^[btṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwy]") then | 696 | if string.find(str, "^[ibtṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwyč]") then |
696 | str = string.gsub(str, "^([btṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwy])", "\\MakeUppercase %1") | 697 | str = string.gsub(str, "^([ibtṯjgḥḫdḏrzsšṣḍṭẓġfqklmnhwyč])", "\\MakeUppercase %1") |
697 | end | 698 | end |
698 | -- else | ||
699 | -- str = "\\MakeUppercase "..str | ||
700 | -- end | ||
701 | return "\\txtrans{"..str.."}" | 699 | return "\\txtrans{"..str.."}" |
702 | end | 700 | end |
703 | 701 | ||