From 8cbdce87049d120488056d9f1b4f6ed2f42e02b0 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sat, 1 Apr 2017 17:21:45 +0200 Subject: the implementation of the 'arabica' transliteration needed more work; a couple of bugs also found their way into v1.8 in the process --- arabluatex.dtx | 28 ++++++++++---------- arabluatex.lua | 4 +-- arabluatex_trans.lua | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 88 insertions(+), 16 deletions(-) diff --git a/arabluatex.dtx b/arabluatex.dtx index 3e2c1d7..cd4e0c6 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -27,7 +27,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{arabluatex} %<*package-info> - [2017/03/30 v1.8 An ArabTeX-like interface for LuaLaTeX] + [2017/04/01 v1.8.1 An ArabTeX-like interface for LuaLaTeX] % % %<*driver> @@ -145,7 +145,7 @@ \defaultfontfeatures{RawFeature={+liga}} \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps}, RawFeature={+mark;+ccmp;+ss05;+ss06}] -\usepackage{arabluatex}[2017/03/30] +\usepackage{arabluatex}[2017/04/01] \usepackage[nopar]{quran} \usepackage{varioref} \usepackage{hyperxmp} @@ -165,6 +165,7 @@ pdflicenseurl={https://creativecommons.org/licenses/by-sa/4.0/legalcode}, pdfmetalang={en-US}, pdftype={Text}, pdfkeywords={Arabic language, arabtex, luatex}} +\usepackage[scale=1.5]{ccicons} \usepackage[toc,lot]{multitoc} \usepackage{paralist} \setdefaultitem{\textendash}{\textendash}{\textendash}{\textendash} @@ -340,7 +341,8 @@ % \subsection*{License applicable to this document} % \label{sec:documentation-license} % Copyright \textcopyright\ 2016--2017 Robert Alessi -% +% +% \ccbysa\ % This document is licensed under the Creative Commons % Attribution-ShareAlike 4.0 International License. To view a copy of % this license, visit @@ -965,7 +967,7 @@ vowels (see §~3). % \begin{quote} % |.hay_aUTuN| \arb[voc]{.hay_aUTuN} \arb[trans]{.hay_aUTuN}, % |.sal_aUTuN| \arb[voc]{.sal_aUTuN} \arb[trans]{.sal_aUTuN}, -% |mi^sk_aUTuN| \arb[voc]{mi^sk_aUTuN} \arb[trans]{mi^sk_aUTuN}, +% |mi^sk_aUTuN| \arb[voc]{mi^sk_aUTuN} \arb[trans]{mi^s\-k_aUTuN}, % |tawr_aITuN| \arb[voc]{tawr_aITuN} \arb[trans]{tawr_aITuN}. % % And so also: |al-rib_aIT-u| \arb[voc]{al-rib_aIT-u} @@ -1594,11 +1596,11 @@ vowels (see §~3). % \begin{compactenum}[(a)] % \item \arb[trans]{'alif-u 'l-wa.sl-i}:--- % \begin{quote} -% |fI "istisqA'-a| \arb[voc]{fI "istisqA'-a} \arb[trans]{fI -% "istisqA'-a}, |wa-"istisqA'-u| \arb[voc]{wa-"istisqA'-u} -% \arb[trans]{wa-"is\-tisqA'-u}, |qAla| |"uhrub| |fa-lan| -% |tuqtala| \arb[voc]{qAla "uhrub fa-lan tuqtala} \arb[trans]{qAla -% "uhrub fa-lan tuqtala}. +% |fI "istiq.sA'-iN| \arb[voc]{fI "istiq.sA'-iN} \arb[trans]{fI +% "istiq.sA'-iN}, |wa-"istiq.sA'-uN| \arb[voc]{wa-"istiq.sA'-uN} +% \allowbreak\arb[trans]{wa-"istiq.sA'-uN}, |qAla| |"uhrub| +% |fa-lan| |tuqtala| \arb[voc]{qAla "uhrub fa-lan tuqtala} +% \arb[trans]{qAla "uhrub fa-lan tuqtala}. % \end{quote} % \item \arb[trans]{sukUn}:--- % \begin{quote} @@ -2452,7 +2454,7 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu % % \SetTranslitConvention{dmg} % \begin{arab}[trans] -% \LR{\textbf{\emph{\enquote*{dmg}} standard}:} 'at_A .sadIquN 'il_A +% \LR{\textbf{\emph{\enquote*{dmg}} standard:}} 'at_A .sadIquN 'il_A % \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI safraTiN % qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu 'ilay-ka fI % 'l-masA'-i wa-'adfa`u la-ka 'ujraTaN.} fa-qAla \cap{ju.hA}: @@ -2467,7 +2469,7 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu % % \SetTranslitConvention{loc} % \begin{arab}[trans] -% \LR{\textbf{\emph{\enquote*{loc}} standard}:} 'at_A .sadIquN 'il_A +% \LR{\textbf{\emph{\enquote*{loc}} standard:}} 'at_A .sadIquN 'il_A % \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI safraTiN % qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu 'ilay-ka fI % 'l-masA'-i wa-'adfa`u la-ka 'ujraTaN.} fa-qAla \cap{ju.hA}: @@ -2483,7 +2485,7 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu % % \SetTranslitConvention{arabica} % \begin{arab}[trans] -% \LR{\textbf{\emph{\enquote*{arabica}} standard}:} 'at_A .sadIquN +% \LR{\textbf{\emph{\enquote*{arabica}} standard:}} 'at_A .sadIquN % 'il_A \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI % safraTiN qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu % 'ilay-ka fI 'l-masA'-i wa-'adfa`u la-ka 'ujraTaN.} fa-qAla @@ -3084,7 +3086,7 @@ wa-ya.sIru ta.hta 'l-jild-i % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{arabluatex}% -[2017/03/30 v1.8 An ArabTeX-like interface for LuaLaTeX] +[2017/04/01 v1.8.1 An ArabTeX-like interface for LuaLaTeX] \RequirePackage{ifluatex} % \end{macrocode} % \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning diff --git a/arabluatex.lua b/arabluatex.lua index 3b76376..eeef54b 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -497,8 +497,8 @@ end local function transarabica(str) str = string.gsub(str, "\\arb(%b{})", function(inside) inside = string.sub(inside, 2, -2) - for i = 1,#hamzatrloc do - inside = string.gsub(inside, hamzatrloc[i].a, hamzatrloc[i].b) + for i = 1,#hamzatrarabica do + inside = string.gsub(inside, hamzatrarabica[i].a, hamzatrarabica[i].b) end for i = 1,#tanwintrloc do inside = string.gsub(inside, tanwintrloc[i].a, tanwintrloc[i].b) diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua index e12eaa0..7820cd1 100644 --- a/arabluatex_trans.lua +++ b/arabluatex_trans.lua @@ -631,10 +631,78 @@ finaltrloc = { -- arabica +hamzatrarabica = { -- ≠ from hamzatrloc: initial hamza has to be held + -- hard coded hamza + {a="|\"'", b="ʾ"}, + {a="A\"'", b="ʾA"}, + {a="[au]\"'", b="ʾ"}, + {a="w\"'", b="ʾ"}, + {a="i\"'", b="ʾ"}, + {a="y\"'", b="ʾ"}, + -- hamza takes tašdīd too + {a="''([Uu])", b="ʾʾ%1"}, + {a="''([Aa])", b="ʾʾ%1"}, + {a="''([Ii])", b="ʾʾ%1"}, + -- initial long u and i (for a, see below) + {a="%'%_U", b="U"}, + {a="%'%_I", b="I"}, + -- taḫfīfu 'l-hamza + {a="^'u'([^uaiUAI])", b="U%1"}, + {a="(%W)'u'([^uaiUAI])", b="%1U%2"}, + {a="'u'([^uaiUAI])", b="ʾU"}, + {a="^'i'([^uaiUAI])", b="I%1"}, + {a="(%W)'i'([^uaiUAI])", b="%1I%2"}, + {a="'i'([^uaiUAI])", b="ʾI"}, + -- madda (historic writing below) + {a="^(')(A)", b="%2"}, + {a="(%W)(')(A)", b="%1%3"}, + {a="^'a'([^uaiUAI])", b="A%1"}, + {a="(%W)'a'([^uaiUAI])", b="%1A%2"}, + {a="'a'([^uaiUAI])", b="A%1"}, + {a="^'a?A", b="A"}, + {a="(%W)'a?A", b="%1A"}, + {a="'a?A", b="ʾA"}, + {a="(A)(')(i)$", b="%1ʾ%3"}, + {a="(A)(')(i)(%W)", b="%1ʾ%3%4"}, + {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda + {a="(A)(')", b="%1ʾ"}, -- historic madda + -- initial (needs both ^ and %W patterns): + -- hold it for now (see below, beginning of digraphs table) + {a="^(')([ua])", b="@%2"}, + {a="^(')(i)", b="@%2"}, + {a="(%W)(')([ua])", b="%1@%3"}, + {a="(%W)(')(i)", b="%1@%3"}, + -- final + {a="([Iy])(')(aN)$", b="%1ʾ%3"}, + {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"}, + {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"}, + {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"}, + {a="([UI])(')([uai])$", b="%1ʾ%3"}, + {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"}, + -- middle + {a="(U)(')", b="%1ʾ"}, + {a="([Iy])(')", b="%1ʾ"}, + {a="([^uai])(')([uU])", b="%1ʾ%3"}, + {a="([^uai])(')([aA])", b="%1ʾ%3"}, + {a="([^uai])(')([iI])", b="%1ʾ%3"}, + {a="(u)(')([uU])", b="%1ʾ%3"}, + {a="(u)(')([aA])", b="%1ʾ%3"}, + {a="(u)(')([iI])", b="%1ʾ%3"}, + {a="(a)(')([aA])", b="%1ʾ%3"}, + {a="(a)(')([uU])", b="%1ʾ%3"}, + {a="(a)(')([iI])", b="%1ʾ%3"}, + {a="(i)(')([aA])", b="%1ʾ%3"}, + {a="(i)(')([uU])", b="%1ʾ%3"}, + {a="(i)(')([iI])", b="%1ʾ%3"}, + {a="(a)(')([^uaiUAI])", b="%1ʾ%3"}, + {a="(u)(')([^uaiUAI])", b="%1ʾ%3"}, + {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} +} + trigraphstrarabica = { -- trigraphs or more -- 'llatI / 'llad_I {a="^'ll(a)([%_]?[dt])", b="ll%1%2"}, - {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p + {a="([%-%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p -- al- + lām {a="^(a)l%-(l)", b="%1l-%2"}, {a="(%s)(a)l%-(l)", b="%1%2l-%3"}, @@ -682,6 +750,8 @@ trigraphstrarabica = { -- trigraphs or more } digraphstrarabica = { + {a="([uai]%-)(\"?[uai])", b="%1"}, -- hyphen + initial alif without hamza + {a="@", b=""}, -- remove the tag before the former hamza -- discard the ʾiʿrāb hyphen (begin) {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, -- cgit v1.2.3