diff --git a/src/arabic/ExtendAra.gf b/src/arabic/ExtendAra.gf index c59d6de58..4e230204b 100644 --- a/src/arabic/ExtendAra.gf +++ b/src/arabic/ExtendAra.gf @@ -20,7 +20,7 @@ concrete ExtendAra of Extend = in { lin - GenNP np = {s = \\_,_,_,_ => np.s ! Gen ; d = Const ; isNum,isPron,is1sg = False} ; + GenNP np = baseQuant ** {s = \\_,_,_,_ => np.s ! Gen ; d = Const} ; -- : NP -> NP -> NP ApposNP np1 np2 = np2 ** {s = \\c => np1.s ! c ++ np2.s ! c} ; diff --git a/src/arabic/MorphoAra.gf b/src/arabic/MorphoAra.gf index 5d0a06572..981534d0b 100644 --- a/src/arabic/MorphoAra.gf +++ b/src/arabic/MorphoAra.gf @@ -6,14 +6,11 @@ flags optimize = all ;--noexpand; oper mkDet : Str -> Number -> State -> Det - = \word,num,state -> + = \word,num,state -> baseQuant ** { s = \\_,_,c => word + caseTbl ! c ; n = numberToSize num; d = state; --only Const is used now. check StructuralAra - is1sg = False; - isNum = False; - isPron = False - }; + } ; mkPredet : Str -> Bool -> Predet = \word,decl -> diff --git a/src/arabic/NounAra.gf b/src/arabic/NounAra.gf index 55e5f2944..ab3837ae4 100644 --- a/src/arabic/NounAra.gf +++ b/src/arabic/NounAra.gf @@ -13,7 +13,7 @@ lin _ => Dl } ; False => sizeToNumber det.n } ; determiner : Case -> Str = \c -> - det.s ! cn.h ! (detGender cn.g det.n) ! c ; + det.s ! cn.h ! detGender cn.g det.n ! c ; noun : Case -> Str = \c -> cn.s ! number ! nounState det.d number @@ -23,16 +23,17 @@ lin ! (definite ! det.d) -- Indef remains Indef, rest become Def ! c } in { - s = \\c => - case cnB4det det.isPron det.isNum det.n det.d of { - False => determiner c - ++ noun c - ++ adj c - ++ cn.np ! c ; + s = \\c => -- Dat is just a hack for liPrep + let c' = case c of {Dat => Gen ; x => x} in + case cnB4det det of { + False => determiner c' + ++ noun c' + ++ adj c' + ++ cn.np ! c' ; True => noun (cas c) -- deal with possessive suffix - ++ determiner c -- (nounCase c det.n det.d) --?? - ++ adj c - ++ cn.np ! c + ++ determiner c' + ++ adj c' + ++ cn.np ! c' }; a = { pgn = agrP3 cn.h cn.g number; isPron = False } ; @@ -81,10 +82,10 @@ lin ! case d of {Poss => Def ; _ => d} ! c ; n = num.n; - isNum = orB num.isNum ord.isNum ; + isNum = orB num.isNum ord.isNum ; -- ord may come from OrdDigits or OrdNumeral -- num may come from NumCard : Card -> Num - + isEmpty = False } ; DetQuant quant num = quant ** { @@ -95,15 +96,18 @@ lin case num.n of { None => False; _ => num.isNum - } + } ; + isEmpty = + case quant.isEmpty of { + True => notB num.isNum ; + _ => False } } ; - PossPron p = { + PossPron p = baseQuant ** { s = \\_,_,_,_ => BIND ++ p.s ! Gen; d = Poss; is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ; - isPron = True; - isNum = False } ; + isPron = True} ; NumSg = { s = \\_,_,_ => [] ; @@ -154,13 +158,15 @@ lin DefArt = { s = \\_,_,_,_ => []; d = Def ; - isNum,isPron,is1sg = False + isNum,isPron,is1sg = False ; + isEmpty = True } ; IndefArt = { s = \\_,_,_,_ => []; d = Indef ; - isNum,isPron,is1sg = False + isNum,isPron,is1sg = False ; + isEmpty = True } ; MassNP cn = diff --git a/src/arabic/ResAra.gf b/src/arabic/ResAra.gf index b2cf6cbf6..5a5f244ca 100644 --- a/src/arabic/ResAra.gf +++ b/src/arabic/ResAra.gf @@ -1155,7 +1155,6 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> --declension 2 (ends in yaa') dec2sg : State => Case => Str = \\s,c => case of { - <_, Bare> => [] ; => "ِياً" ; => "ٍ" ; <_, Acc> => "ِيَ" ; @@ -1311,13 +1310,14 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> -- e.g. some determiners act as adjectives modifying the noun they count -- 'the three children, two children' -- e.g. possesive pronouns: his book ('kitaabuhu' - cnB4det : Bool -> Bool -> Size -> State -> Bool = \isPron,isNum,s,d -> - case of { - => True; - <_,False,_,_> => False; --non-numerals - <_,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 + cnB4det : Det -> Bool = \det -> + case of { + => True; -- hack to make liPrep work + <_,True,_,_,_> => True; + <_,_,False,_,_> => False; --non-numerals + <_,_,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 }; @@ -1369,10 +1369,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> isNum : Bool; -- for genitive pronouns (suffixes). if true, then "cn ++ det" --should be used instead of "det ++ cn" when constructing the NP - isPron: Bool} ; + isPron: Bool; + isEmpty: Bool} ; -- to know if liPrep should attach to the noun baseQuant = { d = Indef ; - is1sg,isNum,isPron = False } ; + is1sg,isNum,isPron,isEmpty = False } ; Quant : Type = BaseQuant ** { s : ResAra.Number => Species => Gender => Case => Str @@ -1614,7 +1615,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf -> True => noPrep ; -- to prevent weird stuff with VVs, might be overly specific _ => vp.sc } } ; - subj = np.empty ++ sc.s + subj = np.empty ++ sc.s ++ bindIf sc.binds ++ case vp.isPred of { False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative True => np.s ! sc.c