1
0
forked from GitHub/gf-rgl

start reworking grammar to split verb and verb complement

This commit is contained in:
Herbert Lange
2019-11-10 20:40:32 +01:00
parent 523b4841fc
commit 48d9b3909e
4 changed files with 23 additions and 10 deletions

View File

@@ -16,6 +16,7 @@ concrete ConjunctionLat of Conjunction =
o = \\_ => [] ;
v = \\_,_ => [] ;
neg = \\_ => [] ;
vcompl = [] ;
p = ss.p ;
sadv = [] ;
t = ss.t

View File

@@ -17,7 +17,8 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
neg = \\_,_ => "" ;
o = \\_ => vp.obj ;
q = ip.s ! Nom ;
v = \\t,a,_,ap,cp => vp.s ! VAct (anteriorityToVAnter a) (tenseToVTense t) ip.n P3 ! VQFalse
v = \\t,a,_,ap,cp => vp.s ! VAct (anteriorityToVAnter a) (tenseToVTense t) ip.n P3 ! VQFalse ;
vcompl = vp.compl ! Ag Masc ip.n Nom ; -- default gender masculine
} ;
-- let qcl = mkQuestion { s = ip.s ! Nom } ( mkClause emptyNP vp )
-- in {s = \\t,a,b,qd => qcl.s ! t ! a ! b ! qd} ;
@@ -40,6 +41,7 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
o = \\_ => combineNounPhrase np ! PronNonDrop ! Nom ; -- Should probably not go into the object field
q = icomp.s ;
v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
vcompl = "" ;
} ;
--
--

View File

@@ -1303,7 +1303,14 @@ oper
sadv : Str -- sentence adverb¡
} ;
Clause = {s,o : AdvPos => Str ; v : Tense => Anteriority => VQForm => AdvPos => ComplPos => Str ; neg : Polarity => AdvPos => Str ; adv : Str } ;
Clause =
{s : AdvPos => Str ;
o : AdvPos => Str ;
v : Tense => Anteriority => VQForm => AdvPos => ComplPos => Str ;
det : Determiner ;
compl : Str ;
neg : Polarity => AdvPos => Str ;
adv : Str } ;
QClause = {s : C.Tense => Anteriority => C.Pol => QForm => Str} ;
mkClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
@@ -1320,8 +1327,8 @@ oper
preneg : AdvPos -> Str = \ap -> case ap of { PreNeg => adv ; _ => [] } ;
ins : AdvPos -> Str = \ap -> case ap of { InS => adv ; _ => [] } ;
inv : AdvPos -> Str = \ap -> case ap of { InV => adv ; _ => [] } ;
cprev : ComplPos -> Str = \cp -> case cp of { CPreV => compl ; _ => [] } ;
cpostv : ComplPos -> Str = \cp -> case cp of { CPostV => compl ; _ => [] }
-- cprev : ComplPos -> Str = \cp -> case cp of { CPreV => compl ; _ => [] } ;
-- cpostv : ComplPos -> Str = \cp -> case cp of { CPostV => compl ; _ => [] }
in
{
-- subject part of the clause:
@@ -1341,12 +1348,14 @@ oper
-- comppos is the position of the verb complement
v = \\tense,anter,vqf,advpos,complpos =>
prev advpos ++ -- adverbs can be placed in the before the verb phrase
cprev complpos ++ -- verb phrase complement, e.g. predicative expression, agreeing with the subject, can go before the verb
-- cprev complpos ++ -- verb phrase complement, e.g. predicative expression, agreeing with the subject, can go before the verb
inv advpos ++ -- adverbs can be placed within the verb phrase
-- verb form with conversion between different forms of tense and aspect
vp.s ! VAct ( anteriorityToVAnter anter ) ( tenseToVTense tense ) np.n np.p ! vqf ++
cpostv complpos ; -- complement can also go after the verb
vp.s ! VAct ( anteriorityToVAnter anter ) ( tenseToVTense tense ) np.n np.p ! vqf ; -- ++
-- cpostv complpos ; -- complement can also go after the verb
-- verb complement
vcompl = compl ;
-- object part of the clause
o = \\advpos => preo advpos ++ vp.obj ;
-- optional negation particle, adverbs can be placed before the negation
@@ -1361,7 +1370,7 @@ oper
neg = cl.neg ! pol.p ;
sadv = "" ;
t = tense ;
p = pol
p = pol ;
} ;
combineSentence : Sentence -> ( SAdvPos => AdvPos => ComplPos => Order => Str ) = \s ->

View File

@@ -67,7 +67,8 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in {
-- } ;
--
-- AdvS : Adv -> S -> S
AdvS adv s = { s = s.s ; o = s.o ; v = s.v ; neg = s.neg ; t = s.t ; p = s.p ; sadv = adv.s ! Posit ++ s.sadv } ;
AdvS adv s = -- { s = s.s ; o = s.o ; v = s.v ; neg = s.neg ; t = s.t ; p = s.p ; sadv = adv.s ! Posit ++ s.sadv } ;
s ** { sadv = adv.s ! Posit ++ s.sadv } ;
-- This covers subjunctive clauses, but they can also be added to the end.
-- SSubjS : S -> Subj -> S -> S ; -- I go home if she comes