mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Ara) elision in only the first word of the CN with liPrep
This commit is contained in:
@@ -20,7 +20,7 @@ concrete ExtendAra of Extend =
|
|||||||
in {
|
in {
|
||||||
|
|
||||||
lin
|
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
|
-- : NP -> NP -> NP
|
||||||
ApposNP np1 np2 = np2 ** {s = \\c => np1.s ! c ++ np2.s ! c} ;
|
ApposNP np1 np2 = np2 ** {s = \\c => np1.s ! c ++ np2.s ! c} ;
|
||||||
|
|||||||
@@ -6,14 +6,11 @@ flags optimize = all ;--noexpand;
|
|||||||
oper
|
oper
|
||||||
|
|
||||||
mkDet : Str -> Number -> State -> Det
|
mkDet : Str -> Number -> State -> Det
|
||||||
= \word,num,state ->
|
= \word,num,state -> baseQuant **
|
||||||
{ s = \\_,_,c => word + caseTbl ! c ;
|
{ s = \\_,_,c => word + caseTbl ! c ;
|
||||||
n = numberToSize num;
|
n = numberToSize num;
|
||||||
d = state; --only Const is used now. check StructuralAra
|
d = state; --only Const is used now. check StructuralAra
|
||||||
is1sg = False;
|
} ;
|
||||||
isNum = False;
|
|
||||||
isPron = False
|
|
||||||
};
|
|
||||||
|
|
||||||
mkPredet : Str -> Bool -> Predet
|
mkPredet : Str -> Bool -> Predet
|
||||||
= \word,decl ->
|
= \word,decl ->
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ lin
|
|||||||
_ => Dl } ;
|
_ => Dl } ;
|
||||||
False => sizeToNumber det.n } ;
|
False => sizeToNumber det.n } ;
|
||||||
determiner : Case -> Str = \c ->
|
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 ->
|
noun : Case -> Str = \c ->
|
||||||
cn.s ! number
|
cn.s ! number
|
||||||
! nounState det.d number
|
! nounState det.d number
|
||||||
@@ -23,16 +23,17 @@ lin
|
|||||||
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
! (definite ! det.d) -- Indef remains Indef, rest become Def
|
||||||
! c
|
! c
|
||||||
} in {
|
} in {
|
||||||
s = \\c =>
|
s = \\c => -- Dat is just a hack for liPrep
|
||||||
case cnB4det det.isPron det.isNum det.n det.d of {
|
let c' = case c of {Dat => Gen ; x => x} in
|
||||||
False => determiner c
|
case cnB4det det of {
|
||||||
++ noun c
|
False => determiner c'
|
||||||
++ adj c
|
++ noun c'
|
||||||
++ cn.np ! c ;
|
++ adj c'
|
||||||
|
++ cn.np ! c' ;
|
||||||
True => noun (cas c) -- deal with possessive suffix
|
True => noun (cas c) -- deal with possessive suffix
|
||||||
++ determiner c -- (nounCase c det.n det.d) --??
|
++ determiner c'
|
||||||
++ adj c
|
++ adj c'
|
||||||
++ cn.np ! c
|
++ cn.np ! c'
|
||||||
};
|
};
|
||||||
a = { pgn = agrP3 cn.h cn.g number;
|
a = { pgn = agrP3 cn.h cn.g number;
|
||||||
isPron = False } ;
|
isPron = False } ;
|
||||||
@@ -81,10 +82,10 @@ lin
|
|||||||
! case d of {Poss => Def ; _ => d}
|
! case d of {Poss => Def ; _ => d}
|
||||||
! c ;
|
! c ;
|
||||||
n = num.n;
|
n = num.n;
|
||||||
isNum = orB num.isNum ord.isNum ;
|
isNum = orB num.isNum ord.isNum ;
|
||||||
-- ord may come from OrdDigits or OrdNumeral
|
-- ord may come from OrdDigits or OrdNumeral
|
||||||
-- num may come from NumCard : Card -> Num
|
-- num may come from NumCard : Card -> Num
|
||||||
|
isEmpty = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuant quant num = quant ** {
|
DetQuant quant num = quant ** {
|
||||||
@@ -95,15 +96,18 @@ lin
|
|||||||
case num.n of {
|
case num.n of {
|
||||||
None => False;
|
None => False;
|
||||||
_ => num.isNum
|
_ => num.isNum
|
||||||
}
|
} ;
|
||||||
|
isEmpty =
|
||||||
|
case quant.isEmpty of {
|
||||||
|
True => notB num.isNum ;
|
||||||
|
_ => False }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = baseQuant ** {
|
||||||
s = \\_,_,_,_ => BIND ++ p.s ! Gen;
|
s = \\_,_,_,_ => BIND ++ p.s ! Gen;
|
||||||
d = Poss;
|
d = Poss;
|
||||||
is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ;
|
is1sg = case p.a.pgn of { Per1 Sing => True ; _ => False } ;
|
||||||
isPron = True;
|
isPron = True} ;
|
||||||
isNum = False } ;
|
|
||||||
|
|
||||||
NumSg = {
|
NumSg = {
|
||||||
s = \\_,_,_ => [] ;
|
s = \\_,_,_ => [] ;
|
||||||
@@ -154,13 +158,15 @@ lin
|
|||||||
DefArt = {
|
DefArt = {
|
||||||
s = \\_,_,_,_ => [];
|
s = \\_,_,_,_ => [];
|
||||||
d = Def ;
|
d = Def ;
|
||||||
isNum,isPron,is1sg = False
|
isNum,isPron,is1sg = False ;
|
||||||
|
isEmpty = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
s = \\_,_,_,_ => [];
|
s = \\_,_,_,_ => [];
|
||||||
d = Indef ;
|
d = Indef ;
|
||||||
isNum,isPron,is1sg = False
|
isNum,isPron,is1sg = False ;
|
||||||
|
isEmpty = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassNP cn =
|
MassNP cn =
|
||||||
|
|||||||
@@ -1155,7 +1155,6 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
--declension 2 (ends in yaa')
|
--declension 2 (ends in yaa')
|
||||||
dec2sg : State => Case => Str = \\s,c =>
|
dec2sg : State => Case => Str = \\s,c =>
|
||||||
case <s,c> of {
|
case <s,c> of {
|
||||||
<_, Bare> => [] ;
|
|
||||||
<Indef,Acc> => "ِياً" ;
|
<Indef,Acc> => "ِياً" ;
|
||||||
<Indef> => "ٍ" ;
|
<Indef> => "ٍ" ;
|
||||||
<_, Acc> => "ِيَ" ;
|
<_, Acc> => "ِيَ" ;
|
||||||
@@ -1311,13 +1310,14 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
-- e.g. some determiners act as adjectives modifying the noun they count
|
-- e.g. some determiners act as adjectives modifying the noun they count
|
||||||
-- 'the three children, two children'
|
-- 'the three children, two children'
|
||||||
-- e.g. possesive pronouns: his book ('kitaabuhu'
|
-- e.g. possesive pronouns: his book ('kitaabuhu'
|
||||||
cnB4det : Bool -> Bool -> Size -> State -> Bool = \isPron,isNum,s,d ->
|
cnB4det : Det -> Bool = \det ->
|
||||||
case <isPron,isNum,s,d> of {
|
case <det.isEmpty,det.isPron,det.isNum,det.n,det.d> of {
|
||||||
<True,_,_,_> => True;
|
<True,_,_,_,_> => True; -- hack to make liPrep work
|
||||||
<_,False,_,_> => False; --non-numerals
|
<_,True,_,_,_> => True;
|
||||||
<_,True,_,Def> => True; --definite numbers act as adjectives
|
<_,_,False,_,_> => False; --non-numerals
|
||||||
<_,True,Two,_> => True; --numerals one and two always adjectives
|
<_,_,True,_,Def> => True; --definite numbers act as adjectives
|
||||||
<_,True,One,_> => True; --numerals one and two always adjectives
|
<_,_,True,Two,_> => True; --numerals one and two always adjectives
|
||||||
|
<_,_,True,One,_> => True; --numerals one and two always adjectives
|
||||||
_ => False
|
_ => False
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1369,10 +1369,11 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
isNum : Bool;
|
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
|
--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 ;
|
baseQuant = { d = Indef ;
|
||||||
is1sg,isNum,isPron = False } ;
|
is1sg,isNum,isPron,isEmpty = False } ;
|
||||||
|
|
||||||
Quant : Type = BaseQuant ** {
|
Quant : Type = BaseQuant ** {
|
||||||
s : ResAra.Number => Species => Gender => Case => Str
|
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
|
True => noPrep ; -- to prevent weird stuff with VVs, might be overly specific
|
||||||
_ => vp.sc }
|
_ => vp.sc }
|
||||||
} ;
|
} ;
|
||||||
subj = np.empty ++ sc.s
|
subj = np.empty ++ sc.s ++ bindIf sc.binds
|
||||||
++ case vp.isPred of {
|
++ case vp.isPred of {
|
||||||
False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative
|
False => (proDrop np).s ! sc.c ; -- prodrop if it's not predicative
|
||||||
True => np.s ! sc.c
|
True => np.s ! sc.c
|
||||||
|
|||||||
Reference in New Issue
Block a user