arabluatex_novoc.lua 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. --[[
  2. This file is part of the `arabluatex' package
  3. ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX
  4. Copyright (C) 2016--2018 Robert Alessi
  5. Please send error reports and suggestions for improvements to Robert
  6. Alessi <alessi@robertalessi.net>
  7. This program is free software: you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation, either version 3 of the License, or
  10. (at your option) any later version.
  11. This program is distributed in the hope that it will be useful, but
  12. WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. General Public License for more details.
  15. You should have received a copy of the GNU General Public License
  16. along with this program. If not, see
  17. <http://www.gnu.org/licenses/>.
  18. --]]
  19. tanwinnv = {
  20. -- assimilations (begin). These are good but may not apply here.
  21. -- {a="(o[%S]-)(%-?[uai]N[UI]?)(o)([rlmnwy])", b="%4%4"},
  22. -- {a="(%-?[uai]NU)(%s)([rlmnwy])", b="%1%2%3%3"},
  23. -- assimilations (end)
  24. {a="%-?uNU", b="و"},
  25. {a="%-?aNU", b="وا"},
  26. {a="%-?iNU", b="و"},
  27. -- assimilations (begin). These are good but may not apply here.
  28. -- {a="%-?(uN)(%s)([rlmnwy])", b="|%2%3%3"},
  29. -- {a="(o[%S]-)(%-?aN)(_A)(o)([rlmnwy])", b="%5%5"},
  30. -- {a="(o[%S]-)(%-?aN)(Y)(o)([rlmnwy])", b="%5%5"},
  31. -- {a="%-?(aN)(_A)(%s)([rlmnwy])", b="ى%3%4%4"},
  32. -- {a="%-?(aN)(Y)(%s)([rlmnwy])", b="ى%3%4%4"},
  33. -- {a="(T)%-?(aN)(%s)([rlmnwy])", b="%1%3%4%4"},
  34. -- {a="(ء)%-?(aN)(%s)([rlmnwy])", b="%1%3%4%4"},
  35. -- {a="([^TA])%-?(aN)(%s)([rlmnwy])", b="%1ا%3%4%4"},
  36. -- {a="%-?(iNI?)(%s)([rlmnwy])", b="|%2%3%3"},
  37. -- assimilations (end)
  38. -- "quoted" tanwīn (begin)
  39. {a="%-?(\"uN)", b="ٌ"},
  40. {a="(B)%-?(\"aN)", b="%1ً"},
  41. {a="%-?(\"aN)(_A)", b="ًى"},
  42. {a="%-?(\"aN)(Y)", b="ًى"},
  43. {a="(T)%-?(\"aN)", b="%1ً"},
  44. {a="([اآ])(ء)%-?(\"aN)", b="%1%2ً"}, --new
  45. {a="([^TA])%-?(\"aN)", b="%1ًا"},
  46. {a="%-?(\"iNI?)", b="ٍ"},
  47. -- "quoted" tanwīn (end)
  48. {a="%-?(uN)", b=""},
  49. {a="(B)%-?(aN)", b="%1"},
  50. {a="%-?(aN)(_A)", b="ى"},
  51. {a="%-?(aN)(Y)", b="ى"},
  52. {a="(T)%-?(aN)", b="%1"},
  53. {a="([اآ])(ء)%-?(aN)", b="%1%2"}, --new
  54. {a="([^TA])%-?(aN)", b="%1ا"},
  55. {a="%-?(iNI?)", b=""},
  56. -- initial straight double quote gives a connective ʾalif. This has
  57. -- nothing to do with the tanwīn, but I put it here for time being.
  58. {a="^\"", b="ٱ"},
  59. {a="([%s%-])\"", b="%1ٱ"}
  60. }
  61. trigraphsnv = { -- trigraphs or more
  62. -- Allah
  63. {a="l%-l_ah", b="l-ll_ah"},
  64. -- 'llatI / 'llad_I
  65. {a="^'ll(a)([%_]?[dt])", b="ال%1%2"},
  66. {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ال%2%3"}, --p
  67. -- al- + lām
  68. {a="^(a)l%-(l)", b="ا%1ل%2"},
  69. {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3"}, --p
  70. -- al- + solar consonant ('c' and '^n' are additional characters)
  71. {a="^(a)l%-(%^n)", b="ا%1ل%2"}, -- ^n is lunar
  72. {a="([%(%[%|%<%s%-])(a)l%-(%^n)", b="%1ا%2ل%3"}, -- ^n is lunar --p
  73. {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="ا%1ل%2"},
  74. {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsnc])", b="%1ا%2ل%3"}, --p
  75. -- assim. art. + solar consonant ('c' and '^n' are additional characters)
  76. {a="^(a)(%^n)%-", b="ا%1ل"}, -- ^n is lunar
  77. {a="([%(%[%|%<%s%-])(a)(%^n)%-", b="%1ا%2ل"}, -- ^n is lunar --p
  78. {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="ا%1ل"},
  79. {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsnc])%-", b="%1ا%2ل"}, --p
  80. -- al- + initial unstable hamza
  81. {a="^(a)l%-(\")([uai])", b="ا%1لٱ%3"},
  82. {a="([%(%[%|%<%s%-])(a)l%-(\")([uai])", b="%1ا%2لٱ%4"}, --p
  83. {a="^(a)l%-([uai])", b="ا%1لا%2"},
  84. {a="([%(%[%|%<%s%-])(a)l%-([uai])", b="%1ا%2لا%3"}, --p
  85. -- li-/la- + art. + initial unstable hamza is a special orthography
  86. {a="l([ai])%-l%-(\")([uai])", b="ل%1لٱ%3"},
  87. {a="l([ai])%-l%-([uai])", b="ل%1لا%2"},
  88. -- al- + lunar consonant (i.e. what remains)
  89. {a="^(a)l%-", b="ا%1ل"},
  90. {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2ل"}, --p
  91. -- art. with waṣla + lām
  92. {a="'l%-(l)", b="ال%1"},
  93. -- art. with waṣla + solar consonant
  94. -- ('c' and '^n' are additional characters)
  95. {a="'l%-(%^n)", b="ال%1"}, -- ^n is lunar
  96. {a="'l%-([%_%^%.]?[tdrzsnc])", b="ال%1"},
  97. -- li-/la- + art. + lām
  98. {a="l([ai])%-l%-(l)", b="ل%1%2"},
  99. -- assim. art. with waṣla + solar consonant
  100. -- ('c' and '^n' are additional characters)
  101. {a="'(%^n)%-", b="ال"}, -- ^n is lunar
  102. {a="'([%_%^%.]?[tdrzsnc])%-", b="ال"},
  103. -- li-/la- + art. + solar consonant is a special orthography
  104. -- ('c' and '^n' are additional characters)
  105. {a="l([ai])%-l%-(%^n)", b="ل%1ل%2"}, -- ^n is lunar
  106. {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="ل%1ل%2"},
  107. -- li-/la + assim. art. + solar consonant is a special orthography
  108. -- ('c' and '^n' are additional characters)
  109. {a="l([ai])%-(%^n)%-(%^n)", b="ل%1ل%3"}, -- ^n is lunar
  110. {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", b="ل%1ل%3"},
  111. -- art. with waṣla + initial unstable hamza
  112. {a="'l%-(\")([uai])", b="الٱ%2"},
  113. {a="'l%-([uai])", b="الا%1"},
  114. -- art. with waṣla + lunar consonant (i.e. what remains)
  115. {a="'l%-", b="ال"},
  116. -- the silent wāw
  117. {a="uU(%p*)$", b="uو%1"},
  118. {a="uU(%p*%s)", b="uو%1"},
  119. {a="aU(%p*)$", b="aو%1"},
  120. {a="aU(%p*%s)", b="aو%1"},
  121. {a="iU(%p*)$", b="iو%1"},
  122. {a="iU(%p*%s)", b="iو%1"},
  123. -- words ending in -āT with silent wāw/yāʾ
  124. {a="(_a)UA", b="%1وا"},
  125. {a="(_a)U", b="%1و"},
  126. {a="(_a)I", b="%1ي"}
  127. }
  128. longvnv = {
  129. {a="\"A", b="َا"},
  130. {a="\"U", b="ُو"},
  131. {a="\"I", b="ِي"},
  132. {a="\"Y", b="aى"},
  133. {a="A", b="ا"},
  134. {a="U", b="و"},
  135. {a="I", b="ي"},
  136. {a="Y", b="ى"},
  137. }
  138. shortvnv = {
  139. {a="\"u", b="ُ"},
  140. {a="\"a", b="َ"},
  141. {a="\"i", b="ِ"},
  142. {a="u", b=""},
  143. {a="a", b=""},
  144. {a="i", b=""}
  145. }