diff options
author | Robert Alessi <alessi@robertalessi.net> | 2017-04-01 17:21:45 +0200 |
---|---|---|
committer | Robert Alessi <alessi@robertalessi.net> | 2017-04-01 17:21:45 +0200 |
commit | 8cbdce87049d120488056d9f1b4f6ed2f42e02b0 (patch) | |
tree | e93041b9fd517bf74a82911a159e3a2f8d37da80 | |
parent | c2c0347648d8d14d46df8114572fd4d1df1d2853 (diff) | |
download | arabluatex-8cbdce87049d120488056d9f1b4f6ed2f42e02b0.tar.gz |
the implementation of the 'arabica' transliteration needed more work; a couple of bugs also found their way into v1.8 in the processv1.8.1
-rw-r--r-- | arabluatex.dtx | 28 | ||||
-rw-r--r-- | arabluatex.lua | 4 | ||||
-rw-r--r-- | 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 @@ | |||
27 | %<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01] | 27 | %<package-info>\NeedsTeXFormat{LaTeX2e}[1999/12/01] |
28 | %<package-info>\ProvidesPackage{arabluatex} | 28 | %<package-info>\ProvidesPackage{arabluatex} |
29 | %<*package-info> | 29 | %<*package-info> |
30 | [2017/03/30 v1.8 An ArabTeX-like interface for LuaLaTeX] | 30 | [2017/04/01 v1.8.1 An ArabTeX-like interface for LuaLaTeX] |
31 | %</package-info> | 31 | %</package-info> |
32 | % | 32 | % |
33 | %<*driver> | 33 | %<*driver> |
@@ -145,7 +145,7 @@ | |||
145 | \defaultfontfeatures{RawFeature={+liga}} | 145 | \defaultfontfeatures{RawFeature={+liga}} |
146 | \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps}, | 146 | \setmainfont{Old Standard}[SmallCapsFont={Latin Modern Roman Caps}, |
147 | RawFeature={+mark;+ccmp;+ss05;+ss06}] | 147 | RawFeature={+mark;+ccmp;+ss05;+ss06}] |
148 | \usepackage{arabluatex}[2017/03/30] | 148 | \usepackage{arabluatex}[2017/04/01] |
149 | \usepackage[nopar]{quran} | 149 | \usepackage[nopar]{quran} |
150 | \usepackage{varioref} | 150 | \usepackage{varioref} |
151 | \usepackage{hyperxmp} | 151 | \usepackage{hyperxmp} |
@@ -165,6 +165,7 @@ | |||
165 | pdflicenseurl={https://creativecommons.org/licenses/by-sa/4.0/legalcode}, | 165 | pdflicenseurl={https://creativecommons.org/licenses/by-sa/4.0/legalcode}, |
166 | pdfmetalang={en-US}, pdftype={Text}, pdfkeywords={Arabic language, | 166 | pdfmetalang={en-US}, pdftype={Text}, pdfkeywords={Arabic language, |
167 | arabtex, luatex}} | 167 | arabtex, luatex}} |
168 | \usepackage[scale=1.5]{ccicons} | ||
168 | \usepackage[toc,lot]{multitoc} | 169 | \usepackage[toc,lot]{multitoc} |
169 | \usepackage{paralist} | 170 | \usepackage{paralist} |
170 | \setdefaultitem{\textendash}{\textendash}{\textendash}{\textendash} | 171 | \setdefaultitem{\textendash}{\textendash}{\textendash}{\textendash} |
@@ -340,7 +341,8 @@ | |||
340 | % \subsection*{License applicable to this document} | 341 | % \subsection*{License applicable to this document} |
341 | % \label{sec:documentation-license} | 342 | % \label{sec:documentation-license} |
342 | % Copyright \textcopyright\ 2016--2017 Robert Alessi | 343 | % Copyright \textcopyright\ 2016--2017 Robert Alessi |
343 | % | 344 | % |
345 | % \ccbysa\ | ||
344 | % This document is licensed under the Creative Commons | 346 | % This document is licensed under the Creative Commons |
345 | % Attribution-ShareAlike 4.0 International License. To view a copy of | 347 | % Attribution-ShareAlike 4.0 International License. To view a copy of |
346 | % this license, visit | 348 | % this license, visit |
@@ -965,7 +967,7 @@ vowels (see §~3). | |||
965 | % \begin{quote} | 967 | % \begin{quote} |
966 | % |.hay_aUTuN| \arb[voc]{.hay_aUTuN} \arb[trans]{.hay_aUTuN}, | 968 | % |.hay_aUTuN| \arb[voc]{.hay_aUTuN} \arb[trans]{.hay_aUTuN}, |
967 | % |.sal_aUTuN| \arb[voc]{.sal_aUTuN} \arb[trans]{.sal_aUTuN}, | 969 | % |.sal_aUTuN| \arb[voc]{.sal_aUTuN} \arb[trans]{.sal_aUTuN}, |
968 | % |mi^sk_aUTuN| \arb[voc]{mi^sk_aUTuN} \arb[trans]{mi^sk_aUTuN}, | 970 | % |mi^sk_aUTuN| \arb[voc]{mi^sk_aUTuN} \arb[trans]{mi^s\-k_aUTuN}, |
969 | % |tawr_aITuN| \arb[voc]{tawr_aITuN} \arb[trans]{tawr_aITuN}. | 971 | % |tawr_aITuN| \arb[voc]{tawr_aITuN} \arb[trans]{tawr_aITuN}. |
970 | % | 972 | % |
971 | % And so also: |al-rib_aIT-u| \arb[voc]{al-rib_aIT-u} | 973 | % And so also: |al-rib_aIT-u| \arb[voc]{al-rib_aIT-u} |
@@ -1594,11 +1596,11 @@ vowels (see §~3). | |||
1594 | % \begin{compactenum}[(a)] | 1596 | % \begin{compactenum}[(a)] |
1595 | % \item \arb[trans]{'alif-u 'l-wa.sl-i}:--- | 1597 | % \item \arb[trans]{'alif-u 'l-wa.sl-i}:--- |
1596 | % \begin{quote} | 1598 | % \begin{quote} |
1597 | % |fI "istisqA'-a| \arb[voc]{fI "istisqA'-a} \arb[trans]{fI | 1599 | % |fI "istiq.sA'-iN| \arb[voc]{fI "istiq.sA'-iN} \arb[trans]{fI |
1598 | % "istisqA'-a}, |wa-"istisqA'-u| \arb[voc]{wa-"istisqA'-u} | 1600 | % "istiq.sA'-iN}, |wa-"istiq.sA'-uN| \arb[voc]{wa-"istiq.sA'-uN} |
1599 | % \arb[trans]{wa-"is\-tisqA'-u}, |qAla| |"uhrub| |fa-lan| | 1601 | % \allowbreak\arb[trans]{wa-"istiq.sA'-uN}, |qAla| |"uhrub| |
1600 | % |tuqtala| \arb[voc]{qAla "uhrub fa-lan tuqtala} \arb[trans]{qAla | 1602 | % |fa-lan| |tuqtala| \arb[voc]{qAla "uhrub fa-lan tuqtala} |
1601 | % "uhrub fa-lan tuqtala}. | 1603 | % \arb[trans]{qAla "uhrub fa-lan tuqtala}. |
1602 | % \end{quote} | 1604 | % \end{quote} |
1603 | % \item \arb[trans]{sukUn}:--- | 1605 | % \item \arb[trans]{sukUn}:--- |
1604 | % \begin{quote} | 1606 | % \begin{quote} |
@@ -2452,7 +2454,7 @@ muhaddamaTaN mi'_danatu-hu}: \arb[trans]{ra'aytu | |||
2452 | % | 2454 | % |
2453 | % \SetTranslitConvention{dmg} | 2455 | % \SetTranslitConvention{dmg} |
2454 | % \begin{arab}[trans] | 2456 | % \begin{arab}[trans] |
2455 | % \LR{\textbf{\emph{\enquote*{dmg}} standard}:} 'at_A .sadIquN 'il_A | 2457 | % \LR{\textbf{\emph{\enquote*{dmg}} standard:}} 'at_A .sadIquN 'il_A |
2456 | % \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI safraTiN | 2458 | % \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI safraTiN |
2457 | % qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu 'ilay-ka fI | 2459 | % qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu 'ilay-ka fI |
2458 | % 'l-masA'-i wa-'adfa`u la-ka 'ujraTaN.} fa-qAla \cap{ju.hA}: | 2460 | % '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 | |||
2467 | % | 2469 | % |
2468 | % \SetTranslitConvention{loc} | 2470 | % \SetTranslitConvention{loc} |
2469 | % \begin{arab}[trans] | 2471 | % \begin{arab}[trans] |
2470 | % \LR{\textbf{\emph{\enquote*{loc}} standard}:} 'at_A .sadIquN 'il_A | 2472 | % \LR{\textbf{\emph{\enquote*{loc}} standard:}} 'at_A .sadIquN 'il_A |
2471 | % \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI safraTiN | 2473 | % \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI safraTiN |
2472 | % qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu 'ilay-ka fI | 2474 | % qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu 'ilay-ka fI |
2473 | % 'l-masA'-i wa-'adfa`u la-ka 'ujraTaN.} fa-qAla \cap{ju.hA}: | 2475 | % '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 | |||
2483 | % | 2485 | % |
2484 | % \SetTranslitConvention{arabica} | 2486 | % \SetTranslitConvention{arabica} |
2485 | % \begin{arab}[trans] | 2487 | % \begin{arab}[trans] |
2486 | % \LR{\textbf{\emph{\enquote*{arabica}} standard}:} 'at_A .sadIquN | 2488 | % \LR{\textbf{\emph{\enquote*{arabica}} standard:}} 'at_A .sadIquN |
2487 | % 'il_A \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI | 2489 | % 'il_A \cap{ju.hA} ya.tlubu min-hu .himAra-hu li-yarkaba-hu fI |
2488 | % safraTiN qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu | 2490 | % safraTiN qa.sIraTiN fa-qAla la-hu: \enquote{sawfa 'u`Idu-hu |
2489 | % 'ilay-ka fI 'l-masA'-i wa-'adfa`u la-ka 'ujraTaN.} fa-qAla | 2491 | % '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 | |||
3084 | % \begin{macrocode} | 3086 | % \begin{macrocode} |
3085 | \NeedsTeXFormat{LaTeX2e} | 3087 | \NeedsTeXFormat{LaTeX2e} |
3086 | \ProvidesPackage{arabluatex}% | 3088 | \ProvidesPackage{arabluatex}% |
3087 | [2017/03/30 v1.8 An ArabTeX-like interface for LuaLaTeX] | 3089 | [2017/04/01 v1.8.1 An ArabTeX-like interface for LuaLaTeX] |
3088 | \RequirePackage{ifluatex} | 3090 | \RequirePackage{ifluatex} |
3089 | % \end{macrocode} | 3091 | % \end{macrocode} |
3090 | % \package{arabluatex} requires \LuaLaTeX\ of course. Issue a warning | 3092 | % \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 | |||
497 | local function transarabica(str) | 497 | local function transarabica(str) |
498 | str = string.gsub(str, "\\arb(%b{})", function(inside) | 498 | str = string.gsub(str, "\\arb(%b{})", function(inside) |
499 | inside = string.sub(inside, 2, -2) | 499 | inside = string.sub(inside, 2, -2) |
500 | for i = 1,#hamzatrloc do | 500 | for i = 1,#hamzatrarabica do |
501 | inside = string.gsub(inside, hamzatrloc[i].a, hamzatrloc[i].b) | 501 | inside = string.gsub(inside, hamzatrarabica[i].a, hamzatrarabica[i].b) |
502 | end | 502 | end |
503 | for i = 1,#tanwintrloc do | 503 | for i = 1,#tanwintrloc do |
504 | inside = string.gsub(inside, tanwintrloc[i].a, tanwintrloc[i].b) | 504 | 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 = { | |||
631 | 631 | ||
632 | -- arabica | 632 | -- arabica |
633 | 633 | ||
634 | hamzatrarabica = { -- ≠ from hamzatrloc: initial hamza has to be held | ||
635 | -- hard coded hamza | ||
636 | {a="|\"'", b="ʾ"}, | ||
637 | {a="A\"'", b="ʾA"}, | ||
638 | {a="[au]\"'", b="ʾ"}, | ||
639 | {a="w\"'", b="ʾ"}, | ||
640 | {a="i\"'", b="ʾ"}, | ||
641 | {a="y\"'", b="ʾ"}, | ||
642 | -- hamza takes tašdīd too | ||
643 | {a="''([Uu])", b="ʾʾ%1"}, | ||
644 | {a="''([Aa])", b="ʾʾ%1"}, | ||
645 | {a="''([Ii])", b="ʾʾ%1"}, | ||
646 | -- initial long u and i (for a, see below) | ||
647 | {a="%'%_U", b="U"}, | ||
648 | {a="%'%_I", b="I"}, | ||
649 | -- taḫfīfu 'l-hamza | ||
650 | {a="^'u'([^uaiUAI])", b="U%1"}, | ||
651 | {a="(%W)'u'([^uaiUAI])", b="%1U%2"}, | ||
652 | {a="'u'([^uaiUAI])", b="ʾU"}, | ||
653 | {a="^'i'([^uaiUAI])", b="I%1"}, | ||
654 | {a="(%W)'i'([^uaiUAI])", b="%1I%2"}, | ||
655 | {a="'i'([^uaiUAI])", b="ʾI"}, | ||
656 | -- madda (historic writing below) | ||
657 | {a="^(')(A)", b="%2"}, | ||
658 | {a="(%W)(')(A)", b="%1%3"}, | ||
659 | {a="^'a'([^uaiUAI])", b="A%1"}, | ||
660 | {a="(%W)'a'([^uaiUAI])", b="%1A%2"}, | ||
661 | {a="'a'([^uaiUAI])", b="A%1"}, | ||
662 | {a="^'a?A", b="A"}, | ||
663 | {a="(%W)'a?A", b="%1A"}, | ||
664 | {a="'a?A", b="ʾA"}, | ||
665 | {a="(A)(')(i)$", b="%1ʾ%3"}, | ||
666 | {a="(A)(')(i)(%W)", b="%1ʾ%3%4"}, | ||
667 | {a="(A)(')(i)", b="%1ʾ%3"}, -- historic madda | ||
668 | {a="(A)(')", b="%1ʾ"}, -- historic madda | ||
669 | -- initial (needs both ^ and %W patterns): | ||
670 | -- hold it for now (see below, beginning of digraphs table) | ||
671 | {a="^(')([ua])", b="@%2"}, | ||
672 | {a="^(')(i)", b="@%2"}, | ||
673 | {a="(%W)(')([ua])", b="%1@%3"}, | ||
674 | {a="(%W)(')(i)", b="%1@%3"}, | ||
675 | -- final | ||
676 | {a="([Iy])(')(aN)$", b="%1ʾ%3"}, | ||
677 | {a="([Iy])(')(aN)(%W)", b="%1ʾ%3%4"}, | ||
678 | {a="([^uai])(')([uai]N?)$", b="%1ʾ%3"}, | ||
679 | {a="([^uai])(')([uai]N?)(%W)", b="%1ʾ%3%4"}, | ||
680 | {a="([UI])(')([uai])$", b="%1ʾ%3"}, | ||
681 | {a="([UI])(')([uai])(%W)", b="%1ʾ%3%4"}, | ||
682 | -- middle | ||
683 | {a="(U)(')", b="%1ʾ"}, | ||
684 | {a="([Iy])(')", b="%1ʾ"}, | ||
685 | {a="([^uai])(')([uU])", b="%1ʾ%3"}, | ||
686 | {a="([^uai])(')([aA])", b="%1ʾ%3"}, | ||
687 | {a="([^uai])(')([iI])", b="%1ʾ%3"}, | ||
688 | {a="(u)(')([uU])", b="%1ʾ%3"}, | ||
689 | {a="(u)(')([aA])", b="%1ʾ%3"}, | ||
690 | {a="(u)(')([iI])", b="%1ʾ%3"}, | ||
691 | {a="(a)(')([aA])", b="%1ʾ%3"}, | ||
692 | {a="(a)(')([uU])", b="%1ʾ%3"}, | ||
693 | {a="(a)(')([iI])", b="%1ʾ%3"}, | ||
694 | {a="(i)(')([aA])", b="%1ʾ%3"}, | ||
695 | {a="(i)(')([uU])", b="%1ʾ%3"}, | ||
696 | {a="(i)(')([iI])", b="%1ʾ%3"}, | ||
697 | {a="(a)(')([^uaiUAI])", b="%1ʾ%3"}, | ||
698 | {a="(u)(')([^uaiUAI])", b="%1ʾ%3"}, | ||
699 | {a="(i)(')([^uaiUAI])", b="%1ʾ%3"} | ||
700 | } | ||
701 | |||
634 | trigraphstrarabica = { -- trigraphs or more | 702 | trigraphstrarabica = { -- trigraphs or more |
635 | -- 'llatI / 'llad_I | 703 | -- 'llatI / 'llad_I |
636 | {a="^'ll(a)([%_]?[dt])", b="ll%1%2"}, | 704 | {a="^'ll(a)([%_]?[dt])", b="ll%1%2"}, |
637 | {a="([%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p | 705 | {a="([%-%(%[%|%<%s])'ll(a)([%_]?[dt])", b="%1ll%2%3"}, --p |
638 | -- al- + lām | 706 | -- al- + lām |
639 | {a="^(a)l%-(l)", b="%1l-%2"}, | 707 | {a="^(a)l%-(l)", b="%1l-%2"}, |
640 | {a="(%s)(a)l%-(l)", b="%1%2l-%3"}, | 708 | {a="(%s)(a)l%-(l)", b="%1%2l-%3"}, |
@@ -682,6 +750,8 @@ trigraphstrarabica = { -- trigraphs or more | |||
682 | } | 750 | } |
683 | 751 | ||
684 | digraphstrarabica = { | 752 | digraphstrarabica = { |
753 | {a="([uai]%-)(\"?[uai])", b="%1"}, -- hyphen + initial alif without hamza | ||
754 | {a="@", b=""}, -- remove the tag before the former hamza | ||
685 | -- discard the ʾiʿrāb hyphen (begin) | 755 | -- discard the ʾiʿrāb hyphen (begin) |
686 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, | 756 | {a="(%-)(\"?[UI]na)(%p?%s)", b="%2%3"}, |
687 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, | 757 | {a="(%-)(\"?[UI]na)(%p?)$", b="%2%3"}, |