mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Som) Add empty Str field to NP so every NP contributes with some string
Otherwise parsing sentences with pronoun objects gives metavariables.
This commit is contained in:
@@ -44,7 +44,8 @@ DetCN det cn = useN cn ** {
|
||||
-- : PN -> NP ;
|
||||
UsePN pn = pn ** {
|
||||
s = \\c => pn.s ;
|
||||
isPron = False
|
||||
isPron = False ;
|
||||
empty = [] ;
|
||||
} ;
|
||||
|
||||
-- : Pron -> NP ;
|
||||
@@ -73,7 +74,7 @@ DetCN det cn = useN cn ** {
|
||||
-- Determiners can form noun phrases directly.
|
||||
|
||||
-- : Det -> NP ;
|
||||
DetNP det = {
|
||||
DetNP det = emptyNP ** {
|
||||
s = det.sp ! Masc ; ---- Any way to decide for gender here?
|
||||
a = getAgr det.n Masc ;
|
||||
isPron = False ;
|
||||
|
||||
@@ -136,6 +136,7 @@ oper
|
||||
BaseNP : Type = {
|
||||
a : Agreement ;
|
||||
isPron : Bool ;
|
||||
empty : Str ;
|
||||
} ;
|
||||
|
||||
NounPhrase : Type = BaseNP ** {s : Case => Str} ;
|
||||
@@ -143,12 +144,14 @@ oper
|
||||
useN : Noun -> CNoun ** BaseNP = \n -> n **
|
||||
{ mod = \\_,_ => [] ; hasMod = False ;
|
||||
a = Sg3 (gender n) ; isPron,isPoss = False ;
|
||||
empty = [] ;
|
||||
} ;
|
||||
|
||||
emptyNP : NounPhrase = {
|
||||
s = \\_ => [] ;
|
||||
a = Pl3 ;
|
||||
isPron = False
|
||||
isPron = False ;
|
||||
empty = [] ;
|
||||
} ;
|
||||
|
||||
impersNP : NounPhrase = emptyNP ** {
|
||||
@@ -172,46 +175,55 @@ oper
|
||||
Sg1 => {
|
||||
s = table {Nom => "aan" ; Abs => "i"} ;
|
||||
a = Sg1 ; isPron = True ; sp = "aniga" ;
|
||||
empty = [] ;
|
||||
poss = {s = quantTable "ayg" "ayd" ; short = quantTable "ay" ; sp = gnTable "ayg" "ayd" "uwayg"}
|
||||
} ;
|
||||
Sg2 => {
|
||||
s = table {Nom => "aad" ; Abs => "ku"} ;
|
||||
a = Sg2 ; isPron = True ; sp ="adiga" ;
|
||||
empty = [] ;
|
||||
poss = {s = quantTable "aag" "aad" ; short = quantTable "aa" ; sp = gnTable "aag" "aad" "uwaag"}
|
||||
} ;
|
||||
Sg3 Masc => {
|
||||
s = table {Nom => "uu" ; Abs => []} ;
|
||||
a = Sg3 Masc ; isPron = True ; sp ="isaga" ;
|
||||
empty = [] ;
|
||||
poss = {s, short = quantTable "iis" ; sp = gnTable "iis" "iis" "uwiis"}
|
||||
} ;
|
||||
Sg3 Fem => {
|
||||
s = table {Nom => "ay" ; Abs => []} ;
|
||||
a = Sg3 Fem ; isPron = True ; sp = "iyada" ;
|
||||
empty = [] ;
|
||||
poss = {s, short = quantTable "eed" ; sp = gnTable "eed" "eed" "uweed"}
|
||||
} ;
|
||||
Pl1 Excl => {
|
||||
s = table {Nom => "aan" ; Abs => "na"} ;
|
||||
a = Pl1 Excl ; isPron = True ; sp ="annaga" ;
|
||||
empty = [] ;
|
||||
poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"}
|
||||
} ;
|
||||
Pl1 Incl => {
|
||||
s = table {Nom => "aynu" ; Abs => "ina"} ;
|
||||
a = Pl1 Incl ; isPron = True ; sp ="innaga" ;
|
||||
empty = [] ;
|
||||
poss = {s = quantTable "eenn" ; short = quantTable "een" ; sp = gnTable "eenn" "eenn" "uweenn"}
|
||||
} ;
|
||||
Pl2 => {
|
||||
s = table {Nom => "aad" ; Abs => "idin"} ;
|
||||
a = Pl2 ; isPron = True ; sp ="idinka" ;
|
||||
empty = [] ;
|
||||
poss = {s = quantTable "iinn" ; short = quantTable "iin" ; sp = gnTable "iinn" "iinn" "uwiinn"}
|
||||
} ;
|
||||
Pl3 => {
|
||||
s = table {Nom => "ay" ; Abs => []} ;
|
||||
a = Pl3 ; isPron = True ; sp = "iyaga" ;
|
||||
empty = [] ;
|
||||
poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"}
|
||||
} ;
|
||||
Impers => {
|
||||
s = table {Nom => "la" ; Abs => "??"} ;
|
||||
a = Impers ; isPron = True ; sp = "??" ;
|
||||
empty = [] ;
|
||||
poss = {s, short = quantTable "??" ; sp = gnTable "??" "??" "??"}
|
||||
}
|
||||
} ;
|
||||
@@ -684,8 +696,8 @@ oper
|
||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
||||
let noun : Str = case <np.isPron,np.a> of {
|
||||
<False,_> => np.s ! Abs ;
|
||||
-- <True,(Sg3 _|Pl3)> => (pronTable ! np.a).sp ; -- uncomment if you want to add long object pronoun for 3rd person object
|
||||
_ => [] } -- no long object for other pronouns
|
||||
-- <True,(Sg3 _|Pl3)> => np.empty ++ (pronTable ! np.a).sp ; -- uncomment if you want to add long object pronoun for 3rd person object
|
||||
_ => np.empty } -- no long object for other pronouns
|
||||
in case vp.obj2.a of {
|
||||
Unassigned =>
|
||||
vp ** {obj2 = {
|
||||
|
||||
Reference in New Issue
Block a user