From 749ab4ccc7ec85f9d109dfea22327a80ef07c621 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sat, 7 Jan 2017 21:18:57 +0100 Subject: bugfix: final hamzah was not parsed correctly in some particular cases --- arabluatex_fullvoc.lua | 168 +++++++++++++++++++++++++------------------------ 1 file changed, 86 insertions(+), 82 deletions(-) (limited to 'arabluatex_fullvoc.lua') diff --git a/arabluatex_fullvoc.lua b/arabluatex_fullvoc.lua index 31956a6..fd2c021 100644 --- a/arabluatex_fullvoc.lua +++ b/arabluatex_fullvoc.lua @@ -33,14 +33,14 @@ hamzafv = { {a="i\"'", b="إ"}, {a="y\"'", b="ئ"}, {a="ؤ([^uaiUAI])", b="ؤْ%1"}, - {a="ؤ$", b="ؤْ"}, - {a="ؤ(%s)", b="ؤْ%1"}, + {a="ؤ(%p?)$", b="ؤْ%1"}, + {a="ؤ(%p?%s)", b="ؤْ%1"}, {a="أ([^uaiUAI])", b="أْ%1"}, - {a="أ$", b="أْ"}, - {a="أ(%s)", b="أْ%1"}, + {a="أ(%p?)$", b="أْ%1"}, + {a="أ(%p?%s)", b="أْ%1"}, {a="ئ([^uaiUAI])", b="ئْ%1"}, - {a="ئ$", b="ئْ"}, - {a="ئ(%s)", b="ئْ%1"}, + {a="ئ(%p?)$", b="ئْ%1"}, + {a="ئ(%p?%s)", b="ئْ%1"}, -- hamza takes tašdīd too {a="''([Uu])", b="ؤؤ%1"}, {a="''([Aa])", b="أأ%1"}, @@ -58,10 +58,10 @@ hamzafv = { {a="([^uiUI])\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"}, {a="^\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="آ%1"}, {a="(%W)\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"}, - {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)(')(uN?%p?)$", b="aآء%3"}, + {a="(A)(')(uN?)(%p?%s)", b="aآء%3%4"}, + {a="(A)(')(iN?%p?)$", b="aآء%3"}, + {a="(A)(')(iN?)(%p?%s)", b="aآء%3%4"}, {a="(A)(')([iI])", b="aآئ%3"}, -- historic madda {a="(A)(')(u)", b="aآؤ%3"}, -- historic madda {a="(A)(')", b="aآء"}, -- historic madda @@ -84,31 +84,33 @@ hamzafv = { -- ^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"}, + {a="(')(I%p?)$", b="إ%2"}, -- affix pr. 1st person sg. + {a="(')(I)(%p?%s)", b="إ%2%3"}, -- affix pr. 1st person sg. + {a="([^uai])(')([uai]N?%p?)$", b="%1ء%3"}, + {a="([^uai])(')([uai]N?)(%p?%s)", 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="(u)(')([uai]N?%p?)$", b="%1ؤ%3"}, + {a="(u)(')([uai]N?)(%p?%s)", b="%1ؤ%3%4"}, + {a="(u)('%p?)$", b="%1ؤْ"}, + {a="(u)(')(%p?%s)", 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"}, + {a="(a)(')(A%p?)$", b="%1آ"}, + {a="(a)(')(A)(%p?%s)", b="%1آ%4"}, + {a="(a)(')([u]N?%p?)$", b="%1أ%3"}, + {a="(a)(')([u]N?)(%p?%s)", b="%1أ%3%4"}, + {a="(a)(')(a%p?)$", b="%1أ%3"}, + {a="(a)(')(a)(%p?%s)", b="%1أ%3%4"}, + {a="(a)(')(aN%p?)$", b="%1أً"}, + {a="(a)(')(aN)(%p?%s)", b="%1أً%4"}, + {a="(a)(')([i]N?%p?)$", b="%1إ%3"}, + {a="(a)(')([i]N?)(%p?%s)", b="%1إ%3%4"}, + {a="(a)('%p?)$", b="%1أْ"}, + {a="(a)(')(%p?%s)", 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"}, + {a="(i)(')([uai]N?%p?)$", b="%1ئ%3"}, + {a="(i)(')([uai]N?)(%p?%s)", b="%1ئ%3%4"}, + {a="(i)('%p?)$", b="%1ئْ"}, + {a="(i)(')(%p?%s)", b="%1ئْ%3"}, -- -- middle {a="(U)(')", b="%1ء"}, @@ -141,14 +143,14 @@ hamzafveasy = { -- differences marked below with 'easy' {a="i\"'", b="إ"}, {a="y\"'", b="ئ"}, {a="ؤ([^uaiUAI])", b="ؤْ%1"}, - {a="ؤ$", b="ؤْ"}, - {a="ؤ(%s)", b="ؤْ%1"}, + {a="ؤ(%p?)$", b="ؤْ%1"}, + {a="ؤ(%p?%s)", b="ؤْ%1"}, {a="أ([^uaiUAI])", b="أْ%1"}, - {a="أ$", b="أْ"}, - {a="أ(%s)", b="أْ%1"}, + {a="أ(%p?)$", b="أْ%1"}, + {a="أ(%p?%s)", b="أْ%1"}, {a="ئ([^uaiUAI])", b="ئْ%1"}, - {a="ئ$", b="ئْ"}, - {a="ئ(%s)", b="ئْ%1"}, + {a="ئ(%p?)$", b="ئْ%1"}, + {a="ئ(%p?%s)", b="ئْ%1"}, -- hamza takes tašdīd too {a="''([Uu])", b="ؤؤ%1"}, {a="''([Aa])", b="أأ%1"}, @@ -167,10 +169,10 @@ hamzafveasy = { -- differences marked below with 'easy' {a="^\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="آ%1"}, {a="(%W)\'a?A([%_%^%.]?[%`%'btjghxdrzsfqklmnywAY])", b="%1آ%2"}, --easy (begin) - {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)(')(uN?%p?)$", b="aاء%3"}, + {a="(A)(')(uN?)(%p?%s)", b="aاء%3%4"}, + {a="(A)(')(iN?%p?)$", b="aاء%3"}, + {a="(A)(')(iN?)(%p?%s)", b="aاء%3%4"}, {a="(A)(')([iI])", b="aائ%3"}, -- historic madda {a="(A)(')(u)", b="aاؤ%3"}, -- historic madda {a="(A)(')", b="aاء"}, -- historic madda @@ -194,31 +196,33 @@ hamzafveasy = { -- differences marked below with 'easy' -- ^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"}, + {a="(')(I%p?)$", b="إ%2"}, -- affix pr. 1st person sg. + {a="(')(I)(%p?%s)", b="إ%2%3"}, -- affix pr. 1st person sg. + {a="([^uai])(')([uai]N?%p?)$", b="%1ء%3"}, + {a="([^uai])(')([uai]N?)(%p?%s)", 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="(u)(')([uai]N?%p?)$", b="%1ؤ%3"}, + {a="(u)(')([uai]N?)(%p?%s)", b="%1ؤ%3%4"}, + {a="(u)('%p?)$", b="%1ؤْ"}, + {a="(u)(')(%p?%s)", 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"}, + {a="(a)(')(A%p?)$", b="%1آ"}, + {a="(a)(')(A)(%p?%s)", b="%1آ%4"}, + {a="(a)(')([u]N?%p?)$", b="%1أ%3"}, + {a="(a)(')([u]N?)(%p?%s)", b="%1أ%3%4"}, + {a="(a)(')(a%p?)$", b="%1أ%3"}, + {a="(a)(')(a)(%p?%s)", b="%1أ%3%4"}, + {a="(a)(')(aN%p?)$", b="%1أً"}, + {a="(a)(')(aN)(%p?%s)", b="%1أً%4"}, + {a="(a)(')([i]N?%p?)$", b="%1إ%3"}, + {a="(a)(')([i]N?)(%p?%s)", b="%1إ%3%4"}, + {a="(a)('%p?)$", b="%1أْ"}, + {a="(a)(')(%p?%s)", 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"}, + {a="(i)(')([uai]N?%p?)$", b="%1ئ%3"}, + {a="(i)(')([uai]N?)(%p?%s)", b="%1ئ%3%4"}, + {a="(i)('%p?)$", b="%1ئْ"}, + {a="(i)(')(%p?%s)", b="%1ئْ%3"}, -- -- middle {a="(U)(')", b="%1ء"}, @@ -388,12 +392,12 @@ trigraphsfv = { -- trigraphs or more -- 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"}, + {a="uU(%p?)$", b="uو%1"}, + {a="uU(%p?%s)", b="uو%1"}, + {a="aU(%p?)$", b="aو%1"}, + {a="aU(%p?%s)", b="aو%1"}, + {a="iU(%p?)$", b="iو%1"}, + {a="iU(%p?%s)", b="iو%1"}, -- words ending in -āT with silent wāw/yāʾ {a="(_a)UA", b="%1وا"}, {a="(_a)U", b="%1و"}, @@ -457,12 +461,12 @@ trigraphsfveasy = { -- trigraphs or more (see 'easy' tag below for the diffs) -- 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"}, + {a="uU(%p?)$", b="uو%1"}, + {a="uU(%p?%s)", b="uو%1"}, + {a="aU(%p?)$", b="aو%1"}, + {a="aU(%p?%s)", b="aو%1"}, + {a="iU(%p?)$", b="iو%1"}, + {a="iU(%p?%s)", b="iو%1"}, -- words ending in -āT with silent wāw/yāʾ {a="(_a)UA", b="%1وا"}, {a="(_a)U", b="%1و"}, @@ -538,8 +542,8 @@ digraphsfvidgham = { -- sukūn begin -- first, take out hyphen if any: {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"}, - {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"}, - {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy]%p?)$", b="%1ْ"}, + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p?%s)", b="%1ْ%2"}, {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIYًٌٍ])", b="%1ْ%2"}, -- take out sukūn in cases of assimilation {a="(n)(ْ)(%s)(ر)", b="%1%3%4"}, @@ -646,8 +650,8 @@ digraphsfv = { -- sukūn begin -- first, take out hyphen if any: {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"}, - {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"}, - {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy]%p?)$", b="%1ْ"}, + {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p?%s)", b="%1ْ%2"}, {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%_]?[^%_uaiUAIYًٌٍ])", b="%1ْ%2"}, -- take out sukūn in cases of assimilation -- {a="(n)(ْ)(%s)(ر)", b="%1%3%4"}, @@ -757,8 +761,8 @@ digraphsfveasy = { -- see the differences under 'easy' marker below {a="ْ", b=""}, -- first, take out hyphen if any: -- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])%-([uaiUAI])", b="%1%2"}, --- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])$", b="%1ْ"}, --- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])([%s])", b="%1ْ%2"}, +-- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy]%p?)$", b="%1ْ"}, +-- {a="([%_%^%.]?[Bbtjghxdrzs%`fqklmnwy])(%p?%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"}, -- cgit v1.2.3