arabluatex_novoc.lua 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. --[[
  2. This file is part of the `arabluatex' package
  3. ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX
  4. Copyright (C) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023
  5. Robert Alessi <alessi@robertalessi.net>
  6. Permission to use, copy, modify, and distribute this software for any
  7. purpose with or without fee is hereby granted, provided that the above
  8. copyright notice and this permission notice appear in all copies.
  9. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  10. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  11. MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  12. ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  13. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  14. ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  15. OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. Please send error reports and suggestions for improvements to Robert
  17. Alessi <alessi@robertalessi.net>
  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="([TH])%-?(aN)(%s)([rlmnwy])", b="%1%3%4%4"},
  34. -- {a="(ء)%-?(aN)(%s)([rlmnwy])", b="%1%3%4%4"},
  35. -- {a="([^TAH])%-?(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="([TH])%-?(\"aN)", b="%1ً"},
  44. {a="([اآ])(ء)%-?(\"aN)", b="%1%2ً"}, --new
  45. {a="([^TAH])%-?(\"aN)", b="%1ًا"},
  46. {a="%-?(\"iNI?)", b="ٍ"},
  47. -- "quoted" tanwīn (end)
  48. {a="%-?(uN)", b=""},
  49. {a="(B)%-?(aN)", b="%1"},
  50. -- needed by \arbcolor:
  51. {a="%-?(aN)(O[%S]-%_AO)", b=""},
  52. {a="%-?(aN)(O[%S]-YO)", b=""},
  53. {a="(O[%S]-[TH]O)%-?(aN)", b=""},
  54. {a="(O[%S]-)([اآ])(ء)(O)%-?(aN)", b=""}, --new
  55. {a="(O[%S]-[^TAH]O)%-?(aN)", b=""},
  56. --
  57. {a="%-?(aN)(_A)", b="ى"},
  58. {a="%-?(aN)(Y)", b="ى"},
  59. {a="([TH])%-?(aN)", b="%1"},
  60. {a="([اآ])(ء)%-?(aN)", b="%1%2"}, --new
  61. {a="([^TAH])%-?(aN)", b="%1ا"},
  62. {a="%-?(iNI?)", b=""},
  63. -- ʾalif al-waṣl: put it back on with \arbnull
  64. {a="(O[%S]-)([%'a]l%-)(O)(\"?[uai])", b="%4"},
  65. -- initial straight double quote gives a connective ʾalif. This has
  66. -- nothing to do with the tanwīn, but I put it here for time being.
  67. {a="^\"", b="ٱ"},
  68. {a="([%s%-])\"", b="%1ٱ"}
  69. }
  70. trigraphsnv = { -- trigraphs or more
  71. -- Allah
  72. {a="l%-l_ah", b="l-ll_ah"},
  73. -- 'llatI / 'llad_I
  74. {a="^'ll(a)([%_]?[dt])", b="ال%1%2"},
  75. {a="([%(%[%|%<%s%-])'ll(a)([%_]?[dt])", b="%1ال%2%3"}, --p
  76. -- al- + lām
  77. {a="^(a)l%-(l)", b="ا%1ل%2"},
  78. {a="([%(%[%|%<%s%-])(a)l%-(l)", b="%1ا%2ل%3"}, --p
  79. -- al- + solar consonant ('c' and '^n' are additional characters)
  80. {a="^(a)l%-(%^n)", b="ا%1ل%2"}, -- ^n is lunar
  81. {a="([%(%[%|%<%s%-])(a)l%-(%^n)", b="%1ا%2ل%3"}, -- ^n is lunar --p
  82. {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="ا%1ل%2"},
  83. {a="([%(%[%|%<%s%-])(a)l%-([%_%^%.]?[tdrzsnc])", b="%1ا%2ل%3"}, --p
  84. -- assim. art. + solar consonant ('c' and '^n' are additional characters)
  85. {a="^(a)(%^n)%-", b="ا%1ل"}, -- ^n is lunar
  86. {a="([%(%[%|%<%s%-])(a)(%^n)%-", b="%1ا%2ل"}, -- ^n is lunar --p
  87. {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="ا%1ل"},
  88. {a="([%(%[%|%<%s%-])(a)([%_%^%.]?[tdrzsnc])%-", b="%1ا%2ل"}, --p
  89. -- al- + initial unstable hamza
  90. {a="^(a)l%-(\")([uai])", b="ا%1لٱ%3"},
  91. {a="([%(%[%|%<%s%-])(a)l%-(\")([uai])", b="%1ا%2لٱ%4"}, --p
  92. {a="^(a)l%-([uai])", b="ا%1لا%2"},
  93. {a="([%(%[%|%<%s%-])(a)l%-([uai])", b="%1ا%2لا%3"}, --p
  94. -- li-/la- + art. + initial unstable hamza is a special orthography
  95. {a="l([ai])%-l%-(\")([uai])", b="ل%1لٱ%3"},
  96. {a="l([ai])%-l%-([uai])", b="ل%1لا%2"},
  97. -- al- + lunar consonant (i.e. what remains)
  98. {a="^(a)l%-", b="ا%1ل"},
  99. {a="([%(%[%|%<%s%-])(a)l%-", b="%1ا%2ل"}, --p
  100. -- art. with waṣla + lām
  101. {a="'l%-(l)", b="ال%1"},
  102. -- art. with waṣla + solar consonant
  103. -- ('c' and '^n' are additional characters)
  104. {a="'l%-(%^n)", b="ال%1"}, -- ^n is lunar
  105. {a="'l%-([%_%^%.]?[tdrzsnc])", b="ال%1"},
  106. -- li-/la- + art. + lām
  107. {a="l([ai])%-l%-(l)", b="ل%1%2"},
  108. -- assim. art. with waṣla + solar consonant
  109. -- ('c' and '^n' are additional characters)
  110. {a="'(%^n)%-", b="ال"}, -- ^n is lunar
  111. {a="'([%_%^%.]?[tdrzsnc])%-", b="ال"},
  112. -- li-/la- + art. + solar consonant is a special orthography
  113. -- ('c' and '^n' are additional characters)
  114. {a="l([ai])%-l%-(%^n)", b="ل%1ل%2"}, -- ^n is lunar
  115. {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="ل%1ل%2"},
  116. -- li-/la + assim. art. + solar consonant is a special orthography
  117. -- ('c' and '^n' are additional characters)
  118. {a="l([ai])%-(%^n)%-(%^n)", b="ل%1ل%3"}, -- ^n is lunar
  119. {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", b="ل%1ل%3"},
  120. -- art. with waṣla + initial unstable hamza
  121. {a="'l%-(\")([uai])", b="الٱ%2"},
  122. {a="'l%-([uai])", b="الا%1"},
  123. -- art. with waṣla + lunar consonant (i.e. what remains)
  124. {a="'l%-", b="ال"},
  125. -- the silent wāw
  126. {a="uU(%p*)$", b="uو%1"},
  127. {a="uU(%p*%s)", b="uو%1"},
  128. {a="aU(%p*)$", b="aو%1"},
  129. {a="aU(%p*%s)", b="aو%1"},
  130. {a="iU(%p*)$", b="iو%1"},
  131. {a="iU(%p*%s)", b="iو%1"},
  132. -- words ending in -āT with silent wāw/yāʾ
  133. {a="(_a)UA", b="%1وا"},
  134. {a="(_a)U", b="%1و"},
  135. {a="(_a)I", b="%1ي"}
  136. }
  137. longvnv = {
  138. {a="\"A", b="َا"},
  139. {a="\"U", b="ُو"},
  140. {a="\"I", b="ِي"},
  141. {a="\"Y", b="aى"},
  142. {a="A", b="ا"},
  143. {a="U", b="و"},
  144. {a="I", b="ي"},
  145. {a="Y", b="ى"},
  146. }
  147. shortvnv = {
  148. {a="\"u", b="ُ"},
  149. {a="\"a", b="َ"},
  150. {a="\"i", b="ِ"},
  151. {a="%-?%.u", b="ُ"},
  152. {a="%-?%.a", b="َ"},
  153. {a="%-?%.i", b="ِ"},
  154. {a="u", b=""},
  155. {a="a", b=""},
  156. {a="i", b=""}
  157. }