mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-09-26 20:23:41 -06:00
support for verbs with prepositions
This commit is contained in:
@@ -104,16 +104,18 @@ concrete CatEus of Cat = CommonX ** open ResEus, Prelude in {
|
||||
-- additional lexicon modules.
|
||||
|
||||
V,
|
||||
V2,
|
||||
V3,
|
||||
VV, -- verb-phrase-complement verb e.g. "want"
|
||||
VS, -- sentence-complement verb e.g. "claim"
|
||||
VQ, -- question-complement verb e.g. "wonder"
|
||||
VA, -- adjective-complement verb e.g. "look"
|
||||
VA = ResEus.Verb ; -- adjective-complement verb, e.g. "look"
|
||||
|
||||
V2,
|
||||
V2V, -- verb with NP and V complement e.g. "cause"
|
||||
V2S, -- verb with NP and S complement e.g. "tell"
|
||||
V2Q, -- verb with NP and Q complement e.g. "ask"
|
||||
V2A = ResEus.Verb ; -- verb with NP and AP complement e.g. "paint"
|
||||
V2A = ResEus.Verb2 ; -- verb with NP and AP complement e.g. "paint"
|
||||
|
||||
V3 = ResEus.Verb3 ;
|
||||
|
||||
A = ResEus.Adjective ;
|
||||
A2 = ResEus.Adjective2 ;
|
||||
|
||||
@@ -91,7 +91,7 @@ lin die_V = izanV "hil" ; -- | mkV "zendu" ; --Apertium
|
||||
lin dig_V = mkV "zulatu" ; --Apertium
|
||||
lin dirty_A = mkA "likits" ; --| mkA "zikin" ; --Apertium
|
||||
lin distance_N3 = mkN3 (mkN "distantzia") toPrep S.from_Prep ; --Apertium
|
||||
lin do_V2 = lin V2 egin_V ;
|
||||
lin do_V2 = mkV2 egin_V ;
|
||||
lin doctor_N = mkN "mediku" animate ; --| mkN "doktore" ; --Apertium
|
||||
lin dog_N = mkN "txakur" ;
|
||||
lin door_N = mkN "ate" ;
|
||||
@@ -120,7 +120,7 @@ lin fall_V = mkV "amildu" ; -- | mkV "erori" ; --Apertium
|
||||
lin far_Adv = mkAdv "urrun" ;
|
||||
lin fat_N = mkN "gantz" ; --| mkN "koipe" ; --Apertium
|
||||
lin father_N2 = mkN2 (mkN "aita" animate) ;
|
||||
lin fear_V2 = ukanV "beldur" ; -- beldur nauzu `you are afraid of me'
|
||||
lin fear_V2 = mkV2 (ukanV "beldur") ; -- beldur nauzu `you are afraid of me'
|
||||
lin fear_VS = izanV "beldur" ; -- beldur naiz [ez datorrela] `I'm afraid s/he won't come'
|
||||
lin feather_N = mkN "luma" ; --Apertium
|
||||
lin fight_V2 = mkV2 "borrokatu" ; --Apertium
|
||||
@@ -224,7 +224,7 @@ lin long_A = mkA "luze" ; --Apertium
|
||||
lin lose_V2 = mkV2 "galdu" ; --Apertium
|
||||
lin louse_N = mkN "zorri" ; --Apertium
|
||||
lin love_N = mkN "maitasun" ; -- | mkN "amodio" ; --Apertium
|
||||
lin love_V2 = ukanV "maite" ;
|
||||
lin love_V2 = mkV2 (ukanV "maite") ;
|
||||
lin man_N = mkN "gizon" animate ; --Apertium
|
||||
lin married_A2 = mkA2 "ezkondu" (mkPrep [] sociative) ;
|
||||
lin meat_N = mkN "haragi" ; -- | mkN "mami" ; --Apertium
|
||||
@@ -336,7 +336,7 @@ lin snake_N = mkN "suge" ; --Apertium
|
||||
lin snow_N = mkN "elur" ; --Apertium
|
||||
lin sock_N = mkN "galtzetin" ; --Apertium
|
||||
lin song_N = mkN "abesti" ; --| mkN "kanta" | mkN "kantu" ; --Apertium
|
||||
lin speak_V2 = lin V2 (mkV "hitz" egin_V) ; --Apertium
|
||||
lin speak_V2 = mkV2 (mkV "hitz" egin_V) ; --Apertium
|
||||
lin spit_V = mkV "txistua bota" ; --Apertium
|
||||
lin split_V2 = mkV2 "pitzatu" ; --| mkV2 "zatitu" ; --Apertium
|
||||
lin squeeze_V2 = mkV2 "estutu" ; --Apertium
|
||||
@@ -430,7 +430,7 @@ oper
|
||||
|
||||
ibili_V : V = lin V (R.syntVerbDa "ibili" R.Ibili) ;
|
||||
|
||||
jakin_V2 : V2 = lin V2 (R.syntVerbDu "jakin" R.Jakin) ;
|
||||
jakin_V2 : V2 = lin V2 (R.syntVerbDu "jakin" R.Jakin ** {c2 = R.noPost}) ;
|
||||
|
||||
joan_V : V = lin V (R.syntVerbDa "joan" R.Joan) ;
|
||||
}
|
||||
|
||||
@@ -204,9 +204,9 @@ concrete NounEus of Noun = CatEus ** open ResEus, Prelude in {
|
||||
let a : Str = artIndef ! Abs ! cn.ph ; --`a' for FinalA, [] for other
|
||||
result : {s : Agr => Str ; ph : Phono} =
|
||||
case ap.typ of {
|
||||
Ko => { s = \\agr => ap.s ! Hau ++ cn.s ! agr ;
|
||||
Ko => { s = \\agr => ap.s ! agr ++ cn.s ! agr ;
|
||||
ph = cn.ph } ;
|
||||
Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ! Hau ;
|
||||
Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ! agr ;
|
||||
ph = ap.ph }
|
||||
} ;
|
||||
in cn ** { s = result.s ;
|
||||
|
||||
@@ -41,6 +41,22 @@ oper
|
||||
mkN : Str -> Bizi -> N = \s,bizi -> lin N (mkNoun s ** { anim = bizi }) ;
|
||||
} ;
|
||||
|
||||
-- Keep the noun's lexical final -a inside compounds with a following
|
||||
-- adjective or adverb, but let case and number suffixes attach at the
|
||||
-- compound's right edge: bonba atomiko+a, bonba atomiko+ek, ...
|
||||
compoundN = overload {
|
||||
compoundN : N -> A -> N = \noun,adj ->
|
||||
lin N {
|
||||
s = noun.s ++ artIndef ! Abs ! noun.ph ++ adj.s ! AF Posit ;
|
||||
ph = adj.ph ;
|
||||
anim = noun.anim
|
||||
} ;
|
||||
|
||||
compoundN : N -> Str -> N = \noun,adv ->
|
||||
let compound = mkNoun (noun.s ++ artIndef ! Abs ! noun.ph ++ adv)
|
||||
in lin N (compound ** {anim = noun.anim}) ;
|
||||
} ;
|
||||
|
||||
mkPN : Str -> PN = \s -> lin PN (mkPNoun s) ;
|
||||
mkLN : Str -> LN = \s -> lin LN (mkPNoun s) ;
|
||||
mkGN : Str -> GN = \s -> lin GN (mkPNoun s) ;
|
||||
@@ -88,31 +104,43 @@ oper
|
||||
-- For verbs with non-inflecting participle, see izanV, egonV and ukanV.
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2 = \s -> lin V2 (mkVerbDu s) ;
|
||||
mkV2 : Str -> V2 = \s -> lin V2 (mkVerbDu s ** {c2 = noPost}) ;
|
||||
|
||||
mkV2 : Str -> AuxType -> V2 = \s,val -> lin V2 (mkVerbDa s ** { val = val }) ;
|
||||
mkV2 : Str -> AuxType -> V2 = \s,val -> lin V2 (mkVerbDa s ** {val = val ; c2 = noPost}) ;
|
||||
|
||||
mkV2 : Str -> V -> V2 = \lo,egin ->
|
||||
lin V2 (egin ** { prc = \\t => lo ++ egin.prc ! t ;
|
||||
val = Du Ukan }) ;
|
||||
val = Du Ukan ;
|
||||
c2 = noPost}) ;
|
||||
|
||||
-- A V2 always selects the transitive auxiliary. Keeping the auxiliary
|
||||
-- inherited from mkV made the very common `mkV2 (mkV "...")` idiom
|
||||
-- produce absolutive subjects and forms of izan (e.g. *hura ... da).
|
||||
mkV2 : V -> V2 = \x -> lin V2 x ;
|
||||
mkV2 : V -> V2 = \x -> lin V2 (x ** {val = Du Ukan ; c2 = noPost}) ;
|
||||
|
||||
mkV2 : V -> Prep -> V2 = \v,p ->
|
||||
lin V2 (v ** {val = Du Ukan ; c2 = p}) ;
|
||||
} ;
|
||||
|
||||
mkVA : Str -> VA = \s -> lin VA (mkVerbDa s) ; -- Nor
|
||||
|
||||
mkV2A : Str -> V2A = \s -> lin V2A (mkVerbDu s) ; -- Nor-nork
|
||||
mkV2A : Str -> V2A = \s -> lin V2A (mkVerbDu s ** {c2 = noPost}) ; -- Nor-nork
|
||||
mkVQ : Str -> VQ = \s -> lin VQ (mkVerbDu s) ; -- Nor-nork
|
||||
mkVS : Str -> VS = \s -> lin VS (mkVerbDu s) ; -- Nor-nork
|
||||
mkVV : V -> VV = \v -> lin VV v ;
|
||||
|
||||
mkV2V : Str -> V2V = \s -> lin V2V (mkVerbDio s) ; -- ??? TODO check valency
|
||||
mkV2S : Str -> V2S = \s -> lin V2S (mkVerbDio s) ; -- Nor-nori-nork: (mutilari) (neska datorrela) erantzun diot
|
||||
mkV2Q : Str -> V2Q = \s -> lin V2Q (mkVerbDio s) ; -- Nor-nori-nork: (mutilari) (neska datorren) galdetu diot
|
||||
mkV3 : Str -> V3 = \s -> lin V3 (mkVerbDio s) ; -- Nor-nori-nork: (mutilari) (garagardoa) edan diot
|
||||
mkV2V : Str -> V2V = \s -> lin V2V (mkVerbDio s ** {c2 = noPost}) ; -- ??? TODO check valency
|
||||
mkV2S : Str -> V2S = \s -> lin V2S (mkVerbDio s ** {c2 = noPost}) ; -- Nor-nori-nork: (mutilari) (neska datorrela) erantzun diot
|
||||
mkV2Q : Str -> V2Q = \s -> lin V2Q (mkVerbDio s ** {c2 = noPost}) ; -- Nor-nori-nork: (mutilari) (neska datorren) galdetu diot
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : Str -> V3 = \s ->
|
||||
lin V3 (mkVerbDio s ** {c2 = noPost ; c3 = mkPost [] Dat False}) ;
|
||||
mkV3 : V -> Prep -> V3 = \v,p3 ->
|
||||
lin V3 (v ** {val = Dio ; c2 = noPost ; c3 = p3}) ;
|
||||
mkV3 : V -> Prep -> Prep -> V3 = \v,p2,p3 ->
|
||||
lin V3 (v ** {val = Dio ; c2 = p2 ; c3 = p3}) ;
|
||||
} ; -- Nor-nori-nork: (mutilari) (garagardoa) edan diot
|
||||
|
||||
|
||||
-----
|
||||
|
||||
@@ -16,7 +16,7 @@ concrete QuestionEus of Question = CatEus ** open ResEus, (VE=VerbEus), (NE=Noun
|
||||
|
||||
-- : IAdv -> Cl -> QCl ; -- why does John walk
|
||||
-- nola (how), zerbait (how much), noiz (when), non (where), zergatik (why)
|
||||
QuestIAdv iadv cl =
|
||||
QuestIAdv iadv cl = cl **
|
||||
{ s = \\t,a,p,c =>
|
||||
let sent = cl.s ! t ! a ! p ! Indir ; -- no "al" with a wh-word!
|
||||
in { beforeAux = iadv.s ++ sent.beforeAux ;
|
||||
|
||||
+37
-4
@@ -298,6 +298,9 @@ oper
|
||||
val : AuxType --TODO change name of the field
|
||||
} ;
|
||||
|
||||
Verb2 : Type = Verb ** { c2 : Postposizio } ;
|
||||
Verb3 : Type = Verb2 ** { c3 : Postposizio } ;
|
||||
|
||||
mkVerbDa : Str -> Verb = \s -> { val = Da Izan ;
|
||||
nstem = mkNStem s ;
|
||||
prc = mkPrc s } ;
|
||||
@@ -413,9 +416,33 @@ oper
|
||||
{ post = noPost ;
|
||||
missing = missingArg } ;
|
||||
|
||||
slashDObj : Verb -> VPSlash = slashV MissingDObj ; --works for V2, V2V, V2S, V2Q, V2A.
|
||||
slashDObj : Verb2 -> VPSlash = \v ->
|
||||
case v.c2.complCase of {
|
||||
Abs => slashV MissingDObj v ;
|
||||
_ => (slashV MissingAdv v) ** {post = v.c2}
|
||||
} ; --works for V2, V2V, V2S, V2Q, V2A.
|
||||
|
||||
slashIObj : Verb -> VPSlash = slashV MissingIObj ; --only Slash3V3
|
||||
slashIObj : Verb3 -> VPSlash = \v ->
|
||||
case v.c3.complCase of {
|
||||
Dat => slashV MissingIObj v ;
|
||||
_ => (slashV MissingAdv v) ** {post = v.c3}
|
||||
} ; --only Slash3V3
|
||||
|
||||
slashDObjVP : Verb2 -> VerbPhrase -> VPSlash = \v,vp ->
|
||||
vp ** { post = v.c2 ;
|
||||
missing = case v.c2.complCase of {
|
||||
Acc => MissingDObj ;
|
||||
_ => MissingAdv
|
||||
}
|
||||
} ;
|
||||
|
||||
slashIObjVP : Verb3 -> VerbPhrase -> VPSlash = \v,vp ->
|
||||
vp ** { post = v.c3 ;
|
||||
missing = case v.c3.complCase of {
|
||||
Acc => MissingIObj ;
|
||||
_ => MissingAdv
|
||||
}
|
||||
} ;
|
||||
|
||||
-----
|
||||
-- Modify existing VPs
|
||||
@@ -462,7 +489,11 @@ oper
|
||||
linSSub : Sentence -> Str -> Str = \sent,subj ->
|
||||
sent.beforeAux ++ glue sent.aux.stem subj ++ sent.afterAux ;
|
||||
|
||||
Clause : Type = { s : Tense => Anteriority => Polarity => ClType => Sentence } ;
|
||||
Clause : Type = {
|
||||
s : Tense => Anteriority => Polarity => ClType => Sentence ;
|
||||
subj : NounPhrase ;
|
||||
vp : VerbPhrase
|
||||
} ;
|
||||
|
||||
linCl : Clause -> Str = \clause ->
|
||||
linS (clause.s ! Pres ! Simul ! Pos ! Stat) ;
|
||||
@@ -498,7 +529,9 @@ oper
|
||||
++ vp.dobj.s ! pol -- garagardoa / garagardorik
|
||||
++ vp.comp ! subj.agr ; -- etorriko dela / nor den / handi(ak) / ...
|
||||
prc = verb.prc ;
|
||||
aux = verb.aux ! subj.agr }
|
||||
aux = verb.aux ! subj.agr } ;
|
||||
subj = subj ;
|
||||
vp = vp
|
||||
} ;
|
||||
|
||||
verbformPeriphrastic : Tense -> Anteriority -> VerbPhrase -> {aux : Agr => VForms ; prc : Str} = \t,a,vp ->
|
||||
|
||||
@@ -21,7 +21,8 @@ lin
|
||||
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
||||
AdvSlash cls adv = cls ** insertAdv adv cls ;
|
||||
|
||||
-- SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks
|
||||
SlashPrep cl prep = mkClSlash cl.subj
|
||||
(cl.vp ** {post = prep ; missing = MissingAdv}) ;
|
||||
|
||||
-- : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves
|
||||
-- SlashVS np vs ss = {} ;
|
||||
|
||||
@@ -173,7 +173,7 @@ lin yes_Utt = ss "bai" ;
|
||||
-------
|
||||
-- Verb
|
||||
|
||||
lin have_V2 = R.syntVerbDu "eduki" R.Eduki ;
|
||||
lin have_V2 = R.syntVerbDu "eduki" R.Eduki ** {c2 = R.noPost} ;
|
||||
|
||||
lin can8know_VV = ukanV "ahal" ; -- can (capacity)
|
||||
lin can_VV = ukanV "ahal" ; -- can (possibility)
|
||||
|
||||
@@ -39,15 +39,12 @@ lin
|
||||
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give it (to her)
|
||||
Slash2V3 v3 npNori = slashDObj v3 **
|
||||
{ iobj = { s = npNori.s ! Dat ;
|
||||
agr = npNori.agr }
|
||||
} ;
|
||||
Slash2V3 v3 npNor =
|
||||
slashIObjVP v3 (complSlash (slashDObj v3) npNor) ;
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
||||
Slash3V3 v3 npNor = slashIObj v3 **
|
||||
{ dobj = npNor ** { s = mkDObj npNor }
|
||||
} ;
|
||||
Slash3V3 v3 npNori =
|
||||
slashDObjVP v3 (complSlash (slashIObj v3) npNori) ;
|
||||
|
||||
|
||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||
@@ -171,4 +168,3 @@ oper
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user