diff --git a/src/arabic/AdverbAra.gf b/src/arabic/AdverbAra.gf index df61ffc59..d10d2ac44 100644 --- a/src/arabic/AdverbAra.gf +++ b/src/arabic/AdverbAra.gf @@ -2,22 +2,24 @@ concrete AdverbAra of Adverb = CatAra ** open ResAra, Prelude in { flags coding=utf8; lin + PositAdvAdj a = {s = a.s ! APosit Masc Sg Indef Acc} ; --- ComparAdvAdj cadv a np = { --- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ np.s ! Gen --- } ; --- ComparAdvAdjS cadv a s = { --- s = cadv.s ++ a.s ! AAdv ++ "تهَن" ++ s.s --- } ; + -- ComparAdvAdj cadv a np = { + -- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ np.s ! Gen + -- } ; + -- ComparAdvAdjS cadv a s = { + -- s = cadv.s ++ a.s ! AAdv ++ "مِنْ" ++ s.s + -- } ; PrepNP prep np = {s = prep.s ++ np.s ! prep.c} ; --- AdAdv = cc2 ; --- - -- : Subj -> S -> Adv ; -- when she sleeps - SubjS subj s = {s = subj.s ++ s.s ! Subord} ; + AdAdv ad av = cc2 av ad ; + + -- : Subj -> S -> Adv ; -- when she sleeps + SubjS subj s = {s = subj.s ++ s.s ! Subord} ; + -- AdvSC s = s ; --- this rule give stack overflow in ordinary parsing --- --- AdnCAdv cadv = {s = cadv.s ++ "تهَن"} ; --- + + AdnCAdv cadv = {s = cadv.s ++ "مِنْ"} ; + } diff --git a/src/arabic/IdiomAra.gf b/src/arabic/IdiomAra.gf index 269d2799b..c46bbadd4 100644 --- a/src/arabic/IdiomAra.gf +++ b/src/arabic/IdiomAra.gf @@ -49,14 +49,12 @@ concrete IdiomAra of Idiom = CatAra ** open -- : VP -> VP ; -- is at home himself; is himself at home SelfAdvVP, SelfAdVVP = \vp -> vp ** { - s = \\pgn,vf => let pron : ResAra.NP = pgn2pron pgn in - vp.s ! pgn ! vf ++ refl ! Nom ++ pron.s ! Gen + s = \\pgn,vf => vp.s ! pgn ! vf ++ reflPron Nom pgn } ; -- : NP -> NP ; -- the president himself (is at home) SelfNP np = np ** { - s = let pron : ResAra.NP = np2pron np ; - in \\c => np.s ! c ++ refl ! c ++ pron.s ! Gen + s = \\c => np.s ! c ++ reflPron c (np.a.pgn) } ; } diff --git a/src/arabic/ParadigmsAra.gf b/src/arabic/ParadigmsAra.gf index 4209267b7..d3edb2b36 100644 --- a/src/arabic/ParadigmsAra.gf +++ b/src/arabic/ParadigmsAra.gf @@ -185,51 +185,33 @@ resource ParadigmsAra = open -- Overloaded operations mkV : overload { - mkV : (imperfect : Str) -> V ; + mkV : (imperfect : Str) -> V ; -- The verb in Per3 Sg Masc imperfect tense gives the most information mkV : (root : Str) -> (perf,impf : Vowel) -> V ; -- verb form I ; vowel = a|i|u mkV : (root : Str) -> VerbForm -> V ; -- FormI .. FormX (no VII, IX) ; default vowels a u for I mkV : V -> (particle : Str) -> V -- V with a non-inflecting particle/phrasal verb } ; --- The verb in the imperfect tense gives the most information + -- regV : Str -> V ; - regV : Str -> V ; + reflV : V -> V ; -- نَفْس in the proper case and with possessive suffix, e.g. نَفْسَكِ ---Verb Form I : fa`ala, fa`ila, fa`ula + v1 : Str -> Vowel -> Vowel -> V ; --Verb Form I : fa`ala, fa`ila, fa`ula - v1 : Str -> Vowel -> Vowel -> V ; + v2 : Str -> V ; --Verb Form II : fa``ala ---Verb Form II : fa``ala + v3 : Str -> V ; --Verb Form III : faa`ala - v2 : Str -> V ; + v4 : Str -> V ; --Verb Form IV : 'af`ala ---Verb Form III : faa`ala + v5 : Str -> V ; --Verb Form V : tafa``ala - v3 : Str -> V ; + v6 : Str -> V ; --Verb Form VI : tafaa`ala ---Verb Form IV : 'af`ala + v7 : Str -> V ; --Verb Form VII : infa`ala - v4 : Str -> V ; + v8 : Str -> V ; --Verb Form VIII ifta`ala ---Verb Form V : tafa``ala - - v5 : Str -> V ; - ---Verb Form VI : tafaa`ala - - v6 : Str -> V ; - ---Verb Form VII : tafaa`ala - - v7 : Str -> V ; - ---Verb Form VIII infa`ala - - v8 : Str -> V ; - --- Verb Form X 'istaf`ala - - v10 : Str -> V ; + v10 : Str -> V ; -- Verb Form X 'istaf`ala --3 Two-place verbs @@ -359,10 +341,11 @@ resource ParadigmsAra = open mkN : N -> (attr : Str) -> N -- Compound nouns = \n,attr -> n ** {s2 = \\n,s,c => attr} ; mkN : N -> N -> N -- Compound nouns - = \n1,n2 -> n1 ** {s2 = - \\n,s,c => n1.s2 ! n ! s ! c - ++ n2.s ! n ! s ! c - ++ n2.s2 ! n ! s ! c} ; + = \n1,n2 -> n1 ** { + s = \\n,_,c => n1.s ! n ! Const ! c ; + s2 = \\n,s,c => n1.s2 ! n ! s ! c + ++ n2.s ! n ! s ! c + ++ n2.s2 ! n ! s ! c} ; } ; dualN : N -> N = \n -> n ** {isDual=True} ; @@ -497,6 +480,8 @@ resource ParadigmsAra = open _ => v10sound } } in lin V (v10fun rbT) ; + reflV v = lin V (ResAra.reflV v) ; + mkFullN nsc gen spec = lin N { s = nsc; --NTable s2 = emptyNTable; diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index e97354b80..dfdd97f5e 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -972,9 +972,10 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> lemma + "ِيّ" => fixShd word (decNisba ! s ! c) ; lemma + "ِي" => fixShd lemma (dec2sg ! s ! c) ; _ + ("ا"|"ى") => fixShd word (dec3sg ! s ! c) ; + lemma + ("ء"|"أ"|"ئ"|"ؤ") => word + dec1sgNoDoubleAlif ! s ! c ; lemma + "ة" => case s of { Poss => lemma + "ت" + dec1sg ! s ! c ; - _ => word + dec1sg ! s ! c + _ => word + dec1sgNoDoubleAlif ! s ! c } ; _ => fixShd word (dec1sg ! s ! c) }) ; @@ -1026,13 +1027,20 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> table { Bare => []; Nom => "ٌ"; - Acc => "ً"; + Acc => "اً"; _Gen => "ٍ" }; _ => caseTbl --think of ?axU, ?axA, (the five nouns) }; + -- if a word ends in ء or ة, don't add alif for indef acc. + dec1sgNoDoubleAlif : State => Case => Str = \\s,c => + case of { + => "ً" ; + _ => dec1sg ! s ! c + }; + --indeclinables (mamnuu3 mina S-Sarf) indecl : Case => Str = table { @@ -1287,7 +1295,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> mkPron : (_,_,_ : Str) -> PerGenNum -> NP = \ana,nI,I,pgn -> { s = table { - Nom => ana; + (Nom|Bare) => ana; Acc => BIND ++ nI; -- object suffix Gen => BIND ++ I; -- possessive suffix Dat => I -- will only be used with preposition لِ, which already has a BIND @@ -1354,8 +1362,18 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> a = np.a ** {isPron=False} -- hack, sometimes we *don't* want prodrop } ; - refl : Case => Str = \\c => "نَفْس" + caseTbl ! c ; + reflPron : Case -> PerGenNum -> Str = \c,pgn -> + let pron : NP = pgn2pron pgn + in "نَفْس" + caseTbl ! c ++ pron.s ! Gen ; + reflV : Verb -> Verb = \v -> v ** { + s = \\vf => case vf of { + VPerf _ pgn => v.s ! vf ++ reflPron Acc pgn ; + VImpf _ _ pgn => v.s ! vf ++ reflPron Acc pgn ; + VImp g n => v.s ! vf ++ reflPron Acc (Per2 g n) ; + VPPart => v.s ! vf ++ reflPron Acc (Per3 Masc Sg) ---- + } + } ; ----------------------------------------------------------------------------- -- IP, questions @@ -1471,7 +1489,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> <_, Past, Pos> => kataba ; <_, Past, Neg> => "لَمْ" ++ yaktub ; <_, Cond, _ > => yaktuba ; - <_, Fut, Pos> => "سَ" ++ yaktubu ; + <_, Fut, Pos> => glue "سَ" yaktubu ; <_, Fut, Neg> => "لَنْ" ++ yaktuba }; pred : ParamX.Tense -> Polarity -> Str = @@ -1616,7 +1634,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> NCard => table { Masc => \\s,c => (sing wAhid) ! s ! c ; --all fem are first declension: - Fem => \\s,c => defArt s c wAhida + dec1sg ! s ! c + Fem => \\s,c => defArt s c wAhida + dec1sgNoDoubleAlif ! s ! c }; NOrd => table { Masc => \\s,c => defArt s c awwal + dec1sg ! s ! c; diff --git a/src/arabic/VerbAra.gf b/src/arabic/VerbAra.gf index e07ff7913..83323dc6d 100644 --- a/src/arabic/VerbAra.gf +++ b/src/arabic/VerbAra.gf @@ -52,7 +52,8 @@ concrete VerbAra of Verb = CatAra ** open Prelude, ResAra, ParamX in { AdvVP vp adv = insertStr adv.s vp ; --- AdVVP adv vp = insertAdV adv.s vp ; + AdVVP adv = insertStr adv.s ; + AdVVPSlash adv vps = vps ** insertStr adv.s vps ; -- -- ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; --