From 7bd04248f4dd33d051e0dedf5de8560e2f3a7496 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Mon, 29 Feb 2016 21:54:47 +0100 Subject: add arabluatex_trans.lua --- arabluatex_trans.lua | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 arabluatex_trans.lua diff --git a/arabluatex_trans.lua b/arabluatex_trans.lua new file mode 100644 index 0000000..e65c3eb --- /dev/null +++ b/arabluatex_trans.lua @@ -0,0 +1,187 @@ +--[[ +This file is part of the `arabluatex' package + +copyright (C) 2016 Robert Alessi + +Please send error reports and suggestions for improvements to +Robert Alessi + +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. +--]] + +hamzatrdmg = { + -- initial long u + {a="%'%_U", b="ʾU"}, + -- madda (historic writing below) + {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"} +} + +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%2"}, + {a="(%s)(a)l%-(l)", b="%1%2l-%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-%2"}, + {a="(%s)(a)([%_%^%.]?[tdrzsn])%-", b="%1%2%3-%3"}, + -- al- + initial unstable hamza + {a="^(a)l%-([uai])", b="%1l-%2"}, + {a="(%s)(a)l%-([uai])", b="%1%2l-%3"}, + -- li- + art. + initial unstable hamza is a special orthography + {a="l(i)%-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-"}, + -- art. with waṣla + lām + {a="'l%-(l)", b="'l-%1"}, + -- art. with waṣla + solar consonant + {a="'l%-([%_%^%.]?[tdrzsn])", b="'%1-"}, + -- li- + art. + lām + {a="l(i)%-l%-(l)", b="l%1-l-%2%2"}, + -- assim. art. with waṣla + solar consonant + {a="'([%_%^%.]?[tdrzsn])%-", b="'%1-%1"}, + -- li- + art. + solar consonant is a special orthography + {a="l(i)%-l%-([%_%^%.]?[tdrzsn])", b="l%1-%2-%2"}, + -- li- + assim. art. + solar consonant is a special orthography + {a="l(i)%-([%_%^%.]?[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-"} +} + +tanwintrdmg = { + {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"} +} + +digraphstrdmg = { + {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="T([^uai])", b="%1"}, + {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="ū"}, + {a="WA", b="ū"}, + {a="(a)W", b="%1w"}, + {a="_A", b="ā"}, + {a="_u", b="ū"}, + {a="_a", b="ā"}, + {a="_i", b="ī"} +} + +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="Y", b="ā"}, + {a='"', b=''}, +} + +longvtrdmg = { + {a="A", b="ā"}, + {a="U", b="ū"}, + {a="I", b="ī"} +} + +shortvtrdmg = { + {a="u", b="u"}, + {a="a", b="a"}, + {a="i", b="i"} +} + + +-- return { +-- raw = raw, +-- hamza = hamza, +-- trigraphs = trigraphs, +-- tanwin = tanwin, +-- digraphs = digraphs, +-- single = single, +-- longv = longv, +-- shortv = shortv, +-- null =null +-- } -- cgit v1.2.3