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