diff options
Diffstat (limited to 'arabluatex_trans.lua')
-rw-r--r-- | arabluatex_trans.lua | 87 |
1 files changed, 86 insertions, 1 deletions
diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua index 455b57b..c5c0b05 100644 --- a/arabluatex_trans.lua +++ b/arabluatex_trans.lua | |||
@@ -2,7 +2,7 @@ | |||
2 | This file is part of the `arabluatex' package | 2 | This file is part of the `arabluatex' package |
3 | 3 | ||
4 | ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX | 4 | ArabLuaTeX -- Processing ArabTeX notation under LuaLaTeX |
5 | Copyright (C) 2016--2020 Robert Alessi | 5 | Copyright (C) 2016--2022 Robert Alessi |
6 | 6 | ||
7 | Please send error reports and suggestions for improvements to Robert | 7 | Please send error reports and suggestions for improvements to Robert |
8 | Alessi <alessi@robertalessi.net> | 8 | Alessi <alessi@robertalessi.net> |
@@ -202,6 +202,91 @@ hamzatrdmg = { | |||
202 | {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} | 202 | {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} |
203 | } | 203 | } |
204 | 204 | ||
205 | hamzatrnoinitialdmg = { | ||
206 | -- next lines for ʾalif alone | ||
207 | {a="(%.A)l%-(%^n)", b=".|l-%2"}, --additional (^n is lunar) | ||
208 | {a="([%(%[%|%<%s%-O])(%.A)l%-(%^n)", b="%1.|l-%3"}, --additional (^n is lunar) --p | ||
209 | {a="(%.A)l%-([%_%^%.]?[tdrzsnc])", b=".|%2-%2"}, | ||
210 | {a="([%(%[%|%<%s%-O])(%.A)l%-([%_%^%.]?[tdrzsnc])", b="%1.|%3-%3"}, --p | ||
211 | {a="(%.A)([uai])l%-(%^n)", b="||%2l-%3"}, --additional (^n is lunar) | ||
212 | {a="([%(%[%|%<%s%-O])(%.A)([uai])l%-(%^n)", b="%1||%3l-%4"}, --additional (^n is lunar) --p | ||
213 | {a="(%.A)([uai])l%-([%_%^%.]?[tdrzsnc])", b="||%2%3-%3"}, | ||
214 | {a="([%(%[%|%<%s%-O])(%.A)([uai])l%-([%_%^%.]?[tdrzsnc])", b="%1||%3%4-%4"}, --p | ||
215 | {a="(%.A)([^uai])", b=".|%2"}, | ||
216 | {a="(%.A)([uai])", b="||%2"}, | ||
217 | -- hard coded hamza | ||
218 | {a="|\"'", b="ʾ"}, | ||
219 | {a="A\"'", b="ʾA"}, | ||
220 | {a="[au]\"'", b="ʾ"}, | ||
221 | {a="w\"'", b="ʾ"}, | ||
222 | {a="i\"'", b="ʾ"}, | ||
223 | {a="y\"'", b="ʾ"}, | ||
224 | -- hamza takes tašdīd too | ||
225 | {a="''([Uu])", b="ʾʾ%1"}, | ||
226 | {a="''([Aa])", b="ʾʾ%1"}, | ||
227 | {a="''([Ii])", b="ʾʾ%1"}, | ||
228 | -- initial long u and i (for a, see below) | ||
229 | {a="%'%_U", b="||U"}, | ||
230 | {a="%'%_I", b="||I"}, | ||
231 | -- taḫfīfu 'l-hamza | ||
232 | {a="'u'([^uaiUAI])", b="|U%1"}, | ||
233 | {a="'i'([^uaiUAI])", b="|I%1"}, | ||
234 | {a="^u'([^uaiUAI])", b="U%1"}, | ||
235 | {a="([^uaiUAIYN][%s%(%[%<])u'([^uaiUAI])", b="%1U%2"}, | ||
236 | {a="^i'([^uaiUAI])", b="I%1"}, | ||
237 | {a="([^uaiUAIYN][%s%(%[%<])i'([^uaiUAI])", b="%1I%2"}, | ||
238 | -- madda (historic writing below) | ||
239 | {a="'a'([^uaiUAI])", b="ʾA%1"}, | ||
240 | {a="'a?A", b="ʾA"}, | ||
241 | {a="(A)(')(i)$", b="%1ʾ%3"}, | ||
242 | {a="(A)(')(i)(%W)", b="%1ʾ%3%4"}, | ||
243 | {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda | ||
244 | {a="(A)(')", b="%1ʾ"}, -- historic madda | ||
245 | -- initial (needs both ^ and %W patterns) | ||
246 | -- 'aw: the diphthong is to be resolved into 'awi' (next 8 lines) | ||
247 | {a="^('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1i"}, | ||
248 | {a="(%W)('aw)(O)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)([%S]-O)", b="%1%2i"}, | ||
249 | {a="^('aw)(O)(\"?[uai])([%S]-O)", b="%1i"}, | ||
250 | {a="(%W)('aw)(O)(\"?[uai])([%S]-O)", b="%1%2i"}, | ||
251 | {a="^('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"}, | ||
252 | {a="(%W)('aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1%2i%3%4"}, | ||
253 | {a="^('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1i%2%3"}, --p | ||
254 | {a="(%W)('aw)(%s)([%(%[%|%<]?\"?[uai])", b="%1%2i%3%4"}, --p | ||
255 | -- then the 'initial' rules for the remaining cases | ||
256 | {a="^(')([ua])", b="||%2"}, | ||
257 | {a="^(')(i)", b="||%2"}, | ||
258 | -- consider replacing initial %W with [%s%(%[%<%-]: | ||
259 | -- {a="(%W)(')([ua])", b="%1||%3"}, | ||
260 | -- {a="(%W)(')(i)", b="%1||%3"}, | ||
261 | {a="([%s%(%[%<%-])(')([ua])", b="%1||%3"}, | ||
262 | {a="([%s%(%[%<%-])(')(i)", b="%1||%3"}, | ||
263 | -- final | ||
264 | {a="([Iy])(')(aN)$", b="%1ʾ%3"}, | ||
265 | {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"}, | ||
266 | {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"}, | ||
267 | {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"}, | ||
268 | {a="([UI])(')([uai])$", b="%1ʾ%3"}, | ||
269 | {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"}, | ||
270 | -- middle | ||
271 | {a="(U)(')", b="%1ʾ"}, | ||
272 | {a="([Iy])(')", b="%1ʾ"}, | ||
273 | {a="([^uai])(')([uU])", b="%1ʾ%3"}, | ||
274 | {a="([^uai])(')(%_?[aAY])", b="%1ʾ%3"}, | ||
275 | {a="([^uai])(')([iI])", b="%1ʾ%3"}, | ||
276 | {a="(u)(')([uU])", b="%1ʾ%3"}, | ||
277 | {a="(u)(')(%_?[aAY])", b="%1ʾ%3"}, | ||
278 | {a="(u)(')([iI])", b="%1ʾ%3"}, | ||
279 | {a="(a)(')(%_?[aAY])", b="%1ʾ%3"}, | ||
280 | {a="(a)(')([uU])", b="%1ʾ%3"}, | ||
281 | {a="(a)(')([iI])", b="%1ʾ%3"}, | ||
282 | {a="(i)(')(%_?[aAY])", b="%1ʾ%3"}, | ||
283 | {a="(i)(')([uU])", b="%1ʾ%3"}, | ||
284 | {a="(i)(')([iI])", b="%1ʾ%3"}, | ||
285 | {a="(a)(')([^uaiUAI])", b="%1ʾ%3"}, | ||
286 | {a="(u)(')([^uaiUAI])", b="%1ʾ%3"}, | ||
287 | {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} | ||
288 | } | ||
289 | |||
205 | tanwintrdmg = { | 290 | tanwintrdmg = { |
206 | {a="%-?([uai]NU)(O)([ui])([%S]-O)", b="\\arbup{un%3}"}, | 291 | {a="%-?([uai]NU)(O)([ui])([%S]-O)", b="\\arbup{un%3}"}, |
207 | {a="%-?([uai]NU)(%s)([ui])", b="\\arbup{un%3}%2'"}, | 292 | {a="%-?([uai]NU)(%s)([ui])", b="\\arbup{un%3}%2'"}, |