forked from GitHub/gf-core
Adv added to Cl instead of VP reduces ambiguity but needs some work to restore coverage.
This commit is contained in:
@@ -40,8 +40,8 @@ fun
|
||||
PassUseV : Temp -> Pol -> (a : Arg) -> V (aNP a) -> VP a ;
|
||||
AgentPassUseV : Temp -> Pol -> (a : Arg) -> V (aNP a) -> NP -> VP a ;
|
||||
|
||||
SlashVNP : (a : Arg) -> VP (aNP a) -> NP -> VP a ; -- consuming first NP
|
||||
SlashVNP2 : (a : Arg) -> VP (aNP (aNP a)) -> NP -> VP (aNP a) ; -- consuming second NP
|
||||
SlashV2 : (a : Arg) -> VP (aNP a) -> NP -> VP a ; -- consuming first NP
|
||||
SlashV3 : (a : Arg) -> VP (aNP (aNP a)) -> NP -> VP (aNP a) ; -- consuming second NP
|
||||
ComplVS : (a : Arg) -> VP aS -> Cl a -> VP a ;
|
||||
ComplVV : (a : Arg) -> VP aV -> VP a -> VP a ;
|
||||
ComplVQ : (a : Arg) -> VP aQ -> QCl a -> VP a ;
|
||||
@@ -60,10 +60,6 @@ fun
|
||||
PrepCl : Prep -> (a : Arg) -> Cl a -> Cl (aNP a) ; -- slash creation (S/NP): hon tittar på (oss)
|
||||
SlashClNP : (a : Arg) -> Cl (aNP a) -> NP -> Cl a ; -- slash consumption: hon tittar på + oss
|
||||
|
||||
AdvVP : Adv -> (a : Arg) -> VP a -> VP a ; ---- these create many ambiguities
|
||||
AdVVP : AdV -> (a : Arg) -> VP a -> VP a ;
|
||||
---- "hon tvingar oss att sova idag": 196 parses, 13s. With AdvVP restricted to top level: 32 parses, 7s
|
||||
|
||||
ReflVP : (a : Arg) -> VP (aNP a) -> VP a ; -- refl on first position (direct object)
|
||||
ReflVP2 : (a : Arg) -> VP (aNP (aNP a)) -> VP (aNP a) ; -- refl on second position (indirect object)
|
||||
|
||||
@@ -77,6 +73,17 @@ fun
|
||||
|
||||
UttS : S -> Utt ;
|
||||
|
||||
-- when to add adverbs
|
||||
|
||||
---- AdvVP : Adv -> (a : Arg) -> VP a -> VP a ; ---- these create many ambiguities
|
||||
---- AdVVP : AdV -> (a : Arg) -> VP a -> VP a ;
|
||||
---- "hon tvingar oss att sova idag": 196 parses, 13s. With AdvVP restricted to top level: 32 parses, 7s
|
||||
---- with AdvCl, just 16 parses, 0.2 s
|
||||
|
||||
AdvCl : Adv -> (a : Arg) -> Cl a -> Cl a ;
|
||||
AdVCl : AdV -> (a : Arg) -> Cl a -> Cl a ;
|
||||
|
||||
|
||||
-- participles as adjectives
|
||||
|
||||
PresPartAP : (a : Arg) -> V a -> AP a ;
|
||||
|
||||
@@ -243,7 +243,7 @@ lin
|
||||
c2 = vp.c2 ;
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = <\\a => ap.s ! a,vp.obj2.p2> ; ---- adjForm
|
||||
obj2 = <\\a => ap.s ! a ++ ap.obj1 ! a, vp.obj2.p2> ; ---- adjForm
|
||||
adV = vp.adV ;
|
||||
adv = vp.adv ;
|
||||
ext = vp.ext ;
|
||||
@@ -256,7 +256,7 @@ lin
|
||||
c2 = vp.c2 ;
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = <\\a => cn.s ! a,vp.obj2.p2> ; ---- cnForm
|
||||
obj2 = <\\a => cn.s ! a ++ cn.obj1 ! a, vp.obj2.p2> ; ---- cnForm
|
||||
adV = vp.adV ;
|
||||
adv = vp.adv ;
|
||||
ext = vp.ext ;
|
||||
@@ -308,7 +308,7 @@ lin
|
||||
c2 = vp.c2 ; ---- consumed
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = <\\a => ap.s ! a, vp.obj2.p2> ; ---- adjForm
|
||||
obj2 = <\\a => ap.s ! a ++ ap.obj1 ! a, vp.obj2.p2> ; ---- adjForm
|
||||
adV = vp.adV ;
|
||||
adv = vp.adv ;
|
||||
ext = vp.ext ;
|
||||
@@ -321,38 +321,12 @@ lin
|
||||
c2 = vp.c2 ; ---- consumed
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = <\\a => vp.c2 ++ cn.s ! a, vp.obj2.p2> ; ---- cn form
|
||||
obj2 = <\\a => cn.s ! a ++ cn.obj1 ! a, vp.obj2.p2> ; ---- cn form
|
||||
adV = vp.adV ;
|
||||
adv = vp.adv ;
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
AdvVP adv x vp = {
|
||||
v = vp.v ;
|
||||
inf = vp.inf ;
|
||||
c1 = vp.c1 ;
|
||||
c2 = vp.c2 ;
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = vp.obj2 ;
|
||||
adV = vp.adV ;
|
||||
adv = vp.adv ++ adv.s ; ---- all adverbs become one field - how to front one of them?
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
AdVVP adv _ vp = {
|
||||
v = vp.v ;
|
||||
inf = vp.inf ;
|
||||
c1 = vp.c1 ;
|
||||
c2 = vp.c2 ;
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = vp.obj2 ;
|
||||
adV = vp.adV ++ adv.s ; ---- all adV's become one field - how to front one of them?
|
||||
adv = vp.adv ;
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
ReflVP x vp = {
|
||||
v = vp.v ;
|
||||
inf = vp.inf ;
|
||||
@@ -466,6 +440,65 @@ lin
|
||||
|
||||
UttS s = s ;
|
||||
|
||||
AdvCl a x cl = {
|
||||
subj = cl.subj ;
|
||||
v = cl.v ;
|
||||
inf = cl.inf ;
|
||||
adj = cl.adj ;
|
||||
obj1 = cl.obj1 ;
|
||||
obj2 = cl.obj2 ;
|
||||
adV = cl.adV ;
|
||||
adv = cl.adv ++ a.s ;
|
||||
ext = cl.ext ;
|
||||
c3 = cl.c3 ;
|
||||
} ;
|
||||
|
||||
AdVCl a x cl = {
|
||||
subj = cl.subj ;
|
||||
v = cl.v ;
|
||||
inf = cl.inf ;
|
||||
adj = cl.adj ;
|
||||
obj1 = cl.obj1 ;
|
||||
obj2 = cl.obj2 ;
|
||||
adV = cl.adV ++ a.s ;
|
||||
adv = cl.adv ;
|
||||
ext = cl.ext ;
|
||||
c3 = cl.c3 ;
|
||||
} ;
|
||||
|
||||
|
||||
{-
|
||||
AdvVP adv x vp = {
|
||||
v = vp.v ;
|
||||
inf = vp.inf ;
|
||||
c1 = vp.c1 ;
|
||||
c2 = vp.c2 ;
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = vp.obj2 ;
|
||||
adV = vp.adV ;
|
||||
adv = vp.adv ++ adv.s ; ---- all adverbs become one field - how to front one of them?
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
|
||||
AdVVP adv _ vp = {
|
||||
v = vp.v ;
|
||||
inf = vp.inf ;
|
||||
c1 = vp.c1 ;
|
||||
c2 = vp.c2 ;
|
||||
adj = vp.adj ;
|
||||
obj1 = vp.obj1 ;
|
||||
obj2 = vp.obj2 ;
|
||||
adV = vp.adV ++ adv.s ; ---- all adV's become one field - how to front one of them?
|
||||
adv = vp.adv ;
|
||||
ext = vp.ext ;
|
||||
} ;
|
||||
-}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
PresPartAP x v = {
|
||||
s = \\a => v.v ! PresPart ;
|
||||
c1 = v.c1 ; -- tittande på henne
|
||||
@@ -641,7 +674,7 @@ oper
|
||||
|
||||
questSubordCl : QCl -> Str = \cl ->
|
||||
let
|
||||
rest = cl.subj ++ cl.adV ++ cl.v.p1 ++ (cl.v.p2 | []) ++ restCl cl
|
||||
rest = cl.subj ++ cl.adV ++ cl.v.p1 ++ (cl.v.p2 | []) ++ restCl cl
|
||||
in case cl.focType of {
|
||||
NoFoc => "om" ++ cl.foc ++ rest ; -- om hon sover
|
||||
FocObj => cl.foc ++ rest ; -- vem älskar hon / varför hon sover
|
||||
@@ -651,7 +684,7 @@ oper
|
||||
that_Compl : Str = "att" | [] ;
|
||||
|
||||
-- this part is usually the same in all reconfigurations
|
||||
restCl : Clause -> Str = \cl -> cl.v.p3 ++ cl.adj ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext ;
|
||||
restCl : Clause -> Str = \cl -> cl.v.p3 ++ cl.adj ++ cl.obj1 ++ cl.obj2 ++ cl.adv ++ cl.ext ++ cl.c3 ;
|
||||
|
||||
agentCase : ComplCase = "av" ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user