forked from GitHub/gf-core
Predication: factored out Prep as Adv/NP; added linref's to test with chunking
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
abstract Pred = Cat [Ant,Tense,Pol,NP,Utt,IP,IAdv,Conj,Prep] ** {
|
abstract Pred = Cat [Ant,Tense,Pol,NP,Utt,IP,IAdv,Conj] ** {
|
||||||
|
|
||||||
cat
|
cat
|
||||||
Arg ;
|
Arg ;
|
||||||
@@ -12,13 +12,12 @@ cat
|
|||||||
ClC Arg ; -- conjunction of Cl
|
ClC Arg ; -- conjunction of Cl
|
||||||
PrQCl Arg ;
|
PrQCl Arg ;
|
||||||
-- NP ;
|
-- NP ;
|
||||||
PrAdv ;
|
PrAdv Arg ;
|
||||||
PrS ;
|
PrS ;
|
||||||
-- Utt ;
|
-- Utt ;
|
||||||
PrAP Arg ;
|
PrAP Arg ;
|
||||||
PrCN Arg ; -- the country he became the president of
|
PrCN Arg ; -- the country he became the president of
|
||||||
-- IP ;
|
-- IP ;
|
||||||
-- Prep ;
|
|
||||||
-- Conj ;
|
-- Conj ;
|
||||||
-- IAdv ;
|
-- IAdv ;
|
||||||
|
|
||||||
@@ -50,7 +49,6 @@ fun
|
|||||||
|
|
||||||
PredVP : (a : Arg) -> NP -> PrVP a -> PrCl a ;
|
PredVP : (a : Arg) -> NP -> PrVP a -> PrCl a ;
|
||||||
|
|
||||||
PrepCl : Prep -> (a : Arg) -> PrCl a -> PrCl (aNP a) ; -- slash creation (S/NP): hon tittar på (oss)
|
|
||||||
SlashClNP : (a : Arg) -> PrCl (aNP a) -> NP -> PrCl a ; -- slash consumption: hon tittar på + oss
|
SlashClNP : (a : Arg) -> PrCl (aNP a) -> NP -> PrCl a ; -- slash consumption: hon tittar på + oss
|
||||||
|
|
||||||
ReflVP : (a : Arg) -> PrVP (aNP a) -> PrVP a ; -- refl on first position (direct object)
|
ReflVP : (a : Arg) -> PrVP (aNP a) -> PrVP a ; -- refl on first position (direct object)
|
||||||
@@ -64,20 +62,13 @@ fun
|
|||||||
UseCl : PrCl aNone -> PrS ;
|
UseCl : PrCl aNone -> PrS ;
|
||||||
UseQCl : PrQCl aNone -> PrS ; -- deprecate QS
|
UseQCl : PrQCl aNone -> PrS ; -- deprecate QS
|
||||||
|
|
||||||
UseAdvCl : PrAdv -> PrCl aNone -> PrS ; -- lift adv to front
|
UseAdvCl : PrAdv aNone -> PrCl aNone -> PrS ; -- lift adv to front
|
||||||
|
|
||||||
UttS : PrS -> Utt ;
|
UttS : PrS -> Utt ;
|
||||||
|
|
||||||
-- when to add adverbs
|
AdvCl : (a : Arg) -> PrAdv a -> PrCl aNone -> PrCl a ;
|
||||||
|
|
||||||
---- AdvVP : Adv -> (a : Arg) -> PrVP a -> PrVP a ; ---- these create many ambiguities
|
|
||||||
---- "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) -> PrCl a -> PrCl a ;
|
|
||||||
|
|
||||||
AdvQCl : Adv -> (a : Arg) -> PrQCl a -> PrQCl a ;
|
|
||||||
|
|
||||||
|
AdvQCl : (a : Arg) -> PrAdv a -> PrQCl aNone -> PrQCl a ;
|
||||||
|
|
||||||
-- participles as adjectives
|
-- participles as adjectives
|
||||||
|
|
||||||
@@ -96,5 +87,6 @@ fun
|
|||||||
ContClC : (a : Arg) -> PrCl a -> ClC a -> ClC a ;
|
ContClC : (a : Arg) -> PrCl a -> ClC a -> ClC a ;
|
||||||
UseClC : (a : Arg) -> ClC a -> PrCl a ;
|
UseClC : (a : Arg) -> ClC a -> PrCl a ;
|
||||||
|
|
||||||
|
ComplAdv : (a : Arg) -> PrAdv (aNP a) -> NP -> PrAdv a ; -- typically: formation of preposition phrase
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -170,7 +170,7 @@ lincat
|
|||||||
c3 : ComplCase ;
|
c3 : ComplCase ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrAdv = {s : Str ; isAdV : Bool} ;
|
PrAdv = {s : Str ; isAdV : Bool ; c1 : Str} ;
|
||||||
PrS = {s : Str} ;
|
PrS = {s : Str} ;
|
||||||
|
|
||||||
PrAP = {
|
PrAP = {
|
||||||
@@ -189,11 +189,28 @@ lincat
|
|||||||
-- language specific
|
-- language specific
|
||||||
NP = {s : NPCase => Str ; a : Agr} ;
|
NP = {s : NPCase => Str ; a : Agr} ;
|
||||||
IP = {s : NPCase => Str ; n : IPAgr} ; ---- n : Number in Eng
|
IP = {s : NPCase => Str ; n : IPAgr} ; ---- n : Number in Eng
|
||||||
Prep = {s : Str} ;
|
|
||||||
Conj = {s1,s2 : Str ; n : Number} ;
|
Conj = {s1,s2 : Str ; n : Number} ;
|
||||||
-}
|
-}
|
||||||
|
|
||||||
|
|
||||||
|
-- reference linearizations for chunking
|
||||||
|
|
||||||
|
linref
|
||||||
|
PrVP = \vp ->
|
||||||
|
let
|
||||||
|
agr = defaultAgr ;
|
||||||
|
vagr = agr2vagr agr ;
|
||||||
|
verb = vp.v ! vagr ;
|
||||||
|
in
|
||||||
|
verb.p1 ++ verb.p2 ++ vp.adV ++ verb.p3 ++ vp.part ++
|
||||||
|
vp.adj ! agr ++ vp.obj1.p1 ! agr ++ vp.obj2.p1 ! agr ++ vp.adv ++ vp.ext ;
|
||||||
|
|
||||||
|
PrCl = \cl -> declCl cl ;
|
||||||
|
---- PrQCl = \qcl -> questCl (lin PrQCl qcl) ;
|
||||||
|
PrAdv = \adv -> adv.c1 ++ adv.s ;
|
||||||
|
PrAP = \ap -> ap.s ! UUnit ++ ap.obj1 ! defaultAgr ;
|
||||||
|
PrCN = \cn -> cn.s ! Sg ++ cn.obj1 ! defaultAgr ;
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
--- linearization rules ----
|
--- linearization rules ----
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|||||||
@@ -15,13 +15,12 @@ cat
|
|||||||
ClC Arg ; -- conjunction of Cl
|
ClC Arg ; -- conjunction of Cl
|
||||||
QCl Arg ;
|
QCl Arg ;
|
||||||
NP ;
|
NP ;
|
||||||
Adv ;
|
Adv Arg ; -- preposition is Adv aNP
|
||||||
S ;
|
S ;
|
||||||
Utt ;
|
Utt ;
|
||||||
AP Arg ;
|
AP Arg ;
|
||||||
CN Arg ; -- the country he became the president of
|
CN Arg ; -- the country he became the president of
|
||||||
IP ;
|
IP ;
|
||||||
Prep ;
|
|
||||||
Conj ;
|
Conj ;
|
||||||
IAdv ;
|
IAdv ;
|
||||||
|
|
||||||
@@ -53,8 +52,7 @@ fun
|
|||||||
|
|
||||||
PredVP : (a : Arg) -> NP -> VP a -> Cl a ;
|
PredVP : (a : Arg) -> NP -> VP a -> Cl a ;
|
||||||
|
|
||||||
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
|
||||||
SlashClNP : (a : Arg) -> Cl (aNP a) -> NP -> Cl a ; -- slash consumption: hon tittar på + oss
|
|
||||||
|
|
||||||
ReflVP : (a : Arg) -> VP (aNP a) -> VP a ; -- refl on first position (direct object)
|
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)
|
ReflVP2 : (a : Arg) -> VP (aNP (aNP a)) -> VP (aNP a) ; -- refl on second position (indirect object)
|
||||||
@@ -67,7 +65,7 @@ fun
|
|||||||
UseCl : Cl aNone -> S ;
|
UseCl : Cl aNone -> S ;
|
||||||
UseQCl : QCl aNone -> S ; -- deprecate QS
|
UseQCl : QCl aNone -> S ; -- deprecate QS
|
||||||
|
|
||||||
UseAdvCl : Adv -> Cl aNone -> S ; -- lift adv to front
|
UseAdvCl : Adv aNone -> Cl aNone -> S ; -- lift adv to front
|
||||||
|
|
||||||
UttS : S -> Utt ;
|
UttS : S -> Utt ;
|
||||||
|
|
||||||
@@ -77,9 +75,9 @@ fun
|
|||||||
---- "hon tvingar oss att sova idag": 196 parses, 13s. With AdvVP restricted to top level: 32 parses, 7s
|
---- "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
|
---- with AdvCl, just 16 parses, 0.2 s
|
||||||
|
|
||||||
AdvCl : Adv -> (a : Arg) -> Cl a -> Cl a ;
|
AdvCl : (a : Arg) -> Adv a -> Cl aNone -> Cl a ;
|
||||||
|
|
||||||
AdvQCl : Adv -> (a : Arg) -> QCl a -> QCl a ;
|
AdvQCl : (a : Arg) -> Adv a -> QCl aNone -> QCl a ;
|
||||||
|
|
||||||
|
|
||||||
-- participles as adjectives
|
-- participles as adjectives
|
||||||
@@ -99,9 +97,10 @@ fun
|
|||||||
ContClC : (a : Arg) -> Cl a -> ClC a -> ClC a ;
|
ContClC : (a : Arg) -> Cl a -> ClC a -> ClC a ;
|
||||||
UseClC : (a : Arg) -> ClC a -> Cl a ;
|
UseClC : (a : Arg) -> ClC a -> Cl a ;
|
||||||
|
|
||||||
|
ComplAdv : (a : Arg) -> Adv (aNP a) -> NP -> Adv a ; -- typically: formation of preposition phrase
|
||||||
|
|
||||||
--------------- from now on, to be inherited from standard RGL; here just for test purposes
|
--------------- from now on, to be inherited from standard RGL; here just for test purposes
|
||||||
|
|
||||||
PrepNP : Prep -> NP -> Adv ;
|
|
||||||
|
|
||||||
-- lexicon
|
-- lexicon
|
||||||
|
|
||||||
@@ -132,11 +131,11 @@ fun
|
|||||||
she_NP : NP ;
|
she_NP : NP ;
|
||||||
we_NP : NP ;
|
we_NP : NP ;
|
||||||
|
|
||||||
today_Adv : Adv ;
|
today_Adv : Adv aNone ;
|
||||||
always_AdV : Adv ;
|
always_AdV : Adv aNone ;
|
||||||
who_IP : IP ;
|
who_IP : IP ;
|
||||||
|
|
||||||
with_Prep : Prep ;
|
with_Prep : Adv (aNP aNone) ;
|
||||||
and_Conj : Conj ;
|
and_Conj : Conj ;
|
||||||
why_IAdv : IAdv ;
|
why_IAdv : IAdv ;
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ lincat
|
|||||||
c3 : ComplCase ;
|
c3 : ComplCase ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Adv = {s : Str ; isAdV : Bool} ;
|
Adv = {s : Str ; isAdV : Bool ; c1 : ComplCase} ;
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
|
|
||||||
AP = {
|
AP = {
|
||||||
@@ -183,7 +183,6 @@ lincat
|
|||||||
|
|
||||||
NP = NounPhrase ;
|
NP = NounPhrase ;
|
||||||
IP = {s : NPCase => Str ; n : IPAgr} ; ---- n : Number in Eng
|
IP = {s : NPCase => Str ; n : IPAgr} ; ---- n : Number in Eng
|
||||||
Prep = Preposition ;
|
|
||||||
Conj = {s1,s2 : Str ; n : Number} ;
|
Conj = {s1,s2 : Str ; n : Number} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
@@ -344,19 +343,30 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
QuestSlash x ip cl =
|
QuestSlash x ip cl =
|
||||||
let
|
let
|
||||||
ips = cl.c3 ++ ip.s ! objCase ; -- in Cl/NP, c3 is the only prep ---- appComplCase for ip
|
prep = cl.c3 ;
|
||||||
|
ips = ip.s ! objCase ; -- in Cl/NP, c3 is the only prep ---- appComplCase for ip
|
||||||
focobj = case cl.focType of {
|
focobj = case cl.focType of {
|
||||||
NoFoc => <ips, [], FocObj> ; -- put ip object to focus if there is no focus yet
|
NoFoc => <ips, [], FocObj,prep> ; -- put ip object to focus if there is no focus yet
|
||||||
t => <[], ips, t> -- put ip object in situ if there already is a focus
|
t => <[], prep ++ ips, t,noComplCase> -- put ip object in situ if there already is a focus
|
||||||
} ;
|
} ;
|
||||||
in cl ** {
|
in
|
||||||
foc = focobj.p1 ;
|
cl ** { -- preposition stranding
|
||||||
|
foc = focobj.p1 ;
|
||||||
focType = focobj.p3 ;
|
focType = focobj.p3 ;
|
||||||
subj = cl.subj ;
|
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
||||||
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
c3 = focobj.p4 ;
|
||||||
c3 = noComplCase ;
|
} ;
|
||||||
|
{-
|
||||||
|
---- this is giving four records instead of two AR 5/2/2014
|
||||||
|
|
|
||||||
|
cl ** { -- pied piping
|
||||||
|
foc = focobj.p4 ++ focobj.p1 ;
|
||||||
|
focType = focobj.p3 ;
|
||||||
|
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
||||||
|
c3 = noComplCase ;
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
UseCl cl = {s = declCl cl} ;
|
UseCl cl = {s = declCl cl} ;
|
||||||
UseQCl cl = {s = questCl cl} ;
|
UseQCl cl = {s = questCl cl} ;
|
||||||
@@ -365,9 +375,15 @@ lin
|
|||||||
|
|
||||||
UttS s = s ;
|
UttS s = s ;
|
||||||
|
|
||||||
AdvCl a x cl = cl ** case a.isAdV of {True => {adV = cl.adV ++ a.s ; adv = cl.adv} ; False => {adv = cl.adv ++ a.s ; adV = cl.adV}} ;
|
AdvCl x a cl = case a.isAdV of {
|
||||||
|
True => cl ** {adV = cl.adV ++ a.s ; adv = cl.adv ; c3 = a.c1} ;
|
||||||
|
False => cl ** {adv = cl.adv ++ a.s ; adV = cl.adV ; c3 = a.c1}
|
||||||
|
} ;
|
||||||
|
|
||||||
AdvQCl a x cl = cl ** {adv = cl.adv ++ a.s} ;
|
AdvQCl x a cl = case a.isAdV of {
|
||||||
|
True => cl ** {adV = cl.adV ++ a.s ; adv = cl.adv ; c3 = a.c1} ;
|
||||||
|
False => cl ** {adv = cl.adv ++ a.s ; adV = cl.adV ; c3 = a.c1}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
PresPartAP x v = {
|
PresPartAP x v = {
|
||||||
@@ -442,7 +458,7 @@ lin
|
|||||||
qforms = <[],[]> ; ---- qforms
|
qforms = <[],[]> ; ---- qforms
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
ComplAdv x p np = {s = p.c1 ++ np.s ! objCase ; isAdV = p.isAdV ; c1 = []} ;
|
||||||
|
|
||||||
|
|
||||||
---- the following may become parameters for a functor
|
---- the following may become parameters for a functor
|
||||||
@@ -673,14 +689,12 @@ lin
|
|||||||
she_NP = {s = table {NCase Nom => "she" ; _ => "her"} ; a = AgP3Sg Fem} ;
|
she_NP = {s = table {NCase Nom => "she" ; _ => "her"} ; a = AgP3Sg Fem} ;
|
||||||
we_NP = {s = table {NCase Nom => "we" ; _ => "us"} ; a = AgP1 Pl} ;
|
we_NP = {s = table {NCase Nom => "we" ; _ => "us"} ; a = AgP1 Pl} ;
|
||||||
|
|
||||||
today_Adv = {s = "today" ; isAdV = False} ;
|
today_Adv = {s = "today" ; isAdV = False ; c1 = []} ;
|
||||||
always_AdV = {s = "always" ; isAdV = True} ;
|
always_AdV = {s = "always" ; isAdV = True ; c1 = []} ;
|
||||||
|
|
||||||
who_IP = {s = \\_ => "who" ; n = Sg} ;
|
who_IP = {s = \\_ => "who" ; n = Sg} ;
|
||||||
|
|
||||||
PrepNP p np = {s = p.s ++ np.s ! objCase ; isAdV = False} ;
|
with_Prep = {s = [] ; c1 = "with" ; isAdV = False} ;
|
||||||
|
|
||||||
with_Prep = {s = "with"} ;
|
|
||||||
|
|
||||||
and_Conj = {s1 = [] ; s2 = "and" ; n = Pl} ;
|
and_Conj = {s1 = [] ; s2 = "and" ; n = Pl} ;
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ param
|
|||||||
oper
|
oper
|
||||||
defaultAgr = Sg ;
|
defaultAgr = Sg ;
|
||||||
ComplCase = Str ; -- preposition
|
ComplCase = Str ; -- preposition
|
||||||
|
objCase = Acc ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Arg = {s : Str} ;
|
Arg = {s : Str} ;
|
||||||
@@ -82,7 +83,7 @@ lincat
|
|||||||
Pol = {s : Str ; p : Polarity} ;
|
Pol = {s : Str ; p : Polarity} ;
|
||||||
|
|
||||||
NP = {s : Case => Str ; a : Agr} ;
|
NP = {s : Case => Str ; a : Agr} ;
|
||||||
Adv = {s : Str ; isAdV : Bool} ;
|
Adv = {s : Str ; isAdV : Bool ; c1 : ComplCase} ;
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
Utt = {s : Str} ;
|
Utt = {s : Str} ;
|
||||||
AP = {
|
AP = {
|
||||||
@@ -98,7 +99,6 @@ lincat
|
|||||||
Agr => Str
|
Agr => Str
|
||||||
} ;
|
} ;
|
||||||
IP = {s : Str ; a : Agr} ;
|
IP = {s : Str ; a : Agr} ;
|
||||||
Prep = {s : Str} ;
|
|
||||||
Conj = {s : Str} ;
|
Conj = {s : Str} ;
|
||||||
IAdv = {s : Str} ;
|
IAdv = {s : Str} ;
|
||||||
|
|
||||||
@@ -210,10 +210,6 @@ lin
|
|||||||
c3 = noComplCase ; -- for one more prep to build ClSlash
|
c3 = noComplCase ; -- for one more prep to build ClSlash
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PrepCl p x cl = cl ** { -- Cl/NP ::= Cl PP/NP
|
|
||||||
c3 = prepComplCase p ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
SlashClNP x cl np = cl ** { -- Cl ::= Cl/NP NP
|
SlashClNP x cl np = cl ** { -- Cl ::= Cl/NP NP
|
||||||
adv = cl.adv ++ appComplCase cl.c3 np ; ---- again, adv just added
|
adv = cl.adv ++ appComplCase cl.c3 np ; ---- again, adv just added
|
||||||
c3 = noComplCase ; -- complCase has been consumed
|
c3 = noComplCase ; -- complCase has been consumed
|
||||||
@@ -235,20 +231,34 @@ lin
|
|||||||
c3 = noComplCase ; -- for one more prep to build ClSlash ---- ever needed for QCl?
|
c3 = noComplCase ; -- for one more prep to build ClSlash ---- ever needed for QCl?
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
QuestSlash x ip cl =
|
QuestSlash x ip cl =
|
||||||
let
|
let
|
||||||
ips = cl.c3 ++ ip.s ; -- in Cl/NP, c3 is the only prep ---- appComplCase for ip
|
prep = cl.c3 ;
|
||||||
|
ips = ip.s ; -- in Cl/NP, c3 is the only prep ---- appComplCase for ip
|
||||||
focobj = case cl.focType of {
|
focobj = case cl.focType of {
|
||||||
NoFoc => <ips, [], FocObj> ; -- put ip object to focus if there is no focus yet
|
NoFoc => <ips, [], FocObj,prep> ; -- put ip object to focus if there is no focus yet
|
||||||
t => <[], ips, t> -- put ip object in situ if there already is a focus
|
t => <[], prep ++ ips, t,noComplCase> -- put ip object in situ if there already is a focus
|
||||||
} ;
|
} ;
|
||||||
in cl ** {
|
in
|
||||||
foc = focobj.p1 ;
|
cl ** { -- preposition stranding
|
||||||
|
foc = focobj.p1 ;
|
||||||
focType = focobj.p3 ;
|
focType = focobj.p3 ;
|
||||||
subj = cl.subj ;
|
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
||||||
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
c3 = focobj.p4 ;
|
||||||
c3 = noComplCase ;
|
} ;
|
||||||
|
{-
|
||||||
|
---- this is giving four records instead of two AR 5/2/2014
|
||||||
|
|
|
||||||
|
cl ** { -- pied piping
|
||||||
|
foc = focobj.p4 ++ focobj.p1 ;
|
||||||
|
focType = focobj.p3 ;
|
||||||
|
obj1 = cl.obj1 ++ focobj.p2 ; ---- just add to a field?
|
||||||
|
c3 = noComplCase ;
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UseCl cl = {s = declCl cl} ;
|
UseCl cl = {s = declCl cl} ;
|
||||||
UseQCl cl = {s = questCl cl} ;
|
UseQCl cl = {s = questCl cl} ;
|
||||||
@@ -257,10 +267,15 @@ lin
|
|||||||
|
|
||||||
UttS s = s ;
|
UttS s = s ;
|
||||||
|
|
||||||
AdvCl a x cl = cl ** case a.isAdV of {True => {adV = cl.adV ++ a.s ; adv = cl.adv} ; False => {adv = cl.adv ++ a.s ; adV = cl.adV}} ;
|
AdvCl x a cl = case a.isAdV of {
|
||||||
|
True => cl ** {adV = cl.adV ++ a.s ; adv = cl.adv ; c3 = a.c1} ;
|
||||||
AdvQCl a x cl = cl ** {adv = cl.adv ++ a.s} ;
|
False => cl ** {adv = cl.adv ++ a.s ; adV = cl.adV ; c3 = a.c1}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvQCl x a cl = case a.isAdV of {
|
||||||
|
True => cl ** {adV = cl.adV ++ a.s ; adv = cl.adv ; c3 = a.c1} ;
|
||||||
|
False => cl ** {adv = cl.adv ++ a.s ; adV = cl.adV ; c3 = a.c1}
|
||||||
|
} ;
|
||||||
|
|
||||||
PresPartAP x v = {
|
PresPartAP x v = {
|
||||||
s = \\a => v.v ! PresPart ;
|
s = \\a => v.v ! PresPart ;
|
||||||
@@ -326,6 +341,8 @@ lin
|
|||||||
c3 = cl.c3 ;
|
c3 = cl.c3 ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
ComplAdv x p np = {s = p.c1 ++ np.s ! objCase ; isAdV = p.isAdV ; c1 = []} ;
|
||||||
|
|
||||||
|
|
||||||
---- the following may become parameters for a functor
|
---- the following may become parameters for a functor
|
||||||
oper
|
oper
|
||||||
@@ -386,7 +403,7 @@ oper
|
|||||||
|
|
||||||
noComplCase : ComplCase = [] ;
|
noComplCase : ComplCase = [] ;
|
||||||
|
|
||||||
prepComplCase : Prep -> ComplCase = \p -> p.s ;
|
prepComplCase : {s : Str} -> ComplCase = \p -> p.s ;
|
||||||
|
|
||||||
noObj : Agr => Str = \\_ => [] ;
|
noObj : Agr => Str = \\_ => [] ;
|
||||||
|
|
||||||
@@ -434,14 +451,14 @@ lin
|
|||||||
she_NP = {s = table {Nom => "hon" ; Acc => "henne"} ; a = Sg} ;
|
she_NP = {s = table {Nom => "hon" ; Acc => "henne"} ; a = Sg} ;
|
||||||
we_NP = {s = table {Nom => "vi" ; Acc => "oss"} ; a = Pl} ;
|
we_NP = {s = table {Nom => "vi" ; Acc => "oss"} ; a = Pl} ;
|
||||||
|
|
||||||
today_Adv = {s = "idag" ; isAdV = False} ;
|
today_Adv = {s = "idag" ; isAdV = False ; c1 = []} ;
|
||||||
always_AdV = {s = "alltid" ; isAdV = True} ;
|
always_AdV = {s = "alltid" ; isAdV = True ; c1 = []} ;
|
||||||
|
|
||||||
who_IP = {s = "vem" ; a = Sg} ;
|
who_IP = {s = "vem" ; a = Sg} ;
|
||||||
|
|
||||||
PrepNP p np = {s = p.s ++ np.s ! Acc ; isAdV = False} ;
|
PrepNP p np = {s = p.s ++ np.s ! Acc ; isAdV = False} ;
|
||||||
|
|
||||||
with_Prep = {s = "med"} ;
|
with_Prep = {s = [] ; isAdV = False ; c1 = "med"} ;
|
||||||
|
|
||||||
and_Conj = {s = "och"} ;
|
and_Conj = {s = "och"} ;
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ flags
|
|||||||
meta_token_prob=1.1965149246222233e-9;
|
meta_token_prob=1.1965149246222233e-9;
|
||||||
|
|
||||||
fun
|
fun
|
||||||
LiftV : V -> PrV aNone ;
|
LiftV : V -> PrV aNone ;
|
||||||
LiftV2 : V2 -> PrV (aNP aNone) ;
|
LiftV2 : V2 -> PrV (aNP aNone) ;
|
||||||
LiftVS : VS -> PrV aS ;
|
LiftVS : VS -> PrV aS ;
|
||||||
LiftVQ : VQ -> PrV aQ ;
|
LiftVQ : VQ -> PrV aQ ;
|
||||||
@@ -29,8 +29,10 @@ fun
|
|||||||
LiftV2N : V2A -> PrV (aNP aN) ; ----
|
LiftV2N : V2A -> PrV (aNP aN) ; ----
|
||||||
|
|
||||||
LiftAP : AP -> PrAP aNone ;
|
LiftAP : AP -> PrAP aNone ;
|
||||||
|
LiftCN : AP -> PrCN aNone ;
|
||||||
|
|
||||||
LiftAdv : Adv -> PrAdv ;
|
LiftAdv : Adv -> PrAdv aNone ;
|
||||||
LiftAdV : Adv -> PrAdv ;
|
LiftAdV : Adv -> PrAdv aNone ;
|
||||||
|
LiftPrep : Prep -> PrAdv (aNP aNone) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ concrete TransEng of Trans =
|
|||||||
|
|
||||||
** open ResEng, Prelude in {
|
** open ResEng, Prelude in {
|
||||||
|
|
||||||
|
flags
|
||||||
|
literal=Symb ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
LiftV v = v ** {v = v.s ; c1,c2 = [] ; isSubjectControl, isAux = False} ;
|
LiftV v = v ** {v = v.s ; c1,c2 = [] ; isSubjectControl, isAux = False} ;
|
||||||
LiftV2 v = v ** {v = v.s ; c1 = v.c2 ; c2 = [] ; isSubjectControl, isAux = False} ;
|
LiftV2 v = v ** {v = v.s ; c1 = v.c2 ; c2 = [] ; isSubjectControl, isAux = False} ;
|
||||||
@@ -14,13 +17,11 @@ lin
|
|||||||
|
|
||||||
LiftAP ap = {s = \\_ => ap.s ! AgP3Sg Neutr ; c1,c2 = [] ; obj1 = \\_ => []} ; --- agr, isPre
|
LiftAP ap = {s = \\_ => ap.s ! AgP3Sg Neutr ; c1,c2 = [] ; obj1 = \\_ => []} ; --- agr, isPre
|
||||||
|
|
||||||
LiftAdv a = a ** {isAdV = False} ;
|
LiftAdv a = a ** {isAdV = False ; c1 = []} ;
|
||||||
LiftAdV a = a ** {isAdV = True} ;
|
LiftAdV a = a ** {isAdV = True ; c1 = []} ;
|
||||||
|
LiftPrep p = {s = [] ; isAdV = False ; c1 = p.s} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
LiftV2 : V2 -> PrV (aNP aNone) ;
|
|
||||||
LiftVS : VS -> PrV aS ;
|
|
||||||
LiftVQ : VQ -> PrV aQ ;
|
LiftVQ : VQ -> PrV aQ ;
|
||||||
LiftVV : VV -> PrV aV ;
|
LiftVV : VV -> PrV aV ;
|
||||||
LiftVA : VA -> PrV aA ;
|
LiftVA : VA -> PrV aA ;
|
||||||
|
|||||||
Reference in New Issue
Block a user