forked from GitHub/gf-rgl
start reworking grammar to split verb and verb complement
This commit is contained in:
@@ -16,6 +16,7 @@ concrete ConjunctionLat of Conjunction =
|
|||||||
o = \\_ => [] ;
|
o = \\_ => [] ;
|
||||||
v = \\_,_ => [] ;
|
v = \\_,_ => [] ;
|
||||||
neg = \\_ => [] ;
|
neg = \\_ => [] ;
|
||||||
|
vcompl = [] ;
|
||||||
p = ss.p ;
|
p = ss.p ;
|
||||||
sadv = [] ;
|
sadv = [] ;
|
||||||
t = ss.t
|
t = ss.t
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ concrete QuestionLat of Question = CatLat ** open ResLat, IrregLat, Prelude in {
|
|||||||
neg = \\_,_ => "" ;
|
neg = \\_,_ => "" ;
|
||||||
o = \\_ => vp.obj ;
|
o = \\_ => vp.obj ;
|
||||||
q = ip.s ! Nom ;
|
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 )
|
-- let qcl = mkQuestion { s = ip.s ! Nom } ( mkClause emptyNP vp )
|
||||||
-- in {s = \\t,a,b,qd => qcl.s ! t ! a ! b ! qd} ;
|
-- 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
|
o = \\_ => combineNounPhrase np ! PronNonDrop ! Nom ; -- Should probably not go into the object field
|
||||||
q = icomp.s ;
|
q = icomp.s ;
|
||||||
v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
|
v = \\t,a,_,ap,cp => esseAux.act ! VAct (anteriorityToVAnter a) (tenseToVTense t) np.n P3 ;
|
||||||
|
vcompl = "" ;
|
||||||
} ;
|
} ;
|
||||||
--
|
--
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -1303,7 +1303,14 @@ oper
|
|||||||
sadv : Str -- sentence adverb¡
|
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} ;
|
QClause = {s : C.Tense => Anteriority => C.Pol => QForm => Str} ;
|
||||||
|
|
||||||
mkClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
|
mkClause : NounPhrase -> VerbPhrase -> Clause = \np,vp ->
|
||||||
@@ -1320,8 +1327,8 @@ oper
|
|||||||
preneg : AdvPos -> Str = \ap -> case ap of { PreNeg => adv ; _ => [] } ;
|
preneg : AdvPos -> Str = \ap -> case ap of { PreNeg => adv ; _ => [] } ;
|
||||||
ins : AdvPos -> Str = \ap -> case ap of { InS => adv ; _ => [] } ;
|
ins : AdvPos -> Str = \ap -> case ap of { InS => adv ; _ => [] } ;
|
||||||
inv : AdvPos -> Str = \ap -> case ap of { InV => adv ; _ => [] } ;
|
inv : AdvPos -> Str = \ap -> case ap of { InV => adv ; _ => [] } ;
|
||||||
cprev : ComplPos -> Str = \cp -> case cp of { CPreV => compl ; _ => [] } ;
|
-- cprev : ComplPos -> Str = \cp -> case cp of { CPreV => compl ; _ => [] } ;
|
||||||
cpostv : ComplPos -> Str = \cp -> case cp of { CPostV => compl ; _ => [] }
|
-- cpostv : ComplPos -> Str = \cp -> case cp of { CPostV => compl ; _ => [] }
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
-- subject part of the clause:
|
-- subject part of the clause:
|
||||||
@@ -1341,12 +1348,14 @@ oper
|
|||||||
-- comppos is the position of the verb complement
|
-- comppos is the position of the verb complement
|
||||||
v = \\tense,anter,vqf,advpos,complpos =>
|
v = \\tense,anter,vqf,advpos,complpos =>
|
||||||
prev advpos ++ -- adverbs can be placed in the before the verb phrase
|
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
|
inv advpos ++ -- adverbs can be placed within the verb phrase
|
||||||
-- verb form with conversion between different forms of tense and aspect
|
-- verb form with conversion between different forms of tense and aspect
|
||||||
vp.s ! VAct ( anteriorityToVAnter anter ) ( tenseToVTense tense ) np.n np.p ! vqf ++
|
vp.s ! VAct ( anteriorityToVAnter anter ) ( tenseToVTense tense ) np.n np.p ! vqf ; -- ++
|
||||||
cpostv complpos ; -- complement can also go after the verb
|
-- cpostv complpos ; -- complement can also go after the verb
|
||||||
|
|
||||||
|
-- verb complement
|
||||||
|
vcompl = compl ;
|
||||||
-- object part of the clause
|
-- object part of the clause
|
||||||
o = \\advpos => preo advpos ++ vp.obj ;
|
o = \\advpos => preo advpos ++ vp.obj ;
|
||||||
-- optional negation particle, adverbs can be placed before the negation
|
-- optional negation particle, adverbs can be placed before the negation
|
||||||
@@ -1361,7 +1370,7 @@ oper
|
|||||||
neg = cl.neg ! pol.p ;
|
neg = cl.neg ! pol.p ;
|
||||||
sadv = "" ;
|
sadv = "" ;
|
||||||
t = tense ;
|
t = tense ;
|
||||||
p = pol
|
p = pol ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
combineSentence : Sentence -> ( SAdvPos => AdvPos => ComplPos => Order => Str ) = \s ->
|
combineSentence : Sentence -> ( SAdvPos => AdvPos => ComplPos => Order => Str ) = \s ->
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ concrete SentenceLat of Sentence = CatLat ** open Prelude, ResLat in {
|
|||||||
-- } ;
|
-- } ;
|
||||||
--
|
--
|
||||||
-- AdvS : Adv -> S -> S
|
-- 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.
|
-- This covers subjunctive clauses, but they can also be added to the end.
|
||||||
-- SSubjS : S -> Subj -> S -> S ; -- I go home if she comes
|
-- SSubjS : S -> Subj -> S -> S ; -- I go home if she comes
|
||||||
|
|||||||
Reference in New Issue
Block a user