aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2018-01-01 16:08:48 +0100
committerRobert Alessi <alessi@robertalessi.net>2018-01-01 16:08:48 +0100
commit09b5274e10b162f22e74b95744e91112579c6899 (patch)
tree0dea47259cfcbb067632ac9ef37a3665163f3330
parent035081bb656778b273ea5aa9ba5f152d64d25027 (diff)
downloadarabluatex-09b5274e10b162f22e74b95744e91112579c6899.tar.gz
\cap{} should be in order. Some more tests before documenting
-rw-r--r--arabluatex.lua27
1 files changed, 25 insertions, 2 deletions
diff --git a/arabluatex.lua b/arabluatex.lua
index 5c167e8..c2487cb 100644
--- a/arabluatex.lua
+++ b/arabluatex.lua
@@ -670,19 +670,42 @@ 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)", "%1{%2}")
673 for i = 1,#lcuc do 674 for i = 1,#lcuc do
674 str = string.gsub(str, "^([%S]-%-)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 675 str = string.gsub(str, "^([%S]-%-)"..lcuc[i].a, "{%1"..lcuc[i].b.."}")
676 end
677 for i = 1,#lcuc do
675 str = string.gsub(str, "(%s)([%S]-%-)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") 678 str = string.gsub(str, "(%s)([%S]-%-)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}")
679 end
680 for i = 1,#lcuc do
676 str = string.gsub(str, "^([%S]-%-ʿ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 681 str = string.gsub(str, "^([%S]-%-ʿ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}")
682 end
683 for i = 1,#lcuc do
677 str = string.gsub(str, "(%s)([%S]-%-ʿ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") 684 str = string.gsub(str, "(%s)([%S]-%-ʿ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}")
685 end
686 for i = 1,#lcuc do
678 str = string.gsub(str, "^([%S]-%-ʾ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 687 str = string.gsub(str, "^([%S]-%-ʾ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}")
688 end
689 for i = 1,#lcuc do
679 str = string.gsub(str, "(%s)([%S]-%-ʾ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") 690 str = string.gsub(str, "(%s)([%S]-%-ʾ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}")
691 end
692 for i = 1,#lcuc do
680 str = string.gsub(str, "^(ʾ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 693 str = string.gsub(str, "^(ʾ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}")
694 end
695 for i = 1,#lcuc do
681 str = string.gsub(str, "(%s)(ʾ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") 696 str = string.gsub(str, "(%s)(ʾ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}")
697 end
698 for i = 1,#lcuc do
682 str = string.gsub(str, "^(ʿ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 699 str = string.gsub(str, "^(ʿ)"..lcuc[i].a, "{%1"..lcuc[i].b.."}")
700 end
701 for i = 1,#lcuc do
683 str = string.gsub(str, "(%s)(ʿ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") 702 str = string.gsub(str, "(%s)(ʿ)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}")
684 str = string.gsub(str, "^"..lcuc[i].a, "{%1"..lcuc[i].b.."}") 703 end
685 str = string.gsub(str, "(%s)"..lcuc[i].a, "%1{%2"..lcuc[i].b.."}") 704 for i = 1,#lcuc do
705 str = string.gsub(str, "^"..lcuc[i].a, lcuc[i].b)
706 end
707 for i = 1,#lcuc do
708 str = string.gsub(str, "(%s)"..lcuc[i].a, "%1"..lcuc[i].b)
686 end 709 end
687 return "\\txtrans{"..str.."}" 710 return "\\txtrans{"..str.."}"
688end 711end