mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Ara) improve the solution to handle CN's np field
This commit is contained in:
@@ -29,13 +29,11 @@ lin
|
|||||||
False => determiner c'
|
False => determiner c'
|
||||||
++ noun c'
|
++ noun c'
|
||||||
++ adj c'
|
++ adj c'
|
||||||
++ bindIf cn.np.binds -- ?
|
++ cn.np ! c' ;
|
||||||
++ cn.np.s ! c' ;
|
True => noun (cas c) -- deal with possessive suffix + dative hack
|
||||||
True => noun (cas c) -- deal with possessive suffix
|
|
||||||
++ determiner c'
|
++ determiner c'
|
||||||
++ adj c'
|
++ adj c'
|
||||||
++ bindIf cn.np.binds -- ?
|
++ cn.np ! c'
|
||||||
++ cn.np.s ! c'
|
|
||||||
};
|
};
|
||||||
a = { pgn = agrP3 cn.h cn.g number;
|
a = { pgn = agrP3 cn.h cn.g number;
|
||||||
isPron = False } ;
|
isPron = False } ;
|
||||||
@@ -182,8 +180,7 @@ lin
|
|||||||
Use3N3 n3 = n3 ** {c2 = n3.c3} ;
|
Use3N3 n3 = n3 ** {c2 = n3.c3} ;
|
||||||
|
|
||||||
ComplN2 n2 np = UseN n2 ** {
|
ComplN2 n2 np = UseN n2 ** {
|
||||||
np = {s = \\c => n2.c2.s ++ bindIf n2.c2.binds ++ np.s ! n2.c2.c ;
|
np = \\c => n2.c2.s ++ bindIf n2.c2.binds ++ np.s ! n2.c2.c
|
||||||
binds = False}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;
|
ComplN3 n3 np = ComplN2 n3 np ** {c2 = n3.c3} ;
|
||||||
@@ -201,16 +198,21 @@ lin
|
|||||||
SentCN = \cn,ss -> cn ** {s2 = \\n,d,c => cn.s2 ! n ! d ! c ++ ss.s} ;
|
SentCN = \cn,ss -> cn ** {s2 = \\n,d,c => cn.s2 ! n ! d ! c ++ ss.s} ;
|
||||||
|
|
||||||
ApposCN cn np = cn ** {
|
ApposCN cn np = cn ** {
|
||||||
np = {s = \\c => cn.np.s ! c ++ np.s ! c ;
|
np = \\c => cn.np ! c ++ np.s ! c
|
||||||
binds = False} -- even if it's pron, it shouldn't be a suffix
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : CN -> NP -> CN ; -- house of Paris, house of mine
|
-- : CN -> NP -> CN ; -- house of Paris, house of mine
|
||||||
PossNP cn np = cn ** {
|
PossNP cn np = cn ** {
|
||||||
s = \\n,_d,c => cn.s ! n ! Const ! c ;
|
s = \\n,d,c => cn.s ! n ! case d of {Poss=>d ; _=>Const} ! c ;
|
||||||
s2 = \\n,_d,c => cn.s2 ! n ! Const ! Gen ;
|
s2 = \\n,d,c => cn.s2 ! n ! case d of {Poss=>d ; _=>Const} ! Gen ;
|
||||||
np = {s = \\c => cn.np.s ! c ++ np.s ! Gen ;
|
np = \\c => cn.np ! c
|
||||||
binds = np.a.isPron} ; -- will be weird if the CN's np field already has something. but that'd be weird in any case, binds or not. /IL
|
++ case is1sg np.a of {
|
||||||
|
True => "لَدَي" ++ np.empty ;
|
||||||
|
False =>
|
||||||
|
case np.a.isPron of {
|
||||||
|
True => "لَدَي" ++ BIND ++ np.s ! Gen ;
|
||||||
|
False => np.s ! Gen }
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
-- : CN -> NP -> CN ; -- glass of wine
|
-- : CN -> NP -> CN ; -- glass of wine
|
||||||
|
|||||||
@@ -173,16 +173,15 @@ resource ResAra = PatternsAra ** open Prelude, Predef, OrthoAra, ParamX in {
|
|||||||
uttAP : AP -> (Gender => Str) ;
|
uttAP : AP -> (Gender => Str) ;
|
||||||
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Indef ! Bare ; ----IL
|
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Indef ! Bare ; ----IL
|
||||||
|
|
||||||
CN : Type = Noun ** {np : {s : Case => Str ; binds : Bool}};
|
CN : Type = Noun ** {np : Case => Str};
|
||||||
|
|
||||||
-- All fields of NP
|
-- All fields of NP
|
||||||
cn2str : CN -> Number -> State -> Case -> Str = \cn,n,s,c ->
|
cn2str : CN -> Number -> State -> Case -> Str = \cn,n,s,c ->
|
||||||
cn.s ! n ! s ! c ++
|
cn.s ! n ! s ! c ++
|
||||||
cn.s2 ! n ! s ! c ++
|
cn.s2 ! n ! s ! c ++
|
||||||
bindIf cn.np.binds ++
|
cn.np ! c ;
|
||||||
cn.np.s ! c ;
|
|
||||||
|
|
||||||
useN : Noun -> CN = \n -> n ** {np = {s = \\_ => []; binds = False}} ;
|
useN : Noun -> CN = \n -> n ** {np = \\_ => []} ;
|
||||||
|
|
||||||
uttCN : CN -> (Gender => Str) ;
|
uttCN : CN -> (Gender => Str) ;
|
||||||
uttCN cn = \\_ => cn2str cn Sg Indef Bare ;
|
uttCN cn = \\_ => cn2str cn Sg Indef Bare ;
|
||||||
@@ -1396,6 +1395,8 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
|
|||||||
AAgr = {g : Gender ; n : Number} ;
|
AAgr = {g : Gender ; n : Number} ;
|
||||||
|
|
||||||
agrLite : Agr -> AgrLite = \a -> a ** {gn = pgn2gn a.pgn} ;
|
agrLite : Agr -> AgrLite = \a -> a ** {gn = pgn2gn a.pgn} ;
|
||||||
|
is1sg : Agr -> Bool = \a ->
|
||||||
|
case a.pgn of {Per1 Sing => True; _ => False} ;
|
||||||
|
|
||||||
-----------------------------------------------------------------------------
|
-----------------------------------------------------------------------------
|
||||||
-- NP, Pron
|
-- NP, Pron
|
||||||
|
|||||||
Reference in New Issue
Block a user