diff options
author | Karl Berry <karl@freefriends.org> | 2016-03-31 23:07:01 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-03-31 23:07:01 +0000 |
commit | 34c1f6f7ba18c399071c8e7a305dbaf5ed63b603 (patch) | |
tree | 4f7efeb0924acff1caef4350b34b0f908ea02b59 /Master/texmf-dist/tex | |
parent | ba0636a59275afac029f6ae7aeac654c1b156b32 (diff) |
arabluatex (31mar16)
git-svn-id: svn://tug.org/texlive/trunk@40202 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
6 files changed, 1827 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua new file mode 100644 index 00000000000..f6597e8abb0 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.lua @@ -0,0 +1,373 @@ +--[[ +This file is part of the `arabluatex' package + +Copyright (C) 2016 Robert Alessi + +Please send error reports and suggestions for improvements to +Robert Alessi <alessi@robertalessi.net> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--]] + +require("arabluatex_voc") +require("arabluatex_fullvoc") +require("arabluatex_novoc") +require("arabluatex_trans") + +local function protectarb(str) + str = string.gsub(str, "(\\arb.?)(%[.-%])(%b{})", "\\@arb%2%3") + str = string.gsub(str, "\\par", "\\p@r{}") + str = string.gsub(str, "\\@@par", "\\p@r{}") +return str +end + +local function unprotectarb(str) + str = string.gsub(str, "(\\@arb)(%[.-%])(%b{})", "\\arb%2%3") + str = string.gsub(str, "\\p@r{}", "\\par") +return str +end + +local function breakcmd(str) + -- \edtext + str = string.gsub(str, "\\(edtext.-)(%b{})(%b{})", + function(tag, bodylem, bodyvar) + bodylem = string.sub(bodylem, 2, -2) + bodyvar = string.sub(bodyvar, 2, -2) + return string.format("\\LR{\\%s{%s}{%s}}", tag, bodylem, bodyvar) + end) + -- \RL + str = string.gsub(str, "\\(RL.-)(%b{})", + function(tag, body) + body = string.sub(body, 2, -2) + return string.format("}\\%s{%s}\\arb{", tag, body) + end) + -- \LR + str = string.gsub(str, "\\(LR.-)(%b{})", + function(tag, body) + body = string.sub(body, 2, -2) + return string.format("}\\%s{%s}\\arb{", tag, body) + end) + -- Footnote + str = string.gsub(str, "\\(Footnote.-)(%b{})", + function(tag, body) + body = string.sub(body, 2, -2) + return string.format("}\\%s{%s}\\arb{", tag, body) + end) + -- Marginpar + str = string.gsub(str, "\\(Marginpar.-)(%b{})", + function(tag, body) + body = string.sub(body, 2, -2) + return string.format("}\\%s{%s}\\arb{", tag, body) + end) + -- Abjad (Needs polyglossia) + str = string.gsub(str, "\\(abjad.-)(%b{})", + function(tag, body) + body = string.sub(body, 2, -2) + return string.format("}\\aemph{\\txarb{\\%s{%s}}}\\arb{", tag, body) + end) + return str +end + +local function holdcmd(str) + str = string.gsub(str, "\\(arb)(%b{})", function(tag, body) + body = string.sub(body, 2, -2) + body = string.gsub(body, "\\(.-)(%b{})", function(btag, bbody) + bbody = string.sub(bbody, 2, -2) + if string.find(btag, "@") then + return holdcmd(string.format("}\\%s{%s}\\arb{", btag, bbody)) + else + return holdcmd(string.format("}\\%s{\\arb{%s}}\\arb{", btag, bbody)) + end + end) + return string.format("\\%s{%s}", tag, body) + end) + str = string.gsub(str, "\\arb{}", "") +return str +end + +local function arbnum(str) + str = string.gsub(str, "([0-9%,%-%/]+)", function(num) + return string.reverse(num) + end) + return str +end + +local function indnum(str) + str = string.gsub(str, "([0-9%,%-%/]+)", function(num) + return string.reverse(num) + end) + for i = 1,#numbers do + str = string.gsub(str, numbers[i].a, numbers[i].b) + end + return str +end + +local function takeoutcap(str) + str = string.gsub(str, "(\\cap.?)(%b{})", function(tag, body) + body = string.sub(body, 2, -2) + return string.format("%s", body) + end) + return str +end + +local function voc(str) + str = string.gsub(str, "\\arb(%b{})", function(inside) + inside = string.sub(inside, 2, -2) + for i = 1,#hamza do + inside = string.gsub(inside, hamza[i].a, hamza[i].b) + end + for i = 1,#tanwin do + inside = string.gsub(inside, tanwin[i].a, tanwin[i].b) + end + for i = 1,#trigraphs do + inside = string.gsub(inside, trigraphs[i].a, trigraphs[i].b) + end + for i = 1,#digraphs do + inside = string.gsub(inside, digraphs[i].a, digraphs[i].b) + end + for i = 1,#single do + inside = string.gsub(inside, single[i].a, single[i].b) + end + for i = 1,#longv do + inside = string.gsub(inside, longv[i].a, longv[i].b) + end + for i = 1,#shortv do + inside = string.gsub(inside, shortv[i].a, shortv[i].b) + end + for i = 1,#punctuation do + inside = string.gsub(inside, punctuation[i].a, punctuation[i].b) + end + for i = 1,#null do + inside = string.gsub(inside, null[i].a, null[i].b) + end + inside = indnum(inside) + return string.format("\\txarb{%s}", inside) + end) +return str +end + +local function fullvoc(str) + str = string.gsub(str, "\\arb(%b{})", function(inside) + inside = string.sub(inside, 2, -2) + for i = 1,#hamzafv do + inside = string.gsub(inside, hamzafv[i].a, hamzafv[i].b) + end + for i = 1,#tanwinfv do + inside = string.gsub(inside, tanwinfv[i].a, tanwinfv[i].b) + end + for i = 1,#trigraphsfv do + inside = string.gsub(inside, trigraphsfv[i].a, trigraphsfv[i].b) + end + for i = 1,#digraphsfv do + inside = string.gsub(inside, digraphsfv[i].a, digraphsfv[i].b) + end + for i = 1,#singlefv do + inside = string.gsub(inside, singlefv[i].a, singlefv[i].b) + end + for i = 1,#longv do + inside = string.gsub(inside, longv[i].a, longv[i].b) + end + for i = 1,#shortv do + inside = string.gsub(inside, shortv[i].a, shortv[i].b) + end + for i = 1,#punctuation do + inside = string.gsub(inside, punctuation[i].a, punctuation[i].b) + end + for i = 1,#null do + inside = string.gsub(inside, null[i].a, null[i].b) + end + inside = indnum(inside) + return string.format("\\txarb{%s}", inside) + end) +return str +end + +local function novoc(str) + str = string.gsub(str, "\\arb(%b{})", function(inside) + inside = string.sub(inside, 2, -2) + for i = 1,#hamza do + inside = string.gsub(inside, hamza[i].a, hamza[i].b) + end + for i = 1,#tanwinnv do + inside = string.gsub(inside, tanwinnv[i].a, tanwinnv[i].b) + end + for i = 1,#trigraphsnv do + inside = string.gsub(inside, trigraphsnv[i].a, trigraphsnv[i].b) + end + for i = 1,#digraphs do + inside = string.gsub(inside, digraphs[i].a, digraphs[i].b) + end + for i = 1,#single do + inside = string.gsub(inside, single[i].a, single[i].b) + end + for i = 1,#longvnv do + inside = string.gsub(inside, longvnv[i].a, longvnv[i].b) + end + for i = 1,#shortvnv do + inside = string.gsub(inside, shortvnv[i].a, shortvnv[i].b) + end + for i = 1,#punctuation do + inside = string.gsub(inside, punctuation[i].a, punctuation[i].b) + end + for i = 1,#null do + inside = string.gsub(inside, null[i].a, null[i].b) + end + inside = indnum(inside) + return string.format("\\txarb{%s}", inside) + end) +return str +end + +local function transdmg(str) + str = string.gsub(str, "\\arb(%b{})", function(inside) + inside = string.sub(inside, 2, -2) + for i = 1,#hamzatrdmg do + inside = string.gsub(inside, hamzatrdmg[i].a, hamzatrdmg[i].b) + end + for i = 1,#tanwintrdmg do + inside = string.gsub(inside, tanwintrdmg[i].a, tanwintrdmg[i].b) + end + for i = 1,#trigraphstrdmg do + inside = string.gsub(inside, trigraphstrdmg[i].a, trigraphstrdmg[i].b) + end + for i = 1,#digraphstrdmg do + inside = string.gsub(inside, digraphstrdmg[i].a, digraphstrdmg[i].b) + end + for i = 1,#singletrdmg do + inside = string.gsub(inside, singletrdmg[i].a, singletrdmg[i].b) + end + for i = 1,#longvtrdmg do + inside = string.gsub(inside, longvtrdmg[i].a, longvtrdmg[i].b) + end + for i = 1,#shortvtrdmg do + inside = string.gsub(inside, shortvtrdmg[i].a, shortvtrdmg[i].b) + end + for i = 1,#punctuationtr do + inside = string.gsub(inside, punctuationtr[i].a, punctuationtr[i].b) + end + for i = 1,#nulltr do + inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) + end + return string.format("\\txtrans{%s}", inside) + end) +return str +end + +local function transloc(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) + end + for i = 1,#tanwintrloc do + inside = string.gsub(inside, tanwintrloc[i].a, tanwintrloc[i].b) + end + for i = 1,#trigraphstrloc do + inside = string.gsub(inside, trigraphstrloc[i].a, trigraphstrloc[i].b) + end + for i = 1,#digraphstrloc do + inside = string.gsub(inside, digraphstrloc[i].a, digraphstrloc[i].b) + end + for i = 1,#singletrloc do + inside = string.gsub(inside, singletrloc[i].a, singletrloc[i].b) + end + for i = 1,#longvtrloc do + inside = string.gsub(inside, longvtrloc[i].a, longvtrloc[i].b) + end + for i = 1,#shortvtrloc do + inside = string.gsub(inside, shortvtrloc[i].a, shortvtrloc[i].b) + end + for i = 1,#finaltrloc do + inside = string.gsub(inside, finaltrloc[i].a, finaltrloc[i].b) + end + for i = 1,#punctuationtr do + inside = string.gsub(inside, punctuationtr[i].a, punctuationtr[i].b) + end + for i = 1,#nulltr do + inside = string.gsub(inside, nulltr[i].a, nulltr[i].b) + end + return string.format("\\txtrans{%s}", inside) + end) +return str +end + +function processvoc(str) + str = "\\arb{".. str.."}" + str = takeoutcap(str) + str = protectarb(str) + str = breakcmd(str) + str = holdcmd(str) + str = voc(str) + str = unprotectarb(str) +return str +end + +function processfullvoc(str) + str = "\\arb{".. str.."}" + str = takeoutcap(str) + str = protectarb(str) + str = breakcmd(str) + str = holdcmd(str) + str = fullvoc(str) + str = unprotectarb(str) +return str +end + +function processnovoc(str) + str = "\\arb{".. str.."}" + str = takeoutcap(str) + str = protectarb(str) + str = breakcmd(str) + str = holdcmd(str) + str = novoc(str) + str = unprotectarb(str) +return str +end + +function processtrans(str, mode) + str = "\\arb{".. str.."}" + str = protectarb(str) + str = breakcmd(str) + str = holdcmd(str) + if mode == "dmg" then + str = transdmg(str) + elseif mode == "loc" then + str = transloc(str) + else end + str = unprotectarb(str) +return str +end + +function cap(str) + str = string.gsub(str, "(\\txtrans.?)(%b{})", function(tag, body) + body = string.sub(body, 2, -2) + return string.format("%s", body) + end) + if string.find(str, "%-['`ʾʿ]") then + str = string.gsub(str, "(%-['`])", "%1\\MakeUppercase ") + str = string.gsub(str, "(%-ʿ)", "%1\\MakeUppercase ") + str = string.gsub(str, "(%-ʾ)", "%1\\MakeUppercase ") + elseif string.find(str, "%-[^'`ʾʿ]") then + str = string.gsub(str, "(%-)", "%1\\MakeUppercase ") + elseif string.find(str, "^['`ʾʿ]") then + str = string.gsub(str, "^(['`])", "%1\\MakeUppercase ") + str = string.gsub(str, "^(ʿ)", "%1\\MakeUppercase ") + str = string.gsub(str, "^(ʾ)", "%1\\MakeUppercase ") + else + str = "\\MakeUppercase "..str + end +return str +end diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty new file mode 100644 index 00000000000..376e47952b5 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex.sty @@ -0,0 +1,145 @@ +%% +%% This is file `arabluatex.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% arabluatex.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2016 Robert Alessi +%% +%% Please send error reports and suggestions for improvements to +%% Robert Alessi <alessi@robertalessi.net> +%% +%% This program is free software; you can redistribute it and/or +%% modify it under the terms of the GNU General Public License +%% as published by the Free Software Foundation; either version 2 +%% of the License, or (at your option) any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +%% GNU General Public License for more details. +%% +%% You should have received a copy of the GNU General Public License +%% along with this program; if not, write to the Free Software +%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, +%% USA. +%% +%% This release of 'arabluatex' consists of the following source files: +%% - arabluatex.ins +%% - arabluatex.dtx +%% - arabluatex.lua +%% - arabluatex_voc.lua +%% - arabluatex_fullvoc.lua +%% - arabluatex_novoc.lua +%% - arabluatex_trans.lua +%% - arabluatex.bib +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{arabluatex}% +[2016/03/31 v1.0.1 ArabTeX-like interface for LuaLaTeX] +\RequirePackage{ifluatex} +\ifluatex\else + \PackageError{arabluatex}{lualatex needed}{% + Package `arabluatex' needs LuaTeX.\MessageBreak + So you should use `lualatex' to process your document.\MessageBreak + See documentation of `arabluatex' for further information.}% + \expandafter\expandafter\expandafter\csname endinput\endcsname +\fi +\DeclareOption{voc}{\def\al@mode{voc}} +\DeclareOption{fullvoc}{\def\al@mode{fullvoc}} +\DeclareOption{novoc}{\def\al@mode{novoc}} +\DeclareOption{trans}{\def\al@mode{trans}} +\ExecuteOptions{voc} +\ProcessOptions\relax +\def\al@mode@voc{voc} +\def\al@mode@fullvoc{fullvoc} +\def\al@mode@novoc{novoc} +\def\al@mode@trans{trans} +\RequirePackage{fontspec} +\RequirePackage{amsmath} +\RequirePackage{etoolbox} +\RequirePackage{luacode} +\RequirePackage{xparse} +\RequirePackage{environ} +\luadirect{dofile(kpse.find_file("arabluatex.lua"))} +\luadirect{tex.enableprimitives("luatex",tex.extraprimitives("omega"))} +\AtBeginDocument{\ifdefined\arabicfont\relax\else +\PackageWarning{arabluatex}{\string\arabicfont\ is not defined.^^JI + will try to load Amiri}% +\newfontfamily\arabicfont[Script=Arabic]{Amiri}\fi}% +\AtBeginDocument{\def\setRL{\pardir TRT\textdir TRT}} +\AtBeginDocument{\def\setLR{\pardir TLT\textdir TLT}} +\AtBeginDocument{\ifdef{\LR}% + {\RenewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}} + {\NewDocumentCommand{\LR}{m}{\bgroup\textdir TLT\rmfamily#1\egroup}}} +\AtBeginDocument{\ifdef{\RL}% + {\RenewDocumentCommand{\RL}{m}{\bgroup\textdir TRT\rmfamily#1\egroup}} + {\NewDocumentCommand{\RL}{m}{\bgroup\textdir TRT#1\rmfamily\egroup}}} +\AtBeginDocument{\ifdef{\aemph}% + {\RenewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}} + {\NewDocumentCommand{\aemph}{m}{$\overline{\text{#1}}$}}} +\def\al@trans@style{\itshape}% +\NewDocumentCommand{\SetTranslitStyle}{m}{\def\al@trans@style{#1}} +\def\al@trans@convention{dmg} +\NewDocumentCommand{\SetTranslitConvention}{m}{\def\al@trans@convention{#1}} +\DeclareDocumentCommand{\cap}{m}% + {\luadirect{tex.sprint(cap(\luastringN{#1}))}} +\DeclareDocumentCommand{\txarb}{+m}{\bgroup\textdir + TRT\arabicfont#1\egroup} +\DeclareDocumentCommand{\txtrans}{+m}{\bgroup\textdir + TLT\rmfamily#1\egroup} +\DeclareDocumentCommand{\arb}{O{\al@mode} +m}% +{\edef\@tempa{#1}% + \ifx\@tempa\al@mode@voc% + \bgroup\textdir TRT\arabicfont% + \luadirect{tex.sprint(processvoc(\luastringN{#2}))}\egroup% + \else% + \ifx\@tempa\al@mode@fullvoc% + \bgroup\textdir TRT\arabicfont% + \luadirect{tex.sprint(processfullvoc(\luastringN{#2}))}\egroup% + \else% + \ifx\@tempa\al@mode@novoc% + \bgroup\textdir TRT\arabicfont% + \luadirect{tex.sprint(processnovoc(\luastringN{#2}))}\egroup% + \else% + \ifx\@tempa\al@mode@trans% + \bgroup\textdir TLT\al@trans@style% + \luadirect{tex.sprint(processtrans(\luastringN{#2}, + \luastringO{\al@trans@convention}))}\egroup% + \else% + \fi\fi\fi\fi} +\NewEnviron{arab}[1][\al@mode]% +{\par\edef\@tempa{#1}% + \ifx\@tempa\al@mode@voc% + \bgroup\pardir TRT\textdir TRT\arabicfont% + \luadirect{tex.sprint(processvoc(\luastringO{\BODY}))}\egroup% + \else% + \ifx\@tempa\al@mode@fullvoc% + \bgroup\pardir TRT\textdir TRT\arabicfont% + \luadirect{tex.sprint(processfullvoc(\luastringO{\BODY}))}\egroup% + \else% + \ifx\@tempa\al@mode@novoc% + \bgroup\pardir TRT\textdir TRT\arabicfont% + \luadirect{tex.sprint(processnovoc(\luastringO{\BODY}))}\egroup% + \else \ifx\@tempa\al@mode@trans% + \bgroup\pardir TLT\textdir TLT\al@trans@style% + \luadirect{tex.sprint(processtrans(\luastringO{\BODY}, + \luastringO{\al@trans@convention}))}\egroup% + \else \fi\fi\fi\fi}[\par] +\DeclareDocumentCommand{\LRmarginpar}{m}{\marginpar{\textdir TLT #1}} +\DeclareDocumentCommand{\LRfootnote}{m}{\bgroup\pardir + TLT\LR{\footnote{#1}}\egroup} +\DeclareDocumentCommand{\RLfootnote}{m}{\bgroup\pardir + TRT\LR{\footnote{#1}}\egroup} +\NewDocumentCommand{\FixArbFtnmk}{}{% + \@ifpackageloaded{scrextend}% + {\AtBeginDocument{\deffootnote{2em}{1.6em}{\LR{\thefootnotemark}.\enskip}}}% + {\RequirePackage{scrextend} + \AtBeginDocument{\deffootnote{2em}{1.6em}{\LR{\thefootnotemark}.\enskip}}}} +\endinput +%% +%% End of file `arabluatex.sty'. diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua new file mode 100644 index 00000000000..f66ed872fd0 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_fullvoc.lua @@ -0,0 +1,318 @@ +--[[ +This file is part of the `arabluatex' package + +Copyright (C) 2016 Robert Alessi + +Please send error reports and suggestions for improvements to +Robert Alessi <alessi@robertalessi.net> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--]] + +-- this is new +hamzafv = { + -- hard coded hamza + {a="|\"'", b="ء"}, + {a="A\"'", b="آ"}, + {a="[au]\"'", b="أ"}, + {a="w\"'", b="ؤ"}, + {a="i\"'", b="إ"}, + {a="y\"'", b="ئ"}, + {a="ؤ([^uaiUAI])", b="ؤْ%1"}, + {a="ؤ$", b="ؤْ"}, + {a="ؤ(%s)", b="ؤْ%1"}, + {a="أ([^uaiUAI])", b="أْ%1"}, + {a="أ$", b="أْ"}, + {a="أ(%s)", b="أْ%1"}, + {a="ئ([^uaiUAI])", b="ئْ%1"}, + {a="ئ$", b="ئْ"}, + {a="ئ(%s)", b="ئْ%1"}, + -- hamza takes tašdīd too + {a="''([Uu])", b="ؤؤ%1"}, + {a="''([Aa])", b="أأ%1"}, + {a="''([Ii])", b="ئئ%1"}, + -- initial long u + {a="%'%_U", b="أU"}, + -- madda (historic writing below) + {a="'a'([^uaiUAI])", b="آ%1"}, + {a="'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="آ%1"}, + {a="(A)(')(uN?)$", b="aآء%3"}, + {a="(A)(')(uN?)(%W)", b="aآء%3%4"}, + {a="(A)(')(iN?)$", b="aآء%3"}, + {a="(A)(')(iN?)(%W)", b="aآء%3%4"}, + {a="(A)(')(i)", b="aآئ%3"}, -- historic madda + {a="(A)(')(u)", b="aآؤ%3"}, -- historic madda + {a="(A)(')", b="aآء"}, -- historic madda + -- initial (needs both ^ and %W patterns) + {a="^(')([ua])", b="أ%2"}, + {a="^(')(i)", b="إ%2"}, + {a="(%W)(')([ua])", b="%1أ%3"}, + {a="(%W)(')(i)", b="%1إ%3"}, + -- final + -- ^say'aN and .zim'aN are special orthographies + {a="(%^say)(%')(aN)", b="%1ئ%3"}, + {a="(.zi?m)(%')(aN)", b="%1ئ%3"}, + {a="([^uai])(')([uai]N?)$", b="%1ء%3"}, + {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"}, +-- u + {a="(u)(')([uai]?N)$", b="%1ؤ%3"}, + {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"}, + {a="(u)(')$", b="%1ؤْ"}, + {a="(u)(')(%W)", b="%1ؤْ%3"}, +-- a + {a="(a)(')(A)$", b="%1آ"}, + {a="(a)(')(A)(%W)", b="%1آ%4"}, + {a="(a)(')([u]N?)$", b="%1أ%3"}, + {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"}, + {a="(a)(')(a)$", b="%1أ%3"}, + {a="(a)(')(a)(%W)", b="%1أ%3%4"}, + {a="(a)(')(aN)$", b="%1أً"}, + {a="(a)(')(aN)(%W)", b="%1أً%4"}, + {a="(a)(')([i]N?)$", b="%1إ%3"}, + {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"}, + {a="(a)(')$", b="%1أْ"}, + {a="(a)(')(%W)", b="%1أْ%3"}, +-- i + {a="(i)(')([uai]N?)$", b="%1ئ%3"}, + {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"}, + {a="(i)(')$", b="%1ئْ"}, + {a="(i)(')(%W)", b="%1ئْ%3"}, +-- + -- 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"} +} + +tanwinfv = { + {a="uNU", b="ٌو"}, + {a="aNU", b="ًوا"}, + {a="iNU", b="ٍو"}, + {a="([uai]N)(%s)([uai])", b="%1%2ٱ"}, + {a="(aN[%_]?[AY])(%s)([uai])", b="%1%2ٱ"}, + -- assimilations (begin) + {a="(uN)(%s)([rlmnwy])", b="ٌ%2%3%3"}, + {a="(aN)(_A)(%s)([rlmnwy])", b="ًى%3%4%4"}, + {a="(aN)(Y)(%s)([rlmnwy])", b="ًى%3%4%4"}, + {a="(T)(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"}, + {a="(ء)(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"}, + {a="([^TA])(aN)(%s)([rlmnwy])", b="%1ًا%3%4%4"}, + {a="(iN)(%s)([rlmnwy])", b="ٍ%2%3%3"}, + -- assimilations (end) + -- quoted tanwīn (begin) + {a="(\"uN)", b=""}, + {a="(B)(\"aN)", b="%1"}, + {a="(\"aN)(_A)", b="ى"}, + {a="(\"aN)(Y)", b="ى"}, + {a="(T)(\"aN)", b="%1"}, + {a="(ء)(\"aN)", b="%1"}, + {a="([^TA])(\"aN)", b="%1ا"}, + {a="(\"iN)", b=""}, + -- quoted tanwīn (end) + {a="(uN)", b="ٌ"}, + {a="(B)(aN)", b="%1ً"}, + {a="(aN)(_A)", b="ًى"}, + {a="(aN)(Y)", b="ًى"}, + {a="(T)(aN)", b="%1ً"}, + {a="(ء)(aN)", b="%1ً"}, + {a="([^TA])(aN)", b="%1ًا"}, + {a="(iN)", b="ٍ"} +} + +-- this is new +trigraphsfv = { -- trigraphs or more + -- 'llatI / 'llad_I + {a="^'ll(a)([%_]?[dt])", b="ٱلّ%1%2"}, + {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ٱلّ%2%3"}, + -- al- + lām + {a="^(a)l%-(l)", b="ا%1ل%2%2"}, + {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"}, + -- al- + solar consonant + {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"}, + {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, + -- assim. art. + solar consonant + {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"}, + {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"}, + -- al- + initial unstable hamza + {a="^(a)l%-(\"?[uai])", b="ا%1لٱ%2"}, + {a="([%s%-])(a)l%-(\"?[uai])", b="%1ا%2لٱ%3"}, + -- li-/la + art. + initial unstable hamza is a special orthography + {a="l([ai])%-l%-(\"?[uai])", b="ل%1لٱ%2"}, + -- al- + lunar consonant (i.e. what remains) + {a="^(a)l%-", b="ا%1لْ"}, + {a="([%s%-])(a)l%-", b="%1ا%2لْ"}, + -- diphthongs to be resolved before ʾalif conjunctionis + {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"}, + {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"}, + {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"}, + -- art. with waṣla + lām + {a="'l%-(l)", b="ٱل%1%1"}, + -- art. with waṣla + solar consonant + {a="'l%-([%_%^%.]?[tdrzsn])", b="ٱل%1%1"}, + -- li-/la- + art. + lām + {a="l([ai])%-l%-(l)", b="ل%1%2%2"}, + -- assim. art. with waṣla + solar consonant + {a="'([%_%^%.]?[tdrzsn])%-", b="ٱل%1"}, + -- li-/la- + art. + solar consonant is a special orthography + {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="ل%1ل%2%2"}, + -- li-/la- + assim. art. + solar consonant is a special orthography + {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="ل%1ل%3%3"}, + -- art. with waṣla + initial unstable hamza + {a="'l%-(\"?[uai])", b="ٱلٱ%1"}, + -- art. with waṣla + lunar consonant (i.e. what remains) + {a="'l%-", b="ٱلْ"}, + -- the silent wāw + {a="uU$", b="uو"}, + {a="uU(%W)", b="uو%1"}, + {a="aU$", b="aو"}, + {a="aU(%W)", b="aو%1"}, + {a="iU$", b="iو"}, + {a="iU(%W)", b="iو%1"}, + -- words ending in -āT with silent wāw/yāʾ + {a="(_a)UA", b="%1وا"}, + {a="(_a)U", b="%1و"}, + {a="(_a)I", b="%1ي"}, + -- assimilations + {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} +} + +-- this is new +digraphsfv = { + -- initial straight double quote gives a connective ʾalif + {a="^\"[uai]", b="ٱ"}, + {a="([%s%-])\"[uai]", b="%1ٱ"}, + -- diphthongs to be resolved before ʾalif conjunctionis + {a="(aW)(%s)(\"?[uai])", b="awuا%2ٱ"}, + {a="(aw)(%s)(\"?[uai])", b="%1u%2ٱ"}, + {a="(ay)(%s)(\"?[uai])", b="%1i%2ٱ"}, + {a="([uai]%-)(\"?[uai])", b="%1ٱ"}, -- hyphen + initial alif without hamza + -- initial alif without hamza + {a="([%_]?[uaiUAIY])(%s)(\"?[uai])", b="%1%2ٱ"}, + {a="^([uai])", b="ا%1"}, -- initial alif without hamza + {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza + {a="%-%-", b="ـ"}, + {a="ؤؤ", b="ؤّ"}, + {a="أأ", b="أّ"}, + {a="ئئ", b="ئّ"}, + {a="bb", b="بّ"}, + {a="BB", b="ـّ"}, + {a="(%_)([thd])([thd])", b="%1%2|%3"}, + {a="tt", b="تّ"}, + {a="%_t%_t", b="ثّ"}, + {a="jj", b="جّ"}, + {a="%^g%^g", b="جّ"}, + {a="xx", b="خّ"}, + {a="%_h%_h", b="خّ"}, + {a="dd", b="دّ"}, + {a="%_d%_d", b="ذّ"}, + {a="rr", b="رّ"}, + {a="zz", b="زّ"}, + {a="ss", b="سّ"}, + {a="%^s%^s", b="شّ"}, + {a="%.s%.s", b="صّ"}, + {a="%.d%.d", b="ضّ"}, + {a="%.t%.t", b="طّ"}, + {a="%.z%.z", b="ظّ"}, + {a="%`%`", b="عّ"}, + {a="%.g%.g", b="غّ"}, + {a="ff", b="فّ"}, + {a="qq", b="قّ"}, + {a="kk", b="كّ"}, + {a="ll", b="لّ"}, + {a="mm", b="مّ"}, + {a="nn", b="نّ"}, + {a="hh", b="هّ"}, + {a="ww", b="وّ"}, + {a="yy", b="يّ"}, + -- sukūn begin + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"}, + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIًٌٍ])", b="%1ْ%2"}, + -- take out sukūn in cases of assimilation + {a="(n)(ْ)(%s)([روي])", b="%1%3%4"}, + {a="(n)(ْ)(%s)([ل])", b="%1%3%4"}, + {a="(n)(ْ)(%s)([م])", b="%1%3%4"}, + {a="(n)(ْ)(%s)([ن])", b="%1%3%4"}, + {a="ْ\"", b="\""}, + -- sukūn end + {a="_t", b="ث"}, + {a="%^g", b="ج"}, + {a="%.h", b="ح"}, + {a="_h", b="خ"}, + {a="_d", b="ذ"}, + {a="%^s", b="ش"}, + {a="%.s", b="ص"}, + {a="%.d", b="ض"}, + {a="%.t", b="ط"}, + {a="%.z", b="ظ"}, + {a="%.g", b="غ"}, + {a="(U)(A)", b="%1ا"}, + {a="WA", b="وْا"}, + {a="(a)W\"", b="%1وا"}, + {a="(a)W", b="%1وْا"}, + {a="_A", b="aى"}, + {a="_u", b="ٗ"}, + {a="_a", b="ٰ"}, + {a="_i", b="ٖ"}, + {a="%.b", b="ٮ"}, + {a="%.f", b="ڡ"}, + {a="%.q", b="ٯ"}, + {a="%.k", b="ک"}, + {a="%.n", b="ں"}, + {a="%^d", b="ڊ"} +} + +singlefv = { + {a="b", b="ب"}, + {a="t", b="ت"}, + {a="j", b="ج"}, + {a="x", b="خ"}, + {a="d", b="د"}, + {a="r", b="ر"}, + {a="z", b="ز"}, + {a="s", b="س"}, + {a="f", b="ف"}, + {a="`", b="ع"}, + {a="f", b="ف"}, + {a="q", b="ق"}, + {a="k", b="ك"}, + {a="l", b="ل"}, + {a="m", b="م"}, + {a="n", b="ن"}, + {a="h", b="ه"}, + {a="w", b="و"}, + {a="y", b="ي"}, + {a="T", b="ة"}, + {a="\"$", b=""}, + {a="\"(%W)", b="%1"}, + {a="\"([^uaiUAI])", b="%1"}, + {a="([^0-9])%-([^0-9])", b="%1%2"}, + {a="B", b="ـ"}, +} diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua new file mode 100644 index 00000000000..deb5d3ef0eb --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_novoc.lua @@ -0,0 +1,136 @@ +--[[ +This file is part of the `arabluatex' package + +Copyright (C) 2016 Robert Alessi + +Please send error reports and suggestions for improvements to +Robert Alessi <alessi@robertalessi.net> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--]] + +tanwinnv = { + {a="uNU", b="و"}, + {a="aNU", b="وا"}, + {a="iNU", b="و"}, + -- assimilations (begin). These are good but may not apply here. +-- {a="(uN)(%s)([rlmnwy])", b="|%2%3%3"}, +-- {a="(aN)(_A)(%s)([rlmnwy])", b="ى%3%4%4"}, +-- {a="(aN)(Y)(%s)([rlmnwy])", b="ى%3%4%4"}, +-- {a="(T)(aN)(%s)([rlmnwy])", b="%1%3%4%4"}, +-- {a="(ء)(aN)(%s)([rlmnwy])", b="%1%3%4%4"}, +-- {a="([^TA])(aN)(%s)([rlmnwy])", b="%1ا%3%4%4"}, +-- {a="(iN)(%s)([rlmnwy])", b="|%2%3%3"}, + -- assimilations (end) + -- "quoted" tanwīn (begin) + {a="(\"uN)", b="ٌ"}, + {a="(B)(\"aN)", b="%1ً"}, + {a="(\"aN)(_A)", b="ًى"}, + {a="(\"aN)(Y)", b="ًى"}, + {a="(T)(\"aN)", b="%1ً"}, + {a="(ء)(\"aN)", b="%1ً"}, + {a="([^TA])(\"aN)", b="%1ًا"}, + {a="(\"iN)", b="ٍ"}, + -- "quoted" tanwīn (end) + {a="(uN)", b=""}, + {a="(B)(aN)", b="%1"}, + {a="(aN)(_A)", b="ى"}, + {a="(aN)(Y)", b="ى"}, + {a="(T)(aN)", b="%1"}, + {a="(ء)(aN)", b="%1"}, + {a="([^TA])(aN)", b="%1ا"}, + {a="(iN)", b=""}, + -- initial straight double quote gives a connective ʾalif. This has + -- nothing to do with the tanwīn, but I put it here for time being. + {a="^\"", b="ٱ"}, + {a="([%s%-])\"", b="%1ٱ"} +} + +trigraphsnv = { -- trigraphs or more + -- Allah + {a="l%-l_ah", b="l-ll_ah"}, + -- 'llatI / 'llad_I + {a="^'ll(a)([%_]?[dt])", b="ال%1%2"}, + {a="([%s%-])'ll(a)([%_]?[dt])", b="%1ال%2%3"}, + -- al- + lām + {a="^(a)l%-(l)", b="ا%1ل%2"}, + {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3"}, + -- al- + solar consonant + {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2"}, + {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3"}, + -- assim. art. + solar consonant + {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل"}, + {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل"}, + -- al- + initial unstable hamza + {a="^(a)l%-(\")([uai])", b="ا%1لٱ%3"}, + {a="([%s%-])(a)l%-(\")([uai])", b="%1ا%2لٱ%4"}, + {a="^(a)l%-([uai])", b="ا%1لا%2"}, + {a="([%s%-])(a)l%-([uai])", b="%1ا%2لا%3"}, + -- li-/la- + art. + initial unstable hamza is a special orthography + {a="l([ai])%-l%-(\")([uai])", b="ل%1لٱ%3"}, + {a="l([ai])%-l%-([uai])", b="ل%1لا%2"}, + -- al- + lunar consonant (i.e. what remains) + {a="^(a)l%-", b="ا%1ل"}, + {a="([%s%-])(a)l%-", b="%1ا%2ل"}, + -- art. with waṣla + lām + {a="'l%-(l)", b="ال%1"}, + -- art. with waṣla + solar consonant + {a="'l%-([%_%^%.]?[tdrzsn])", b="ال%1"}, + -- li-/la- + art. + lām + {a="l([ai])%-l%-(l)", b="ل%1%2"}, + -- assim. art. with waṣla + solar consonant + {a="'([%_%^%.]?[tdrzsn])%-", b="ال"}, + -- li-/la- + art. + solar consonant is a special orthography + {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="ل%1ل%2"}, + -- li-/la + assim. art. + solar consonant is a special orthography + {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="ل%1ل%3"}, + -- art. with waṣla + initial unstable hamza + {a="'l%-(\")([uai])", b="الٱ%2"}, + {a="'l%-([uai])", b="الا%1"}, + -- art. with waṣla + lunar consonant (i.e. what remains) + {a="'l%-", b="ال"}, + -- the silent wāw + {a="uU$", b="uو"}, + {a="uU(%W)", b="uو%1"}, + {a="aU$", b="aو"}, + {a="aU(%W)", b="aو%1"}, + {a="iU$", b="iو"}, + {a="iU(%W)", b="iو%1"}, + -- words ending in -āT with silent wāw/yāʾ + {a="(_a)UA", b="%1وا"}, + {a="(_a)U", b="%1و"}, + {a="(_a)I", b="%1ي"} +} + +longvnv = { + {a="\"A", b="َا"}, + {a="\"U", b="ُو"}, + {a="\"I", b="ِي"}, + {a="\"Y", b="aى"}, + {a="A", b="ا"}, + {a="U", b="و"}, + {a="I", b="ي"}, + {a="Y", b="ى"}, +} + +shortvnv = { + {a="\"u", b="ُ"}, + {a="\"a", b="َ"}, + {a="\"i", b="ِ"}, + {a="u", b=""}, + {a="a", b=""}, + {a="i", b=""} +} diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua new file mode 100644 index 00000000000..b61c6db7373 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_trans.lua @@ -0,0 +1,483 @@ +--[[ +This file is part of the `arabluatex' package + +Copyright (C) 2016 Robert Alessi + +Please send error reports and suggestions for improvements to +Robert Alessi <alessi@robertalessi.net> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--]] + +-- common + +punctuationtr = { + {a="%(%(", b="("}, + {a="%)%)", b=")"} +} + +nulltr = { + {a="%|", b=""} +} + +-- cap +captr = { + -- dmg (defaut); loc as well + {a="ā", b="Ā"}, + {a="b", b="B"}, + {a="t", b="T"}, + {a="ṯ", b="Ṯ"}, + {a="ǧ", b="Ǧ"}, + {a="ḥ", b="Ḥ"}, + {a="ḫ", b="Ḫ"}, + {a="d", b="D"}, + {a="ḏ", b="Ḏ"}, + {a="r", b="R"}, + {a="z", b="Z"}, + {a="s", b="S"}, + {a="š", b="Š"}, + {a="ṣ", b="Ṣ"}, + {a="ḍ", b="Ḍ"}, + {a="ṭ", b="Ṭ"}, + {a="ẓ", b="Ẓ"}, + {a="ġ", b="Ġ"}, + {a="f", b="F"}, + {a="q", b="Q"}, + {a="k", b="K"}, + {a="l", b="L"}, + {a="m", b="M"}, + {a="n", b="N"}, + {a="h", b="H"}, + {a="w", b="W"}, + {a="ū", b="Ū"}, + {a="y", b="Y"}, + {a="ī", b="Ī"} +} + +-- dmg + +hamzatrdmg = { + -- 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 + {a="%'%_U", b="ʾU"}, + -- madda (historic writing below) + {a="'a'([^uaiUAI])", b="ʾA%1"}, + {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) + {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"} +} + +tanwintrdmg = { + {a="uNU", b="un"}, + {a="aNU", b="an"}, + {a="iNU", b="in"}, + -- tanwīn preceding ʾalif conjunctionis + {a="(uN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="uni%2%3"}, + {a="(aN)(_A)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ani%3%4"}, + {a="(aN)(Y)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ani%3%4"}, + {a="(T)(aN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="tani%3%4"}, + {a="([^TA])(aN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1ani%3%4"}, + {a="(iN)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="ini%2%3"}, + -- + {a="uN", b="un"}, + {a="(aN)(_A)", b="an"}, + {a="(aN)(Y)", b="an"}, + {a="(T)(\"?aN)", b="tan"}, + {a="([^TA])(\"?aN)", b="%1an"}, + {a="iN", b="in"} +} + +trigraphstrdmg = { -- trigraphs or more + -- 'llatI / 'llad_I + {a="^'ll(a)([%_]?[dt])", b="'ll%1%2"}, + {a="(%s)'ll(a)([%_]?[dt])", b="%1'll%2%3"}, + -- al- + lām + {a="^(a)l%-(l)", b="%1l-%2"}, + {a="([%s%-])(a)l%-(l)", b="%1%2l-%3"}, + -- al- + solar consonant + {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2-%2"}, + {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2%3-%3"}, + -- assim. art. + solar consonant + {a="^(a)([%_%^%.]?[tdrzsn])%-", b="%1%2-"}, + {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1%2%3-"}, + -- al- + initial unstable hamza + {a="^(a)l%-([uai])", b="%1l-%2"}, + {a="([%s%-])(a)l%-([uai])", b="%1%2l-%3"}, + -- li-/la- + art. + initial unstable hamza is a special orthography + {a="l([ai])%-l%-([uai])", b="l%1-l-%2"}, + -- al- + lunar consonant (i.e. what remains) + {a="^(a)l%-", b="%1l-"}, + {a="([%s%-])(a)l%-", b="%1%2l-"}, + -- diphthongs to be resolved before ʾalif conjunctionis + {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"}, + {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"}, + -- art. with waṣla + lām + {a="'l%-(l)", b="'l-%1"}, + -- art. with waṣla + solar consonant + {a="'l%-([%_%^%.]?[tdrzsn])", b="'%1-%1"}, + -- li-/la- + art. + lām + {a="l([ai])%-l%-(l)", b="l%1-%2%2"}, + -- assim. art. with waṣla + solar consonant + {a="'([%_%^%.]?[tdrzsn])%-", b="'%1-"}, + -- li-/la- + art. + solar consonant is a special orthography + {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%2"}, + -- li-/la- + assim. art. + solar consonant is a special orthography + {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%3"}, + -- art. with waṣla + initial unstable hamza + {a="'l%-([uai])", b="'l-%1"}, + -- art. with waṣla + lunar consonant (i.e. what remains) + {a="'l%-", b="'l-"}, + -- the silent wāw + {a="uU$", b="u"}, + {a="uU(%W)", b="u%1"}, + {a="aU$", b="a"}, + {a="aU(%W)", b="a%1"}, + {a="iU$", b="i"}, + {a="iU(%W)", b="i%1"}, + -- words ending in -āT with silent wāw/yāʾ + {a="(_a)UA", b="A"}, + {a="(_a)U", b="A"}, + {a="(_a)I", b="A"}, + -- assimilations + {a="(n)(%s)([rlmnwy])", b="%3%2%3"} +} + +digraphstrdmg = { + {a="([uai]%-)(\"?[uai])", b="%1'"}, -- hyphen + initial alif without hamza + {a="^(\"?[uai])", b="%1"}, -- initial alif without hamza +-- {a="([%_]?[uaiUAIY])(%s)([uai])", b="%1%2'"}, -- initial alif without hamza + {a="(aW)(%s)(\"?[uai])", b="awu%2%3"}, + {a="([^%_][uai])(%s)(\"?[uai])", b="%1%2'"}, + {a="([%_]?[AYa])(%s)(\"?[uai])", b="a%2'"}, + {a="([%_]?[Uu])(%s)(\"?[uai])", b="u%2'"}, + {a="([%_]?[Ii])(%s)(\"?[uai])", b="i%2'"}, + -- shorten long vowels preceding ʾalif conjunctionis + {a="(U)(A)", b="U"}, + {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awu%2%3"}, + {a="([%_]?[AYa])(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="a%2%3"}, + {a="([%_]?[Uu])(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="u%2%3"}, + {a="([%_]?[Ii])(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="i%2%3"}, + {a="%-%-", b=""}, +-- {a="T([^uai])", b="%1"}, + {a="T(%s)", b="%1"}, + {a="T$", b=""}, + {a="_t", b="ṯ"}, + {a="%^g", b="ǧ"}, + {a="%.h", b="ḥ"}, + {a="_h", b="ḫ"}, + {a="_d", b="ḏ"}, + {a="%^s", b="š"}, + {a="%.s", b="ṣ"}, + {a="%.d", b="ḍ"}, + {a="%.t", b="ṭ"}, + {a="%.z", b="ẓ"}, + {a="%.g", b="ġ"}, + -- the following needs to be moved above shortening rules +-- {a="(U)(A)", b="ū"}, + {a="WA", b="w"}, + {a="(a)W", b="%1w"}, + {a="_A", b="ā"}, + {a="_u", b="ū"}, + {a="_a", b="ā"}, + {a="_i", b="ī"}, + {a="%.b", b="ḅ"}, + {a="%.f", b="f̣"}, + {a="%.q", b="q̣"}, + {a="%.k", b="k"}, + {a="%.n", b="ṇ"}, + {a="%^d", b="d́"} +} + +singletrdmg = { + {a="b", b="b"}, + {a="t", b="t"}, + {a="j", b="ǧ"}, + {a="x", b="ḫ"}, + {a="d", b="d"}, + {a="r", b="r"}, + {a="z", b="z"}, + {a="s", b="s"}, + {a="`", b="ʿ"}, + {a="f", b="f"}, + {a="q", b="q"}, + {a="k", b="k"}, + {a="l", b="l"}, + {a="m", b="m"}, + {a="n", b="n"}, + {a="h", b="h"}, + {a="w", b="w"}, + {a="y", b="y"}, + {a="T", b="t"}, + {a="\"", b=""}, + {a="B", b=""} +} + +longvtrdmg = { + {a="A", b="ā"}, + {a="U", b="ū"}, + {a="I", b="ī"}, + {a="Y", b="ā"} +} + +shortvtrdmg = { + {a="u", b="u"}, + {a="a", b="a"}, + {a="i", b="i"} +} + +-- loc + +hamzatrloc = { + -- 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 + {a="%'%_U", b="U"}, + -- 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) + {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"} +} + +tanwintrloc = { + {a="uNU", b="un"}, + {a="aNU", b="an"}, + {a="iNU", b="in"}, + {a="uN", b="un"}, + {a="(aN)(_A)", b="an"}, + {a="(aN)(Y)", b="an"}, + {a="(T)(\"?aN)", b="tan"}, + {a="([^TA])(\"?aN)", b="%1an"}, + {a="iN", b="in"} +} + +trigraphstrloc = { -- trigraphs or more + -- 'llatI / 'llad_I + {a="^'ll(a)([%_]?[dt])", b="all%1%2"}, + {a="(%s)'ll(a)([%_]?[dt])", b="%1all%2%3"}, + -- al- + lām + {a="^(a)l%-(l)", b="%1l-%2"}, + {a="(%s)(a)l%-(l)", b="%1%2l-%3"}, + -- al- + solar consonant + {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="%1l-%2"}, + {a="(%s)(a)l%-([%_%^%.]?[tdrzsn])", b="%1%2l-%3"}, + -- assim. art. + solar consonant + {a="^(a)([%_%^%.]?[tdrzsn])%-", b="%1l-"}, + {a="(%s)(a)([%_%^%.]?[tdrzsn])%-", b="%1%2l-"}, + -- al- + initial unstable hamza + {a="^(a)l%-([uai])", b="%1l-%2"}, + {a="(%s)(a)l%-([uai])", b="%1%2l-%3"}, + -- li-/la- + art. + initial unstable hamza is a special orthography + {a="l([ai])%-l%-([uai])", b="l%1l-%2"}, + -- al- + lunar consonant (i.e. what remains) + {a="^(a)l%-", b="%1l-"}, + {a="(%s)(a)l%-", b="%1%2l-"}, + -- art. with waṣla + lām + {a="'l%-(l)", b="al-%1"}, + -- art. with waṣla + solar consonant + {a="'l%-([%_%^%.]?[tdrzsn])", b="al-%1"}, + -- li-/la- + art. + lām + {a="l([ai])%-l%-(l)", b="l%1-%2"}, + -- assim. art. with waṣla + solar consonant + {a="'([%_%^%.]?[tdrzsn])%-", b="al-"}, + -- li-/la- + art. + solar consonant is a special orthography + {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="l%1l-%2"}, + -- li-/la- + assim. art. + solar consonant is a special orthography + {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="l%1l-%3"}, + -- art. with waṣla + initial unstable hamza + {a="'l%-([uai])", b="al-%1"}, + -- art. with waṣla + lunar consonant (i.e. what remains) + {a="'l%-", b="al-"}, + -- the silent wāw + {a="uU$", b="u"}, + {a="uU(%W)", b="u%1"}, + {a="aU$", b="a"}, + {a="aU(%W)", b="a%1"}, + {a="iU$", b="i"}, + {a="iU(%W)", b="i%1"}, + -- words ending in -āT with silent wāw/yāʾ + {a="(_a)UA", b="A"}, + {a="(_a)U", b="A"}, + {a="(_a)I", b="A"} +} + +digraphstrloc = { + {a="(%-)([uai])", b="%1%2"}, -- hyphen + initial alif without hamza + {a="^([uai])", b="%1"}, -- initial alif without hamza + {a="(%s)([uai])", b="%1%2"}, -- initial alif without hamza + {a="%-%-", b=""}, + {a="uww", b="ūw"}, + {a="iyy", b="īy"}, + {a="([tkdsg])(h)", b="%1'%2"}, +-- {a="T([^uai])", b="h%1"}, + {a="T$", b="h"}, + {a="T(%W)", b="h%1"}, + {a="_t", b="th"}, + {a="%^g", b="j"}, + {a="%.h", b="ḥ"}, + {a="_h", b="kh"}, + {a="_d", b="dh"}, + {a="%^s", b="sh"}, + {a="%.s", b="ṣ"}, + {a="%.d", b="ḍ"}, + {a="%.t", b="ṭ"}, + {a="%.z", b="ẓ"}, + {a="%.g", b="gh"}, + {a="(U)(A)", b="ū"}, + {a="WA", b="w"}, + {a="(a)W", b="%1w"}, + {a="_A", b="á"}, + {a="_u", b="ū"}, + {a="_a", b="ā"}, + {a="_i", b="ī"}, + {a="%.b", b="b"}, + {a="%.f", b="f"}, + {a="%.q", b="q"}, + {a="%.k", b="k"}, + {a="%.n", b="n"}, + {a="%^d", b="d"} +} + +singletrloc = { + {a="b", b="b"}, + {a="t", b="t"}, + {a="j", b="j"}, + {a="x", b="kh"}, + {a="d", b="d"}, + {a="r", b="r"}, + {a="z", b="z"}, + {a="s", b="s"}, + {a="`", b="`"}, + {a="f", b="f"}, + {a="q", b="q"}, + {a="k", b="k"}, + {a="l", b="l"}, + {a="m", b="m"}, + {a="n", b="n"}, + {a="h", b="h"}, + {a="w", b="w"}, + {a="y", b="y"}, + {a="T", b="t"}, + {a="\"", b=""}, + {a="B", b=""} +} + +longvtrloc = { + {a="A", b="ā"}, + {a="U", b="ū"}, + {a="I", b="ī"}, + {a="Y", b="á"}, +} + +shortvtrloc = { + {a="u", b="u"}, + {a="a", b="a"}, + {a="i", b="i"} +} + +finaltrloc = { + {a="ʾ", b="'"}, +} diff --git a/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua new file mode 100644 index 00000000000..97249012661 --- /dev/null +++ b/Master/texmf-dist/tex/lualatex/arabluatex/arabluatex_voc.lua @@ -0,0 +1,372 @@ +--[[ +This file is part of the `arabluatex' package + +Copyright (C) 2016 Robert Alessi + +Please send error reports and suggestions for improvements to +Robert Alessi <alessi@robertalessi.net> + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +--]] + +numbers = { + {a="0", b="٠"}, + {a="1", b="١"}, + {a="2", b="٢"}, + {a="3", b="٣"}, + {a="4", b="٤"}, + {a="5", b="٥"}, + {a="6", b="٦"}, + {a="7", b="٧"}, + {a="8", b="٨"}, + {a="9", b="٩"} +} + +raw = { + {a="A", b="َا"}, + {a="U", b="ُو"}, + {a="I", b="ِي"}, + {a="b", b="ب"}, + {a="t", b="ت"}, + {a="j", b="ج"}, + {a="x", b="خ"}, + {a="d", b="د"}, + {a="r", b="ر"}, + {a="z", b="ز"}, + {a="s", b="س"}, + {a="f", b="ف"}, + {a="`", b="ع"}, + {a="f", b="ف"}, + {a="q", b="ق"}, + {a="k", b="ك"}, + {a="l", b="ل"}, + {a="m", b="م"}, + {a="n", b="ن"}, + {a="h", b="ه"}, + {a="w", b="و"}, + {a="y", b="ي"}, + {a="T", b="ة"}, + {a="u", b="ُ"}, + {a="a", b="َ"}, + {a="i", b="ِ"} +} + +hamza = { + -- hard coded hamza + {a="|\"'", b="ء"}, + {a="A\"'", b="آ"}, + {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 + {a="%'%_U", b="أU"}, + -- madda (historic writing below) + {a="'a'([^uaiUAI])", b="آ%1"}, + {a="'a?A([%_%^%.]?[%`%'btjghdrzsfqklmnywAY])", b="آ%1"}, + {a="(A)(')(uN?)$", b="aآء%3"}, + {a="(A)(')(uN?)(%W)", b="aآء%3%4"}, + {a="(A)(')(iN?)$", b="aآء%3"}, + {a="(A)(')(iN?)(%W)", b="aآء%3%4"}, + {a="(A)(')(i)", b="aآئ%3"}, -- historic madda + {a="(A)(')(u)", b="aآؤ%3"}, -- historic madda + {a="(A)(')", b="aآء"}, -- historic madda + -- initial (needs both ^ and %W patterns) + {a="^(')([ua])", b="أ%2"}, + {a="^(')(i)", b="إ%2"}, + {a="(%W)(')([ua])", b="%1أ%3"}, + {a="(%W)(')(i)", b="%1إ%3"}, + -- final + -- ^say'aN and .zim'aN are special orthographies + {a="(%^say)(%')(aN)", b="%1ئ%3"}, + {a="(.zi?m)(%')(aN)", b="%1ئ%3"}, + {a="([^uai])(')([uai]N?)$", b="%1ء%3"}, + {a="([^uai])(')([uai]N?)(%W)", b="%1ء%3%4"}, +-- u + {a="(u)(')([uai]?N)$", b="%1ؤ%3"}, + {a="(u)(')([uai]N?)(%W)", b="%1ؤ%3%4"}, + {a="(u)(')$", b="%1ؤ"}, + {a="(u)(')(%W)", b="%1ؤ%3"}, +-- a + {a="(a)(')(A)$", b="%1آ"}, + {a="(a)(')(A)(%W)", b="%1آ%4"}, + {a="(a)(')([u]N?)$", b="%1أ%3"}, + {a="(a)(')([u]N?)(%W)", b="%1أ%3%4"}, + {a="(a)(')(a)$", b="%1أ%3"}, + {a="(a)(')(a)(%W)", b="%1أ%3%4"}, + {a="(a)(')(aN)$", b="%1أً"}, + {a="(a)(')(aN)(%W)", b="%1أً%4"}, + {a="(a)(')([i]N?)$", b="%1إ%3"}, + {a="(a)(')([i]N?)(%W)", b="%1إ%3%4"}, + {a="(a)(')$", b="%1أ"}, + {a="(a)(')(%W)", b="%1أ%3"}, +-- i + {a="(i)(')([uai]N?)$", b="%1ئ%3"}, + {a="(i)(')([uai]N?)(%W)", b="%1ئ%3%4"}, + {a="(i)(')$", b="%1ئ"}, + {a="(i)(')(%W)", b="%1ئ%3"}, +-- + -- 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"} +} + +tanwin = { + {a="uNU", b="ٌو"}, + {a="aNU", b="ًوا"}, + {a="iNU", b="ٍو"}, + -- assimilations (begin) + {a="(uN)(%s)([rlmnwy])", b="ٌ%2%3%3"}, + {a="(aN)(_A)(%s)([rlmnwy])", b="ًى%3%4%4"}, + {a="(aN)(Y)(%s)([rlmnwy])", b="ًى%3%4%4"}, + {a="(T)(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"}, + {a="(ء)(aN)(%s)([rlmnwy])", b="%1ً%3%4%4"}, + {a="([^TA])(aN)(%s)([rlmnwy])", b="%1ًا%3%4%4"}, + {a="(iN)(%s)([rlmnwy])", b="ٍ%2%3%3"}, + -- assimilations (end) + -- quoted tanwīn (begin) + {a="(\"uN)", b=""}, + {a="(B)(\"aN)", b="%1"}, + {a="(\"aN)(_A)", b="ى"}, + {a="(\"aN)(Y)", b="ى"}, + {a="(T)(\"aN)", b="%1"}, + {a="(ء)(\"aN)", b="%1"}, + {a="([^TA])(\"aN)", b="%1ا"}, + {a="(\"iN)", b=""}, + -- quoted tanwīn (end) + {a="(uN)", b="ٌ"}, + {a="(B)(aN)", b="%1ً"}, + {a="(aN)(_A)", b="ًى"}, + {a="(aN)(Y)", b="ًى"}, + {a="(T)(aN)", b="%1ً"}, + {a="(ء)(aN)", b="%1ً"}, + {a="([^TA])(aN)", b="%1ًا"}, + {a="(iN)", b="ٍ"} +} + +trigraphs = { -- trigraphs or more + -- 'llatI / 'llad_I + {a="^'ll(a)([%_]?[dt])", b="الّ%1%2"}, + {a="([%s%-])'ll(a)([%_]?[dt])", b="%1الّ%2%3"}, + -- al- + lām + {a="^(a)l%-(l)", b="ا%1ل%2%2"}, + {a="([%s%-])(a)l%-(l)", b="%1ا%2ل%3%3"}, + -- al- + solar consonant + {a="^(a)l%-([%_%^%.]?[tdrzsn])", b="ا%1ل%2%2"}, + {a="([%s%-])(a)l%-([%_%^%.]?[tdrzsn])", b="%1ا%2ل%3%3"}, + -- assim. art. + solar consonant + {a="^(a)([%_%^%.]?[tdrzsn])%-", b="ا%1ل%2"}, + {a="([%s%-])(a)([%_%^%.]?[tdrzsn])%-", b="%1ا%2ل%3"}, + -- al- + initial unstable hamza + {a="^(a)l%-(\")([uai])", b="ا%1لٱ%3"}, + {a="([%s%-])(a)l%-(\")([uai])", b="%1ا%2لٱ%4"}, + {a="^(a)l%-([uai])", b="ا%1لا%2"}, + {a="([%s%-])(a)l%-([uai])", b="%1ا%2لا%3"}, + -- li-/la- + art. + initial unstable hamza is a special orthography + {a="l([ai])%-l%-(\")([uai])", b="ل%1لٱ%3"}, + {a="l([ai])%-l%-([uai])", b="ل%1لا%2"}, + -- al- + lunar consonant (i.e. what remains) + {a="^(a)l%-", b="ا%1ل"}, + {a="([%s%-])(a)l%-", b="%1ا%2ل"}, + -- diphthongs to be resolved before ʾalif conjunctionis + {a="(aW)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="awuا%2%3"}, + {a="(aw)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1u%2%3"}, + {a="(ay)(%s)(['][%_%^%.]?[l'btjghxdrzs`fqkmnwy]%-)", b="%1i%2%3"}, + -- art. with waṣla + lām + {a="'l%-(l)", b="ال%1%1"}, + -- art. with waṣla + solar consonant + {a="'l%-([%_%^%.]?[tdrzsn])", b="ال%1%1"}, + -- li-/la- + art. + lām + {a="l([ai])%-l%-(l)", b="ل%1%2%2"}, + -- assim. art. with waṣla + solar consonant + {a="'([%_%^%.]?[tdrzsn])%-", b="ال%1"}, + -- li-/la- + art. + solar consonant is a special orthography + {a="l([ai])%-l%-([%_%^%.]?[tdrzsn])", b="ل%1ل%2%2"}, + -- li-/la + assim. art. + solar consonant is a special orthography + {a="l([ai])%-([%_%^%.]?[tdrzsn])%-([%_%^%.]?[tdrzsn])", b="ل%1ل%3%3"}, + -- art. with waṣla + initial unstable hamza + {a="'l%-(\")([uai])", b="الٱ%2"}, + {a="'l%-([uai])", b="الا%1"}, + -- art. with waṣla + lunar consonant (i.e. what remains) + {a="'l%-", b="ال"}, + -- the silent wāw + {a="uU$", b="uو"}, + {a="uU(%W)", b="uو%1"}, + {a="aU$", b="aو"}, + {a="aU(%W)", b="aو%1"}, + {a="iU$", b="iو"}, + {a="iU(%W)", b="iو%1"}, + -- words ending in -āT with silent wāw/yāʾ + {a="(_a)UA", b="%1وا"}, + {a="(_a)U", b="%1و"}, + {a="(_a)I", b="%1ي"}, + -- assimilations + {a="(n)(%s)([rlmnwy])", b="%1%2%3%3"} +} + +digraphs = { + -- initial straight double quote gives a connective ʾalif + {a="^\"[uai]", b="ٱ"}, + {a="([%s%-])\"[uai]", b="%1ٱ"}, + {a="(aW)(%s)([uai])", b="awuا%2%3"}, + {a="(%-)([uai])", b="%1ا%2"}, -- hyphen + initial alif without hamza + {a="^([uai])", b="ا%1"}, -- initial alif without hamza + {a="(%s)([uai])", b="%1ا%2"}, -- initial alif without hamza + {a="%-%-", b="ـ"}, + {a="ؤؤ", b="ؤّ"}, + {a="أأ", b="أّ"}, + {a="ئئ", b="ئّ"}, + {a="bb", b="بّ"}, + {a="BB", b="ـّ"}, + {a="(%_)([thd])([thd])", b="%1%2|%3"}, + {a="tt", b="تّ"}, + {a="%_t%_t", b="ثّ"}, + {a="jj", b="جّ"}, + {a="%^g%^g", b="جّ"}, + {a="xx", b="خّ"}, + {a="%_h%_h", b="خّ"}, + {a="dd", b="دّ"}, + {a="%_d%_d", b="ذّ"}, + {a="rr", b="رّ"}, + {a="zz", b="زّ"}, + {a="ss", b="سّ"}, + {a="%^s%^s", b="شّ"}, + {a="%.s%.s", b="صّ"}, + {a="%.d%.d", b="ضّ"}, + {a="%.t%.t", b="طّ"}, + {a="%.z%.z", b="ظّ"}, + {a="%`%`", b="عّ"}, + {a="%.g%.g", b="غّ"}, + {a="ff", b="فّ"}, + {a="qq", b="قّ"}, + {a="kk", b="كّ"}, + {a="ll", b="لّ"}, + {a="mm", b="مّ"}, + {a="nn", b="نّ"}, + {a="hh", b="هّ"}, + {a="ww", b="وّ"}, + {a="yy", b="يّ"}, + {a="_t", b="ث"}, + {a="%^g", b="ج"}, + {a="%.h", b="ح"}, + {a="_h", b="خ"}, + {a="_d", b="ذ"}, + {a="%^s", b="ش"}, + {a="%.s", b="ص"}, + {a="%.d", b="ض"}, + {a="%.t", b="ط"}, + {a="%.z", b="ظ"}, + {a="%.g", b="غ"}, + {a="(U)(A)", b="%1ا"}, + {a="WA", b="وا"}, + {a="(a)W\"", b="%1وْا"}, + {a="(a)W", b="%1وا"}, + {a="_A", b="aى"}, + {a="_u", b="ٗ"}, + {a="_a", b="ٰ"}, + {a="_i", b="ٖ"}, + {a="%.b", b="ٮ"}, + {a="%.f", b="ڡ"}, + {a="%.q", b="ٯ"}, + {a="%.k", b="ک"}, + {a="%.n", b="ں"}, + {a="%^d", b="ڊ"} +} + +single = { + {a="b", b="ب"}, + {a="t", b="ت"}, + {a="j", b="ج"}, + {a="x", b="خ"}, + {a="d", b="د"}, + {a="r", b="ر"}, + {a="z", b="ز"}, + {a="s", b="س"}, + {a="f", b="ف"}, + {a="`", b="ع"}, + {a="f", b="ف"}, + {a="q", b="ق"}, + {a="k", b="ك"}, + {a="l", b="ل"}, + {a="m", b="م"}, + {a="n", b="ن"}, + {a="h", b="ه"}, + {a="w", b="و"}, + {a="y", b="ي"}, + {a="T", b="ة"}, + {a="\"$", b="ْ"}, + {a="\"(%W)", b="ْ%1"}, + {a="\"([^uaiUAI])", b="ْ%1"}, + {a="([^0-9])%-([^0-9])", b="%1%2"}, + {a="B", b="ـ"} +} + +longv = { + {a="\"A", b="ا"}, + {a="\"U", b="و"}, + {a="\"I", b="ي"}, + {a="\"Y", b="ى"}, + {a="A", b="َا"}, + {a="U", b="ُو"}, + {a="I", b="ِي"}, + {a="Y", b="aى"} +} + +shortv = { + {a="\"u", b=""}, + {a="\"a", b=""}, + {a="\"i", b=""}, + {a="u", b="ُ"}, + {a="a", b="َ"}, + {a="i", b="ِ"} +} + +punctuation = { + {a="%(%(", b="﴿"}, + {a="%)%)", b="﴾"}, + {a="%(", b="+@("}, + {a="%)", b="-@("}, + {a="%+%@%(", b=")"}, + {a="%-%@%(", b="("}, + {a="%.", b="۔"}, + {a="([^0-9])%,", b="%1،"}, + {a="%?", b="؟"}, + {a="%;", b="؛"}, +} + +null = { + {a="%|", b=""}, + {a="([^0-9])(%-)", b="%1"} +} |