diff --git a/src/arabic/AdjectiveAra.gf b/src/arabic/AdjectiveAra.gf index aa8a0b306..98734aba3 100644 --- a/src/arabic/AdjectiveAra.gf +++ b/src/arabic/AdjectiveAra.gf @@ -20,10 +20,9 @@ concrete AdjectiveAra of Adjective = CatAra ** open ResAra, Prelude in { -- -- $SuperlA$ belongs to determiner syntax in $Noun$. -- --- ComplA2 a np = { --- s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ; --- isPre = False --- } ; + ComplA2 a np = { + s = \\sp,g,n,st,c => a.s ! APosit g n st c ++ a.c2 ++ np.s ! Gen ; + } ; -- -- ReflA2 a = { -- s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ; diff --git a/src/arabic/CatAra.gf b/src/arabic/CatAra.gf index e46d2f35a..aeebc2d50 100644 --- a/src/arabic/CatAra.gf +++ b/src/arabic/CatAra.gf @@ -16,16 +16,18 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { -- Sentence - Cl = {s : ResAra.Tense => Polarity => Order => Str} ; --- Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ; + Cl = ResAra.Cl ; -- {s : ResAra.Tense => Polarity => Order => Str} ; + ClSlash = ResAra.ClSlash ; Imp = {s : Polarity => Gender => ResAra.Number => Str} ; -- Question - QCl = {s : ResAra.Tense => Polarity => QForm => Str} ; - IP = {s : Str ; n : ResAra.Number} ; --- IAdv = {s : Str} ; - IDet = {s : Case => Str ; n : ResAra.Number} ; ---- AR add Case + QCl = ResAra.QCl ; -- {s : ResAra.Tense => Polarity => QForm => Str} ; + IP, + IDet, + IComp = ResAra.IP ; -- {s : Gender => State => Case => Str ; n : ResAra.Number} ; + -- IAdv = {s : Str} ; + IQuant = {s : State => Case => Str} ; -- ---- Relative -- @@ -35,7 +37,7 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { -- Verb VP = ResAra.VP ; - VPSlash = ResAra.VP ** {c2 : Str} ; + VPSlash = ResAra.VPSlash ; -- VP ** {c2:Str} Comp = ResAra.Comp ; --{s : AAgr => Case => Str} ; -- SC = {s : Str} ; -- @@ -47,18 +49,11 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in { CN = ResAra.Noun ** {adj : NTable}; NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ; - Num, Ord, Card = ResAra.NumOrdCard ; - + Ord, + Num, + Card = ResAra.NumOrdCard ; Predet = ResAra.Predet ; --- DEPRECATED --- QuantSg, QuantPl = --- {s : Species => Gender => Case => Str; --- n : ResAra.Number; --- d : State; --- isNum : Bool; --- isPron : Bool} ; - Det = ResAra.Det ; -- {s : Species => Gender => Case => Str ; -- d : State; n : Size; isNum : Bool } ; diff --git a/src/arabic/MissingAra.gf b/src/arabic/MissingAra.gf index 3d5a7ec49..2e417386d 100644 --- a/src/arabic/MissingAra.gf +++ b/src/arabic/MissingAra.gf @@ -9,8 +9,6 @@ oper AdvCN : CN -> Adv -> CN = notYet "AdvCN" ; oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; oper AdvS : Adv -> S -> S = notYet "AdvS" ; -oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ; -oper ApposCN : CN -> NP -> CN = notYet "ApposCN" ; oper BaseAP : AP -> AP -> ListAP = notYet "BaseAP" ; oper BaseAdv : Adv -> Adv -> ListAdv = notYet "BaseAdv" ; oper BaseNP : NP -> NP -> ListNP = notYet "BaseNP" ; @@ -19,12 +17,8 @@ oper BaseS : S -> S -> ListS = notYet "BaseS" ; oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ; oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ; oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; -oper CompCN : CN -> Comp = notYet "CompCN" ; -oper CompIAdv : IAdv -> IComp = notYet "CompIAdv" ; -oper CompIP : IP -> IComp = notYet "CompIP" ; oper ComparAdvAdj : CAdv -> A -> NP -> Adv = notYet "ComparAdvAdj" ; oper ComparAdvAdjS : CAdv -> A -> S -> Adv = notYet "ComparAdvAdjS" ; -oper ComplA2 : A2 -> NP -> AP = notYet "ComplA2" ; oper ComplN2 : N2 -> NP -> CN = notYet "ComplN2" ; oper ComplN3 : N3 -> NP -> N2 = notYet "ComplN3" ; oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ; @@ -54,12 +48,8 @@ oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ; oper ImpersCl : VP -> Cl = notYet "ImpersCl" ; oper PConjConj : Conj -> PConj = notYet "PConjConj" ; oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ; -oper PassV2 : V2 -> VP = notYet "PassV2" ; oper PredSCVP : SC -> VP -> Cl = notYet "PredSCVP" ; -oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ; oper ProgrVP : VP -> VP = notYet "ProgrVP" ; -oper QuestIComp : IComp -> NP -> QCl = notYet "QuestIComp" ; -oper QuestSlash : IP -> ClSlash -> QCl = notYet "QuestSlash" ; oper ReflA2 : A2 -> AP = notYet "ReflA2" ; oper ReflVP : VPSlash -> VP = notYet "ReflVP" ; oper RelCN : CN -> RS -> CN = notYet "RelCN" ; @@ -70,13 +60,11 @@ oper RelVP : RP -> VP -> RCl = notYet "RelVP" ; oper SentAP : AP -> SC -> AP = notYet "SentAP" ; oper SentCN : CN -> SC -> CN = notYet "SentCN" ; oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ; -oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ; oper SlashV2A : V2A -> AP -> VPSlash = notYet "SlashV2A" ; oper SlashV2Q : V2Q -> QS -> VPSlash = notYet "SlashV2Q" ; oper SlashV2S : V2S -> S -> VPSlash = notYet "SlashV2S" ; oper SlashV2V : V2V -> VP -> VPSlash = notYet "SlashV2V" ; oper SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash = notYet "SlashV2VNP" ; -oper SlashVP : NP -> VPSlash -> ClSlash = notYet "SlashVP" ; oper SlashVS : NP -> VS -> SSlash -> ClSlash = notYet "SlashVS" ; oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ; oper SubjS : Subj -> S -> Adv = notYet "SubjS" ; @@ -86,15 +74,10 @@ oper UseComparA : A -> AP = notYet "UseComparA" ; oper UseN2 : N2 -> CN = notYet "UseN2" ; oper UseRCl : Temp -> Pol -> RCl -> RS = notYet "UseRCl" ; oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; -oper UttAP : AP -> Utt = notYet "UttAP" ; -oper UttCN : CN -> Utt = notYet "UttCN" ; -oper UttCard : Card -> Utt = notYet "UttCard" ; oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ; oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; oper UttVP : VP -> Utt = notYet "UttVP" ; oper VocNP : NP -> Voc = notYet "VocNP" ; oper pot3plus : Sub1000 -> Sub1000 -> Sub1000000 = notYet "pot3plus" ; -oper which_IQuant : IQuant = notYet "which_IQuant" ; - -} \ No newline at end of file +} diff --git a/src/arabic/PhraseAra.gf b/src/arabic/PhraseAra.gf index ddbd9f8b8..95d1d2995 100644 --- a/src/arabic/PhraseAra.gf +++ b/src/arabic/PhraseAra.gf @@ -11,7 +11,7 @@ concrete PhraseAra of Phrase = CatAra ** open UttImpSg pol imp = {s = \\g => imp.s ! pol.p ! g ! ResAra.Sg ++ pol.s} ; UttImpPl,UttImpPol = \pol,imp -> {s = \\g => imp.s ! pol.p ! g ! ResAra.Pl ++ pol.s} ; - UttIP ip = {s = \\_ => ip.s} ; ---- AR + UttIP ip = {s = \\g => ip.s ! g ! Def ! Nom} ; --IL UttAP ap = {s = ResAra.uttAP ap} ; --IL UttCard c = {s = ResAra.uttNum c} ; --IL diff --git a/src/arabic/QuestionAra.gf b/src/arabic/QuestionAra.gf index 60b7cc637..f5f247dee 100644 --- a/src/arabic/QuestionAra.gf +++ b/src/arabic/QuestionAra.gf @@ -1,4 +1,4 @@ -concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude in { +concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude, VerbAra in { flags optimize=all_subs ; coding = utf8 ; @@ -12,13 +12,16 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude in { } }; + -- ComplSlashIP vps ip = {} ; -- AR copied from PredVP QuestVP qp vp = { s =\\t,p,_ => let { ----- o = Verbal ; ---- AR - np = {s = table Case {_ => qp.s} ; a ={pgn = Per3 Masc qp.n ; isPron = False}} ; + ---- o = Verbal ; ---- AR + objgn = pgn2gn vp.obj.a.pgn ; + np = {s = qp.s ! objgn.g ! Def ; ----IL just guessing state + a ={pgn = Per3 Masc qp.n ; isPron = False}} ; pgn = np.a.pgn ; gn = pgn2gn pgn; kataba = vp.s ! pgn ! VPPerf ; @@ -60,47 +63,48 @@ concrete QuestionAra of Question = CatAra ** open ResAra, ParamX, Prelude in { ; ---- }; --- QuestSlash ip slash = { --- s = \\t,a,p => --- let --- cls = slash.s ! t ! a ! p ; --- who = slash.c2 ++ ip.s ! Acc --- stranding in ExtAra --- in table { --- QDir => who ++ cls ! OQuest ; --- QIndir => who ++ cls ! ODir --- } --- } ; --- - ---- AR guessed - QuestIAdv iadv cl = {s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! Verbal} ; + QuestIAdv iadv cl = {s = \\t,p,_ => iadv.s ++ cl.s ! t ! p ! Verbal} ; --- s = \\t,a,p => --- let --- cls = cl.s ! t ! a ! p ; --- why = iadv.s --- in table { --- QDir => why ++ cls ! OQuest ; --- QIndir => why ++ cls ! ODir --- } --- } ; --- --- PrepIP p ip = {s = p.s ++ ip.s ! Nom} ; --- --- AdvIP ip adv = { --- s = \\c => ip.s ! c ++ adv.s ; --- n = ip.n --- } ; --- +---- IL guessed + QuestIComp icomp np = + let vp = kaan (CompNP np) in + QuestVP icomp vp ; ----- AR guesses - IdetCN idet cn = { - s = idet.s ! Nom ++ cn.s ! idet.n ! Indef ! Nom ; - n = idet.n + CompIP ip = ip ; + -- old, when IComp = Comp { s = \\{g=g ; n=_},c => ip.s ! g ! Def ! c } ; ---- + + CompIAdv iadv = mkIP iadv.s ResAra.Sg ; + + -- QCl = {s : R.Tense => Polarity => QForm => Str} ; + QuestSlash ip cl = { ----IL just guessing + s = \\t,p,qf => case qf of { + QDir => cl.s ! t ! p ! Verbal ++ cl.c2 ++ ip.s ! Masc ! Def ! Nom ; --VSO (purely guessing) + QIndir => cl.s ! t ! p ! Nominal ++ cl.c2 ++ ip.s ! Masc ! Def ! Nom } --SVO (purely guessing) } ; - IdetQuant idet num = { - s = \\c => idet.s ++ num.s ! Masc ! Indef ! c; - n = ResAra.Sg ---- size of Num - } ; --- + + PrepIP p ip = {s = p.s ++ ip.s ! Masc ! Def ! Acc} ; ----IL + + AdvIP ip adv = ip ** { + s = \\g,s,c => ip.s ! g ! s ! c ++ adv.s ; + n = ip.n + } ; + +----IL guessed with help of L and Google translate + -- : IDet -> IP + IdetIP idet = idet ; -- Gender still matters if turned into IComp + + -- : IDet -> CN -> IP + IdetCN idet cn = idet ** { + s = \\g,s,c => idet.s ! cn.g ! s ! c ++ -- gender is determined by the CN + cn.s ! idet.n ! Indef ! Gen ; --idaafa + } ; + + -- : IQuant -> Num -> IDet + IdetQuant iquant num = { + s = \\g,s,c => + let gend = detGender g num.n -- gender flips with some numbers + in iquant.s ! s ! c ++ num.s ! gend ! s ! c ; + n = sizeToNumber num.n + } ; } diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index 0405a7105..8d2bd255d 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -7,7 +7,7 @@ ---- implement $Test$, it moreover contains regular lexical ---- patterns needed for $Lex$. -- -resource ResAra = PatternsAra ** open Prelude, Predef in { +resource ResAra = PatternsAra ** open Prelude, Predef, ParamX in { flags optimize=noexpand ; coding=utf8 ; @@ -114,7 +114,11 @@ resource ResAra = PatternsAra ** open Prelude, Predef in { uttAP : AP -> (Gender => Str) ; uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL - NumOrdCard : Type = {s : Gender => State => Case => Str ; n : Size }; + NumOrdCard : Type = { + s : Gender => State => Case => Str ; + n : Size ; + } ; + uttNum : NumOrdCard -> (Gender => Str) ; uttNum n = \\g => n.s ! g ! Def ! Nom ; ----IL @@ -980,8 +984,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> }; - mkIP : Str -> Number -> {s : Str ; n : Number} = - \s,n -> {s = s ; n = n} ; + mkIP : Str -> Number -> IP = + \s,n -> {s = \\_g,_s,_c => s ; n = n} ; mkOrd : (_,_ : Str) -> NumOrdCard = \aysar,yusra -> @@ -1027,7 +1031,14 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> s : Case => Str ; a : Agr } ; - + + IP : Type = { + s : Gender -- because of CompIP + => State => Case -- because of PrepIP: e.g. "in which" chooses definite accusative + => Str ; + n : Number + } ; + param VPForm = VPPerf | VPImpf Mood @@ -1089,6 +1100,15 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> kaan : {s : AAgr => Case => Str} -> VP = \xabar -> insertPred xabar (predV (v1hollow {f = "ك"; c = "و" ; l = "ن"} u) ); + -- Slash categories + VPSlash : Type = VP ** {c2 : Str} ; + ClSlash : Type = Cl ** {c2 : Str} ; + + Cl : Type = {s : Tense => Polarity => Order => Str} ; + QCl : Type = {s : Tense => Polarity => QForm => Str} ; + +--TODO: slashRCl : ClSlash -> RP -> RCl ; + param Size = One | Two | ThreeTen | Teen | NonTeen | Hundreds | None ; diff --git a/src/arabic/SentenceAra.gf b/src/arabic/SentenceAra.gf index 30ae03795..1b0990581 100644 --- a/src/arabic/SentenceAra.gf +++ b/src/arabic/SentenceAra.gf @@ -71,7 +71,6 @@ concrete SentenceAra of Sentence = CatAra ** open np.s ! Nom ++ (vStr t p) ++ vp.obj.s ++ vp.s2 ++ (pred t p) } }; - -- PredVP np vp = mkClause (np.s ! Nom) np.a vp ; -- PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; @@ -91,14 +90,16 @@ concrete SentenceAra of Sentence = CatAra ** open -- mkClause (np.s ! Nom) np.a -- (insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) ** -- {c2 = v2.c2} ; --- --- AdvSlash slash adv = { --- s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; --- c2 = slash.c2 --- } ; --- --- SlashPrep cl prep = cl ** {c2 = prep.s} ; --- + +-- ClSlash + + SlashVP np vps = PredVP np vps ** { c2 = vps.c2 } ; + AdvSlash slash adv = slash ** { s2 = slash.s2 ++ adv.s } ; + SlashPrep cl prep = cl ** {c2 = prep.s} ; + +-- SlashVS np vs sslash = TODO + + -- EmbedS s = {s = conjThat ++ s.s} ; -- EmbedQS qs = {s = qs.s ! QIndir} ; -- EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr diff --git a/src/arabic/StructuralAra.gf b/src/arabic/StructuralAra.gf index 989258830..3982df417 100644 --- a/src/arabic/StructuralAra.gf +++ b/src/arabic/StructuralAra.gf @@ -95,8 +95,16 @@ concrete StructuralAra of Structural = CatAra ** when_IAdv = ss "مَتَى" ; -- when_Subj = ss "وهن" ; where_IAdv = ss "أَينَ" ; --- whichPl_IDet = mkDeterminer Pl ["وهِعه"] ; --- whichSg_IDet = mkDeterminer Sg ["وهِعه"] ; + which_IQuant = { + s = \\s,c => case of { + => "أيٌّ" ; + => "أيُّ" ; + => "أيّاً" ; + => "أيَّ" ; + => "أيٍّ" ; + => "أيِّ" + } + } ; whoSg_IP = mkIP "مَنْ" Sg ; whoPl_IP = mkIP "مَنْ" Pl ; -- why_IAdv = ss "وهي" ; diff --git a/src/arabic/VerbAra.gf b/src/arabic/VerbAra.gf index e95e3eeab..c57e9cc10 100644 --- a/src/arabic/VerbAra.gf +++ b/src/arabic/VerbAra.gf @@ -35,7 +35,7 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra in { -- -- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; -- --- PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; + PassV2 v = kaan {s = \\_,_ => v.s ! VPPart} ; ---- IL guessed -- -- UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no