diff --git a/src/arabic/AdjectiveAra.gf b/src/arabic/AdjectiveAra.gf index 98734aba3..5b738fb8b 100644 --- a/src/arabic/AdjectiveAra.gf +++ b/src/arabic/AdjectiveAra.gf @@ -11,11 +11,11 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in { Pl => a.s ! APosit Fem Sg d c ; _ => a.s ! APosit g n d c } - } + } }; ---- guessed by AR ComparA a np = { - s = \\sp,g,n,st,c => a.s ! AComp st c ++ "مِنْ" ++ np.s ! Gen ; + s = \\sp,g,n,st,c => a.s ! AComp st c ++ "مِنْ" ++ np.s ! Gen ; } ; -- -- $SuperlA$ belongs to determiner syntax in $Noun$. @@ -25,12 +25,12 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in { } ; -- -- ReflA2 a = { --- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; +-- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; -- isPre = False -- } ; -- -- SentAP ap sc = { --- s = \\a => ap.s ! a ++ sc.s ; +-- s = \\a => ap.s ! a ++ sc.s ; -- isPre = False -- } ; -- diff --git a/src/arabic/CatAra.gf b/src/arabic/CatAra.gf index 786e70a29..8dc9a1af6 100644 --- a/src/arabic/CatAra.gf +++ b/src/arabic/CatAra.gf @@ -38,7 +38,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { VP = ResAra.VP ; VPSlash = ResAra.VPSlash ; -- VP ** {c2:Str} - Comp = ResAra.Comp ; --{s : AAgr => Case => Str} ; + Comp = ResAra.Comp ; --{s : AAgr => Case => Str} ; -- SC = {s : Str} ; -- -- Adjective @@ -55,18 +55,18 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { Predet = ResAra.Predet ; Det = ResAra.Det ; --- {s : Species => Gender => Case => Str ; +-- {s : Species => Gender => Case => Str ; -- d : State; n : Size; isNum : Bool } ; - Quant = {s : ResAra.Number => Species => Gender => Case => Str; + Quant = {s : ResAra.Number => Species => Gender => Case => Str; d : State; isNum : Bool; isPron: Bool} ; - Art = {s : ResAra.Number => Species => Gender => Case => Str; + Art = {s : ResAra.Number => Species => Gender => Case => Str; d : State} ; -- Numeral - Numeral = {s : CardOrd => Gender => State => Case => Str ; + Numeral = {s : CardOrd => Gender => State => Case => Str ; n : Size } ; Digits = {s : Str; n : Size}; @@ -79,18 +79,17 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { Prep = {s : Str} ; -- Open lexical classes, e.g. Lexicon - + V, VS, VQ, VA = ResAra.Verb ; -- = {s : VForm => Str} ; V2, V2A = ResAra.Verb ** {c2 : Str} ; V2V, V2S, V2Q = ResAra.Verb ** {c2 : Str} ; --- AR V3 = ResAra.Verb ** {c2, c3 : Str} ; VV = ResAra.Verb ** {c2 : Str ; isAux : Bool} ; --- IL --- VV = {s : VVForm => Str ; isAux : Bool} ; A = ResAra.Adj ; A2 = ResAra.Adj ** {c2 : Str} ; - N, N2 = ResAra.Noun ; + N, N2 = ResAra.Noun ; --{s : ResAra.Number => State => Case => Str; g : Gender ; h = Species} ; -- N2 = {s : ResAra.Number => Case => Str} ** {c2 : Str} ;?? N3 = ResAra.Noun ** {c2,c3 : Str} ; diff --git a/src/arabic/ExtendAra.gf b/src/arabic/ExtendAra.gf index beda66f3e..43c35f592 100644 --- a/src/arabic/ExtendAra.gf +++ b/src/arabic/ExtendAra.gf @@ -11,10 +11,9 @@ concrete ExtendAra of Extend = Prelude, ResAra - + in { lin GenNP np = { s = \\_,_,_,_ => np.s ! Gen ; d = Const ; isNum, isPron = False } ; - } ; diff --git a/src/arabic/GrammarAra.gf b/src/arabic/GrammarAra.gf index d305f8f6e..21bf9f570 100644 --- a/src/arabic/GrammarAra.gf +++ b/src/arabic/GrammarAra.gf @@ -1,8 +1,8 @@ --# -path=.:../abstract:../common:prelude -concrete GrammarAra of Grammar = - NounAra, - VerbAra, +concrete GrammarAra of Grammar = + NounAra, + VerbAra, AdjectiveAra, AdverbAra, NumeralAra, diff --git a/src/arabic/LexiconAra.gf b/src/arabic/LexiconAra.gf index 8d78804f7..7b60364f4 100644 --- a/src/arabic/LexiconAra.gf +++ b/src/arabic/LexiconAra.gf @@ -1,12 +1,12 @@ --# -path=.:prelude -- -concrete LexiconAra of Lexicon = CatAra ** open - ParadigmsAra, +concrete LexiconAra of Lexicon = CatAra ** open + ParadigmsAra, ResAra, MorphoAra, --shouldn't open it here, only needed reg &sndf - Prelude in { + Prelude in { -flags +flags optimize=values ; coding=utf8 ; lin @@ -27,7 +27,7 @@ flags beg_V2V = dirV2 (v5 "وسل") ; big_A = sndA "كبر" "فَعِيل" ; bike_N = sdfN "درج" "فَعّالة" Fem NoHum ; - bird_N = brkN "طير" "فَعل" "فُعُول" Masc NoHum; + bird_N = brkN "طير" "فَعل" "فُعُول" Masc NoHum; black_A = clrA "سود" ; blue_A = clrA "زرق" ; boat_N = brkN "قرب" "فاعِل" "فَواعِل" Masc NoHum ; @@ -62,7 +62,7 @@ flags come_V = v1 "جي؟" a i ; --check computer_N = brkN "حسب" "فاعُول" "فَواعِيل" Masc NoHum ; country_N = brkN "بلد" "فَعَل" "فِعال" Masc NoHum ; - cousin_N = brkN "قرب" "فَعِيل" "أَفعِلاء" Masc Hum ; -- ( Number -> State -> Det - = \word,num,state -> + mkDet : Str -> Number -> State -> Det + = \word,num,state -> { s = \\_,_,c => word + vowel ! c ; n = numberToSize num; d = state; --only Const is used now. check StructuralAra isNum = False; isPron = False }; - - mkPredet : Str -> Bool -> Predet + + mkPredet : Str -> Bool -> Predet = \word,decl -> - { s = \\c => + { s = \\c => case decl of { True => word + vowel!c; False => word @@ -24,23 +24,23 @@ flags optimize = all ;--noexpand; isDecl = decl }; - mkQuantNum : Str -> Number -> State -> { - s: Species => Gender => Case => Str; n: Number; d : State; isPron: Bool; isNum : Bool} = - \waHid,num,state -> - let waHida = waHid + "َة" in - { s = \\_,g,c => - let word = + mkQuantNum : Str -> Number -> State -> { + s: Species => Gender => Case => Str; n: Number; d : State; isPron: Bool; isNum : Bool} = + \waHid,num,state -> + let waHida = waHid + "َة" in + { s = \\_,g,c => + let word = case g of { Masc => waHid; Fem => waHida - } in Al ! state + word + dec1sg ! state ! c; + } in defArt state waHid + word + dec1sg ! state ! c; n = num; d = state; isPron = False; isNum = True }; - - vowel : Case => Str = + + vowel : Case => Str = table { Nom => "ُ"; Acc => "َ"; diff --git a/src/arabic/NounAra.gf b/src/arabic/NounAra.gf index 8e8c77e9e..8fa166831 100644 --- a/src/arabic/NounAra.gf +++ b/src/arabic/NounAra.gf @@ -6,30 +6,30 @@ lin DetCN det cn = let { number = sizeToNumber det.n; - determiner : Case -> Str = \c -> + determiner : Case -> Str = \c -> det.s ! cn.h ! (detGender cn.g det.n) ! c; noun : Case -> NTable -> Str = \c,nt -> nt ! number ! (nounState det.d number) ! (nounCase c det.n det.d) - } in { - s = \\c => + } in { + s = \\c => case cnB4det det.isPron det.isNum det.n det.d of { False => determiner c ++ noun c cn.s ++ noun c cn.adj ; - --FIXME use the adj -> cn -> cn rule from below instead of + --FIXME use the adj -> cn -> cn rule from below instead of --repeating code - True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c + True => cn.s ! number ! det.d ! c ++ det.s ! cn.h ! cn.g ! c ++ cn.adj ! number ! det.d ! c }; a = { pgn = agrP3 cn.h cn.g number; isPron = False } }; - - UsePN pn = { - s = pn.s; - a = {pgn = (Per3 pn.g Sg); isPron = False } + + UsePN pn = { + s = pn.s; + a = {pgn = (Per3 pn.g Sg); isPron = False } }; - + UsePron p = p ; - + PredetNP pred np = { s = \\c => case pred.isDecl of { True => pred.s!c ++ np.s ! Gen ; -- akvaru l-awlAdi @@ -39,7 +39,7 @@ lin } ; {- --should compile.. not working :( wierd error message.. bug? - PPartNP np v2 = + PPartNP np v2 = let x = case np.a.pgn of { Per3 g n => ( positAdj (v2.s ! VPPart) ) ! g ! n ! Indef ; _ => \\_ => [] -- not occuring anyway @@ -47,83 +47,83 @@ lin s = \\c => np.s ! c ++ x ! c ; a = np.a }; - -} - + -} + -- FIXME try parsing something like "this house now" and you'll get -- an internal compiler error, but it still works.. wierd.. AdvNP np adv = { s = \\c => np.s ! c ++ adv.s; a = np.a }; -{- +{- DetSg quant ord = { - s = \\h,g,c => + s = \\h,g,c => quant.s ! Sg ! h ! g ! c ++ ord.s ! g ! quant.d ! c ; n = One; d = quant.d; isPron = quant.isPron; - isNum = + isNum = case ord.n of { None => False; _ => True } } ; --} - +-} + DetQuantOrd quant num ord = { - s = \\h,g,c => quant.s ! Pl ! h ! g ! c - ++ num.s ! g ! (toDef quant.d num.n) ! c + s = \\h,g,c => quant.s ! Pl ! h ! g ! c + ++ num.s ! g ! (toDef quant.d num.n) ! c --FIXME check this: - ++ ord.s ! g ! (toDef quant.d num.n) ! c ; + ++ ord.s ! g ! (toDef quant.d num.n) ! c ; n = num.n; d = quant.d; isPron = quant.isPron; - isNum = + isNum = case num.n of { None => False; _ => True } } ; - + DetQuant quant num = { - s = \\h,g,c => quant.s ! Pl ! h ! g ! c + s = \\h,g,c => quant.s ! Pl ! h ! g ! c ++ num.s ! g ! (toDef quant.d num.n) ! c ; n = num.n; d = quant.d; isPron = quant.isPron; - isNum = + isNum = case num.n of { None => False; _ => True } } ; - + --DEPRECATED - -- SgQuant quant = {s = quant.s ! Sg ; d = quant.d; + -- SgQuant quant = {s = quant.s ! Sg ; d = quant.d; -- isPron = quant.isPron; isNum = False} ; - -- PlQuant quant = {s = quant.s ! Pl ; d = quant.d; + -- PlQuant quant = {s = quant.s ! Pl ; d = quant.d; -- isPron = quant.isPron; isNum = False} ; - + PossPron p = { - s = \\_,_,_,_ => p.s ! Gen; - d = Const; - isPron = True; + s = \\_,_,_,_ => p.s ! Gen; + d = Const; + isPron = True; isNum = False } ; - + NumSg = { - s = \\_,_,_ => [] ; - n = One } ; + s = \\_,_,_ => [] ; + n = One } ; NumPl = { - s = \\_,_,_ => [] ; - n = None } ; - + s = \\_,_,_ => [] ; + n = None } ; + NumDigits digits = { s = \\_,_,_ => digits.s; n = digits.n }; - + NumNumeral numeral = { s = numeral.s ! NCard ; n = numeral.n @@ -134,18 +134,18 @@ lin AdNum adn num = { s = \\g,d,c => adn.s ++ num.s ! g ! d ! c ; n = num.n } ; - + OrdDigits digits = { s = \\_,d,_ => Al ! d ++ digits.s; n = digits.n }; - + -- OrdNumeral : Numeral -> Ord ; -- fifty-first OrdNumeral numeral = { s = numeral.s ! NOrd ; n = numeral.n }; - + -- FIXME, "the biggest house" would better translate into -- akbaru baytin rather than al-baytu l-2akbaru -- DetCN (DetSg DefArt (OrdSuperl big_A)) (UseN house_N) @@ -153,25 +153,25 @@ lin s = \\_,d,c => a.s ! AComp d c; n = One } ; - + DefArt = { - s = \\_,_,_,_ => []; + s = \\_,_,_,_ => []; d = Def ; isNum,isPron = False } ; - + IndefArt = { - s = \\_,_,_,_ => []; + s = \\_,_,_,_ => []; d = Indef ; isNum,isPron = False } ; - + MassNP cn = ---- AR {s = cn.s ! Sg ! Indef ; a = {pgn = Per3 cn.g Sg ; isPron = False}} ; --- MassDet = {s = \\_,_,_,_ => [] ; d = Indef; +-- MassDet = {s = \\_,_,_,_ => [] ; d = Indef; -- isNum = False; isPron = False} ; - + UseN n = n ** {adj = \\_,_,_ => []}; -- ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ; -- ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ; diff --git a/src/arabic/NumeralAra.gf b/src/arabic/NumeralAra.gf index c2e7df741..4dcd463b6 100644 --- a/src/arabic/NumeralAra.gf +++ b/src/arabic/NumeralAra.gf @@ -3,75 +3,75 @@ concrete NumeralAra of Numeral = CatAra [Numeral,Digits] ** flags coding=utf8 ; -lincat +lincat Digit = {s : DForm => CardOrd => Gender => State => Case => Str ; n : Size } ; - Sub10 = {s : DForm => CardOrd => Gender => State => Case => Str ; + Sub10 = {s : DForm => CardOrd => Gender => State => Case => Str ; n : Size } ; - Sub100 = {s : CardOrd => Gender => State => Case => Str ; + Sub100 = {s : CardOrd => Gender => State => Case => Str ; n : Size} ; - Sub1000 = {s : CardOrd => Gender => State => Case => Str ; + Sub1000 = {s : CardOrd => Gender => State => Case => Str ; n : Size } ; - Sub1000000 = {s : CardOrd => Gender => State => Case => Str ; + Sub1000000 = {s : CardOrd => Gender => State => Case => Str ; n : Size} ; - - + + lin num x = x ; - + lin n2 = num2 ** {n = Two }; - lin n3 = num3_10 "ثَلاث" "ثالِث"; - lin n4 = num3_10 "أَربَع" "رابِع"; - lin n5 = num3_10 "خَمس" "خامِس"; - lin n6 = num3_10 "سِتّ" "سادِس"; - lin n7 = num3_10 "سَبع" "سابِع"; - lin n8 = num3_10 "ثَمانِي" "ثامِن"; - lin n9 = num3_10 "تِسع" "تاسِع"; + lin n3 = num3_10 "ثَلاث" "ثالِث"; + lin n4 = num3_10 "أَربَع" "رابِع"; + lin n5 = num3_10 "خَمس" "خامِس"; + lin n6 = num3_10 "سِتّ" "سادِس"; + lin n7 = num3_10 "سَبع" "سابِع"; + lin n8 = num3_10 "ثَمانِي" "ثامِن"; + lin n9 = num3_10 "تِسع" "تاسِع"; lin pot01 = mkNum "واحِد" "أَوَّل" "أُولى" ** { n = One } ; lin pot0 d = d ; - lin pot110 = { + lin pot110 = { s= ((num3_10 "عَشر" "عاشِر").s ! unit ) ; n = ThreeTen }; - lin pot111 = { - s = \\_,g,d,_ => + lin pot111 = { + s = \\_,g,d,_ => case g of { Masc => Al ! d + "أَحَدَ" ++ teen ! Masc ; Fem => Al ! d + "إِحدَى" ++ teen ! Fem }; n = NonTeen }; - - lin pot1to19 dig = { + + lin pot1to19 dig = { s = \\co,g,d,c => case dig.n of { Two => Al ! d + num2.s ! unit ! co ! g ! Const ! c ++ teen ! g ; - _ => dig.s ! unit ! co ! g ! (toDef d ThreeTen) ! Acc ++ - teen ! (genPolarity ! g) + _ => dig.s ! unit ! co ! g ! (toDef d ThreeTen) ! Acc ++ + teen ! (genPolarity ! g) }; n = case dig.n of { Two => NonTeen; _ => Teen } }; - - lin pot0as1 num = { + + lin pot0as1 num = { s= num.s ! unit; n = num.n } ; - - lin pot1 dig = { + + lin pot1 dig = { s = dig.s ! ten; n = NonTeen } ; - + lin pot1plus dig n = { - s = \\co,g,d,c => n.s ! unit ! co ! g ! d ! c + s = \\co,g,d,c => n.s ! unit ! co ! g ! d ! c ++ "وَ" ++ dig.s ! ten ! co ! g ! d ! c ; n = NonTeen }; @@ -86,34 +86,34 @@ lincat }; n = Hundreds }; - + lin pot2plus m e = { s = \\co,g,d,c => case m.n of { One => num100 ! d ! c; Two => num200 ! d ! c; _ => m.s ! unit ! co ! Masc ! (toDef d ThreeTen) ! c ++ "مِٱَةٌ" } ++ "وَ" ++ e.s ! co ! g ! d ! c ; - n = e.n + n = e.n }; lin pot2as3 n = n ; - + lin pot3 m = { s = \\co,_,d,c => case m.n of { One => num1000 ! (definite ! d) ! c; Two => num2000 ! (definite ! d) ! c; _ => m.s ! co ! Fem ! (toDef d ThreeTen) ! c ++ "آلافٌ" } ; - n = m.n + n = m.n }; --lin pot3plus n m = { -- s = \\c => n.s ! NCard ++ "تهُْسَند" ++ m.s ! c ; n = Pl} ; -- numerals as sequences of digits - lincat - Dig = Digits ; --- Numeral,Digits = {s : Gender => State => Case => Str ; + lincat + Dig = Digits ; +-- Numeral,Digits = {s : Gender => State => Case => Str ; -- n : Size } ; diff --git a/src/arabic/OrthoAra.gf b/src/arabic/OrthoAra.gf index 62ebc9b58..89cf4513a 100644 --- a/src/arabic/OrthoAra.gf +++ b/src/arabic/OrthoAra.gf @@ -3,7 +3,7 @@ resource OrthoAra = open Prelude, Predef in { flags coding=utf8 ; oper - + rectifyHmz: Str -> Str = \word -> case word of { l@(""|"ال") + "؟" + v@("َ"|"ُ") + tail => l + "أ" + v + tail; @@ -12,14 +12,14 @@ flags coding=utf8 ; head + "؟" + tail => head + (bHmz (dp 2 head) (take 2 tail)) + tail; --last head , take 1 tail _ => word }; - + --hamza at beginning of word (head) hHmz : Str -> Str = \d -> case d of { "ِ" => "إ"; _ => "أ" }; - + --hamza in middle of word (body) bHmz : Str -> Str -> Str = \d1,d2 -> case of { @@ -28,7 +28,7 @@ flags coding=utf8 ; <"َ",_> | <_,"َ"> => "أ"; _ => "ء" }; - + --hamza carrier sequence tHmz : Str -> Str = \d -> case d of { @@ -37,5 +37,5 @@ flags coding=utf8 ; "َ" => "أ"; "ْ"|"ا"|"و"|"ي" => "ء" }; - + } diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index e900e64b7..3ef6236ea 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -4,12 +4,12 @@ -- -- Ali El Dada 2005--2006 -- --- This is an API to the user of the resource grammar +-- This is an API to the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. --- +-- -- Closed categories (determiners, pronouns, conjunctions) are --- accessed through the resource syntax API, $Structural.gf$. +-- accessed through the resource syntax API, $Structural.gf$. -- -- The main difference with $MorphoAra.gf$ is that the types -- referred to are compiled resource grammar types. We have moreover @@ -20,12 +20,12 @@ -- first we give a handful of patterns that aim to cover all -- regular cases. Then we give a worst-case function $mkC$, which serves as an -- escape to construct the most irregular words of type $C$. --- +-- -- The following modules are presupposed: -resource ParadigmsAra = open - Predef, - Prelude, +resource ParadigmsAra = open + Predef, + Prelude, MorphoAra, OrthoAra,(ResAra=ResAra), CatAra @@ -34,7 +34,7 @@ resource ParadigmsAra = open flags optimize = noexpand; coding=utf8 ; oper - + -- Prepositions are used in many-argument functions for rection. Preposition : Type ; @@ -49,11 +49,13 @@ resource ParadigmsAra = open mkN : Species -> N -> N = \p,n -> n ** {h = p} ; mkN : (sg,pl : Str) -> Gender -> Species -> N - = \sg,pl -> mkFullN (reg sg pl) ; + = \sg,pl -> mkFullN (reg sg pl) ; mkN : NTable -> Gender -> Species -> N -- loan words, irregular = mkFullN ; mkN : (root,sgPatt,brokenPlPatt : Str) -> Gender -> Species -> N -- broken plural - = brkN ; + = brkN ; + mkN : N -> (attr : Str) -> N -- Compound nouns + = \n,attr -> n ** { s = \\num,s,c => n.s ! num ! s ! c ++ attr } ; --- IL (TODO: all kinds of compounds) --- mkN : (root,sgPatt : Str) -> Gender -> Species -> N -- sound feminine plural --- = sdfN ; } ; @@ -61,18 +63,18 @@ resource ParadigmsAra = open --This is used for loan words or anything that has untreated irregularities --in the interdigitization process of its words mkFullN : NTable -> Gender -> Species -> N ; - ---Takes a root string, a singular pattern string, a broken plural + +--Takes a root string, a singular pattern string, a broken plural --pattern string, a gender, and species. Gives a noun. brkN : Str -> Str -> Str -> Gender -> Species -> N ; - ---Takes a root string, a singular pattern string, a gender, + +--Takes a root string, a singular pattern string, a gender, --and species. Gives a noun whose plural is sound feminine. sdfN : Str -> Str -> Gender -> Species -> N ; - ---takes a root string, a singular pattern string, a gender, + +--takes a root string, a singular pattern string, a gender, --and species. Gives a noun whose plural is sound masculine - sdmN : Str -> Str -> Gender -> Species -> N ; + sdmN : Str -> Str -> Gender -> Species -> N ; --3 Proper names @@ -88,7 +90,7 @@ resource ParadigmsAra = open ---3 Relational nouns +--3 Relational nouns mkN2 : N -> Preposition -> N2 ; @@ -111,7 +113,7 @@ resource ParadigmsAra = open --Takes a root string and a pattern string sndA : (root,patt : Str) -> A ; - + --Takes a root string only clrA : (root : Str) -> A ; -- forms adjectives of type aFCal @@ -140,7 +142,7 @@ resource ParadigmsAra = open mkPrep : Str -> Prep = \s -> lin Prep {s = mkPreposition s} ; -- preposition in the sense of RGL abstract syntax - + mkPreposition : Str -> Preposition ; -- just a string, for internal use @@ -164,29 +166,29 @@ resource ParadigmsAra = open --Verb Form I : fa`ala, fa`ila, fa`ula v1 : Str -> Vowel -> Vowel -> V ; - + --Verb Form II : fa``ala - + v2 : Str -> V ; - + --Verb Form III : faa`ala - + v3 : Str -> V ; - + --Verb Form IV : 'af`ala - + v4 : Str -> V ; - ---Verb Form V : tafa``ala - + +--Verb Form V : tafa``ala + v5 : Str -> V ; ---Verb Form VI : tafaa`ala - +--Verb Form VI : tafaa`ala + v6 : Str -> V ; - + --Verb Form VIII 'ifta`ala - + v8 : Str -> V ; --3 Two-place verbs @@ -236,7 +238,7 @@ resource ParadigmsAra = open -- Notice: categories $AS, A2S, AV, A2V$ are just $A$, -- and the second argument is given --- as an adverb. Likewise +-- as an adverb. Likewise -- $V0$ is just $V$. V0 : Type ; @@ -250,7 +252,7 @@ resource ParadigmsAra = open -- hidden from the document. regV : Str -> V = \wo -> - let rau : Str * Vowel * Vowel = + let rau : Str * Vowel * Vowel = case wo of { "يَ" + fc + "ُ" + l => ; "يَ" + fc + "ِ" + l => ; @@ -260,43 +262,43 @@ resource ParadigmsAra = open } in v1 rau.p1 rau.p2 rau.p3 ; - v1 = \rootStr,vPerf,vImpf -> + v1 = \rootStr,vPerf,vImpf -> let { raw = v1' rootStr vPerf vImpf } in - { s = \\vf => + { s = \\vf => case rootStr of { _ + "؟" + _ => rectifyHmz(raw.s ! vf); - _ => raw.s ! vf + _ => raw.s ! vf }; lock_V = <> } ; - + va : Vowel = ResAra.a ; - v1' : Str -> Vowel -> Vowel -> Verb = + v1' : Str -> Vowel -> Vowel -> Verb = \rootStr,vPerf,vImpf -> let { root = mkRoot3 rootStr ; l = dp 2 rootStr } in --last rootStr case of { <"ّ",_> => v1geminate rootStr vPerf vImpf ; - <"و"|"ي",_> => v1defective root vImpf ; + <"و"|"ي",_> => v1defective root vPerf vImpf ; <_,"و"|"ي"> => v1hollow root vImpf ; - _ => v1sound root vPerf vImpf + _ => v1sound root vPerf vImpf }; - - v2 = + + v2 = \rootStr -> let { - root = mkRoot3 rootStr + root = mkRoot3 rootStr } in { - s = + s = case root.l of { "و"|"ي" => (v2defective root).s; _ => (v2sound root).s }; lock_V = <> - }; - - v3 = + }; + + v3 = \rootStr -> let { tbc = mkRoot3 rootStr ; @@ -304,21 +306,21 @@ resource ParadigmsAra = open s = (v3sound tbc).s ; lock_V = <> }; - - v4 = + + v4 = \rootStr -> let { - root = mkRoot3 rootStr + root = mkRoot3 rootStr } in { - s = + s = case root.l of { "و"|"ي" => (v4defective root).s; _ => (v4sound root).s - }; + }; lock_V = <> }; - - + + v5 = \rootStr -> let { raw = v5' rootStr } in @@ -329,16 +331,16 @@ resource ParadigmsAra = open }; lock_V = <> }; - - v5' : Str -> V = + + v5' : Str -> V = \rootStr -> let { nfs = mkRoot3 rootStr ; } in { s = (v5sound nfs).s ; lock_V = <> }; - - v6 = + + v6 = \rootStr -> let { fqm = mkRoot3 rootStr ; @@ -346,31 +348,31 @@ resource ParadigmsAra = open s = (v6sound fqm).s ; lock_V = <> }; - - v8 = + + v8 = \rootStr -> let { rbT = mkRoot3 rootStr ; - } in { - s = (v8sound rbT).s ; - lock_V = <> - }; - + v8fun = case rbT.f of { + ("و"|"ي"|"ّ") => v8assimilated ; + _ => v8sound } + } in lin V (v8fun rbT) ; + Preposition = Str ; - + mkFullN nsc gen spec = { s = nsc; --NTable - g = gen; + g = gen; h = spec; lock_N = <> }; - + brkN' : Str -> Str -> Str -> Gender -> Species -> N = \root,sg,pl,gen,spec -> let { kitAb = mkWord sg root; kutub = mkWord pl root } in mkFullN (reg kitAb kutub) gen spec; - + brkN root sg pl gen spec = let { raw = brkN' root sg pl gen spec} in { s = \\n,d,c => @@ -381,31 +383,31 @@ resource ParadigmsAra = open g = gen; h = spec ; lock_N = <> }; - + sdfN = \root,sg,gen,spec -> let { kalima = mkWord sg root; } in mkFullN (sndf kalima) gen spec; - + sdmN = \root,sg,gen,spec -> let { mucallim = mkWord sg root; } in mkFullN (sndm mucallim) gen spec; - mkFullPN = \str,gen,species -> + mkFullPN = \str,gen,species -> { s = \\c => str + indecl!c ; g = gen; h = species; lock_PN = <> }; - - + + mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; - + mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; - + mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn -> - { s = + { s = table { Nom => ana; Acc => nI; @@ -428,7 +430,7 @@ resource ParadigmsAra = open a = {pgn = Per3 Masc n; isPron = False }; lock_NP = <> }; - + mkQuant7 : (_,_,_,_,_,_,_ : Str) -> State -> Quant = \hava,havihi,havAn,havayn,hAtAn,hAtayn,hA'ulA,det -> { s = \\n,s,g,c => @@ -447,7 +449,7 @@ resource ParadigmsAra = open isNum = False; lock_Quant = <> }; - + mkQuant3 : (_,_,_ : Str) -> State -> Quant = \dalika,tilka,ula'ika,det -> { s = \\n,s,g,c => @@ -465,9 +467,9 @@ resource ParadigmsAra = open degrA : (posit,compar,plur : Str) -> A = \posit,compar,plur -> lin A {s = clr posit compar plur} ; - + sndA root pat = - let raw = sndA' root pat in { + let raw = sndA' root pat in { s = \\af => case root of { _ + "؟" + _ => rectifyHmz(raw.s ! af); @@ -475,7 +477,7 @@ resource ParadigmsAra = open }; lock_A = <> }; - + sndA' : Str -> Str -> A = \root,pat -> let { kabIr = mkWord pat root; @@ -487,7 +489,7 @@ resource ParadigmsAra = open }; lock_A = <> }; - + clrA root = let { eaHmar = mkWord "أَفعَل" root; HamrA' = mkWord "فَعلاء" root; @@ -496,20 +498,20 @@ resource ParadigmsAra = open s = clr eaHmar HamrA' Humr; lock_A = <> }; - + mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; - + mkAdv x = ss x ** {lock_Adv = <>} ; mkAdV x = ss x ** {lock_AdV = <>} ; mkAdA x = ss x ** {lock_AdA = <>} ; - + mkPreposition p = p ; prepV2 : V -> Preposition -> V2 = \v,p -> v ** {s = v.s ; c2 = p ; lock_V2 = <>} ; strV2 : Str -> V2 = \str -> dirV2 (mkV str) ; dirV2 v = prepV2 v [] ; - + mkV3 v p q = v ** {s = v.s ; c2 = p ; c3 = q ; lock_V3 = <>} ; dirV3 v p = mkV3 v [] p ; dirdirV3 v = dirV3 v [] ; @@ -560,6 +562,6 @@ formV : (root : Str) -> VerbForm -> V = \s,f -> case f of { } ; param VerbForm = - FormI | FormIII | FormIII | FormIV | FormV | FormVI | FormVIII ; + FormI | FormII | FormIII | FormIV | FormV | FormVI | FormVIII ; } ; diff --git a/src/arabic/PatternsAra.gf b/src/arabic/PatternsAra.gf index 611fd262a..4d3388a4d 100644 --- a/src/arabic/PatternsAra.gf +++ b/src/arabic/PatternsAra.gf @@ -3,104 +3,107 @@ resource PatternsAra = { flags coding=utf8 ; oper - - fA' = { h = "" ; m1 = ""; m2 = ""; t = "َاء"} ; - eafAcI = { h = "أَ"; m1 = "َا"; m2 = ""; t = "ِي" } ; - eafcA' = { h = "أَ"; m1 = "ْ" ; m2 = ""; t = "َاء"} ; - eafcI = { h = "أَ"; m1 = "ْ" ; m2 = ""; t = "ِي" } ; - fac = { h = "" ; m1 = "َ" ; m2 = ""; t = "" } ; - facc = { h = "" ; m1 = "َ" ; m2 = ""; t = "ّ" } ; - facca = { h = "" ; m1 = "َ" ; m2 = ""; t = "َّ" } ; - facci = { h = "" ; m1 = "َ" ; m2 = ""; t = "ِّ" } ; - faccu = { h = "" ; m1 = "َ" ; m2 = ""; t = "ُّ" } ; - facp = { h = "" ; m1 = "َ" ; m2 = ""; t = "َة" } ; - faca = { h = "" ; m1 = "َ" ; m2 = ""; t = "َ" } ; - facA = { h = "" ; m1 = "َ" ; m2 = ""; t = "َا" } ; - facA' = { h = "" ; m1 = "َ" ; m2 = ""; t = "َاء"} ; - fAc = { h = "" ; m1 = "َا"; m2 = ""; t = "" } ; - fAcp = { h = "" ; m1 = "َا"; m2 = ""; t = "َة" } ; - fic = { h = "" ; m1 = "ِ" ; m2 = ""; t = "" } ; - ficc = { h = "" ; m1 = "ِ" ; m2 = ""; t = "ّ" } ; - ficA' = { h = "" ; m1 = "ِ" ; m2 = ""; t = "َاء"} ; - fIc = { h = "" ; m1 = "ِي"; m2 = ""; t = "" } ; - fIcAn = { h = "" ; m1 = "ِي"; m2 = ""; t = "َان"} ; - fca = { h = "" ; m1 = "ْ" ; m2 = ""; t = "َ" } ; - fci = { h = "" ; m1 = "ْ" ; m2 = ""; t = "ِ" } ; - fcu = { h = "" ; m1 = "ْ" ; m2 = ""; t = "ُ" } ; - fuc = { h = "" ; m1 = "ُ" ; m2 = ""; t = "" } ; - fucc = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ّ" } ; - fucci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِّ" } ; - fuccu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُّ" } ; - fuci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِ" } ; - fucu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُ" } ; - fUc = { h = "" ; m1 = "ُو"; m2 = ""; t = "" } ; - ufAc = { h = "ُ" ; m1 = "َا"; m2 = ""; t = "" } ; - ufca = { h = "ُ" ; m1 = "ْ" ; m2 = ""; t = "َ" } ; + fA' = { h = "" ; m1 = ""; m2 = ""; t = "َاء"} ; - eafAcil = { h = "أَ"; m1 = "َا" ; m2 = "ِ" ; t = "" } ; - eafAcIl = { h = "أَ"; m1 = "َا" ; m2 = "ِي" ; t = "" } ; - eafcilp = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "َة" } ; - eafcal = { h = "أَ"; m1 = "ْ" ; m2 = "َ" ; t = "" } ; - eafcAl = { h = "أَ"; m1 = "ْ" ; m2 = "َا" ; t = "" } ; - eafcil = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; - eafcul = { h = "أَ"; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; - eiftacal = { h = "إِ"; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ; - eufcil = { h = "أُ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; - euftucil = { h = "أُ"; m1 = "ْتُ" ; m2 = "ِ" ; t = "" } ; - afcul = { h = "َ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; - faccalo = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "ْ" } ; - facal = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "" } ; - facalo = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "ْ" } ; - facalp = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "َة" } ; - facA'il = { h = "" ; m1 = "َ" ; m2 = "َائِ"; t = "" } ; - facAl = { h = "" ; m1 = "َ" ; m2 = "َا" ; t = "" } ; - facAlI = { h = "" ; m1 = "َ" ; m2 = "َا" ; t = "ِي" } ; - facil = { h = "" ; m1 = "َ" ; m2 = "ِ" ; t = "" } ; - facIl = { h = "" ; m1 = "َ" ; m2 = "ِي" ; t = "" } ; - facl = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "" } ; - faclp = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "َة" } ; - facul = { h = "" ; m1 = "َ" ; m2 = "ُ" ; t = "" } ; - fAcal = { h = "" ; m1 = "َا" ; m2 = "َ" ; t = "" } ; - fAcil = { h = "" ; m1 = "َا" ; m2 = "ِ" ; t = "" } ; - faccal = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "" } ; - faccil = { h = "" ; m1 = "َ" ; m2 = "ِّ" ; t = "" } ; - faclA' = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "َاء"} ; - fAcilp = { h = "" ; m1 = "َا" ; m2 = "ِ" ; t = "َة" } ; - fawAcil = { h = "" ; m1 = "َوَا"; m2 = "ِ" ; t = "" } ; - ficAlp = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "َة" } ; - fcal = { h = "" ; m1 = "ْ" ; m2 = "َ" ; t = "" } ; - fcil = { h = "" ; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; - fcul = { h = "" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; - ficl = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "" } ; - ficAl = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "" } ; - ficlp = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "َة" } ; - ftacal = { h = "" ; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ; - ftacil = { h = "" ; m1 = "ْتَ" ; m2 = "ِ" ; t = "" } ; - fuccAl = { h = "" ; m1 = "ُ" ; m2 = "َّا" ; t = "" } ; - fuccil = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ; - fuccilo = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "ْ" } ; - fucal = { h = "" ; m1 = "ُ" ; m2 = "َ" ; t = "" } ; - fucaylp = { h = "" ; m1 = "ُ" ; m2 = "َيْ" ; t = "َة" } ; - fucAl = { h = "" ; m1 = "ُ" ; m2 = "َا" ; t = "" } ; - fucl = { h = "" ; m1 = "ُ" ; m2 = "ْ" ; t = "" } ; - fucil = { h = "" ; m1 = "ُ" ; m2 = "ِ" ; t = "" } ; - fuclp = { h = "" ; m1 = "ُ" ; m2 = "ْ" ; t = "َة" } ; - fucilo = { h = "" ; m1 = "ُ" ; m2 = "ِ" ; t = "ْ" } ; - fucul = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "" } ; - fuculo = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "ْ" } ; - fucUl = { h = "" ; m1 = "ُ" ; m2 = "ُو" ; t = "" } ; - fUcil = { h = "" ; m1 = "ُو" ; m2 = "ِ" ; t = "" } ; + eafAcI = { h = "أَ"; m1 = "َا"; m2 = ""; t = "ِي" } ; + eafcA' = { h = "أَ"; m1 = "ْ" ; m2 = ""; t = "َاء"} ; + eafcI = { h = "أَ"; m1 = "ْ" ; m2 = ""; t = "ِي" } ; + fac = { h = "" ; m1 = "َ" ; m2 = ""; t = "" } ; + facc = { h = "" ; m1 = "َ" ; m2 = ""; t = "ّ" } ; + facca = { h = "" ; m1 = "َ" ; m2 = ""; t = "َّ" } ; + facci = { h = "" ; m1 = "َ" ; m2 = ""; t = "ِّ" } ; + faccu = { h = "" ; m1 = "َ" ; m2 = ""; t = "ُّ" } ; + facp = { h = "" ; m1 = "َ" ; m2 = ""; t = "َة" } ; + faca = { h = "" ; m1 = "َ" ; m2 = ""; t = "َ" } ; + facA = { h = "" ; m1 = "َ" ; m2 = ""; t = "َا" } ; + facA' = { h = "" ; m1 = "َ" ; m2 = ""; t = "َاء"} ; + fAc = { h = "" ; m1 = "َا"; m2 = ""; t = "" } ; + fAcp = { h = "" ; m1 = "َا"; m2 = ""; t = "َة" } ; + fic = { h = "" ; m1 = "ِ" ; m2 = ""; t = "" } ; + ficc = { h = "" ; m1 = "ِ" ; m2 = ""; t = "ّ" } ; + ficA' = { h = "" ; m1 = "ِ" ; m2 = ""; t = "َاء"} ; + fIc = { h = "" ; m1 = "ِي"; m2 = ""; t = "" } ; + fIcAn = { h = "" ; m1 = "ِي"; m2 = ""; t = "َان"} ; + fca = { h = "" ; m1 = "ْ" ; m2 = ""; t = "َ" } ; + fci = { h = "" ; m1 = "ْ" ; m2 = ""; t = "ِ" } ; + fcu = { h = "" ; m1 = "ْ" ; m2 = ""; t = "ُ" } ; + fuc = { h = "" ; m1 = "ُ" ; m2 = ""; t = "" } ; + fucc = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ّ" } ; + fucci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِّ" } ; + fuccu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُّ" } ; + fuci = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ِ" } ; + fucu = { h = "" ; m1 = "ُ" ; m2 = ""; t = "ُ" } ; + fUc = { h = "" ; m1 = "ُو"; m2 = ""; t = "" } ; + ufAc = { h = "ُ" ; m1 = "َا"; m2 = ""; t = "" } ; + ufca = { h = "ُ" ; m1 = "ْ" ; m2 = ""; t = "َ" } ; + + eafAcil = { h = "أَ"; m1 = "َا" ; m2 = "ِ" ; t = "" } ; + eafAcIl = { h = "أَ"; m1 = "َا" ; m2 = "ِي" ; t = "" } ; + eafcilp = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "َة" } ; + eafcal = { h = "أَ"; m1 = "ْ" ; m2 = "َ" ; t = "" } ; + eafcAl = { h = "أَ"; m1 = "ْ" ; m2 = "َا" ; t = "" } ; + eafcil = { h = "أَ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; + eafcul = { h = "أَ"; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; + eiftacal = { h = "إِ"; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ; + eufcil = { h = "أُ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; + euftucil = { h = "أُ"; m1 = "ْتُ" ; m2 = "ِ" ; t = "" } ; + euttucil = euftucil ** { h = "تُّأُ" ; m1 = "" } ; ---- IL assimilated VIII + afcul = { h = "َ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; + faccalo = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "ْ" } ; + facal = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "" } ; + facalo = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "ْ" } ; + facalp = { h = "" ; m1 = "َ" ; m2 = "َ" ; t = "َة" } ; + facA'il = { h = "" ; m1 = "َ" ; m2 = "َائِ"; t = "" } ; + facAl = { h = "" ; m1 = "َ" ; m2 = "َا" ; t = "" } ; + facAlI = { h = "" ; m1 = "َ" ; m2 = "َا" ; t = "ِي" } ; + facil = { h = "" ; m1 = "َ" ; m2 = "ِ" ; t = "" } ; + facIl = { h = "" ; m1 = "َ" ; m2 = "ِي" ; t = "" } ; + facl = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "" } ; + faclp = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "َة" } ; + facul = { h = "" ; m1 = "َ" ; m2 = "ُ" ; t = "" } ; + fAcal = { h = "" ; m1 = "َا" ; m2 = "َ" ; t = "" } ; + fAcil = { h = "" ; m1 = "َا" ; m2 = "ِ" ; t = "" } ; + faccal = { h = "" ; m1 = "َ" ; m2 = "َّ" ; t = "" } ; + faccil = { h = "" ; m1 = "َ" ; m2 = "ِّ" ; t = "" } ; + faclA' = { h = "" ; m1 = "َ" ; m2 = "ْ" ; t = "َاء"} ; + fAcilp = { h = "" ; m1 = "َا" ; m2 = "ِ" ; t = "َة" } ; + fawAcil = { h = "" ; m1 = "َوَا"; m2 = "ِ" ; t = "" } ; + ficAlp = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "َة" } ; + fcal = { h = "" ; m1 = "ْ" ; m2 = "َ" ; t = "" } ; + fcil = { h = "" ; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; + fcul = { h = "" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; + ficl = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "" } ; + ficAl = { h = "" ; m1 = "ِ" ; m2 = "َا" ; t = "" } ; + ficlp = { h = "" ; m1 = "ِ" ; m2 = "ْ" ; t = "َة" } ; + ftacal = { h = "" ; m1 = "ْتَ" ; m2 = "َ" ; t = "" } ; + ftacil = { h = "" ; m1 = "ْتَ" ; m2 = "ِ" ; t = "" } ; + ttacal = ftacal ** { m1 = "" ; h = "تَّ" } ; ---- IL assimilated VIII + ttacil = ftacil ** { m1 = "" ; h = "تَّ" } ; ---- IL assimilated VIII + fuccAl = { h = "" ; m1 = "ُ" ; m2 = "َّا" ; t = "" } ; + fuccil = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ; + fuccilo = { h = "" ; m1 = "ُ" ; m2 = "ِّ" ; t = "ْ" } ; + fucal = { h = "" ; m1 = "ُ" ; m2 = "َ" ; t = "" } ; + fucaylp = { h = "" ; m1 = "ُ" ; m2 = "َيْ" ; t = "َة" } ; + fucAl = { h = "" ; m1 = "ُ" ; m2 = "َا" ; t = "" } ; + fucl = { h = "" ; m1 = "ُ" ; m2 = "ْ" ; t = "" } ; + fucil = { h = "" ; m1 = "ُ" ; m2 = "ِ" ; t = "" } ; + fuclp = { h = "" ; m1 = "ُ" ; m2 = "ْ" ; t = "َة" } ; + fucilo = { h = "" ; m1 = "ُ" ; m2 = "ِ" ; t = "ْ" } ; + fucul = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "" } ; + fuculo = { h = "" ; m1 = "ُ" ; m2 = "ُ" ; t = "ْ" } ; + fucUl = { h = "" ; m1 = "ُ" ; m2 = "ُو" ; t = "" } ; + fUcil = { h = "" ; m1 = "ُو" ; m2 = "ِ" ; t = "" } ; mafcUl = { h = "مَ"; m1 = "ْ" ; m2 = "ُو" ; t = "" } ; mafcil = { h = "مَ"; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; - tafAcal = { h = "تَ"; m1 = "َا" ; m2 = "َ" ; t = "" } ; - tafaccal = { h = "تَ"; m1 = "َ" ; m2 = "َّ" ; t = "" } ; - tufuccil = { h = "تُ"; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ; - tufUcil = { h = "تُ"; m1 = "ُو" ; m2 = "ِ" ; t = "" } ; - ufAcal = { h = "ُ" ; m1 = "َا" ; m2 = "َ" ; t = "" } ; - ufAcil = { h = "ُ" ; m1 = "َا" ; m2 = "ِ" ; t = "" } ; - ufcal = { h = "ُ" ; m1 = "ْ" ; m2 = "َ" ; t = "" } ; - ufcil = { h = "ُ" ; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; - ufcul = { h = "ُ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; + tafAcal = { h = "تَ"; m1 = "َا" ; m2 = "َ" ; t = "" } ; + tafaccal = { h = "تَ"; m1 = "َ" ; m2 = "َّ" ; t = "" } ; + tufuccil = { h = "تُ"; m1 = "ُ" ; m2 = "ِّ" ; t = "" } ; + tufUcil = { h = "تُ"; m1 = "ُو" ; m2 = "ِ" ; t = "" } ; + ufAcal = { h = "ُ" ; m1 = "َا" ; m2 = "َ" ; t = "" } ; + ufAcil = { h = "ُ" ; m1 = "َا" ; m2 = "ِ" ; t = "" } ; + ufcal = { h = "ُ" ; m1 = "ْ" ; m2 = "َ" ; t = "" } ; + ufcil = { h = "ُ" ; m1 = "ْ" ; m2 = "ِ" ; t = "" } ; + ufcul = { h = "ُ" ; m1 = "ْ" ; m2 = "ُ" ; t = "" } ; } diff --git a/src/arabic/PhraseAra.gf b/src/arabic/PhraseAra.gf index 11f994742..0bc3931cb 100644 --- a/src/arabic/PhraseAra.gf +++ b/src/arabic/PhraseAra.gf @@ -1,6 +1,6 @@ -concrete PhraseAra of Phrase = CatAra ** open - ParamX, - Prelude, +concrete PhraseAra of Phrase = CatAra ** open + ParamX, + Prelude, ResAra in { flags coding=utf8; diff --git a/src/arabic/QuestionAra.gf b/src/arabic/QuestionAra.gf index 30d528391..38b2296c2 100644 --- a/src/arabic/QuestionAra.gf +++ b/src/arabic/QuestionAra.gf @@ -5,18 +5,18 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA lin QuestCl cl = { - s = \\t,p => + s = \\t,p => table { QIndir => "إِذا" ++ cl.s ! t ! p ! Verbal ; - QDir => "هَل" ++ cl.s ! t ! p ! Verbal + QDir => "هَل" ++ cl.s ! t ! p ! Verbal } }; -- ComplSlashIP vps ip = {} ; -- AR copied from PredVP - QuestVP qp vp = - { s =\\t,p,_ => + QuestVP qp vp = + { s =\\t,p,_ => let { ---- o = Verbal ; ---- AR objgn = pgn2gn vp.obj.a.pgn ; @@ -28,38 +28,38 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbA yaktubu = vp.s ! pgn ! VPImpf Ind ; yaktuba = vp.s ! pgn ! VPImpf Cnj ; yaktub = vp.s ! pgn ! VPImpf Jus ; - vStr : ResAra.Tense -> Polarity -> Str = + vStr : ResAra.Tense -> Polarity -> Str = \tn,pl -> case of { => yaktubu ; => "لَا" ++ yaktubu ; - => "" ; --no verb "to be" in present + => "" ; --no verb "to be" in present => "لَيسَ" ;--same here, just add negation particle <_, ResAra.Past, Pos> => kataba ; <_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ; - <_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ; - <_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba + <_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ; + <_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba }; - pred : ResAra.Tense -> Polarity -> Str = + pred : ResAra.Tense -> Polarity -> Str = \tn,pl -> case of { => vp.pred.s ! gn ! Nom; --xabar marfooc _ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob } ; - + } in ---- case o of { ----- _ => +--- case o of { +---- _ => case of { ---- AR workaround 18/12/2008 case of { -- ya2kuluhu => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p); - -- ya2kuluhu al-waladu, yakuluhu al-2awlaadu + -- ya2kuluhu al-waladu, yakuluhu al-2awlaadu => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p); => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p); => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p) }; ---- Nominal => ---- np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p) - } + } ; ---- }; diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index eafea20ae..353106a79 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -12,8 +12,8 @@ resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { flags optimize=noexpand ; coding=utf8 ; - param - + param + Vowel = u | a | i ; Number = Sg | Dl | Pl; Gender = Masc | Fem ; @@ -26,10 +26,10 @@ resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { Tense = Pres | Past | Fut ; Order = Verbal | Nominal ; - oper - + oper + --roots, patterns, and making words: - + Pattern : Type = {h, m1, m2, t : Str}; Root : Type = {f : Str}; Root2 : Type = Root ** {c : Str} ; @@ -51,21 +51,21 @@ resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { } }; -} - - --for roots with 2 consonants (works also for assimilated strs, like fc~, + + --for roots with 2 consonants (works also for assimilated strs, like fc~, --because the function discards anything after the first two characters mkRoot2 : Str -> Root2 = \fcl -> let { cl = drop 2 fcl} in --drop 1 fcl {f = take 2 fcl; c = take 2 cl}; --take 1 - + --opers to interdigitize (make words out of roots and patterns: oper --regular case, 3 non-weak consonants mkStrong : Pattern -> Root3 -> Str = \p,fcl -> p.h + fcl.f + p.m1 + fcl.c + p.m2 + fcl.l + p.t; - - mkDefective: Pattern -> Root3 -> Str = \p,fcl -> + + mkDefective: Pattern -> Root3 -> Str = \p,fcl -> p.h + fcl.f + p.m1 + fcl.c + p.t; mkHollow: Pattern -> Root3 -> Str = \p,fcl -> @@ -76,12 +76,11 @@ resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { -- takes a weak pattern and a triliteral root and makes -- a word, deducing which root consonant is weak - mkWeak : Pattern -> Str -> Str = \pat,root -> - let fcl = mkRoot3 root in - case root of { - _ + ("و"|"ي"|"ّ") => mkDefective pat fcl; - _ + ("و"|"ي") + _ => mkHollow pat fcl; - ("و"|"ي") + _ => mkAssimilated pat fcl + mkWeak : Pattern -> Root3 -> Str = \pat,fcl -> + case of { + <_,_,("و"|"ي"|"ّ")> => mkDefective pat fcl; + <_,("و"|"ي"),_> => mkHollow pat fcl; + <("و"|"ي"),_,_> => mkAssimilated pat fcl }; mkBilit : Pattern -> Root2 -> Str = \p,fcl -> @@ -90,14 +89,14 @@ resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { --takes a pattern string and root string and makes a word mkWord : Str -> Str -> Str =\pS, rS -> case pS of { - w@_ + "ف" + x@_ + "ع" + y@_ + "ل" + z@_ => + w@_ + "ف" + x@_ + "ع" + y@_ + "ل" + z@_ => mkStrong { h = w ; m1 = x; m2 = y; t = z} (mkRoot3 rS); - w@_ + "ف" + x@_ + "ع" + y@_ => + w@_ + "ف" + x@_ + "ع" + y@_ => let pat = { h = w ; m1 = x; m2 = ""; t = y} in case of { - 6 | 5 => mkWeak pat rS ; --3=> + 6 | 5 => mkWeak pat (mkRoot3 rS) ; --3=> 4 | 3 => mkBilit pat (mkRoot2 rS) ; --2=> - _ => rS ---- AR error "expected 3--6" + _ => rS ---- AR error "expected 3--6" } }; @@ -121,33 +120,33 @@ resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { uttNum : NumOrdCard -> (Gender => Str) ; uttNum n = \\g => n.s ! g ! Def ! Nom ; ----IL - + param VForm = VPerf Voice PerGenNum | VImpf Mood Voice PerGenNum - | VImp Gender Number + | VImp Gender Number | VPPart ; - - PerGenNum = - Per3 Gender Number + + PerGenNum = + Per3 Gender Number | Per2 Gender Number | Per1 SgPl; - + SgPl = Sing | Plur; - - AForm = + + AForm = APosit Gender Number State Case | AComp State Case ; - + --verbal morphology - -oper - + +oper + --macro for sound verb --PerfAct, PerfPas, ImpfAct, ImpfPas, Imp, PPart - verb : (_,_,_,_,_,_ : Str) -> Verb = - \katab,kutib,aktub,uktab,euktub,maktUb -> { + verb : (_,_,_,_,_,_ : Str) -> Verb = + \katab,kutib,aktub,uktab,euktub,maktUb -> { s = table { VPerf Act pgn => katab + suffixPerf ! pgn ; VPerf Pas pgn => kutib + suffixPerf ! pgn ; @@ -157,63 +156,63 @@ oper VImpf m Pas pgn => prefixImpf !pgn + uktab + suffixImpfCJ m !pgn; VImp g n => euktub + suffixImpfCJ Jus ! (Per2 g n); VPPart => maktUb - } + } } ; - + --affixes of sound verbs - - suffixPerf : PerGenNum => Str = + + suffixPerf : PerGenNum => Str = table { - Per3 Masc Sg => "َ" ; - Per3 Masc Dl => "َا" ; - Per3 Masc Pl => "ُوا" ; - Per3 Fem Sg => "َتْ" ; - Per3 Fem Dl => "َتَا" ; - Per3 Fem Pl => "ْنَ" ; - Per2 Masc Sg => "ْتَ" ; + Per3 Masc Sg => "َ" ; + Per3 Masc Dl => "َا" ; + Per3 Masc Pl => "ُوا" ; + Per3 Fem Sg => "َتْ" ; + Per3 Fem Dl => "َتَا" ; + Per3 Fem Pl => "ْنَ" ; + Per2 Masc Sg => "ْتَ" ; Per2 _ Dl => "ْتُمَا" ; - Per2 Masc Pl => "ْتُمْ" ; - Per2 Fem Sg => "ْتِ" ; - Per2 Fem Pl => "ْتُنَّ" ; - Per1 Sing => "ْتُ" ; + Per2 Masc Pl => "ْتُمْ" ; + Per2 Fem Sg => "ْتِ" ; + Per2 Fem Pl => "ْتُنَّ" ; + Per1 Sing => "ْتُ" ; Per1 Plur => "ْنَا" } ; - prefixImpf : PerGenNum => Str = + prefixImpf : PerGenNum => Str = table { - Per1 Sing => "أ" ; + Per1 Sing => "أ" ; Per1 Plur => "ن" ; - Per3 Masc _ => "ي" ; - Per3 Fem Pl => "ي" ; + Per3 Masc _ => "ي" ; + Per3 Fem Pl => "ي" ; _ => "ت" } ; - - suffixImpfInd : PerGenNum => Str = + + suffixImpfInd : PerGenNum => Str = table { - Per3 Masc Pl => "ُونَ" ; - Per3 Fem Pl => "ْنَ" ; - Per3 g Dl => "َانِ" ; - Per2 Masc Pl => "ُونَ" ; - Per2 Fem Sg => "ِينَ" ; - Per2 g Dl => "َانِ" ; - Per2 Fem Pl => "ْنَ" ; + Per3 Masc Pl => "ُونَ" ; + Per3 Fem Pl => "ْنَ" ; + Per3 g Dl => "َانِ" ; + Per2 Masc Pl => "ُونَ" ; + Per2 Fem Sg => "ِينَ" ; + Per2 g Dl => "َانِ" ; + Per2 Fem Pl => "ْنَ" ; _ => "ُ" } ; - + suffixImpfCJ : Mood -> PerGenNum => Str = \m -> table { - Per3 Masc Pl => "ُوا" ; - Per3 Fem Pl => "ْنَ" ; - Per3 g Dl => "َا" ; - Per2 Masc Pl => "ُوا" ; - Per2 Fem Sg => "ِي" ; - Per2 g Dl => "َا" ; - Per2 Fem Pl => "ْنَ" ; + Per3 Masc Pl => "ُوا" ; + Per3 Fem Pl => "ْنَ" ; + Per3 g Dl => "َا" ; + Per2 Masc Pl => "ُوا" ; + Per2 Fem Sg => "ِي" ; + Per2 g Dl => "َا" ; + Per2 Fem Pl => "ْنَ" ; _ => endVowel ! m } ; - - --macro for geminate verbs: FIXME, change the misleading variable names - verbGeminate : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb = + + --macro for geminate verbs: FIXME, change the misleading variable names + verbGeminate : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb = \xAf,xif,xyf,xuf,axAf,axaf,uxAf,uxaf,xaf,xAf',ppart -> let { perfPattern = patHollowPerf xAf xif xyf xuf ; impfPattern = patHollowImpf axAf axaf uxAf uxaf ; @@ -227,107 +226,119 @@ oper VPPart => ppart } } ; - + --macro for hollow verbs: - verbHollow : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb = + verbHollow : (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb = \xAf,xif,xyf,xuf,axAf,axaf,uxAf,uxaf,xaf,xAf',ppart -> let { perfPattern = patHollowPerf xAf xif xyf xuf ; - impfPattern = patHollowImpf axAf axaf uxAf uxaf ; - impPattern = patHollowImp axaf xAf' ; + impfPattern = patHollowImpf axAf axaf uxAf uxaf ; + impPattern = patHollowImp axaf xAf' ; jusPattern = patHollowJus axaf axAf uxaf uxAf ; } in { s = table { VPerf v pgn => perfPattern ! v ! pgn + suffixPerf ! pgn ; - VImpf Ind v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfInd ! pgn ; - VImpf Cnj v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfCJ Cnj ! pgn ; - VImpf Jus v pgn => prefixImpf ! pgn + jusPattern ! v ! pgn + suffixImpfCJ Jus ! pgn ; - VImp g n => impPattern ! g ! n + suffixImpfCJ Jus ! (Per2 g n); + VImpf Ind v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfInd ! pgn ; + VImpf Cnj v pgn => prefixImpf ! pgn + impfPattern ! v ! pgn + suffixImpfCJ Cnj ! pgn ; + VImpf Jus v pgn => prefixImpf ! pgn + jusPattern ! v ! pgn + suffixImpfCJ Jus ! pgn ; + VImp g n => impPattern ! g ! n + suffixImpfCJ Jus ! (Per2 g n); VPPart => ppart } } ; - + --macro for defective verbs: - verbDef: (_,_,_,_,_,_,_,_,_,_,_ : Str) -> Vowel -> Verb = - \rama,ramay,rumi,rumu,rumiy,armi,armu,urma,Irmi,Irmu,ppart,vowel -> + verbDef : DefForms -> Vowel -> Verb = + \vforms,vImpf -> let { - patPerf = patDefPerf rama ramay rumi rumu rumiy ; - patImpfAct = patDefImpfAct armi armu ; - patImp = patDefImp Irmi Irmu + rama = vforms ! 0 ; -- VPerf Act (Per3 Masc Sg) + ramay = vforms ! 1 ; -- VPerf Act (Per3 Fem Pl) + rumi = vforms ! 2 ; -- VPerf Pas (Per3 _ Sg) + rumu = vforms ! 3 ; -- VPerf Pas (Per3 Masc Pl) + rumiy = vforms ! 4 ; -- VPerf Pas (Per3 Fem Pl) + armi = vforms ! 5 ; -- VImpf _ Act (Per1 _ _ | Per2/3 Fem _ | Per2/3 Masc Sg) + armu = vforms ! 6 ; -- VImpf _ Act (Per2/3 Masc Pl) + urma = vforms ! 7 ; -- VImpf _ Pas + Irmi = vforms ! 8 ; -- VImp Masc Sg | VImp Fem _ + Irmu = vforms ! 9 ; -- VImp Masc Pl + ppart = vforms ! 10 ; -- VPPart + + patPerf = patDefPerf rama ramay rumi rumu rumiy ; + patImpfAct = patDefImpfAct armi armu ; + patImp = patDefImp Irmi Irmu } in { s = table { VPerf v pgn => patPerf ! v ! pgn + (suffixPerfDef v) ! pgn ; - VImpf m Act pgn => prefixImpf ! pgn + patImpfAct ! pgn + (suffixImpfDef Act vowel) ! m ! pgn ; - VImpf m Pas pgn => prefixImpf ! pgn + urma + (suffixImpfDef Pas vowel) ! m ! pgn ; - VImp g n => patImp ! g ! n + (suffixImpfDef Act vowel) ! Jus ! (Per2 g n) ; + VImpf m Act pgn => prefixImpf ! pgn + patImpfAct ! pgn + (suffixImpfDef Act vImpf) ! m ! pgn ; + VImpf m Pas pgn => prefixImpf ! pgn + urma + (suffixImpfDef Pas vImpf) ! m ! pgn ; + VImp g n => patImp ! g ! n + (suffixImpfDef Act vImpf) ! Jus ! (Per2 g n) ; VPPart => ppart } } ; - + patDefPerf : (_,_,_,_,_ :Str) -> Voice => PerGenNum => Str = \rama,ramay,rumi,rumu,rumy -> table { - Act => + Act => table { Per3 Fem Pl => ramay ; - Per3 _ _ => rama ; - _ => ramay + Per3 _ _ => rama ; + _ => ramay } ; Pas => table { Per3 Masc Pl => rumu ; - Per3 Fem Pl => rumy ; - Per3 _ _ => rumi ; - _ => rumy + Per3 Fem Pl => rumy ; + Per3 _ _ => rumi ; + _ => rumy } } ; - + --ignores the vowel=u case, eg "دعو" patDefImpfAct : (_,_ : Str) -> PerGenNum => Str = \rmi,rmu -> table { Per3 Masc Pl => rmu ; - Per2 Masc Pl => rmu ; - _ => rmi + Per2 Masc Pl => rmu ; + _ => rmi } ; - - + + patDefImp : (_,_ : Str) -> Gender => Number => Str = \rmi, rmu -> table { Masc => table {Pl => rmu ; _ => rmi} ; - _ => table {_ => rmi} + _ => table {_ => rmi} } ; - + suffixPerfDef : Voice -> PerGenNum => Str = \v -> - let {p3ms = + let {p3ms = case v of { Act => "ى" ; Pas => "يَ" } ; - ya = + ya = case v of { Act => "" ; Pas => "يَ" } } in table { - Per3 Masc Sg => p3ms ; - Per3 Masc Dl => "يَا" ; - Per3 Masc Pl => "وْا" ; - Per3 Fem Sg => ya + "تْ" ; - Per3 Fem Dl => ya + "تَا" ; - Per3 Fem Pl => "نَ" ; - Per2 Masc Sg => "تَ" ; + Per3 Masc Sg => p3ms ; + Per3 Masc Dl => "يَا" ; + Per3 Masc Pl => "وْا" ; + Per3 Fem Sg => ya + "تْ" ; + Per3 Fem Dl => ya + "تَا" ; + Per3 Fem Pl => "نَ" ; + Per2 Masc Sg => "تَ" ; Per2 _ Dl => "تُمَا" ; - Per2 Masc Pl => "تُمْ" ; - Per2 Fem Sg => "تِ" ; - Per2 Fem Pl => "تُنَّ" ; - Per1 Sing => "تُ" ; + Per2 Masc Pl => "تُمْ" ; + Per2 Fem Sg => "تِ" ; + Per2 Fem Pl => "تُنَّ" ; + Per1 Sing => "تُ" ; Per1 Plur => "نَا" } ; - - + + suffixImpfDef : Voice -> Vowel -> Mood => PerGenNum => Str = \vc,vw -> - let { - default : Mood -> Str = \m -> + let { + default : Mood -> Str = \m -> case vc of { Pas => case m of {Jus => "" ; _ => "ى"} ; Act => case vw of { @@ -335,70 +346,70 @@ oper i => case m of {Ind => "ي" ; Cnj => "يَ" ; Jus => ""} ; a => case m of {Ind => "ى" ; Cnj => "ى" ; Jus => ""} } - } + } } in table { Ind => table { - Per3 Masc Pl => "وْنَ" ; - Per2 Masc Pl => "وْنَ" ; - Per3 g Dl => "يَانِ" ; - Per2 g Dl => "يَانِ" ; - Per3 Fem Pl => "يْنَ" ; - Per2 Fem _ => "يْنَ" ; + Per3 Masc Pl => "وْنَ" ; + Per2 Masc Pl => "وْنَ" ; + Per3 g Dl => "يَانِ" ; + Per2 g Dl => "يَانِ" ; + Per3 Fem Pl => "يْنَ" ; + Per2 Fem _ => "يْنَ" ; _ => default Ind } ; m => table { - Per3 Masc Pl => "وْا" ; - Per2 Masc Pl => "وْا" ; - Per3 g Dl => "يَا" ; - Per2 g Dl => "يَا" ; - Per3 Fem Pl => "يْنَ" ; - Per2 Fem Pl => "يْنَ" ; - Per2 Fem Sg => "ي" ; + Per3 Masc Pl => "وْا" ; + Per2 Masc Pl => "وْا" ; + Per3 g Dl => "يَا" ; + Per2 g Dl => "يَا" ; + Per3 Fem Pl => "يْنَ" ; + Per2 Fem Pl => "يْنَ" ; + Per2 Fem Sg => "ي" ; _ => default m } } ; --now is used for the sound, assimilated (weak C1), and when C1 = hamza: -v1sound : Root3 -> Vowel -> Vowel -> Verb = +v1sound : Root3 -> Vowel -> Vowel -> Verb = \fcl,vPerf,vImpf -> let { qf = {f = fcl.c ; c = fcl.l} ; qif = mkBilit (fvc ! vImpf) qf; - katab = mkStrong (patV1Perf ! vPerf) fcl ; + katab = mkStrong (patV1Perf ! vPerf) fcl ; kutib = mkStrong fucil fcl ; --FIXME no passive if vPerf == u - ktub = mkStrong (patV1Impf ! vImpf) fcl ; - aktub = "َ" + + ktub = mkStrong (patV1Impf ! vImpf) fcl ; + aktub = "َ" + case fcl.f of { "و"|"ي" => qif ; _ => ktub }; uktab = mkStrong ufcal fcl ; - euktub = case fcl.f of { + euktub = case fcl.f of { "؟"|"و"|"ي" => qif ; - _ => prefixImp ! vImpf + ktub + _ => prefixImp ! vImpf + ktub }; - maktUb = mkStrong mafcUl fcl + maktUb = mkStrong mafcUl fcl } in verb katab kutib aktub uktab euktub maktUb ; v1hollow : Root3 -> Vowel -> Verb = - \xwf,vowel -> + \xwf,vowel -> let { xAf = mkHollow fAc xwf ; xif = mkHollow (patHol1 ! vowel) xwf ; xyf = mkHollow fIc xwf ; - xuf = mkHollow (patHol2 ! vowel) xwf ; + xuf = mkHollow (patHol2 ! vowel) xwf ; xaf = mkHollow (fvc ! vowel) xwf ; - axaf= "َ" + xaf ; + axaf= "َ" + xaf ; uxAf= mkHollow ufAc xwf ; uxaf= "ُ" + xaf ; xAf'= mkHollow (patHol3 ! vowel) xwf ; axAf= "َ" + xAf'; - ppart = "مَ" + xAf' -- FIXME actually wierd anomalies happen with the a vowel.. + ppart = "مَ" + xAf' -- FIXME actually wierd anomalies happen with the a vowel.. } in verbHollow xAf xif xyf xuf axAf axaf uxAf uxaf xaf xAf' ppart ; @@ -419,13 +430,13 @@ patHol3 : Vowel => Pattern = fvc : Vowel => Pattern = table { u => fuc ; - i => fic ; - a => fac + i => fic ; + a => fac } ; v1geminate : Str -> Vowel -> Vowel -> Verb = - \rootStr,vPerf,vImpf -> + \rootStr,vPerf,vImpf -> let { mdd = mkRoot3 rootStr ; --fcc md = mkRoot2 rootStr ; --fc @@ -446,82 +457,118 @@ v1geminate : Str -> Vowel -> Vowel -> Verb = patGem1 : Vowel => Pattern = table { a => facal ; - u => facul ; - i => facil + u => facul ; + i => facil } ; patGem2 : Vowel => Pattern = table { u => fucc ; - a => facc ; - i => ficc --no such verb probably exists + a => facc ; + i => ficc --no such verb probably exists } ; patGem3 : Vowel => Pattern = table { u => fcul ; - a => fcal ; - i => fcil --no such verb probably exists + a => fcal ; + i => fcil --no such verb probably exists } ; -v1defective : Root3 -> Vowel -> Verb = - \rmy,vowel -> - let { - rama = mkDefective faca rmy ; - ramay = mkStrong facalo rmy ; - rumi = mkDefective fuci rmy ; - rumu = mkDefective fucu rmy ; - rumiy = mkStrong fucilo rmy ; - rmi = mkDefective (patDef1 ! vowel) rmy ; - armi = "َ" + rmi ; - rmu = mkDefective (patDef2 ! vowel) rmy ; - armu = "َ" + rmu ; - urma = mkDefective ufca rmy ; - eirmi = prefixImp ! vowel + rmi; - eirmu = prefixImp ! vowel + rmu; - marmiy = mkStrong mafcil rmy - } in verbDef rama ramay rumi rumu rumiy armi armu urma eirmi eirmu marmiy vowel ; +DefForms : Type = Predef.Ints 10 => Str ; +toDefForms : (x1,_,_,_,_,_,_,_,_,_,x11 : Str) -> DefForms = + \rama,ramay,rumi,rumu,rumiy,armi,armu,urma,eirmi,eirmu,marmiy -> + table { + 0 => rama ; + 1 => ramay ; + 2 => rumi ; + 3 => rumu ; + 4 => rumiy ; + 5 => armi ; + 6 => armu ; + 7 => urma ; + 8 => eirmi ; + 9 => eirmu ; + 10 => marmiy + } ; + + +def1Forms_vPerfA : Root3 -> Vowel -> DefForms = \rmy,vImpf -> + let { + rama = mkDefective faca rmy ; + ramay = mkStrong facalo rmy ; + rumi = mkDefective fuci rmy ; + rumu = mkDefective fucu rmy ; + rumiy = mkStrong fucilo rmy ; + rmi = mkDefective (patDef1 ! vImpf) rmy ; + armi = "َ" + rmi ; + rmu = mkDefective (patDef2 ! vImpf) rmy ; + armu = "َ" + rmu ; + urma = mkDefective ufca rmy ; + eirmi = prefixImp ! vImpf + rmi; + eirmu = prefixImp ! vImpf + rmu; + marmiy = mkStrong mafcil rmy + } in toDefForms rama ramay rumi rumu rumiy armi armu urma eirmi eirmu marmiy ; + +v1defective : Root3 -> Vowel -> Vowel -> Verb = \rmy,vPerf,vImpf -> + case vPerf of { + i => v1defective_i rmy vImpf ; + _ => v1defective_a rmy vImpf + } ; + +v1defective_a : Root3 -> Vowel -> Verb = \rmy,vImpf -> + let vforms = def1Forms_vPerfA rmy vImpf + in verbDef vforms vImpf ; + +v1defective_i : Root3 -> Vowel -> Verb = \bqy,vImpf -> -- IL (conjugation 1d4) + let vforms_a = def1Forms_vPerfA bqy vImpf ; + baqI = mkDefective facIl bqy ; + baqiy = mkDefective facil bqy ; + vforms_i = table { 0 => baqI ; + 1 => baqiy ; + x => vforms_a ! x } ; + in verbDef vforms_i vImpf ; patDef1 : Vowel => Pattern = table { u => fcu ; - a => fca ; - i => fci + a => fca ; + i => fci } ; patDef2 : Vowel => Pattern = table { - a => fca ; + a => fca ; _ => fcu } ; v2sound : Root3 -> Verb = \qsm -> let { - qassam = mkStrong faccal qsm ; + qassam = mkStrong faccal qsm ; qussim = mkStrong fuccil qsm ; - qassim = mkStrong faccil qsm ; + qassim = mkStrong faccil qsm ; uqassim = "ُ" + qassim ; - uqassam = "ُ" + qassam ; + uqassam = "ُ" + qassam ; muqassam = "مُ" + qassam } in verb qassam qussim uqassim uqassam qassim muqassam; v2defective : Root3 -> Verb = \gny -> let { - ganna = mkDefective facca gny ; - gannay = mkStrong faccalo gny ; - gunni = mkDefective fucci gny ; - gunnu = mkDefective fuccu gny ; - gunniy = mkStrong fuccilo gny ; + ganna = mkDefective facca gny ; + gannay = mkStrong faccalo gny ; + gunni = mkDefective fucci gny ; + gunnu = mkDefective fuccu gny ; + gunniy = mkStrong fuccilo gny ; ganni = mkDefective facci gny; uganni = "ُ" + ganni; gannu = mkDefective faccu gny; ugannu = "ُ" + gannu; uganna = "ُ" + ganna; mugannaY = "مُ" + ganna + "ى" - } in verbDef ganna gannay gunni gunnu gunniy uganni ugannu uganna ganni gannu mugannaY i; + } in verbDef (toDefForms ganna gannay gunni gunnu gunniy uganni ugannu uganna ganni gannu mugannaY) i; -v3sound : Root3 -> Verb = +v3sound : Root3 -> Verb = \tbc -> let { tAbac = mkStrong fAcal tbc ; @@ -529,7 +576,7 @@ v3sound : Root3 -> Verb = tAbic = mkStrong fAcil tbc ; utAbic = "ُ" + tAbic ; utAbac = mkStrong ufAcal tbc ; - mutAbac = "م" + utAbac + mutAbac = "م" + utAbac } in verb tAbac twbic utAbic utAbac tAbic mutAbac; v4sound : Root3 -> Verb = @@ -541,29 +588,29 @@ v4sound : Root3 -> Verb = uqnac = mkStrong ufcal qnc; eaqnic = mkStrong eafcil qnc; muqnac = "م" + uqnac - } in + } in verb eaqnac euqnic uqnic uqnac eaqnic muqnac; v4defective : Root3 -> Verb = \cTy -> let { - cTa = mkDefective fca cTy; + cTa = mkDefective fca cTy; cTu = mkDefective fcu cTy; cTi = mkDefective fci cTy; eacTa = "أَ" + cTa; - eacTay = mkStrong eafcal cTy ; + eacTay = mkStrong eafcal cTy ; ucTi = "ُ" + cTi; - eucTi = "أُ" + cTi; + eucTi = "أُ" + cTi; ucTu = "ُ" + cTu; - eucTu = "أُ" + cTu; - eucTiy = mkStrong eufcil cTy ; + eucTu = "أُ" + cTu; + eucTiy = mkStrong eufcil cTy ; ucTa = "ُ" + cTa; eacTi = "أَ" + cTi; eacTu = "أَ" + cTu; mucTaY = "م" + ucTa +"ى" - } in verbDef eacTa eacTay eucTi eucTu eucTiy ucTi ucTu ucTa eacTi eacTu mucTaY i; + } in verbDef (toDefForms eacTa eacTay eucTi eucTu eucTiy ucTi ucTu ucTa eacTi eacTu mucTaY) i; -v5sound : Root3 -> Verb = +v5sound : Root3 -> Verb = \nfs -> let { tanaffas = mkStrong tafaccal nfs ; @@ -573,7 +620,7 @@ v5sound : Root3 -> Verb = mutanaffas = "م" + tanaffas } in verb tanaffas tunuffis atanaffas utanaffas tanaffas mutanaffas; -v6sound : Root3 -> Verb = +v6sound : Root3 -> Verb = \fqm -> let { tafAqam = mkStrong tafAcal fqm ; @@ -583,7 +630,7 @@ v6sound : Root3 -> Verb = mutafAqam = "م" + utafAqam } in verb tafAqam tufUqim atafAqam utafAqam tafAqam mutafAqam; -v8sound : Root3 -> Verb = +v8sound : Root3 -> Verb = \rbT -> let { rtabiT = mkStrong ftacil rbT ; @@ -596,18 +643,32 @@ v8sound : Root3 -> Verb = murtabaT = "م" + urtabaT } in verb eirtabaT eurtubiT artabiT urtabaT eirtabiT murtabaT; +v8assimilated : Root3 -> Verb = --- IL 8a1 + \wfq -> + let { + ttafiq = mkWeak ttacil wfq ; + ttafaq = mkWeak ttacal wfq ; + eittafaq = "إِ" + ttafaq ; + euttufiq = mkWeak euttucil wfq ; + attafiq = "َ" + ttafiq ; + uttafaq = "ُ" + ttafaq ; + eittafiq = "إِ" + ttafiq ; + muttafaq = "م" + uttafaq + } in verb eittafaq euttufiq attafiq uttafaq eittafiq muttafaq; + + patV1Perf : Vowel => Pattern = table { a => facal ; --katab - u => facul ; --Hasun - i => facil --rabiH + u => facul ; --Hasun + i => facil --rabiH } ; patV1Impf : Vowel => Pattern = table { u => fcul ; --ktub - a => fcal ; --rbaH - i => fcil --Hsin + a => fcal ; --rbaH + i => fcil --Hsin } ; endVowel : Mood => Str = @@ -617,7 +678,7 @@ endVowel : Mood => Str = Ind => "" } ; -prefixImp : Vowel => Str = +prefixImp : Vowel => Str = table { u => "أُ" ; _ => "إِ" @@ -625,7 +686,7 @@ prefixImp : Vowel => Str = patHollowPerf : (_,_,_,_ :Str) -> Voice => PerGenNum => Str = \xAf,xif,xyf,xuf -> table { - Act => + Act => table { Per3 Fem Pl => xif ; Per3 _ _ => xAf ; @@ -642,7 +703,7 @@ patHollowPerf : (_,_,_,_ :Str) -> Voice => PerGenNum => Str = \xAf,xif,xyf,xuf - --this is the pattern of imperfect hollow (ind & conj) and geminate verbs (all) patHollowImpf : (_,_,_,_ :Str) -> Voice => PerGenNum => Str = \axAf,axaf,uxAf,uxaf -> table { - Act => + Act => table { Per3 Fem Pl => axaf ; Per2 Fem Pl => axaf ; @@ -658,7 +719,7 @@ patHollowImpf : (_,_,_,_ :Str) -> Voice => PerGenNum => Str = \axAf,axaf,uxAf,ux patHollowJus : (_,_,_,_ : Str) -> Voice => PerGenNum => Str =\axaf,axAf,uxaf,uxAf-> table { - Act => + Act => table { Per3 g Sg => axaf ; Per3 Fem Pl => axaf; @@ -667,7 +728,7 @@ patHollowJus : (_,_,_,_ : Str) -> Voice => PerGenNum => Str =\axaf,axAf,uxaf,uxA Per1 _ => axaf; _ => axAf } ; - Pas => + Pas => table { Per3 g Sg => uxaf ; Per3 Fem Pl => uxaf; @@ -675,9 +736,9 @@ patHollowJus : (_,_,_,_ : Str) -> Voice => PerGenNum => Str =\axaf,axAf,uxaf,uxA Per2 Masc Sg => uxaf; Per1 _ => uxaf; _ => uxAf - } + } } ; - + patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> @@ -691,12 +752,12 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> --takes the adjective lemma and gives the Posit table positAdj : Str -> Gender => NTable = \kabIr -> - let kabIra = kabIr + "َة" in + let kabIra = kabIr + "َة" in table { Masc => sndm kabIr; Fem => sndf kabIra }; - + clr : Str -> Str -> Str -> AForm => Str = \aHmar,HamrA',Humr -> table { @@ -710,92 +771,113 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> Dl => dual ((tk 2 HamrA') + "و") ! d ! c; Pl => sing Humr ! d ! c }; - AComp d c => indeclN aHmar ! d ! c + AComp d c => indeclN aHmar ! d ! c }; - + -- indeclinable nominal word (mamnuu3 mina S-Sarf) indeclN : Str -> State => Case => Str = - \aHmar -> \\s,c => Al!s + aHmar + indecl!c; + \aHmar -> \\s,c => defArt s aHmar + indecl!c; - -- takes 2 words, singular and broken plural, and gives the + -- takes 2 words, singular and broken plural, and gives the -- complete noun inflection table reg : Str -> Str -> NTable = \kitAb,kutub -> table { Sg => sing kitAb ; Dl => dual kitAb ; - Pl => sing kutub + Pl => sing kutub }; - - --takes the sound noun in singular and gives the + + --takes the sound noun in singular and gives the --complete noun inflection table of sound feminine plural sndf : Str -> NTable = \lawHa -> table { Sg => sing lawHa ; Dl => dual lawHa ; - Pl => plurF lawHa + Pl => plurF lawHa }; - - --takes the sound noun in singular and gives the + + --takes the sound noun in singular and gives the --complete inflection table of sound masculine plural nominals sndm : Str -> NTable = \muzAric -> table { Sg => sing muzAric ; Dl => dual muzAric ; - Pl => plurM muzAric + Pl => plurM muzAric }; - + -- takes a singular or broken plural word and tests the ending to -- determine the declension and gives the corresponding inf table - sing : Str -> State => Case => Str = - \word -> + sing : Str -> State => Case => Str = + \word -> case word of { - lemma + "ِي" => \\s,c => Al ! s + lemma + dec2sg ! s ! c ; - _ + ("ا"|"ى") => \\s,c => Al ! s + word + dec3sg ! s ! c ; - _ => \\s,c => Al ! s + word + dec1sg ! s ! c + lemma + "ِي" => \\s,c => defArt s lemma + dec2sg ! s ! c ; + _ + ("ا"|"ى") => \\s,c => defArt s word + dec3sg ! s ! c ; + _ => \\s,c => defArt s word + dec1sg ! s ! c }; + -- takes a singular word and tests the ending to -- determine the declension and gives the corresponding dual inf table - dual : Str -> State => Case => Str = - \caSaA -> + dual : Str -> State => Case => Str = + \caSaA -> case caSaA of { - lemma + ("ا"|"ى") => \\s,c => Al ! s + lemma + "ي" + dl ! s ! c ; - _ => \\s,c => Al ! s + caSaA + dl ! s ! c + lemma + ("ا"|"ى") => \\s,c => defArt s lemma + "ي" + dl ! s ! c ; + _ => \\s,c => defArt s caSaA + dl ! s ! c }; - -- takes a singular word and gives the corresponding sound + -- takes a singular word and gives the corresponding sound --plural feminine table - plurF : Str -> State => Case => Str = - \kalima -> - \\s,c => Al ! s + (mkAt kalima) + f_pl ! s ! c ; + plurF : Str -> State => Case => Str = + \kalima -> + \\s,c => defArt s (mkAt kalima) + f_pl ! s ! c ; - -- takes a singular word and gives the corresponding sound + -- takes a singular word and gives the corresponding sound --plural masculine table. FIXME: consider declension 3 - plurM : Str -> State => Case => Str = - \mucallim -> - \\s,c => Al ! s + mucallim + m_pl ! s ! c ; - + plurM : Str -> State => Case => Str = + \mucallim -> + \\s,c => defArt s mucallim + m_pl ! s ! c ; -- to add the Al prefix for Definite words - Al : State => Str = + Al : State => Str = table { - Def => "ال"; + Def => "ال" ; _ => "" }; - --declection 1 (strong ending) of the singular or broken plural words - dec1sg : State => Case => Str = + defArt : State -> Str -> Str = \st,stem -> + let arra = "الرَّ" ; + arri = "الرِّ" ; + arr = "الرِّ" ; + atta = "التَ" ; + atti = "التِّ"; + att = "التّ" ; + al = "ال" ; + in case st of { -- TODO rest of the assimilations + Def => case stem of { + ra@"رَ" + x => arra + x ; + ri@"رِ" + x => arri + x ; + r@"ر" + x => arr + x ; -- no vowel specified + ta@"تَ" + x => atta + x ; + ti@"تِ" + x => atti + x ; + t@"ت" + x => att + x ; -- no vowel specified + _ => al + stem + } ; + _ => "" + stem + }; + + --declension 1 (strong ending) of the singular or broken plural words + dec1sg : State => Case => Str = table { - Indef => + Indef => table { Nom => "ٌ"; Acc => "ً"; Gen => "ٍ" }; - _ => + _ => table { --think of ?axU, ?axA, (the five nouns) Nom => "ُ"; Acc => "َ"; @@ -803,43 +885,43 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> } }; - --indeclinables (mamnuu3 mina S-Sarf) + --indeclinables (mamnuu3 mina S-Sarf) indecl : Case => Str = table { Nom => "ُ"; _ => "َ" }; - - --declection 2 (ends in yaa') - dec2sg : State => Case => Str = + + --declection 2 (ends in yaa') + dec2sg : State => Case => Str = table { - Indef => + Indef => table { Acc => "ِياً"; _ => "ٍ" }; - _ => - table { + _ => + table { Acc => "ِيَ"; _ => "ِي" } }; --declention 3 (ending in alif) - dec3sg : State => Case => Str = + dec3sg : State => Case => Str = table { - Indef => + Indef => table { _ => "ً" }; - _ => - table { + _ => + table { _ => "" } }; - + --dual suffixes dl : State => Case => Str = table { @@ -885,7 +967,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> } }; - + mkAt : Str -> Str = \bayDo -> case bayDo of { bayD + "ة" => bayD + "ات"; @@ -893,10 +975,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> bayD + "ى" => bayD + "يَات"; _ => bayDo + "ات" }; - + oper - + sizeToNumber : Size -> Number = \s -> case s of { ThreeTen | None => Pl; @@ -929,8 +1011,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> --FIXME needs testing - nounCase : Case -> Size -> State -> Case = - \c,size,s -> + nounCase : Case -> Size -> State -> Case = + \c,size,s -> case of { => Acc; => Acc; @@ -939,7 +1021,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> <_,Const> => Gen; _ => c }; - + definite : State => State = table { Indef => Indef; @@ -953,7 +1035,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> case of { => Const; => Const; - _ => s + _ => s }; -- in a NP, sometimes the common noun preceedes the determiner @@ -967,9 +1049,9 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> <_,True,_,Def> => True; --definite numbers act as adjectives <_,True,Two,_> => True; --numerals one and two always adjectives <_,True,One,_> => True; --numerals one and two always adjectives - _ => False + _ => False }; - + agrP3 : Species -> Gender -> Number -> PerGenNum= \h,g,n -> case of { => Per3 Fem Sg; @@ -982,13 +1064,13 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> Per2 gn nm => {g = gn; n = nm}; _ => {g = Masc; n = Sg} --randomly }; - + mkIP : Str -> Number -> IP = \s,n -> {s = \\_g,_s,_c => s ; n = n} ; mkOrd : (_,_ : Str) -> NumOrdCard = - \aysar,yusra -> + \aysar,yusra -> { s = \\g,s,c => case g of { Masc => (sing aysar) ! s ! c; @@ -996,23 +1078,23 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> }; n = None }; - + oper Det : Type = { - s : Species => Gender => Case => Str ; - d : State; - n : Size; + s : Species => Gender => Case => Str ; + d : State; + n : Size; isNum : Bool; - -- for genitive pronouns (suffixes). if true, then "cn ++ det" + -- for genitive pronouns (suffixes). if true, then "cn ++ det" --should be used instead of "det ++ cn" when constructing the NP - isPron : Bool + isPron : Bool } ; - Predet : Type = { + Predet : Type = { s : Case => Str; - isDecl : Bool + isDecl : Bool }; Agr = { pgn : PerGenNum; isPron : Bool} ; @@ -1020,16 +1102,16 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> Comp : Type = { s : AAgr => Case => Str - } ; + } ; - Obj : Type = { - s : Str ; + Obj : Type = { + s : Str ; a : Agr }; NP : Type = { - s : Case => Str ; - a : Agr + s : Case => Str ; + a : Agr } ; IP : Type = { @@ -1040,19 +1122,19 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> } ; param VPForm = - VPPerf - | VPImpf Mood + VPPerf + | VPImpf Mood | VPImp ; oper - VP : Type = { + VP : Type = { s : PerGenNum => VPForm => Str; obj : Obj; pred : Comp; isPred : Bool; --indicates if there is a predicate (xabar) s2 : Str - }; + }; -- For complements of VV. -- TODO: does verbal complement agree with the noun @@ -1066,7 +1148,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> } ; predV : Verb -> VP = \v -> - { s = \\pgn,vf => + { s = \\pgn,vf => let gn = pgn2gn pgn in case vf of { VPPerf => v.s ! (VPerf Act pgn); @@ -1074,16 +1156,16 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> VPImp => v.s ! (VImp Masc Sg)--gn.g gn.n) }; obj = { - s = [] ; - a = {pgn = Per3 Masc Sg ; isPron = False} + s = [] ; + a = {pgn = Per3 Masc Sg ; isPron = False} }; --or anything! s2 = []; pred = { s = \\_,_ => []}; isPred = False }; - - -- in verbal sentences, the verb agrees with the subject + + -- in verbal sentences, the verb agrees with the subject -- in Gender but not in number verbalAgr : PerGenNum -> PerGenNum = \pgn -> case pgn of { @@ -1102,7 +1184,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> insertStr : Str -> VP -> VP = \str,vp -> vp ** { s2 = vp.s2 ++ str }; - kaan : {s : AAgr => Case => Str} -> VP = \xabar -> + kaan : {s : AAgr => Case => Str} -> VP = \xabar -> insertPred xabar (predV (v1hollow {f = "ك"; c = "و" ; l = "ن"} u) ); -- Slash categories @@ -1113,7 +1195,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> QCl : Type = {s : Tense => Polarity => QForm => Str} ; --TODO: slashRCl : ClSlash -> RP -> RCl ; - + param Size = One | Two | ThreeTen | Teen | NonTeen | Hundreds | None ; @@ -1121,18 +1203,18 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> CardOrd = NCard | NOrd ; oper - --digits 1, 3 - 10: take the lemmas of the card ords & in masculine - --form and calculates the whole table + --digits 1, 3 - 10: take the lemmas of the card ords & in masculine + --form and calculates the whole table - regNum : Str -> Str -> - {s : DForm => CardOrd => Gender => State => Case => Str} = + regNum : Str -> Str -> + {s : DForm => CardOrd => Gender => State => Case => Str} = \xams,xAmis -> let { xamsa = xams + "َة"; - xAmisa = xAmis + "َة"} in + xAmisa = xAmis + "َة"} in mkNum xamsa xAmis xAmisa; mkNum : Str -> Str -> Str -> - {s : DForm => CardOrd => Gender => State => Case => Str} = + {s : DForm => CardOrd => Gender => State => Case => Str} = \wAhid,awwal,Ula -> let { wAhida = wAhid + "َة"} in { s= table { @@ -1140,21 +1222,21 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> NCard => table { Masc => \\s,c => (sing wAhid) ! s ! c ; --all fem are first declension: - Fem => \\s,c => Al ! s + wAhida + dec1sg ! s ! c + Fem => \\s,c => defArt s wAhida + dec1sg ! s ! c }; NOrd => table { - Masc => \\s,c => Al ! s + awwal + dec1sg ! s ! c; - Fem => \\s,c => (sing Ula) ! s ! c + Masc => \\s,c => defArt s awwal + dec1sg ! s ! c; + Fem => \\s,c => (sing Ula) ! s ! c } }; ten => table { - NCard => \\_,s,c => Al ! s + wAhid + m_pl ! Indef ! c; - NOrd => \\_,s,c => Al ! s + awwal + m_pl ! Indef ! c + NCard => \\_,s,c => defArt s wAhid + m_pl ! Indef ! c; + NOrd => \\_,s,c => defArt s awwal + m_pl ! Indef ! c } } }; - num3_10 : Str -> Str -> { s : DForm => CardOrd => Gender + num3_10 : Str -> Str -> { s : DForm => CardOrd => Gender => State => Case => Str ; n : Size } = \xams,xAmis -> regNum xams xAmis ** { n = ThreeTen }; @@ -1164,11 +1246,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> unit => table { NCard => table { Masc => \\s,c => Al ! s + "ٱِثن" + dl ! s ! c ; - Fem => \\s,c => Al ! s + "ٱِثنَت" + dl ! s ! c + Fem => \\s,c => Al ! s + "ٱِثنَت" + dl ! s ! c }; NOrd => table { Masc => \\s,c => Al ! s + "ثان" + dec2sg ! s ! c ; - Fem => \\s,c => Al ! s + "ثانِيَة" + dec1sg ! s ! c + Fem => \\s,c => Al ! s + "ثانِيَة" + dec1sg ! s ! c } }; ten => \\_,_,s,c => Al ! s + "عِشر" + m_pl ! Indef ! c @@ -1187,7 +1269,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> num2000 : State => Case => Str = \\s,c => Al ! s + "أَلف" + dl ! s ! c ; - teen : Gender => Str = + teen : Gender => Str = table { Masc => "عَشَرَ"; Fem => "عَشرَةَ" diff --git a/src/arabic/SentenceAra.gf b/src/arabic/SentenceAra.gf index ed7440214..1a26da8cf 100644 --- a/src/arabic/SentenceAra.gf +++ b/src/arabic/SentenceAra.gf @@ -1,34 +1,35 @@ --# -path=.:abstract:common:prelude -concrete SentenceAra of Sentence = CatAra ** open +concrete SentenceAra of Sentence = CatAra ** open ResAra, - Prelude, + Prelude, ResAra, + TenseX, ParamX, CommonX in { flags optimize=all_subs ; coding=utf8 ; - + lin {- - PredVP np vp = - { s = \\t,p,o => - case o of { - Verbal => + PredVP np vp = + { s = \\t,p,o => + case o of { + Verbal => case vp.comp.a.isPron of { False => vp.s ! t ! p ! Verbal ! np.a ++ np.s ! Nom ++ vp.comp.s ! Acc ; - True => vp.s ! t ! p ! Verbal ! np.a ++ vp.comp.s ! Acc ++ np.s ! Nom + True => vp.s ! t ! p ! Verbal ! np.a ++ vp.comp.s ! Acc ++ np.s ! Nom }; Nominal => - np.s ! Nom ++ vp.s ! t ! p ! Nominal ! np.a ++ vp.comp.s ! Acc + np.s ! Nom ++ vp.s ! t ! p ! Nominal ! np.a ++ vp.comp.s ! Acc } }; -} PredVP np vp = - { s =\\t,p,o => + { s =\\t,p,o => let { - pgn = + pgn = case of { => verbalAgr np.a.pgn; _ => np.a.pgn @@ -38,44 +39,44 @@ concrete SentenceAra of Sentence = CatAra ** open yaktubu = vp.s ! pgn ! VPImpf Ind ; yaktuba = vp.s ! pgn ! VPImpf Cnj ; yaktub = vp.s ! pgn ! VPImpf Jus ; - vStr : ResAra.Tense -> Polarity -> Str = + vStr : ResAra.Tense -> Polarity -> Str = \tn,pl -> case of { => yaktubu ; => "لَا" ++ yaktubu ; - => "" ; --no verb "to be" in present + => "" ; --no verb "to be" in present => "لَيسَ" ;--same here, just add negation particle <_, ResAra.Past, Pos> => kataba ; <_, ResAra.Past, Neg> => "لَمْ" ++ yaktub ; - <_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ; - <_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba + <_, ResAra.Fut, Pos> => "سَ" ++ yaktubu ; + <_, ResAra.Fut, Neg> => "لَنْ" ++ yaktuba }; - pred : ResAra.Tense -> Polarity -> Str = + pred : ResAra.Tense -> Polarity -> Str = \tn,pl -> case of { => vp.pred.s ! gn ! Nom; --xabar marfooc _ => vp.pred.s ! gn ! Acc --xabar kaana wa laysa manSoob }; - + } in - case o of { - Verbal => + case o of { + Verbal => --case of { ---- AR workaround 18/12/2008 - case of { - {- IL: I don't think we should do prodrop here. vStr drops the copula in present tense, - so there's hardly anything left for a predicative clause: e.g. - PredVP (UsePron i_Pron) (UseComp (CompCN (UseN car_N))) "I am a car" - would be linearised just as "car", if we have both prodrop and copula drop. - Leaving it up to someone who knows Arabic to decide what is better. - Original here: + case of { + {- IL: I don't think we should do prodrop here. vStr drops the copula in present tense, + so there's hardly anything left for a predicative clause: e.g. + PredVP (UsePron i_Pron) (UseComp (CompCN (UseN car_N))) "I am a car" + would be linearised just as "car", if we have both prodrop and copula drop. + Leaving it up to someone who knows Arabic to decide what is better. + Original here: => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p) ; -- ya2kuluhu => (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p); -} - -- ya2kuluhu al-waladu, yakuluhu al-2awlaadu + -- ya2kuluhu al-waladu, yakuluhu al-2awlaadu => (vStr t p) ++ np.s ! Nom ++ vp.obj.s ++ vp.s2 ++ (pred t p); => (vStr t p) ++ vp.obj.s ++ np.s ! Nom ++ vp.s2 ++ (pred t p) }; Nominal => np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p) - } + } }; -- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; @@ -89,11 +90,11 @@ concrete SentenceAra of Sentence = CatAra ** open }; -- --- SlashV2 np v2 = +-- SlashV2 np v2 = -- mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; -- --- SlashVVV2 np vv v2 = --- mkClause (np.s ! Nom) np.a +-- SlashVVV2 np vv v2 = +-- mkClause (np.s ! Nom) np.a -- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) ** -- {c2 = v2.c2} ; @@ -111,31 +112,22 @@ concrete SentenceAra of Sentence = CatAra ** open -- EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr -- - --FIXME, all tenses - UseCl t ap cl = - {s = cl.s ! ResAra.Pres ! ap.p ! Verbal -{- case t of { - TPres => cl.s ! ResAra.Pres ! p.p ! Verbal ; - TCond => cl.s ! ResAra.Pres ! p.p ! Verbal ; - TPast => cl.s ! ResAra.Past ! p.p ! Verbal ; - TFut => cl.s ! ResAra.Fut ! p.p ! Verbal - } --} }; + UseCl t p cl = + {s = case of { --- IL guessed tenses + <(Pres|Cond),Simul> => cl.s ! ResAra.Pres ! p.p ! Verbal ; + => cl.s ! ResAra.Fut ! p.p ! Verbal ; + <_ ,_ > => cl.s ! ResAra.Past ! p.p ! Verbal + } + }; - --FIXME, all tenses - UseQCl t ap qcl = --{s = cl.s ! t ! p ! Verbal } ; - {s = - table { - QDir => qcl.s ! ResAra.Pres ! ap.p ! QDir; - QIndir => qcl.s ! ResAra.Pres ! ap.p ! QIndir + UseQCl t p qcl = + {s = \\q => + case of { --- IL guessed tenses + <(Pres|Cond),Simul> => qcl.s ! ResAra.Pres ! p.p ! q ; + => qcl.s ! ResAra.Fut ! p.p ! q ; + <_ ,_ > => qcl.s ! ResAra.Past ! p.p ! q } -{- case t of { - TPres => "هَل" ++ qcl.s ! ResAra.Pres ! p.p ! q ; - TCond => "هَل" ++ qcl.s ! ResAra.Pres ! p.p ! q ; - TPast => "هَل" ++ qcl.s ! ResAra.Past ! p.p ! q ; - TFut => "هَل" ++ qcl.s ! ResAra.Fut ! p.p ! q - } --} }; + }; -- UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ; diff --git a/src/arabic/StructuralAra.gf b/src/arabic/StructuralAra.gf index c4692cbfd..36ba135be 100644 --- a/src/arabic/StructuralAra.gf +++ b/src/arabic/StructuralAra.gf @@ -1,4 +1,4 @@ -concrete StructuralAra of Structural = CatAra ** +concrete StructuralAra of Structural = CatAra ** open MorphoAra, ResAra, ParadigmsAra, Prelude in { flags optimize=all ; coding=utf8 ; @@ -21,8 +21,8 @@ concrete StructuralAra of Structural = CatAra ** by8agent_Prep = ss "بِ" ; by8means_Prep = ss "بِ" ; -- can8know_VV, can_VV = { --- s = table VVForm [["بي َبلي تْ"] ; "عَن" ; "عُْلد" ; --- ["بّن َبلي تْ"] ; ["بِنغ َبلي تْ"] ; "عَنءت" ; "عُْلدنءت"] ; +-- s = table VVForm [["بي َبلي تْ"] ; "عَن" ; "عُْلد" ; +-- ["بّن َبلي تْ"] ; ["بِنغ َبلي تْ"] ; "عَنءت" ; "عُْلدنءت"] ; -- isAux = True -- } ; during_Prep = ss "خِلَالَ" ; @@ -51,8 +51,8 @@ concrete StructuralAra of Structural = CatAra ** most_Predet = mkPredet "أَكثَر" True ; much_Det = mkDet "الكَثِير مِنَ" Pl Const ; must_VV = mkVV (v1 "وجب" a i) "أن" ; --- s = table VVForm [["بي هَثي تْ"] ; "مُست" ; ["هَد تْ"] ; --- ["هَد تْ"] ; ["هَثِنغ تْ"] ; "مُستنءت" ; ["هَدنءت تْ"]] ; ---- +-- s = table VVForm [["بي هَثي تْ"] ; "مُست" ; ["هَد تْ"] ; +-- ["هَد تْ"] ; ["هَثِنغ تْ"] ; "مُستنءت" ; ["هَدنءت تْ"]] ; ---- -- isAux = True -- } ; no_Utt = {s = \\_ => "لا"} ; @@ -79,7 +79,7 @@ concrete StructuralAra of Structural = CatAra ** -- there7from_Adv = ss ["فرْم تهري"] ; -- therefore_PConj = ss "تهرفْري" ; ----b these_NP = indeclNP "هَؤُلَاء" Pl ; - they_Pron = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ; + they_Pron = mkPron "هُمْ" "هُمْ" "هُمْ" (Per3 Masc Pl) ; this_Quant = mkQuant7 "هَذا" "هَذِهِ" "هَذَان" "هَذَيْن" "هَاتَان" "هَاتَيْن" "هَؤُلَاء" Def; ----b this_NP = indeclNP "هَذا" Sg ; ----b those_NP = indeclNP "هَؤُلَاءكَ" Pl ; @@ -97,13 +97,13 @@ concrete StructuralAra of Structural = CatAra ** where_IAdv = ss "أَينَ" ; which_IQuant = { s = \\s,c => case of { - => "أيٌّ" ; - => "أيُّ" ; - => "أيّاً" ; - => "أيَّ" ; - => "أيٍّ" ; - => "أيِّ" - } + => "أيٌّ" ; + => "أيُّ" ; + => "أيّاً" ; + => "أيَّ" ; + => "أيٍّ" ; + => "أيِّ" + } } ; whoSg_IP = mkIP "مَنْ" Sg ; whoPl_IP = mkIP "مَنْ" Pl ; @@ -115,7 +115,7 @@ concrete StructuralAra of Structural = CatAra ** youPl_Pron = mkPron "أَنتُمْ" "كُمْ" "كُمْ" (Per2 Masc Sg) ; youPol_Pron = mkPron "أَنتِ" "كِ" "كِ" (Per2 Fem Sg) ; - have_V2 = dirV2 (regV "يَملِك") ; + have_V2 = dirV2 (regV "يَملِك") ; lin language_title_Utt = {s = \\_ => "العربية"} ; diff --git a/src/arabic/SymbolAra.gf b/src/arabic/SymbolAra.gf index 625fcfc52..02368836c 100644 --- a/src/arabic/SymbolAra.gf +++ b/src/arabic/SymbolAra.gf @@ -29,7 +29,7 @@ lin SymbOrd n = {s = \\_,_,_ => n.s ; n = None } ; SymbNum n = SymbOrd n ** { n = ThreeTen } ; ----IL -lincat +lincat Symb, [Symb] = SS ; @@ -46,4 +46,3 @@ oper { pgn = Per3 Masc n ; isPron = False } ; } - diff --git a/src/arabic/VerbAra.gf b/src/arabic/VerbAra.gf index bd9bc8c3a..a70e875a4 100644 --- a/src/arabic/VerbAra.gf +++ b/src/arabic/VerbAra.gf @@ -28,7 +28,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in { -- ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; -- -- ComplVA v ap = insertObj (ap.s) (predV v) ; --- ComplV2A v np ap = +-- ComplV2A v np ap = -- insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; -- UseComp xabar = kaan xabar ;