mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
relatives, except Finnish
This commit is contained in:
@@ -50,6 +50,7 @@ lincat
|
||||
-- = {s : VForm => Str ; s1 : Particle}
|
||||
VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
||||
VPI = {s : VIForm => Agr => Str ; s1 : Str} ; -- s1 is "not" or []
|
||||
VCl = {s : Bool => Anteriority => VIForm => Agr => Str ; s1 : Bool => Str} ;
|
||||
V2 = TransVerb ;
|
||||
-- = Verb ** {s3 : Preposition} ;
|
||||
V3 = TransVerb ** {s4 : Preposition} ;
|
||||
@@ -69,6 +70,7 @@ lincat
|
||||
|
||||
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
||||
Tense = {s : Str ; t : Tense} ;
|
||||
Pol = {s : Str ; p : Bool} ;
|
||||
Ant = {s : Str ; a : Anteriority} ;
|
||||
|
||||
PP = {s : Str} ;
|
||||
|
||||
@@ -51,27 +51,50 @@ concrete ClauseEng of Clause = CategoriesEng **
|
||||
|
||||
QPredProgVP np vp = predBeGroupQ np (vp.s ! VIPresPart) ;
|
||||
|
||||
IPredV a v = predVerbI True a v (complVerb v) ;
|
||||
IPredPassV a v = predVerbI True a v (passVerb v) ;
|
||||
IPredV2 a v x = predVerbI True a v (complTransVerb v x) ;
|
||||
IPredReflV2 a v = predVerbI True a v (reflTransVerb v) ;
|
||||
IPredV3 a v x y = predVerbI True a v (complDitransVerb v x y) ;
|
||||
IPredVS a v x = predVerbI True a v (complSentVerb v x) ;
|
||||
IPredVV a v x = predVerbI True a (aux2verb v) (complVerbVerb v x) ;
|
||||
IPredVQ a v x = predVerbI True a v (complQuestVerb v x) ;
|
||||
IPredVA a v x = predVerbI True a v (complAdjVerb v x) ;
|
||||
IPredV2A a v x y = predVerbI True a v (complDitransAdjVerb v x y) ;
|
||||
IPredSubjV2V a v x y = predVerbI True a v (complDitransVerbVerb False v x y) ;
|
||||
IPredObjV2V a v x y = predVerbI True a v (complDitransVerbVerb True v x y) ;
|
||||
IPredV2S a v x y = predVerbI True a v (complDitransSentVerb v x y) ;
|
||||
IPredV2Q a v x y = predVerbI True a v (complDitransQuestVerb v x y) ;
|
||||
|
||||
IPredAP a v = predBeGroupI True a v.s ;
|
||||
IPredCN a v = predBeGroupI True a (complCommNoun v) ;
|
||||
IPredNP a v = predBeGroupI True a (complNounPhrase v) ;
|
||||
IPredAdv a v = predBeGroupI True a (complAdverb v) ;
|
||||
RPredV np v = relVerbClause np v (complVerb v) ;
|
||||
RPredPassV np v = predBeGroupR np (passVerb v) ;
|
||||
RPredV2 np v x = relVerbClause np v (complTransVerb v x) ;
|
||||
RPredReflV2 np v = relVerbClause np v (reflTransVerb v) ;
|
||||
RPredV3 np v x y = relVerbClause np v (complDitransVerb v x y) ;
|
||||
RPredVS np v x = relVerbClause np v (complSentVerb v x) ;
|
||||
RPredVV np v x = relVerbClause np (aux2verb v) (complVerbVerb v x) ;
|
||||
RPredVQ np v x = relVerbClause np v (complQuestVerb v x) ;
|
||||
RPredVA np v x = relVerbClause np v (complAdjVerb v x) ;
|
||||
RPredV2A np v x y = relVerbClause np v (complDitransAdjVerb v x y) ;
|
||||
RPredSubjV2V np v x y = relVerbClause np v (complDitransVerbVerb False v x y) ;
|
||||
RPredObjV2V np v x y = relVerbClause np v (complDitransVerbVerb True v x y) ;
|
||||
RPredV2S np v x y = relVerbClause np v (complDitransSentVerb v x y) ;
|
||||
RPredV2Q np v x y = relVerbClause np v (complDitransQuestVerb v x y) ;
|
||||
|
||||
IPredProgVP a vp = predBeGroupI True a (vp.s ! VIPresPart) ;
|
||||
RPredAP np v = predBeGroupR np v.s ;
|
||||
RPredCN np v = predBeGroupR np (complCommNoun v) ;
|
||||
RPredNP np v = predBeGroupR np (complNounPhrase v) ;
|
||||
RPredAdv np v = predBeGroupR np (complAdverb v) ;
|
||||
|
||||
RPredProgVP np vp = predBeGroupR np (vp.s ! VIPresPart) ;
|
||||
|
||||
IPredV v = predVerbI v (complVerb v) ;
|
||||
IPredPassV v = predVerbI v (passVerb v) ;
|
||||
IPredV2 v x = predVerbI v (complTransVerb v x) ;
|
||||
IPredReflV2 v = predVerbI v (reflTransVerb v) ;
|
||||
IPredV3 v x y = predVerbI v (complDitransVerb v x y) ;
|
||||
IPredVS v x = predVerbI v (complSentVerb v x) ;
|
||||
IPredVV v x = predVerbI (aux2verb v) (complVerbVerb v x) ;
|
||||
IPredVQ v x = predVerbI v (complQuestVerb v x) ;
|
||||
IPredVA v x = predVerbI v (complAdjVerb v x) ;
|
||||
IPredV2A v x y = predVerbI v (complDitransAdjVerb v x y) ;
|
||||
IPredSubjV2V v x y = predVerbI v (complDitransVerbVerb False v x y) ;
|
||||
IPredObjV2V v x y = predVerbI v (complDitransVerbVerb True v x y) ;
|
||||
IPredV2S v x y = predVerbI v (complDitransSentVerb v x y) ;
|
||||
IPredV2Q v x y = predVerbI v (complDitransQuestVerb v x y) ;
|
||||
|
||||
IPredAP v = predBeGroupI v.s ;
|
||||
IPredCN v = predBeGroupI (complCommNoun v) ;
|
||||
IPredNP v = predBeGroupI (complNounPhrase v) ;
|
||||
IPredAdv v = predBeGroupI (complAdverb v) ;
|
||||
|
||||
IPredProgVP vp = predBeGroupI (vp.s ! VIPresPart) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
@@ -91,6 +91,10 @@ lin
|
||||
UseCl tp cl = {s = tp.s ++ cl.s ! Dir ! tp.b ! VFinite tp.t tp.a} ;
|
||||
UseQCl tp cl = {s = \\q => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! q} ;
|
||||
UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! a} ;
|
||||
UseVCl p a cl = {
|
||||
s = \\v,ag => p.s ++ a.s ++ cl.s ! p.p ! a.a ! v ! ag ;
|
||||
s1 = cl.s1 ! p.p
|
||||
} ;
|
||||
|
||||
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
||||
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;
|
||||
@@ -103,6 +107,9 @@ lin
|
||||
ASimul = {s = [] ; a = Simul} ;
|
||||
AAnter = {s = [] ; a = Anter} ;
|
||||
|
||||
PPos = {s = [] ; p = True} ;
|
||||
PNeg = {s = [] ; p = False} ;
|
||||
|
||||
-- Adverbs.
|
||||
|
||||
AdjAdv a = ss (a.s ! AAdv) ;
|
||||
|
||||
@@ -428,7 +428,14 @@ oper
|
||||
s1 : Str -- "not" or []
|
||||
} ;
|
||||
|
||||
VerbClause = {
|
||||
s : Bool => Anteriority => VIForm => Agr => Str ;
|
||||
s1 : Bool => Str -- "not" or []
|
||||
} ;
|
||||
|
||||
-- To form an infinitival group
|
||||
|
||||
{- ---- obsolete
|
||||
predVerbGroup : Bool -> {s : Str ; a : Anteriority} -> VerbGroup -> VerbPhrase =
|
||||
\b,ant,vg -> {
|
||||
s = table {
|
||||
@@ -437,23 +444,22 @@ oper
|
||||
} ;
|
||||
s1 = if_then_Str b [] "not"
|
||||
} ;
|
||||
-}
|
||||
|
||||
-- All negative verb phrase behave as auxiliary ones in questions.
|
||||
|
||||
predVerbI : Bool -> {s : Str ; a : Anteriority} -> Verb -> Complement -> VerbPhrase =
|
||||
\b,ant,verb,comp ->
|
||||
let
|
||||
ans = ant.s ; --- just to avoid ? in parsing
|
||||
inf = case ant.a of {
|
||||
Simul => verb.s ! InfImp ;
|
||||
Anter => "have" ++ verb.s ! PPart
|
||||
}
|
||||
in
|
||||
{s = table {
|
||||
VIInfinit => \\a => ans ++ inf ++ verb.s1 ++ comp ! a ;
|
||||
VIPresPart => \\a => ans ++ verb.s ! PresPart ++ comp ! a
|
||||
predVerbI : Verb -> Complement -> VerbClause =
|
||||
\verb,comp ->
|
||||
{s = \\p,a =>
|
||||
let
|
||||
inf = case a of {
|
||||
Simul => verb.s ! InfImp ;
|
||||
Anter => "have" ++ verb.s ! PPart
|
||||
}
|
||||
in
|
||||
table {
|
||||
VIInfinit => \\ag => inf ++ verb.s1 ++ comp ! ag ;
|
||||
VIPresPart => \\ag => verb.s ! PresPart ++ comp ! ag
|
||||
} ;
|
||||
s1 = if_then_Str b [] "not"
|
||||
s1 = \\b => if_then_Str b [] "not"
|
||||
} ;
|
||||
|
||||
-- A simple verb can be made into a verb phrase with an empty complement.
|
||||
@@ -489,16 +495,16 @@ oper
|
||||
|
||||
Complement = Agr => Str ;
|
||||
|
||||
predBeGroupI : Bool -> {s : Str ; a : Anteriority} -> Complement -> VerbPhrase =
|
||||
\b,ant,vg ->
|
||||
{s = table {
|
||||
VIInfinit => \\a => ant.s ++ case ant.a of {
|
||||
predBeGroupI : Complement -> VerbClause =
|
||||
\vg ->
|
||||
{s = \\b,ant => table {
|
||||
VIInfinit => \\a => case ant of {
|
||||
Simul => "be" ++ vg ! a ;
|
||||
Anter => "have" ++ "been" ++ vg ! a
|
||||
} ;
|
||||
VIPresPart => \\a => "being" ++ vg ! a
|
||||
} ;
|
||||
s1 = if_then_Str b [] "not" ;
|
||||
s1 = \\b => if_then_Str b [] "not" ;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -981,9 +987,12 @@ oper
|
||||
|
||||
slashVerbVerb : NounPhrase -> VerbVerb -> TransVerb -> ClauseSlashNounPhrase =
|
||||
\you,want,lookat ->
|
||||
let youlookat = (predVerbClause you (aux2verb want)
|
||||
(complVerbVerb want (predVerbI True {s = [] ; a = Simul} lookat
|
||||
(complVerb lookat)))).s
|
||||
let
|
||||
tolook = predVerbI lookat (complVerb lookat) ;
|
||||
youlookat =
|
||||
(predVerbClause you (aux2verb want)
|
||||
(complVerbVerb want
|
||||
{s = tolook.s ! True ! Simul ; s1 = tolook.s1 ! True})).s
|
||||
in
|
||||
{s = table {
|
||||
DirQ => youlookat ! Inv ;
|
||||
@@ -1036,6 +1045,25 @@ oper
|
||||
(predVerbGroupClause (relNounPhrase who wa.g wa.n) walks).s ! Dir ! b ! sf
|
||||
} ;
|
||||
|
||||
relVerbClause : RelPron -> Verb -> Complement -> RelClause = \who,walk,here ->
|
||||
{s = \\b,sf,a =>
|
||||
let
|
||||
wa = fromAgr a ;
|
||||
who : NounPhrase = relNounPhrase who wa.g wa.n ;
|
||||
whowalks : Clause = predVerbClause who walk here
|
||||
in
|
||||
whowalks.s ! Dir ! b ! sf
|
||||
} ;
|
||||
|
||||
predBeGroupR : RelPron -> Complement -> RelClause = \who,old ->
|
||||
{s = \\b,sf,a =>
|
||||
let
|
||||
wa = fromAgr a ;
|
||||
whoisold = predBeGroup (relNounPhrase who wa.g wa.n) old
|
||||
in
|
||||
whoisold.s ! Dir ! b ! sf
|
||||
} ;
|
||||
|
||||
relSlash : RelPron -> ClauseSlashNounPhrase -> RelClause = \who,yousee ->
|
||||
{s = \\b,sf,a =>
|
||||
let
|
||||
|
||||
Reference in New Issue
Block a user