arabluatex_trans.lua 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  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. -- common
  20. punctuationtr = {
  21. {a="%(%(", b="("},
  22. {a="%)%)", b=")"}
  23. }
  24. nulltr = {
  25. {a="%|", b=""},
  26. {a="o", b=""},
  27. {a="O[%S]-O", b=""},
  28. {a="[%^%_](.)", b="<??>%1"}
  29. }
  30. -- cap (legacy)
  31. captr = {
  32. -- dmg (defaut); loc as well
  33. {a="ā", b="Ā"},
  34. {a="b", b="B"},
  35. {a="t", b="T"},
  36. {a="ṯ", b="Ṯ"},
  37. {a="ǧ", b="Ǧ"},
  38. {a="ḥ", b="Ḥ"},
  39. {a="ḫ", b="Ḫ"},
  40. {a="d", b="D"},
  41. {a="ḏ", b="Ḏ"},
  42. {a="r", b="R"},
  43. {a="z", b="Z"},
  44. {a="s", b="S"},
  45. {a="š", b="Š"},
  46. {a="ṣ", b="Ṣ"},
  47. {a="ḍ", b="Ḍ"},
  48. {a="ṭ", b="Ṭ"},
  49. {a="ẓ", b="Ẓ"},
  50. {a="ġ", b="Ġ"},
  51. {a="f", b="F"},
  52. {a="q", b="Q"},
  53. {a="k", b="K"},
  54. {a="l", b="L"},
  55. {a="m", b="M"},
  56. {a="n", b="N"},
  57. {a="h", b="H"},
  58. {a="w", b="W"},
  59. {a="ū", b="Ū"},
  60. {a="y", b="Y"},
  61. {a="ī", b="Ī"}
  62. }
  63. -- uc
  64. lcuc = {
  65. {a="b", b="B"},
  66. {a="t", b="T"},
  67. {a="ṯ", b="Ṯ"},
  68. {a="ǧ", b="Ǧ"},
  69. {a="j", b="J"},
  70. {a="ḥ", b="Ḥ"},
  71. {a="ḫ", b="Ḫ"},
  72. {a="d", b="D"},
  73. {a="ḏ", b="Ḏ"},
  74. {a="r", b="R"},
  75. {a="z", b="Z"},
  76. {a="s", b="S"},
  77. {a="š", b="Š"},
  78. {a="ṣ", b="Ṣ"},
  79. {a="ḍ", b="Ḍ"},
  80. {a="ṭ", b="Ṭ"},
  81. {a="ẓ", b="Ẓ"},
  82. {a="ġ", b="Ġ"},
  83. {a="f", b="F"},
  84. {a="q", b="Q"},
  85. {a="k", b="K"},
  86. {a="l", b="L"},
  87. {a="m", b="M"},
  88. {a="n", b="N"},
  89. {a="h", b="H"},
  90. {a="w", b="W"},
  91. {a="y", b="Y"},
  92. {a="u", b="U"},
  93. {a="a", b="A"},
  94. {a="i", b="I"},
  95. {a="ū", b="Ū"},
  96. {a="ā", b="Ā"},
  97. {a="ī", b="Ī"},
  98. -- additional characters
  99. {a="p", b="P"},
  100. {a="č", b="Č"},
  101. {a="ž", b="Ž"},
  102. {a="v", b="V"},
  103. {a="g", b="G"},
  104. {a="ñ", b="Ñ"},
  105. {a="ch", b="Ch"}, -- loc
  106. }
  107. -- dmg
  108. hamzatrdmg = {
  109. -- next lines for ʾalif alone
  110. {a="(%.A)l%-(%^n)", b=".|l-%2"}, --additional (^n is lunar)
  111. {a="([%(%[%|%<%s%-O])(%.A)l%-(%^n)", b="%1.|l-%3"}, --additional (^n is lunar) --p
  112. {a="(%.A)l%-([%_%^%.]?[tdrzsnc])", b=".|%2-%2"},
  113. {a="([%(%[%|%<%s%-O])(%.A)l%-([%_%^%.]?[tdrzsnc])", b="%1.|%3-%3"}, --p
  114. {a="(%.A)([uai])l%-(%^n)", b="||%2l-%3"}, --additional (^n is lunar)
  115. {a="([%(%[%|%<%s%-O])(%.A)([uai])l%-(%^n)", b="%1||%3l-%4"}, --additional (^n is lunar) --p
  116. {a="(%.A)([uai])l%-([%_%^%.]?[tdrzsnc])", b="||%2%3-%3"},
  117. {a="([%(%[%|%<%s%-O])(%.A)([uai])l%-([%_%^%.]?[tdrzsnc])", b="%1||%3%4-%4"}, --p
  118. {a="(%.A)([^uai])", b=".|%2"},
  119. {a="(%.A)([uai])", b="||%2"},
  120. -- hard coded hamza
  121. {a="|\"'", b="ʾ"},
  122. {a="A\"'", b="ʾA"},
  123. {a="[au]\"'", b="ʾ"},
  124. {a="w\"'", b="ʾ"},
  125. {a="i\"'", b="ʾ"},
  126. {a="y\"'", b="ʾ"},
  127. -- hamza takes tašdīd too
  128. {a="''([Uu])", b="ʾʾ%1"},
  129. {a="''([Aa])", b="ʾʾ%1"},
  130. {a="''([Ii])", b="ʾʾ%1"},
  131. -- initial long u and i (for a, see below)
  132. {a="%'%_U", b="ʾU"},
  133. {a="%'%_I", b="ʾI"},
  134. -- taḫfīfu 'l-hamza
  135. {a="'u'([^uaiUAI])", b="ʾU%1"},
  136. {a="'i'([^uaiUAI])", b="ʾI%1"},
  137. {a="^u'([^uaiUAI])", b="U%1"},
  138. {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1U%2"},
  139. {a="^i'([^uaiUAI])", b="I%1"},
  140. {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1I%2"},
  141. -- madda (historic writing below)
  142. {a="'a'([^uaiUAI])", b="ʾA%1"},
  143. {a="'a?A", b="ʾA"},
  144. {a="(A)(')(i)$", b="%1ʾ%3"},
  145. {a="(A)(')(i)(%W)", b="%1ʾ%3%4"},
  146. {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda
  147. {a="(A)(')", b="%1ʾ"}, -- historic madda
  148. -- initial (needs both ^ and %W patterns)
  149. -- 'aw: the diphthong is to be resolved into 'awi' (next 8 lines)
  150. {a="^('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
  151. {a="(%W)('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
  152. {a="^('aw)(O)(\"?[uai])([%S]-O)", b="%1i"},
  153. {a="(%W)('aw)(O)(\"?[uai])([%S]-O)", b="%1%2i"},
  154. {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
  155. {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
  156. {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"}, --p
  157. {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"}, --p
  158. -- then the 'initial' rules for the remaining cases
  159. {a="^(')([ua])", b="ʾ%2"},
  160. {a="^(')(i)", b="ʾ%2"},
  161. -- consider replacing initial %W with [%s%(%[%<%-]:
  162. -- {a="(%W)(')([ua])", b="%1ʾ%3"},
  163. -- {a="(%W)(')(i)", b="%1ʾ%3"},
  164. {a="([%s%(%[%<%-])(')([ua])", b="%1ʾ%3"},
  165. {a="([%s%(%[%<%-])(')(i)", b="%1ʾ%3"},
  166. -- final
  167. {a="([Iy])(')(aN)$", b="%1ʾ%3"},
  168. {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"},
  169. {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"},
  170. {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"},
  171. {a="([UI])(')([uai])$", b="%1ʾ%3"},
  172. {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"},
  173. -- middle
  174. {a="(U)(')", b="%1ʾ"},
  175. {a="([Iy])(')", b="%1ʾ"},
  176. {a="([^uai])(')([uU])", b="%1ʾ%3"},
  177. {a="([^uai])(')(%_?[aAY])", b="%1ʾ%3"},
  178. {a="([^uai])(')([iI])", b="%1ʾ%3"},
  179. {a="(u)(')([uU])", b="%1ʾ%3"},
  180. {a="(u)(')(%_?[aAY])", b="%1ʾ%3"},
  181. {a="(u)(')([iI])", b="%1ʾ%3"},
  182. {a="(a)(')(%_?[aAY])", b="%1ʾ%3"},
  183. {a="(a)(')([uU])", b="%1ʾ%3"},
  184. {a="(a)(')([iI])", b="%1ʾ%3"},
  185. {a="(i)(')(%_?[aAY])", b="%1ʾ%3"},
  186. {a="(i)(')([uU])", b="%1ʾ%3"},
  187. {a="(i)(')([iI])", b="%1ʾ%3"},
  188. {a="(a)(')([^uaiUAI])", b="%1ʾ%3"},
  189. {a="(u)(')([^uaiUAI])", b="%1ʾ%3"},
  190. {a="(i)(')([^uaiUAI])", b="%1ʾ%3"}
  191. }
  192. hamzatrnoinitialdmg = {
  193. -- next lines for ʾalif alone
  194. {a="(%.A)l%-(%^n)", b=".|l-%2"}, --additional (^n is lunar)
  195. {a="([%(%[%|%<%s%-O])(%.A)l%-(%^n)", b="%1.|l-%3"}, --additional (^n is lunar) --p
  196. {a="(%.A)l%-([%_%^%.]?[tdrzsnc])", b=".|%2-%2"},
  197. {a="([%(%[%|%<%s%-O])(%.A)l%-([%_%^%.]?[tdrzsnc])", b="%1.|%3-%3"}, --p
  198. {a="(%.A)([uai])l%-(%^n)", b="||%2l-%3"}, --additional (^n is lunar)
  199. {a="([%(%[%|%<%s%-O])(%.A)([uai])l%-(%^n)", b="%1||%3l-%4"}, --additional (^n is lunar) --p
  200. {a="(%.A)([uai])l%-([%_%^%.]?[tdrzsnc])", b="||%2%3-%3"},
  201. {a="([%(%[%|%<%s%-O])(%.A)([uai])l%-([%_%^%.]?[tdrzsnc])", b="%1||%3%4-%4"}, --p
  202. {a="(%.A)([^uai])", b=".|%2"},
  203. {a="(%.A)([uai])", b="||%2"},
  204. -- hard coded hamza
  205. {a="|\"'", b="ʾ"},
  206. {a="A\"'", b="ʾA"},
  207. {a="[au]\"'", b="ʾ"},
  208. {a="w\"'", b="ʾ"},
  209. {a="i\"'", b="ʾ"},
  210. {a="y\"'", b="ʾ"},
  211. -- hamza takes tašdīd too
  212. {a="''([Uu])", b="ʾʾ%1"},
  213. {a="''([Aa])", b="ʾʾ%1"},
  214. {a="''([Ii])", b="ʾʾ%1"},
  215. -- initial long u and i (for a, see below)
  216. {a="%'%_U", b="||U"},
  217. {a="%'%_I", b="||I"},
  218. -- taḫfīfu 'l-hamza
  219. {a="'u'([^uaiUAI])", b="|U%1"},
  220. {a="'i'([^uaiUAI])", b="|I%1"},
  221. {a="^u'([^uaiUAI])", b="U%1"},
  222. {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1U%2"},
  223. {a="^i'([^uaiUAI])", b="I%1"},
  224. {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1I%2"},
  225. -- madda (historic writing below)
  226. {a="'a'([^uaiUAI])", b="ʾA%1"},
  227. {a="'a?A", b="ʾA"},
  228. {a="(A)(')(i)$", b="%1ʾ%3"},
  229. {a="(A)(')(i)(%W)", b="%1ʾ%3%4"},
  230. {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda
  231. {a="(A)(')", b="%1ʾ"}, -- historic madda
  232. -- initial (needs both ^ and %W patterns)
  233. -- 'aw: the diphthong is to be resolved into 'awi' (next 8 lines)
  234. {a="^('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
  235. {a="(%W)('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
  236. {a="^('aw)(O)(\"?[uai])([%S]-O)", b="%1i"},
  237. {a="(%W)('aw)(O)(\"?[uai])([%S]-O)", b="%1%2i"},
  238. {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
  239. {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
  240. {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"}, --p
  241. {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"}, --p
  242. -- then the 'initial' rules for the remaining cases
  243. {a="^(')([ua])", b="||%2"},
  244. {a="^(')(i)", b="||%2"},
  245. -- consider replacing initial %W with [%s%(%[%<%-]:
  246. -- {a="(%W)(')([ua])", b="%1||%3"},
  247. -- {a="(%W)(')(i)", b="%1||%3"},
  248. {a="([%s%(%[%<%-])(')([ua])", b="%1||%3"},
  249. {a="([%s%(%[%<%-])(')(i)", b="%1||%3"},
  250. -- final
  251. {a="([Iy])(')(aN)$", b="%1ʾ%3"},
  252. {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"},
  253. {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"},
  254. {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"},
  255. {a="([UI])(')([uai])$", b="%1ʾ%3"},
  256. {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"},
  257. -- middle
  258. {a="(U)(')", b="%1ʾ"},
  259. {a="([Iy])(')", b="%1ʾ"},
  260. {a="([^uai])(')([uU])", b="%1ʾ%3"},
  261. {a="([^uai])(')(%_?[aAY])", b="%1ʾ%3"},
  262. {a="([^uai])(')([iI])", b="%1ʾ%3"},
  263. {a="(u)(')([uU])", b="%1ʾ%3"},
  264. {a="(u)(')(%_?[aAY])", b="%1ʾ%3"},
  265. {a="(u)(')([iI])", b="%1ʾ%3"},
  266. {a="(a)(')(%_?[aAY])", b="%1ʾ%3"},
  267. {a="(a)(')([uU])", b="%1ʾ%3"},
  268. {a="(a)(')([iI])", b="%1ʾ%3"},
  269. {a="(i)(')(%_?[aAY])", b="%1ʾ%3"},
  270. {a="(i)(')([uU])", b="%1ʾ%3"},
  271. {a="(i)(')([iI])", b="%1ʾ%3"},
  272. {a="(a)(')([^uaiUAI])", b="%1ʾ%3"},
  273. {a="(u)(')([^uaiUAI])", b="%1ʾ%3"},
  274. {a="(i)(')([^uaiUAI])", b="%1ʾ%3"}
  275. }
  276. tanwintrdmg = {
  277. {a="%-?([uai]NU)(O)([ui])([%S]-O)", b="\\arbup{un%3}"},
  278. {a="%-?([uai]NU)(%s)([ui])", b="\\arbup{un%3}%2'"},
  279. {a="%-?(iNI)(O)([ui])([%S]-O)", b="i\\arbup{n%3}"},
  280. {a="%-?(iNI)(%s)([ui])", b="i\\arbup{n%3}%2'"},
  281. {a="(O[%S]-)([uai]N[UI])(O)(\"?[ui])", b="'"},
  282. {a="%-?uNU", b="\\arbup{un}"},
  283. {a="%-?aNU", b="\\arbup{an}"},
  284. {a="%-?iNU", b="\\arbup{in}"},
  285. {a="%-?iNI", b="i\\arbup{n}"},
  286. -- tanwīn preceding ʾalif conjunctionis
  287. {a="%-?(uN)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="\\arbup{uni}"},
  288. {a="%-?(aN)(_A)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="ạ\\arbup{ni}"},
  289. {a="%-?(aN)(Y)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="ạ\\arbup{ni}"},
  290. {a="([TH])%-?(aN)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="t\\arbup{ani}"},
  291. {a="([^TAH])%-?(aN)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1\\arbup{ani}"},
  292. {a="%-?(iN)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="\\arbup{ini}"},
  293. {a="%-?(uN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="\\arbup{uni}%2%3"},
  294. {a="%-?(aN)(_A)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ạ\\arbup{ni}%3%4"},
  295. {a="%-?(aN)(Y)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ạ\\arbup{ni}%3%4"},
  296. {a="([TH])%-?(aN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="t\\arbup{ani}%3%4"},
  297. {a="([^TAH])%-?(aN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1\\arbup{ani}%3%4"},
  298. {a="%-?(iN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="\\arbup{ini}%2%3"},
  299. -- tanwīn preceding 'lla_dI/'llatI
  300. {a="%-?(uN)(O)('lla[%_]?[dt])([%S]-O)", b="\\arbup{uni}"},
  301. {a="%-?(aN)(_A)(O)('lla[%_]?[dt])([%S]-O)", b="ạ\\arbup{ni}"},
  302. {a="%-?(aN)(Y)(O)('lla[%_]?[dt])([%S]-O)", b="ạ\\arbup{ni}"},
  303. {a="([TH])%-?(aN)(O)('lla[%_]?[dt])([%S]-O)", b="t\\arbup{ani}"},
  304. {a="([^TAH])%-?(aN)(O)('lla[%_]?[dt])([%S]-O)", b="%1\\arbup{ani}"},
  305. {a="%-?(iN)(O)('lla[%_]?[dt])([%S]-O)", b="\\arbup{ini}"},
  306. {a="%-?(uN)(%s)('lla[%_]?[dt])", b="\\arbup{uni}%2%3"},
  307. {a="%-?(aN)(_A)(%s)('lla[%_]?[dt])", b="ạ\\arbup{ni}%3%4"},
  308. {a="%-?(aN)(Y)(%s)('lla[%_]?[dt])", b="ạ\\arbup{ni}%3%4"},
  309. {a="([TH])%-?(aN)(%s)('lla[%_]?[dt])", b="t\\arbup{ani}%3%4"},
  310. {a="([^TAH])%-?(aN)(%s)('lla[%_]?[dt])", b="%1\\arbup{ani}%3%4"},
  311. {a="%-?(iN)(%s)('lla[%_]?[dt])", b="\\arbup{ini}%2%3"},
  312. -- tanwīn + alif without hamza and kasra (ibn) or dhamma (uhrub)
  313. {a="%-?(uN)(O)([ui])([%S]-O)", b="\\arbup{un%3}"},
  314. {a="%-?(aN)(_A)(O)([ui])([%S]-O)", b="ạ\\arbup{n%4}"},
  315. {a="%-?(aN)(Y)(O)([ui])([%S]-O)", b="ạ\\arbup{n%4}"},
  316. {a="([TH])%-?(aN)(O)([ui])([%S]-O)", b="t\\arbup{an%4}"},
  317. {a="([^TAH])%-?(aN)(O)([ui])([%S]-O)", b="%1\\arbup{an%4}"},
  318. {a="%-?(iN)(O)([ui])([%S]-O)", b="\\arbup{in%3}"},
  319. {a="(O[%S]-)([uai]N)(O)(\"?[ui])", b="'"},
  320. {a="%-?(uN)(%s)([ui])", b="\\arbup{un%3}%2'"},
  321. {a="%-?(aN)(_A)(%s)([ui])", b="ạ\\arbup{n%4}%3'"},
  322. {a="%-?(aN)(Y)(%s)([ui])", b="ạ\\arbup{n%4}%3'"},
  323. {a="([TH])%-?(aN)(%s)([ui])", b="t\\arbup{an%4}%3'"},
  324. {a="([^TAH])%-?(aN)(%s)([ui])", b="%1\\arbup{an%4}%3'"},
  325. {a="%-?(iN)(%s)([ui])", b="\\arbup{in%3}%2'"},
  326. --
  327. -- {a="uN", b="\\arbup{un}"}, (now included in the last line of this table)
  328. {a="%-?(\"?At)%-?([ui])N", b="\\arbup{%1%2n}"},
  329. -- needed by \arbcolor:
  330. {a="%-?(aN)(O[%S]-%_AO)", b="ạ\\arbup{n}"},
  331. {a="%-?(aN)(O[%S]-YO)", b="ạ\\arbup{n}"},
  332. {a="(O[%S]-[TH]O)%-?(\"?aN)", b="\\arbup{an}"},
  333. {a="(O[%S]-[^TAH]O)%-?(\"?aN)", b="\\arbup{an}"},
  334. --
  335. {a="%-?(aN)(_A)", b="ạ\\arbup{n}"},
  336. {a="%-?(aN)(Y)", b="ạ\\arbup{n}"},
  337. {a="([TH])%-?(\"?aN)", b="t\\arbup{an}"},
  338. {a="([^TAH])%-?(\"?aN)", b="%1\\arbup{an}"},
  339. {a="%-?([ui])N", b="\\arbup{%1n}"}
  340. }
  341. trigraphstrdmg = { -- trigraphs or more
  342. -- 'llatI / 'llad_I
  343. {a="^'ll(a)([%_]?[dt])", b="'ll%1%2"},
  344. {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1'll%2%3"}, --p
  345. -- law: the diphthong is to be resolved into 'awi' (next 8 lines)
  346. {a="^(law)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
  347. {a="(%W)(law)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"},
  348. {a="^(law)(O)(\"?[uai])([%S]-O)", b="%1i"},
  349. {a="(%W)(law)(O)(\"?[uai])([%S]-O)", b="%1%2i"},
  350. {a="^(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
  351. {a="(%W)(law)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"},
  352. {a="^(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"}, --p
  353. {a="(%W)(law)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"}, --p
  354. -- al- + lām
  355. {a="^(a)l%-(l)", b="%1l-%2"},
  356. {a="([%(%[%|%<%s%-O])(a)l%-(l)", b="%1%2l-%3"}, --p
  357. -- al- + solar consonant ('c' and '^n' are additional characters)
  358. {a="^(a)l%-(%^n)", b="%1l-%2"}, -- ^n is lunar
  359. {a="([%(%[%|%<%s%-O])(a)l%-(%^n)", b="%1%2l-%3"}, --^n is lunar --p
  360. {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="%1%2-%2"},
  361. {a="([%(%[%|%<%s%-O])(a)l%-([%_%^%.]?[tdrzsnc])", b="%1%2%3-%3"}, --p
  362. -- assim. art. + solar consonant ('c' and '^n' are additional characters)
  363. {a="^(a)(%^n)%-", b="%1l-"}, -- ^n is lunar
  364. {a="([%(%[%|%<%s%-O])(a)(%^n)%-", b="%1%2l-"}, --^n is lunar --p
  365. {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="%1%2-"},
  366. {a="([%(%[%|%<%s%-O])(a)([%_%^%.]?[tdrzsnc])%-", b="%1%2%3-"}, --p
  367. -- al- + initial unstable hamza
  368. {a="^(a)l%-(\"?[uai])", b="%1l-%2"},
  369. {a="([%(%[%|%<%s%-O])(a)l%-(\"?[uai])", b="%1%2l-%3"}, --p
  370. -- li-/la- + art. + initial unstable hamza is a special orthography
  371. {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
  372. -- al- + lunar consonant (i.e. what remains)
  373. {a="^(a)l%-", b="%1l-"},
  374. {a="([%(%[%|%<%s%-O])(a)l%-", b="%1%2l-"}, --p
  375. -- diphthongs to be resolved before ʾalif conjunctionis
  376. {a="(aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1u"},
  377. {a="(ay)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"},
  378. {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"},
  379. {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"},
  380. -- art. with waṣla + lām
  381. {a="'l%-(l)", b="'l-%1"},
  382. -- art. with waṣla + solar consonant
  383. -- ('c' and '^n' are additional characters)
  384. {a="'l%-(%^n)", b="'l-%1"}, -- ^n is lunar
  385. {a="'l%-([%_%^%.]?[tdrzsnc])", b="'%1-%1"},
  386. -- li-/la- + art. + lām
  387. {a="l([ai])%-l%-(l)", b="l%1-%2-%2"},
  388. -- assim. art. with waṣla + solar consonant
  389. -- ('c' and '^n' are additional characters)
  390. {a="'(%^n)%-", b="'l-"}, -- ^n is lunar
  391. {a="'([%_%^%.]?[tdrzsnc])%-", b="'%1-"},
  392. -- li-/la- + art. + solar consonant is a special orthography
  393. -- ('c' and '^n' are additional characters)
  394. {a="l([ai])%-l%-(%^n)", b="l%1-l-%2"}, -- ^n is lunar
  395. {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="l%1-%2-%2"},
  396. -- li-/la- + assim. art. + solar consonant is a special orthography
  397. -- ('c' and '^n' are additional characters)
  398. {a="l([ai])%-(%^n)%-(%^n)", b="l%1-l-%3"}, -- ^n is lunar
  399. {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", b="l%1-%2-%3"},
  400. -- art. with waṣla + initial unstable hamza
  401. {a="'l%-(\"?[uai])", b="'l-%1"},
  402. -- art. with waṣla + lunar consonant (i.e. what remains)
  403. {a="'l%-", b="'l-"},
  404. -- the silent wāw
  405. {a="uU$", b="u"},
  406. {a="uU(%W)", b="u%1"},
  407. {a="aU$", b="a"},
  408. {a="aU(%W)", b="a%1"},
  409. {a="iU$", b="i"},
  410. {a="iU(%W)", b="i%1"},
  411. -- words ending in -āT with silent wāw/yāʾ
  412. {a="(_a)UA", b="A"},
  413. {a="(_a)U", b="A"},
  414. {a="(_a)I", b="A"}
  415. }
  416. idghamtrdmg = {
  417. -- assimilations
  418. {a="(n)(}?)(%s)([rlmnwy])", b="%4%2%3%4"},
  419. {a="(n)(}?)(O)([rlmnwy])([%S]-O)", b="%4%2"}
  420. }
  421. digraphstrdmg = {
  422. {a="([uai]%-)(\"?[uai])", b="%1'"}, -- hyphen + initial alif without hamza
  423. -- the following two are replaced with the 4 lines next for now
  424. -- {a="^(\"?[uai])", b="%1"}, -- initial alif without hamza
  425. -- {a="(%W)(\"?[uai])", b="%1%2"}, -- initial alif without hamza
  426. -- {a="^(\"[uai])", b="'"}, -- initial alif without hamza
  427. -- {a="(%W)(\"[uai])", b="%1'"}, -- initial alif without hamza
  428. {a="^(\"?[uai])", b="%1"}, -- initial alif without hamza
  429. {a="(%W)(\"?[uai])", b="%1%2"}, -- initial alif without hamza
  430. -- this is not necessary, take out for now:
  431. -- {a="([%_]?[uaiUAIY])(%s)([uai])", b="%1%2'"}, -- initial alif without hamza
  432. {a="(aw)(O)(\"?[uai])([%S]-O)", b="%1u"},
  433. {a="(aw)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1u%2%3'"}, --p
  434. {a="(ay)(O)(\"?[uai])([%S]-O)", b="%1i"},
  435. {a="(ay)(%s)([%(%[%|%<]?)(\"?[uai])", b="%1i%2%3'"}, --p
  436. {a="(aW)(O)(\"?[uai])([%S]-O)", b="awu"},
  437. {a="(UA)(O)(\"?[uai])([%S]-O)", b="u"},
  438. {a="(%_A)(O)(\"?[uai])([%S]-O)", b="ạ"},
  439. {a="(Y)(O)(\"?[uai])([%S]-O)", b="ạ"},
  440. {a="(%_a)(O)(\"?[uai])([%S]-O)", b="a"},
  441. {a="(A)(O)(\"?[uai])([%S]-O)", b="a"},
  442. {a="([%_]?[Uu])(O)(\"?[uai])([%S]-O)", b="u"},
  443. {a="([%_]?[Ii])(O)(\"?[uai])([%S]-O)", b="i"},
  444. {a="(O[%S]-)([%'a]l%-)(O)(\"?[uai])", b="'"},
  445. {a="(O[%S]-)([UAIYWuaiyw])(O)(\"?[uai])", b="'"},
  446. {a="(aW)(%s)([%(%[%|%<]?)(\"?[uai])", b="awu%2%3%4"}, --p
  447. {a="(UA)(%s)([%(%[%|%<]?)(\"?[uai])", b="u%2%3'"}, --p
  448. {a="([^%_][uai])(%s)([%(%[%|%<]?)(\"?[uai])", b="%1%2%3'"}, --p
  449. {a="(%_A)(%s)([%(%[%|%<]?)(\"?[uai])", b="ạ%2%3'"}, --p
  450. {a="(Y)(%s)([%(%[%|%<]?)(\"?[uai])", b="ạ%2%3'"}, --p
  451. {a="(%_a)(%s)([%(%[%|%<]?)(\"?[uai])", b="a%2%3'"}, --p
  452. {a="(A)(%s)([%(%[%|%<]?)(\"?[uai])", b="a%2%3'"}, --p
  453. {a="([%_]?[Uu])(%s)([%(%[%|%<]?)(\"?[uai])", b="u%2%3'"}, --p
  454. {a="([%_]?[Ii])(%s)([%(%[%|%<]?)(\"?[uai])", b="i%2%3'"}, --p
  455. -- ʾiʿrāb hyphen (begin)
  456. {a="(%-)(\"?[UI]na)(%p*%s)", b="\\arbup{%2}%3"},
  457. {a="(%-)(\"?[UI]na)(%p*)$", b="\\arbup{%2}%3"},
  458. {a="(%-)(\"?At%.?[ui])(%p*%s)", b="\\arbup{%2}%3"},
  459. {a="(%-)(\"?At%.?[ui])(%p*)$", b="\\arbup{%2}%3"},
  460. {a="(%-)(\"?Ani)(%p*%s)", b="\\arbup{%2}%3"},
  461. {a="(%-)(\"?Ani)(%p*)$", b="\\arbup{%2}%3"},
  462. {a="(%-)(\"?%.?ayni)(%p*%s)", b="\\arbup{%2}%3"},
  463. {a="(%-)(\"?%.?ayni)(%p*)$", b="\\arbup{%2}%3"},
  464. {a="(%-)(\"?%.?[uai])(%p*%s)", b="\\arbup{%2}%3"},
  465. {a="(%-)(\"?%.?[uai])(%p*)$", b="\\arbup{%2}%3"},
  466. -- ʾiʿrāb hyphen (end) shorten long vowels preceding ʾalif
  467. -- conjunctionis—without forgetting 'lla_dI
  468. {a="(U)(A)", b="U"},
  469. {a="(aW)(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="awu"},
  470. {a="(%_a)(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="a"},
  471. {a="(%_A)(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="ạ"},
  472. {a="(A)(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="a"},
  473. {a="(Y)(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="ạ"},
  474. {a="([%_]?[Uu])(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="u"},
  475. {a="([%_]?[Ii])(O)('[%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])([%S]-O)", b="i"},
  476. --p (next 7 lines, just after %s)
  477. {a="(aW)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="awu%2%3"},
  478. {a="(%_a)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="a%2%3"},
  479. {a="(%_A)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="ạ%2%3"},
  480. {a="(A)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="a%2%3"},
  481. {a="(Y)(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="ạ%2%3"},
  482. {a="([%_]?[Uu])(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="u%2%3"},
  483. {a="([%_]?[Ii])(%s)([%(%[%|%<]?['][%_%^%.]?[l'btjghxdrzs`fqkmnwy][%-l])", b="i%2%3"},
  484. {a="%-%-", b=""},
  485. -- {a="iyyaT(%p*)$", b="īyaT%1"}, -- previously. is now:
  486. {a="iyya([TH])(%p*)$", b="īya%1%2"},
  487. -- {a="iyyaT(%p*%s)", b="īyaT%1"}, -- previously. is now:
  488. {a="iyya([TH])(%p*%s)", b="īya%1%2"},
  489. {a="iyy(%p*)$", b="ī%1"},
  490. {a="iyy(%p*%s)", b="ī%1"},
  491. -- {a="[TH]([^uai])", b="%1"},
  492. {a="[TH](\\arbup)", b="t%1"},
  493. {a="([a%'][%_%^%.]?[tdrzsln]%-)(%S-)[TH]([%(%[%|%<%s])(a[%_%^%.]?[tdrzsln]%-)", b="%1%2h%3%4"}, --p
  494. {a="[TH]([%(%[%|%<%s])(a[%_%^%.]?[tdrzsln]%-)", b="t%1%2"}, --p
  495. {a="[TH]([%|\"])", b="t%1"},
  496. {a="[TH](%p*%s)", b="h%1"},
  497. {a="[TH](%p*)$", b="h%1"},
  498. {a="[TH](%p*)(%W)", b="h%1%2"},
  499. {a="_t", b="ṯ"},
  500. {a="%^g", b="ǧ"},
  501. {a="%.h", b="ḥ"},
  502. {a="_h", b="ḫ"},
  503. {a="_d", b="ḏ"},
  504. {a="%^s", b="š"},
  505. {a="%.s", b="ṣ"},
  506. {a="%.d", b="ḍ"},
  507. {a="%.t", b="ṭ"},
  508. {a="%.z", b="ẓ"},
  509. {a="%.g", b="ġ"},
  510. {a="%.y", b="y"},
  511. -- additional characters (begin)
  512. {a="%^c", b="č"},
  513. {a="%^z", b="ž"},
  514. {a="%^n", b="ñ"},
  515. -- additional characters (end)
  516. -- the following needs to be moved above shortening rules
  517. -- {a="(U)(A)", b="ū"},
  518. {a="WA", b="w"},
  519. {a="(a)W", b="%1w"},
  520. {a="_A", b="ạ̄"},
  521. {a="_u", b="ū"},
  522. {a="_a", b="ā"},
  523. {a="_i", b="ī"},
  524. {a="%.b", b="ḅ"},
  525. {a="%.f", b="f̣"},
  526. {a="%.q", b="q̣"},
  527. {a="%.k", b="k"},
  528. {a="%.n", b="ṇ"},
  529. {a="%^d", b="d́"}
  530. }
  531. singletrdmg = {
  532. {a="b", b="b"},
  533. {a="t", b="t"},
  534. {a="j", b="ǧ"},
  535. {a="x", b="ḫ"},
  536. {a="d", b="d"},
  537. {a="r", b="r"},
  538. {a="z", b="z"},
  539. {a="s", b="s"},
  540. {a="`", b="ʿ"},
  541. {a="f", b="f"},
  542. {a="q", b="q"},
  543. {a="k", b="k"},
  544. {a="l", b="l"},
  545. {a="m", b="m"},
  546. {a="n", b="n"},
  547. {a="h", b="h"},
  548. {a="w", b="w"},
  549. {a="y", b="y"},
  550. {a="T", b="t"},
  551. -- additional characters (begin)
  552. {a="H", b="t"},
  553. {a="p", b="p"},
  554. {a="v", b="v"},
  555. {a="g", b="g"},
  556. -- additional characters (end)
  557. {a="\"", b=""},
  558. {a="B", b=""}
  559. }
  560. longvtrdmg = {
  561. {a="A", b="ā"},
  562. {a="U", b="ū"},
  563. {a="I", b="ī"},
  564. {a="aY", b="ay"},
  565. {a="iY", b="ī"},
  566. {a="Y", b="ạ̄"}
  567. }
  568. shortvtrdmg = {
  569. {a="([uai])([uai])([uai])", b="/%1,%2,%3/"},
  570. {a="([uai])([uai])", b="/%1,%2/"},
  571. {a="%.u", b="u"},
  572. {a="%.a", b="a"},
  573. {a="%.i", b="i"},
  574. {a="u", b="u"},
  575. {a="a", b="a"},
  576. {a="i", b="i"}
  577. }
  578. -- loc
  579. hamzatrloc = {
  580. -- next lines for ʾalif alone
  581. {a="(%.A)([^uai])", b=".|%2"},
  582. {a="(%.A)([uai])", b="||%2"},
  583. -- hard coded hamza
  584. {a="|\"'", b="ʾ"},
  585. {a="A\"'", b="ʾA"},
  586. {a="[au]\"'", b="ʾ"},
  587. {a="w\"'", b="ʾ"},
  588. {a="i\"'", b="ʾ"},
  589. {a="y\"'", b="ʾ"},
  590. -- hamza takes tašdīd too
  591. {a="''([Uu])", b="ʾʾ%1"},
  592. {a="''([Aa])", b="ʾʾ%1"},
  593. {a="''([Ii])", b="ʾʾ%1"},
  594. -- initial long u and i (for a, see below)
  595. {a="%'%_U", b="U"},
  596. {a="%'%_I", b="I"},
  597. -- taḫfīfu 'l-hamza
  598. {a="^'u'([^uaiUAI])", b="U%1"},
  599. {a="([%s%(%[%<%-])'u'([^uaiUAI])", b="%1U%2"},
  600. {a="^'i'([^uaiUAI])", b="I%1"},
  601. {a="([%s%(%[%<%-])'i'([^uaiUAI])", b="%1I%2"},
  602. {a="^u'([^uaiUAI])", b="U%1"},
  603. {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1U%2"},
  604. {a="^i'([^uaiUAI])", b="I%1"},
  605. {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1I%2"},
  606. -- madda (historic writing below)
  607. {a="^(')(A)", b="%2"},
  608. {a="(%W)(')(A)", b="%1%3"},
  609. {a="^'a'([^uaiUAI])", b="A%1"},
  610. {a="(%W)'a'([^uaiUAI])", b="%1A%2"},
  611. {a="'a'([^uaiUAI])", b="A%1"},
  612. {a="^'a?A", b="A"},
  613. {a="(%W)'a?A", b="%1A"},
  614. {a="'a?A", b="ʾA"},
  615. {a="(A)(')(i)$", b="%1ʾ%3"},
  616. {a="(A)(')(i)(%W)", b="%1ʾ%3%4"},
  617. {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda
  618. {a="(A)(')", b="%1ʾ"}, -- historic madda
  619. -- initial (needs both ^ and %W patterns)
  620. {a="^(')([ua])", b="%2"},
  621. {a="^(')(i)", b="%2"},
  622. -- consider replacing initial %W with [%s%(%[%<%-]:
  623. -- {a="(%W)(')([ua])", b="%1%3"},
  624. -- {a="(%W)(')(i)", b="%1%3"},
  625. {a="([%s%(%[%<%-])(')([ua])", b="%1%3"},
  626. {a="([%s%(%[%<%-])(')(i)", b="%1%3"},
  627. -- final
  628. {a="([Iy])(')(aN)$", b="%1ʾ%3"},
  629. {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"},
  630. {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"},
  631. {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"},
  632. {a="([UI])(')([uai])$", b="%1ʾ%3"},
  633. {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"},
  634. -- middle
  635. {a="(U)(')", b="%1ʾ"},
  636. {a="([Iy])(')", b="%1ʾ"},
  637. {a="([^uai])(')([uU])", b="%1ʾ%3"},
  638. {a="([^uai])(')(%_?[aAY])", b="%1ʾ%3"},
  639. {a="([^uai])(')([iI])", b="%1ʾ%3"},
  640. {a="(u)(')([uU])", b="%1ʾ%3"},
  641. {a="(u)(')(%_?[aAY])", b="%1ʾ%3"},
  642. {a="(u)(')([iI])", b="%1ʾ%3"},
  643. {a="(a)(')(%_?[aAY])", b="%1ʾ%3"},
  644. {a="(a)(')([uU])", b="%1ʾ%3"},
  645. {a="(a)(')([iI])", b="%1ʾ%3"},
  646. {a="(i)(')(%_?[aAY])", b="%1ʾ%3"},
  647. {a="(i)(')([uU])", b="%1ʾ%3"},
  648. {a="(i)(')([iI])", b="%1ʾ%3"},
  649. {a="(a)(')([^uaiUAI])", b="%1ʾ%3"},
  650. {a="(u)(')([^uaiUAI])", b="%1ʾ%3"},
  651. {a="(i)(')([^uaiUAI])", b="%1ʾ%3"}
  652. }
  653. tanwintrloc = {
  654. {a="%-?uNU", b="un"},
  655. {a="%-?aNU", b="an"},
  656. {a="%-?iNU", b="in"},
  657. {a="%-?iNI", b="in"},
  658. {a="%-?(\"?At)%-?([ui])N", b="%1%2n"},
  659. {a="%-?([ui])N", b="%1n"},
  660. -- needed by \arbcolor:
  661. {a="%-?(aN)(O[%S]-%_AO)", b="an"},
  662. {a="%-?(aN)(O[%S]-YO)", b="an"},
  663. {a="(O[%S]-[TH]O)%-?(\"?aN)", b="an"},
  664. {a="(O[%S]-[^TAH]O)%-?(\"?aN)", b="an"},
  665. --
  666. {a="%-?(aN)(_A)", b="an"},
  667. {a="%-?(aN)(Y)", b="an"},
  668. {a="([TH])%-?(\"?aN)", b="tan"},
  669. {a="([^TAH])%-?(\"?aN)", b="%1an"}
  670. }
  671. trigraphstrloc = { -- trigraphs or more
  672. -- 'llatI / 'llad_I
  673. {a="^'ll(a)([%_]?[dt])", b="all%1%2"},
  674. {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1all%2%3"}, --p
  675. -- al- + lām
  676. {a="^(a)l%-(l)", b="%1l-%2"},
  677. {a="(%s)(a)l%-(l)", b="%1%2l-%3"},
  678. -- al- + solar consonant ('c' and '^n' are additional characters)
  679. {a="^(a)l%-(%^n)", b="%1l-%2"}, -- ^n is lunar
  680. {a="(%s)(a)l%-(%^n)", b="%1%2l-%3"}, -- ^n is lunar
  681. {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="%1l-%2"},
  682. {a="(%s)(a)l%-([%_%^%.]?[tdrzsnc])", b="%1%2l-%3"},
  683. -- assim. art. + solar consonant ('c' and '^n' are additional characters)
  684. {a="^(a)(%^n)%-", b="%1l-"}, -- ^n is lunar
  685. {a="(%s)(a)(%^n)%-", b="%1%2l-"}, -- ^n is lunar
  686. {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="%1l-"},
  687. {a="(%s)(a)([%_%^%.]?[tdrzsnc])%-", b="%1%2l-"},
  688. -- al- + initial unstable hamza
  689. {a="^(a)l%-([uai])", b="%1l-%2"},
  690. {a="(%s)(a)l%-([uai])", b="%1%2l-%3"},
  691. -- li-/la- + art. + initial unstable hamza is a special orthography
  692. {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
  693. -- al- + lunar consonant (i.e. what remains)
  694. {a="^(a)l%-", b="%1l-"},
  695. {a="(%s)(a)l%-", b="%1%2l-"},
  696. -- art. with waṣla + lām
  697. {a="'l%-(l)", b="al-%1"},
  698. -- art. with waṣla + solar consonant
  699. -- ('c' and '^n' are additional characters)
  700. {a="'l%-(%^n)", b="al-%1"}, -- ^n is lunar
  701. {a="'l%-([%_%^%.]?[tdrzsnc])", b="al-%1"},
  702. -- li-/la- + art. + lām
  703. {a="l([ai])%-l%-(l)", b="l%1-l-%2"},
  704. -- assim. art. with waṣla + solar consonant
  705. -- ('c' and '^n' are additional characters)
  706. {a="'(%^n)%-", b="al-"}, -- ^n is lunar
  707. {a="'([%_%^%.]?[tdrzsnc])%-", b="al-"},
  708. -- li-/la- + art. + solar consonant is a special orthography
  709. -- ('c' and '^n' are additional characters)
  710. {a="l([ai])%-l%-(%^n)", b="l%1-l-%2"}, -- ^n is lunar
  711. {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="l%1-l-%2"},
  712. -- li-/la- + assim. art. + solar consonant is a special orthography
  713. -- ('c' and '^n' are additional characters)
  714. {a="l([ai])%-(%^n)%-(%^n)", b="l%1-l-%3"}, -- ^n is lunar
  715. {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", b="l%1-l-%3"},
  716. -- art. with waṣla + initial unstable hamza
  717. {a="'l%-([uai])", b="al-%1"},
  718. -- art. with waṣla + lunar consonant (i.e. what remains)
  719. {a="'l%-", b="al-"},
  720. -- the silent wāw
  721. {a="uU$", b="u"},
  722. {a="uU(%W)", b="u%1"},
  723. {a="aU$", b="a"},
  724. {a="aU(%W)", b="a%1"},
  725. {a="iU$", b="i"},
  726. {a="iU(%W)", b="i%1"},
  727. -- words ending in -āT with silent wāw/yāʾ
  728. {a="(_a)UA", b="A"},
  729. {a="(_a)U", b="A"},
  730. {a="(_a)I", b="A"}
  731. }
  732. digraphstrloc = {
  733. -- discard the ʾiʿrāb hyphen (begin)
  734. {a="(%-)(\"?[UI]na)(%p*%s)", b="%2%3"},
  735. {a="(%-)(\"?[UI]na)(%p*)$", b="%2%3"},
  736. {a="(%-)(\"?At[ui])(%p*%s)", b="%2%3"},
  737. {a="(%-)(\"?At[ui])(%p*)$", b="%2%3"},
  738. {a="(%-)(\"?Ani)(%p*%s)", b="%2%3"},
  739. {a="(%-)(\"?Ani)(%p*)$", b="%2%3"},
  740. {a="(%-)(\"?ayni)(%p*%s)", b="%2%3"},
  741. {a="(%-)(\"?ayni)(%p*)$", b="%2%3"},
  742. {a="(%-)([uai])(%p*%s)", b="%2%3"},
  743. {a="(%-)([uai])(%p*)$", b="%2%3"},
  744. -- discard the ʾiʿrāb hyphen (end)
  745. {a="(%-)(\"?[uai])", b="%1%2"}, -- hyphen + initial alif without hamza
  746. {a="^(\"?[uai])", b="%1"}, -- initial alif without hamza
  747. {a="(%s)([uai])", b="%1%2"}, -- initial alif without hamza
  748. {a="%-%-", b=""},
  749. {a="uww", b="ūw"},
  750. {a="iyy(%p*)$", b="ī%1"},
  751. {a="iyy(%p*%s)", b="ī%1"},
  752. {a="iyy", b="īy"},
  753. {a="([tkdsg])(h)", b="%1'%2"},
  754. -- {a="[TH]([^uai])", b="h%1"},
  755. {a="([a%']l%-)(%S-)[TH]([%(%[%|%<%s])(al%-)", b="%1%2h%3%4"}, --p
  756. {a="[TH]([%(%[%|%<%s])(al%-)", b="t%1%2"}, --p
  757. {a="[TH]([%|\"])", b="t%1"},
  758. {a="[TH](%p*)$", b="h%1"},
  759. {a="[TH](%p*%s)", b="h%1"},
  760. {a="_t", b="th"},
  761. {a="%^g", b="j"},
  762. {a="%.h", b="ḥ"},
  763. {a="_h", b="kh"},
  764. {a="_d", b="dh"},
  765. {a="%^s", b="sh"},
  766. {a="%.s", b="ṣ"},
  767. {a="%.d", b="ḍ"},
  768. {a="%.t", b="ṭ"},
  769. {a="%.z", b="ẓ"},
  770. {a="%.g", b="gh"},
  771. {a="%.y", b="y"},
  772. -- additional characters (begin)
  773. {a="%^c", b="ch"},
  774. {a="%^z", b="zh"},
  775. {a="%^n", b="ñ"},
  776. -- additional characters (end)
  777. {a="(U)(A)", b="ū"},
  778. {a="WA", b="w"},
  779. {a="(a)W", b="%1w"},
  780. {a="_A", b="á"},
  781. {a="_u", b="ū"},
  782. {a="_a", b="ā"},
  783. {a="_i", b="ī"},
  784. {a="%.b", b="b"},
  785. {a="%.f", b="f"},
  786. {a="%.q", b="q"},
  787. {a="%.k", b="k"},
  788. {a="%.n", b="n"},
  789. {a="%^d", b="d"}
  790. }
  791. singletrloc = {
  792. {a="b", b="b"},
  793. {a="t", b="t"},
  794. {a="j", b="j"},
  795. {a="x", b="kh"},
  796. {a="d", b="d"},
  797. {a="r", b="r"},
  798. {a="z", b="z"},
  799. {a="s", b="s"},
  800. {a="`", b="`"},
  801. {a="f", b="f"},
  802. {a="q", b="q"},
  803. {a="k", b="k"},
  804. {a="l", b="l"},
  805. {a="m", b="m"},
  806. {a="n", b="n"},
  807. {a="h", b="h"},
  808. {a="w", b="w"},
  809. {a="y", b="y"},
  810. {a="T", b="t"},
  811. -- additional characters (begin)
  812. {a="H", b="t"},
  813. {a="p", b="p"},
  814. {a="v", b="v"},
  815. {a="g", b="g"},
  816. -- additional characters (end)
  817. {a="\"", b=""},
  818. {a="B", b=""}
  819. }
  820. longvtrloc = {
  821. {a="A", b="ā"},
  822. {a="U", b="ū"},
  823. {a="I", b="ī"},
  824. {a="aY", b="ay"},
  825. {a="iY", b="ī"},
  826. {a="Y", b="á"},
  827. }
  828. shortvtrloc = {
  829. {a="([uai])([uai])([uai])", b="/%1,%2,%3/"},
  830. {a="([uai])([uai])", b="/%1,%2/"},
  831. {a="%.u", b="u"},
  832. {a="%.a", b="a"},
  833. {a="%.i", b="i"},
  834. {a="u", b="u"},
  835. {a="a", b="a"},
  836. {a="i", b="i"}
  837. }
  838. finaltrloc = {
  839. {a="ʾ", b="'"},
  840. }
  841. -- arabica
  842. hamzatrarabica = { -- ≠ from hamzatrloc: initial hamza has to be held
  843. -- next lines for ʾalif alone
  844. {a="(%.A)([^uai])", b=".|%2"},
  845. {a="(%.A)([uai])", b="||%2"},
  846. -- hard coded hamza
  847. {a="|\"'", b="ʾ"},
  848. {a="A\"'", b="ʾA"},
  849. {a="[au]\"'", b="ʾ"},
  850. {a="w\"'", b="ʾ"},
  851. {a="i\"'", b="ʾ"},
  852. {a="y\"'", b="ʾ"},
  853. -- hamza takes tašdīd too
  854. {a="''([Uu])", b="ʾʾ%1"},
  855. {a="''([Aa])", b="ʾʾ%1"},
  856. {a="''([Ii])", b="ʾʾ%1"},
  857. -- initial long u and i (for a, see below)
  858. {a="%'%_U", b="U"},
  859. {a="%'%_I", b="I"},
  860. -- taḫfīfu 'l-hamza
  861. {a="^'u'([^uaiUAI])", b="U%1"},
  862. {a="([%s%(%[%<%-])'u'([^uaiUAI])", b="%1U%2"},
  863. {a="^'i'([^uaiUAI])", b="I%1"},
  864. {a="([%s%(%[%<%-])'i'([^uaiUAI])", b="%1I%2"},
  865. {a="^u'([^uaiUAI])", b="U%1"},
  866. {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1U%2"},
  867. {a="^i'([^uaiUAI])", b="I%1"},
  868. {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1I%2"},
  869. -- madda (historic writing below)
  870. {a="^(')(A)", b="%2"},
  871. {a="(%W)(')(A)", b="%1%3"},
  872. {a="^'a'([^uaiUAI])", b="A%1"},
  873. {a="(%W)'a'([^uaiUAI])", b="%1A%2"},
  874. {a="'a'([^uaiUAI])", b="A%1"},
  875. {a="^'a?A", b="A"},
  876. {a="(%W)'a?A", b="%1A"},
  877. {a="'a?A", b="ʾA"},
  878. {a="(A)(')(i)$", b="%1ʾ%3"},
  879. {a="(A)(')(i)(%W)", b="%1ʾ%3%4"},
  880. {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda
  881. {a="(A)(')", b="%1ʾ"}, -- historic madda
  882. -- initial (needs both ^ and %W patterns):
  883. -- hold it for now (see below, beginning of digraphs table)
  884. {a="^(')([ua])", b="@%2"},
  885. {a="^(')(i)", b="@%2"},
  886. -- consider replacing initial %W with [%s%(%[%<%-]:
  887. -- {a="(%W)(')([ua])", b="%1@%3"},
  888. -- {a="(%W)(')(i)", b="%1@%3"},
  889. {a="([%s%(%[%<%-])(')([ua])", b="%1@%3"},
  890. {a="([%s%(%[%<%-])(')(i)", b="%1@%3"},
  891. -- final
  892. {a="([Iy])(')(aN)$", b="%1ʾ%3"},
  893. {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"},
  894. {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"},
  895. {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"},
  896. {a="([UI])(')([uai])$", b="%1ʾ%3"},
  897. {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"},
  898. -- middle
  899. {a="(U)(')", b="%1ʾ"},
  900. {a="([Iy])(')", b="%1ʾ"},
  901. {a="([^uai])(')([uU])", b="%1ʾ%3"},
  902. {a="([^uai])(')(%_?[aAY])", b="%1ʾ%3"},
  903. {a="([^uai])(')([iI])", b="%1ʾ%3"},
  904. {a="(u)(')([uU])", b="%1ʾ%3"},
  905. {a="(u)(')(%_?[aAY])", b="%1ʾ%3"},
  906. {a="(u)(')([iI])", b="%1ʾ%3"},
  907. {a="(a)(')(%_?[aAY])", b="%1ʾ%3"},
  908. {a="(a)(')([uU])", b="%1ʾ%3"},
  909. {a="(a)(')([iI])", b="%1ʾ%3"},
  910. {a="(i)(')(%_?[aAY])", b="%1ʾ%3"},
  911. {a="(i)(')([uU])", b="%1ʾ%3"},
  912. {a="(i)(')([iI])", b="%1ʾ%3"},
  913. {a="(a)(')([^uaiUAI])", b="%1ʾ%3"},
  914. {a="(u)(')([^uaiUAI])", b="%1ʾ%3"},
  915. {a="(i)(')([^uaiUAI])", b="%1ʾ%3"}
  916. }
  917. trigraphstrarabica = { -- trigraphs or more
  918. -- 'llatI / 'llad_I
  919. {a="^'ll(a)([%_]?[dt])", b="ll%1%2"},
  920. {a="([%-%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p
  921. -- al- + lām
  922. {a="^(a)l%-(l)", b="%1l-%2"},
  923. {a="(%s)(a)l%-(l)", b="%1%2l-%3"},
  924. -- al- + solar consonant ('c' and '^n' are additional characters)
  925. {a="^(a)l%-(%^n)", b="%1l-%2"}, -- ^n is lunar
  926. {a="(%s)(a)l%-(%^n)", b="%1%2l-%3"}, -- ^n is lunar
  927. {a="^(a)l%-([%_%^%.]?[tdrzsnc])", b="%1l-%2"},
  928. {a="(%s)(a)l%-([%_%^%.]?[tdrzsnc])", b="%1%2l-%3"},
  929. -- assim. art. + solar consonant ('c' and '^n' are additional characters)
  930. {a="^(a)(%^n)%-", b="%1l-"}, -- ^n is lunar
  931. {a="(%s)(a)(%^n)%-", b="%1%2l-"}, -- ^n is lunar
  932. {a="^(a)([%_%^%.]?[tdrzsnc])%-", b="%1l-"},
  933. {a="(%s)(a)([%_%^%.]?[tdrzsnc])%-", b="%1%2l-"},
  934. -- al- + initial unstable hamza
  935. {a="^(a)l%-([uai])", b="%1l-%2"},
  936. {a="(%s)(a)l%-([uai])", b="%1%2l-%3"},
  937. -- li-/la- + art. + initial unstable hamza is a special orthography
  938. {a="l([ai])%-l%-([uai])", b="l%1-l-%2"},
  939. -- al- + lunar consonant (i.e. what remains)
  940. {a="^(a)l%-", b="%1l-"},
  941. {a="(%s)(a)l%-", b="%1%2l-"},
  942. -- art. with waṣla + lām
  943. {a="'l%-(l)", b="l-%1"},
  944. -- art. with waṣla + solar consonant
  945. -- ('c' and '^n' are additional characters)
  946. {a="'l%-(%^n)", b="l-%1"}, -- ^n is lunar
  947. {a="'l%-([%_%^%.]?[tdrzsnc])", b="l-%1"},
  948. -- li-/la- + art. + lām
  949. {a="l([ai])%-l%-(l)", b="l%1-l-%2"},
  950. -- assim. art. with waṣla + solar consonant
  951. -- ('c' and '^n' are additional characters)
  952. {a="'(%^n)%-", b="l-"}, -- ^n is lunar
  953. {a="'([%_%^%.]?[tdrzsnc])%-", b="l-"},
  954. -- li-/la- + art. + solar consonant is a special orthography
  955. -- ('c' and '^n' are additional characters)
  956. {a="l([ai])%-l%-(%^n)", b="l%1-l-%2"}, -- ^n is lunar
  957. {a="l([ai])%-l%-([%_%^%.]?[tdrzsnc])", b="l%1-l-%2"},
  958. -- li-/la- + assim. art. + solar consonant is a special orthography
  959. -- ('c' and '^n' are additional characters)
  960. {a="l([ai])%-(%^n)%-(%^n)", b="l%1-l-%3"}, -- ^n is lunar
  961. {a="l([ai])%-([%_%^%.]?[tdrzsnc])%-([%_%^%.]?[tdrzsnc])", b="l%1-l-%3"},
  962. -- art. with waṣla + initial unstable hamza
  963. {a="'l%-([uai])", b="l-%1"},
  964. -- art. with waṣla + lunar consonant (i.e. what remains)
  965. {a="'l%-", b="l-"},
  966. -- the silent wāw
  967. {a="uU$", b="u"},
  968. {a="uU(%W)", b="u%1"},
  969. {a="aU$", b="a"},
  970. {a="aU(%W)", b="a%1"},
  971. {a="iU$", b="i"},
  972. {a="iU(%W)", b="i%1"},
  973. -- words ending in -āT with silent wāw/yāʾ
  974. {a="(_a)UA", b="A"},
  975. {a="(_a)U", b="A"},
  976. {a="(_a)I", b="A"}
  977. }
  978. digraphstrarabica = {
  979. {a="([uai]%-)(\"?[uai])", b="%1"}, -- hyphen + initial alif without hamza
  980. {a="([UAIYuai])(%s)([%(%[%|%<]?)(\"?[uai])", b="%1%2%3"}, --p
  981. {a="(O[%S]-)([UAIuai])(O)(\"?[uai])", b=""},
  982. {a="@", b=""}, -- remove the tag before the former hamza
  983. -- discard the ʾiʿrāb hyphen (begin)
  984. {a="(%-)(\"?[UI]na)(%p*%s)", b="%2%3"},
  985. {a="(%-)(\"?[UI]na)(%p*)$", b="%2%3"},
  986. {a="(%-)(\"?At[ui])(%p*%s)", b="%2%3"},
  987. {a="(%-)(\"?At[ui])(%p*)$", b="%2%3"},
  988. {a="(%-)(\"?Ani)(%p*%s)", b="%2%3"},
  989. {a="(%-)(\"?Ani)(%p*)$", b="%2%3"},
  990. {a="(%-)(\"?ayni)(%p*%s)", b="%2%3"},
  991. {a="(%-)(\"?ayni)(%p*)$", b="%2%3"},
  992. {a="(%-)([uai])(%p*%s)", b="%2%3"},
  993. {a="(%-)([uai])(%p*)$", b="%2%3"},
  994. -- discard the ʾiʿrāb hyphen (end)
  995. {a="(%-)(\"?[uai])", b="%1%2"}, -- hyphen + initial alif without hamza
  996. {a="^(\"?[uai])", b="%1"}, -- initial alif without hamza
  997. {a="(%s)([uai])", b="%1%2"}, -- initial alif without hamza
  998. {a="%-%-", b=""},
  999. {a="iyy(%p*)$", b="ī%1"},
  1000. {a="iyy(%p*%s)", b="ī%1"},
  1001. -- {a="[TH]([^uai])", b="h%1"},
  1002. {a="([a%']l%-)(%S-)a[TH]([%(%[%|%<%s])(al%-)", b="%1%2a%3%4"}, --p
  1003. {a="a[TH]([%(%[%|%<%s])(al%-)", b="at%1%2"}, --p
  1004. {a="[TH]([%|\"])", b="t%1"},
  1005. {a="a[TH](%p*)$", b="a%1"},
  1006. {a="a[TH](%p*%s)", b="a%1"},
  1007. {a="_t", b="ṯ"},
  1008. {a="%^g", b="ǧ"},
  1009. {a="%.h", b="ḥ"},
  1010. {a="_h", b="ḫ"},
  1011. {a="_d", b="ḏ"},
  1012. {a="%^s", b="š"},
  1013. {a="%.s", b="ṣ"},
  1014. {a="%.d", b="ḍ"},
  1015. {a="%.t", b="ṭ"},
  1016. {a="%.z", b="ẓ"},
  1017. {a="%.g", b="ġ"},
  1018. {a="%.y", b="y"},
  1019. -- additional characters (begin)
  1020. {a="%^c", b="č"},
  1021. {a="%^z", b="ž"},
  1022. {a="%^n", b="ñ"},
  1023. -- additional characters (end)
  1024. {a="(U)(A)", b="ū"},
  1025. {a="WA", b="w"},
  1026. {a="(a)W", b="%1w"},
  1027. {a="_A", b="ā"},
  1028. {a="_u", b="ū"},
  1029. {a="_a", b="ā"},
  1030. {a="_i", b="ī"},
  1031. {a="%.b", b="b"},
  1032. {a="%.f", b="f"},
  1033. {a="%.q", b="q"},
  1034. {a="%.k", b="k"},
  1035. {a="%.n", b="n"},
  1036. {a="%^d", b="d"}
  1037. }
  1038. singletrarabica = {
  1039. {a="b", b="b"},
  1040. {a="t", b="t"},
  1041. {a="j", b="ǧ"},
  1042. {a="x", b="ḫ"},
  1043. {a="d", b="d"},
  1044. {a="r", b="r"},
  1045. {a="z", b="z"},
  1046. {a="s", b="s"},
  1047. {a="`", b="ʿ"},
  1048. {a="f", b="f"},
  1049. {a="q", b="q"},
  1050. {a="k", b="k"},
  1051. {a="l", b="l"},
  1052. {a="m", b="m"},
  1053. {a="n", b="n"},
  1054. {a="h", b="h"},
  1055. {a="w", b="w"},
  1056. {a="y", b="y"},
  1057. {a="T", b="t"},
  1058. -- additional characters (begin)
  1059. {a="H", b="t"},
  1060. {a="p", b="p"},
  1061. {a="v", b="v"},
  1062. {a="g", b="g"},
  1063. -- additional characters (end)
  1064. {a="\"", b=""},
  1065. {a="B", b=""}
  1066. }
  1067. longvtrarabica = {
  1068. {a="aY", b="ay"},
  1069. {a="iY", b="ī"},
  1070. {a="[AY]", b="ā"},
  1071. {a="U", b="ū"},
  1072. {a="I", b="ī"}
  1073. }