From 66827ccf15a7b86dcc2f7218b4b5e683fe1b72f3 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 3 Jul 2016 12:02:49 +0200 Subject: almost done implementing Buckwalter scheme; testing romanization --- arabluatex.dtx | 3 ++- arabluatex.lua | 5 ++++- arabluatex_voc.lua | 66 ++++++++++++++++++++++++++++++++++++++++++------------ 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/arabluatex.dtx b/arabluatex.dtx index d7a4adb..8fb206b 100644 --- a/arabluatex.dtx +++ b/arabluatex.dtx @@ -2396,7 +2396,8 @@ wa-ya.sIru ta.hta 'l-jild-i \bgroup\textdir TLT\al@trans@style% \luadirect{tex.sprint(processtrans(\luastringN{#2}, \luastringO{\al@trans@convention}, - \luastringO{\al@arb@rules}))}\egroup% + \luastringO{\al@arb@rules}, + \luastringO{\al@input@scheme}))}\egroup% \else% \fi\fi\fi\fi} % \end{macrocode} diff --git a/arabluatex.lua b/arabluatex.lua index 9134ce5..5400a62 100644 --- a/arabluatex.lua +++ b/arabluatex.lua @@ -515,12 +515,15 @@ function processnovoc(str, rules) return str end -function processtrans(str, mode, rules) +function processtrans(str, mode, rules, scheme) str = "\\arb{".. str.."}" str = takeoutabjad(str) str = protectarb(str) str = breakcmd(str) str = holdcmd(str) + if scheme == "buckwalter" then + str = processbuckw(str) + else end if mode == "dmg" then if rules == "easy" then str = transdmgeasy(str) diff --git a/arabluatex_voc.lua b/arabluatex_voc.lua index b295254..836ee4b 100644 --- a/arabluatex_voc.lua +++ b/arabluatex_voc.lua @@ -72,26 +72,64 @@ raw = { } buckwalter = { - -- trigraphs - {a="^Aal", b="al-"}, - {a="(%W)Aal", b="%1al-"}, - {a="([%-%s])Al", b="%1\'l-"}, --- {a="([uai])Al", b="%1-\'l-"}, - {a="(al%-[%a])(%~)", b="%1"}, - {a="(\'l%-[%a])(%~)", b="%1"}, - -- šadda - {a="([%a])(%~)", b="%1%1"}, - -- digraphs begin - {a="aA", b="A"}, - {a="uw", b="U"}, - {a="iy", b="I"}, - -- digraphs end + --- madda: hold it for now + {a="%|", b="@"}, + -- prevent any unwanted šadda from being generated + {a="bb", b="b|b"}, + {a="tt", b="t|t"}, + {a="vv", b="v|v"}, + {a="jj", b="j|j"}, + {a="HH", b="H|H"}, + {a="xx", b="x|x"}, + {a="dd", b="d|d"}, + {a="%*|%*", b="*|*"}, + {a="rr", b="r|r"}, + {a="ss", b="s|s"}, + {a="%$%$", b="$|$"}, + {a="SS", b="S|S"}, + {a="DD", b="D|D"}, + {a="TT", b="T|T"}, + {a="ZZ", b="Z|Z"}, + {a="EE", b="E|E"}, + {a="gg", b="g|g"}, + {a="ff", b="f|f"}, + {a="qq", b="q|q"}, + {a="kk", b="k|k"}, + {a="ll", b="l|l"}, + {a="mm", b="m|m"}, + {a="nn", b="n|n"}, + {a="hh", b="h|h"}, + {a="ww", b="w|w"}, + {a="yy", b="y|y"}, -- hamza begin + {a="\'", b="|\"\'"}, {a="%>", b="a\"\'"}, {a="%&", b="w\"\'"}, {a="%<", b="i\"\'"}, {a="%]", b="y\"\'"}, -- hamza end + -- trigraphs + {a="^Aal%-?", b="al-"}, + {a="(%W)Aal%-?", b="%1al-"}, + {a="([%-%s])Al%-?", b="%1\'l-"}, +-- {a="([fw]a?)([tw]a?)Al", b="%1-%2-\'l-"}, +-- {a="([fw]a?)(bi?)Al", b="%1-%2-\'l-"}, +-- {a="([fw]a?)(l[ai]?l)Al", b="%1-%2-l-"}, +-- {a="(al%-[%a])(%~)", b="%1"}, +-- {a="([fltw]a?)Al%-?", b="%1-\'l-"}, +-- {a="(bi?)Al%-?", b="%1-'l-"}, +-- {a="(li?)Al%-?", b="%1-l-"}, + {a="(\'l%-[%g])(%~)", b="%1"}, + -- digraphs begin + {a="([^a])A", b="%1\"A"}, + {a="aA", b="A"}, + {a="uw([^%~])", b="U%1"}, + {a="iy([^%~])", b="I%1"}, + -- digraphs end + -- madda: get it back + {a="%@", b="A\"\'"}, + -- šadda: + {a="([%g])(%~)", b="%1%1"}, {a="v", b="_t"}, {a="H", b=".h"}, {a="%*", b="_d"}, -- cgit v1.2.3