mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
clause working with vp
This commit is contained in:
@@ -33,6 +33,9 @@ fun
|
||||
SPredAV : NP -> AV ->VPI ->Cl ; -- "John is eager to leave"
|
||||
SPredObjA2V : NP -> A2V -> NP ->VPI ->Cl ; -- "John is easy for us to convince"
|
||||
|
||||
SPredProgVP : NP -> VPI -> Cl ; -- "he is eating"
|
||||
|
||||
|
||||
QPredV : IP -> V -> QCl ; -- "who walks"
|
||||
QPredPassV : IP -> V -> QCl ; -- "who is seen"
|
||||
QPredV2 : IP -> V2 -> NP -> QCl ; -- "who sees Mary"
|
||||
|
||||
@@ -214,7 +214,6 @@ fun
|
||||
|
||||
--- The type signatures of these ones should be changed from VP to VPI.
|
||||
|
||||
ProgVG : VP -> VP ; -- he is eating
|
||||
OneVP : VP -> Cl ; -- "one walks"
|
||||
OneVP : VP -> Cl ; -- "one walks"
|
||||
|
||||
} ;
|
||||
|
||||
@@ -114,4 +114,13 @@ instance SyntaxDan of SyntaxScand = TypesDan **
|
||||
{s3 = ["ved at"]}
|
||||
)
|
||||
(predVerbGroup True Simul verb) ;
|
||||
|
||||
progressiveClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
|
||||
predVerbGroupClause np
|
||||
(complVerbVerb
|
||||
(verbVara **
|
||||
{s3 = ["ved at"]}
|
||||
)
|
||||
vp) ;
|
||||
|
||||
}
|
||||
@@ -53,7 +53,7 @@ lincat
|
||||
V = Verb ;
|
||||
-- = {s : VForm => Str ; s1 : Particle}
|
||||
VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
||||
VPI = {s : Agr => Str ; s1 : Str} ; -- s1 is "not" or []
|
||||
VPI = {s : VIForm => Agr => Str ; s1 : Str} ; -- s1 is "not" or []
|
||||
V2 = TransVerb ;
|
||||
-- = Verb ** {s3 : Preposition} ;
|
||||
V3 = TransVerb ** {s4 : Preposition} ;
|
||||
|
||||
@@ -29,6 +29,8 @@ concrete ClauseEng of Clause = CategoriesEng **
|
||||
SPredAV np v x = predVerbGroupClause np (complVerbAdj v x) ;
|
||||
SPredObjA2V np v x y = predVerbGroupClause np (complVerbAdj2 True v x y) ;
|
||||
|
||||
SPredProgVP = progressiveClause ;
|
||||
|
||||
QPredV np v = intVerbPhrase np (predVerb v) ;
|
||||
QPredPassV np v = intVerbPhrase np (passVerb v) ;
|
||||
QPredV2 np v x = intVerbPhrase np (complTransVerb v x) ;
|
||||
|
||||
@@ -87,10 +87,6 @@ lin
|
||||
UseA2S x = x ;
|
||||
UseA2V x = x ;
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
ProgVG = progressiveVerbPhrase ;
|
||||
|
||||
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} ;
|
||||
|
||||
@@ -453,9 +453,13 @@ oper
|
||||
|
||||
-- This is just an infinitival (or present participle) phrase
|
||||
|
||||
|
||||
param
|
||||
VIForm = VIInfinit | VIPresPart ;
|
||||
|
||||
oper
|
||||
VerbPhrase = {
|
||||
s : Agr => Str ;
|
||||
s : VIForm => Agr => Str ;
|
||||
s1 : Str -- "not" or []
|
||||
} ;
|
||||
|
||||
@@ -463,14 +467,17 @@ oper
|
||||
-- All negative verb phrase behave as auxiliary ones in questions.
|
||||
|
||||
predVerbGroup : Bool -> Anteriority -> VerbGroup -> VerbPhrase = \b,ant,vg -> {
|
||||
s = \\a => vg.s2 ! b ! VInfinit ant ! a ; -- s1 is just neg for inf
|
||||
s = table {
|
||||
VIInfinit => \\a => vg.s2 ! b ! VInfinit ant ! a ; -- s1 is just neg for inf
|
||||
VIPresPart => \\a => vg.s2 ! b ! VPresPart ! a
|
||||
} ;
|
||||
s1 = if_then_Str b [] "not"
|
||||
} ;
|
||||
|
||||
predVerbGroupI : Bool -> {s : Str ; a : Anteriority} -> VerbGroup -> VerbPhrase =
|
||||
\b,ant,vg ->
|
||||
let vp = predVerbGroup b ant.a vg in
|
||||
{s = \\a => ant.s ++ vp.s ! a ;
|
||||
{s = \\f,a => ant.s ++ vp.s ! f ! a ;
|
||||
s1 = vp.s1
|
||||
} ;
|
||||
|
||||
@@ -709,8 +716,11 @@ oper
|
||||
APl P3 => "themselves"
|
||||
} ;
|
||||
|
||||
progressiveVerbPhrase : VerbGroup -> VerbGroup = \vp ->
|
||||
beGroup (vp.s2 ! True ! VPresPart) ;
|
||||
progressiveVerbPhrase : VerbPhrase -> VerbGroup = \vp ->
|
||||
beGroup (vp.s ! VIPresPart) ;
|
||||
|
||||
progressiveClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
|
||||
predBeGroup np (vp.s ! VIPresPart) ;
|
||||
|
||||
--- negation of prp ignored: "not" only for "be"
|
||||
|
||||
@@ -794,7 +804,7 @@ oper
|
||||
taux = try.isAux ;
|
||||
to = if_then_Str taux [] "to" ;
|
||||
torun : Agr => Str =
|
||||
\\a => run.s1 ++ to ++ run.s ! a
|
||||
\\a => run.s1 ++ to ++ run.s ! VIInfinit ! a
|
||||
in
|
||||
if_then_else VerbGroup taux
|
||||
(useVerb try torun)
|
||||
@@ -830,8 +840,8 @@ oper
|
||||
(\\a => be.s1 ++ be.s3 ++ dig.s ! AccP ++ be.s3 ++ be.s4 ++
|
||||
simma.s1 ++ -- negation
|
||||
if_then_Str obj
|
||||
(simma.s ! dig.a)
|
||||
(simma.s ! a)
|
||||
(simma.s ! VIInfinit ! dig.a)
|
||||
(simma.s ! VIInfinit ! a)
|
||||
) ;
|
||||
|
||||
transVerbVerb : VerbVerb -> TransVerb -> TransVerb = \vilja,hitta ->
|
||||
@@ -846,7 +856,7 @@ oper
|
||||
(\\a =>
|
||||
grei.s ! AAdj ++ simma.s1 ++
|
||||
"to" ++
|
||||
simma.s ! a) ;
|
||||
simma.s ! VIInfinit ! a) ;
|
||||
|
||||
complVerbAdj2 :
|
||||
Bool -> AdjCompl -> NounPhrase -> VerbPhrase -> VerbGroup =
|
||||
@@ -857,8 +867,8 @@ oper
|
||||
grei.s2 ++ dig.s ! AccP ++
|
||||
simma.s1 ++ "to" ++
|
||||
if_then_Str obj
|
||||
(simma.s ! dig.a)
|
||||
(simma.s ! a)
|
||||
(simma.s ! VIInfinit ! dig.a)
|
||||
(simma.s ! VIInfinit ! a)
|
||||
) ;
|
||||
|
||||
|
||||
@@ -1127,7 +1137,7 @@ oper
|
||||
a = toAgr n P2 human ;
|
||||
dont = if_then_Str b [] "don't"
|
||||
in
|
||||
dont ++ walk.s ! a
|
||||
dont ++ walk.s ! VIInfinit ! a
|
||||
} ;
|
||||
|
||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||
@@ -1137,7 +1147,7 @@ oper
|
||||
-- "What do you want to do? - Wash myself."
|
||||
|
||||
verbUtterance : VerbPhrase -> Utterance = \vp ->
|
||||
ss (vp.s1 ++ vp.s ! ASgP1) ;
|
||||
ss (vp.s1 ++ vp.s ! VIInfinit ! ASgP1) ;
|
||||
|
||||
|
||||
--2 Sentence adverbs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete RulesNor of Rules =
|
||||
concrete RulesNor of Rules = CategoriesNor **
|
||||
RulesScand with (SyntaxScand=SyntaxNor) ;
|
||||
|
||||
@@ -116,4 +116,12 @@ instance SyntaxNor of SyntaxScand = TypesNor **
|
||||
)
|
||||
(predVerbGroup True Simul verb) ;
|
||||
|
||||
progressiveClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
|
||||
predVerbGroupClause np
|
||||
(complVerbVerb
|
||||
(verbVara **
|
||||
{s3 = ["ved at"]}
|
||||
)
|
||||
vp) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete TestResourceNor of TestResource = RulesNor, StructuralNor **
|
||||
concrete TestResourceNor of TestResource = RulesNor, ClauseNor, StructuralNor **
|
||||
open Prelude, MorphoNor, SyntaxNor in {
|
||||
|
||||
flags startcat=Phr ; lexer=text ; unlexer=text ;
|
||||
|
||||
@@ -28,6 +28,8 @@ incomplete concrete ClauseScand of Clause = CategoriesScand **
|
||||
SPredAV np v x = predVerbGroupClause np (complVerbAdj v x) ;
|
||||
SPredObjA2V np v x y = predVerbGroupClause np (complVerbAdj2 True v x y) ;
|
||||
|
||||
SPredProgVP = progressiveClause ;
|
||||
|
||||
|
||||
QPredV np v = intVerbPhrase np (predVerb v) ;
|
||||
QPredPassV np v = intVerbPhrase np (passVerb v) ;
|
||||
|
||||
@@ -70,8 +70,6 @@ lin
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
ProgVG = progressiveVerbPhrase ;
|
||||
|
||||
UseCl tp cl = {s = \\o => tp.s ++ cl.s ! tp.b ! ClFinite tp.t tp.a o} ;
|
||||
UseRCl tp cl =
|
||||
{s = \\gn,p => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! gn ! p} ;
|
||||
|
||||
@@ -575,7 +575,8 @@ oper
|
||||
predVerb0 : Verb -> Clause = \regna ->
|
||||
predVerbGroupClause npDet (predVerb regna) ;
|
||||
|
||||
progressiveVerbPhrase : VerbGroup -> VerbGroup ;
|
||||
progressiveVerbPhrase : VerbGroup -> VerbGroup ;
|
||||
progressiveClause : NounPhrase -> VerbPhrase -> Clause ;
|
||||
|
||||
-- Verb phrases can also be formed from adjectives ("är snäll"),
|
||||
-- common nouns ("är en man"), and noun phrases ("är den yngste mannen").
|
||||
|
||||
@@ -121,6 +121,13 @@ instance SyntaxSwe of SyntaxScand = TypesSwe **
|
||||
{s3 = ["på att"]})
|
||||
(predVerbGroup True Simul verb) ;
|
||||
|
||||
progressiveClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
|
||||
predVerbGroupClause np
|
||||
(complVerbVerb
|
||||
(mkVerb "hålla" "håller" "håll" "höll" "hållit" "hållen" **
|
||||
{s3 = ["på att"]})
|
||||
vp) ;
|
||||
|
||||
strPrep : ComplPrep -> Str = \p -> case p of {
|
||||
CPnoPrep => [] ;
|
||||
CPav => "av" ;
|
||||
|
||||
Reference in New Issue
Block a user