mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Som) Make Cl, S etc. discontinuous, to add Subj to the right place
This commit is contained in:
@@ -24,7 +24,8 @@ lin
|
||||
-- Subordinate clauses can function as adverbs.
|
||||
|
||||
-- : Subj -> S -> Adv ;
|
||||
SubjS subj s = mkAdv (subj.s ++ s.s ! True) ;
|
||||
SubjS subj s = let subs = s.s ! True in
|
||||
mkAdv (subs.beforeSTM ++ subj.s ++ subs.afterSTM) ;
|
||||
|
||||
-- Comparison adverbs also work as numeral adverbs.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = {s = s.s ! False} ;
|
||||
UttS s = let basecl = s.s ! False in {s = basecl.beforeSTM ++ basecl.afterSTM} ;
|
||||
UttQS qs = qs ;
|
||||
|
||||
UttImpSg pol imp =
|
||||
|
||||
@@ -6,7 +6,7 @@ concrete QuestionSom of Question = CatSom ** open
|
||||
|
||||
lin
|
||||
-- : Cl -> QCl ;
|
||||
QuestCl cl = {s = cl.s ! Question} ;
|
||||
QuestCl cl = mergeSTM (cl.s ! Question) ;
|
||||
|
||||
-- : IP -> VP -> QCl ;
|
||||
-- QuestVP ip vp = ;
|
||||
|
||||
@@ -22,9 +22,9 @@ books-the men-the bring 'the books which the men bring'
|
||||
RelVP rp vp = RelSlash rp (predVPSlash emptyNP vp) ;
|
||||
|
||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||
RelSlash rp cls = {
|
||||
s = \\t,a,p => rp.s ++ cls.s ! True ! t ! a ! p
|
||||
} ;
|
||||
RelSlash rp cls =
|
||||
let rcl = mergeSTM (cls.s ! True)
|
||||
in rcl ** {s = \\t,a,p => rp.s ++ rcl.s ! t ! a ! p} ;
|
||||
|
||||
|
||||
-- : RP ;
|
||||
|
||||
@@ -749,10 +749,14 @@ oper
|
||||
} ;
|
||||
--------------------------------------------------------------------------------
|
||||
-- Sentences etc.
|
||||
Clause : Type = {s : ClType => Tense => Anteriority => Polarity => Str} ;
|
||||
BaseCl : Type = {beforeSTM, afterSTM : Str} ; -- adverbs, subjects, all that comes before sentence type marker. Eventual Subj attaches to the part after STM.
|
||||
Clause : Type = {s : ClType => Tense => Anteriority => Polarity => BaseCl} ;
|
||||
ClSlash : Type = {s : Bool {-is subordinate-} => Tense => Anteriority => Polarity => BaseCl} ;
|
||||
Sentence : Type = {s : Bool {-is subordinate-} => BaseCl} ;
|
||||
QClause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
||||
ClSlash : Type = {s : Bool {-is subordinate-} => Tense => Anteriority => Polarity => Str} ;
|
||||
Sentence : Type = {s : Bool {-is subordinate-} => Str} ;
|
||||
|
||||
mergeSTM : (Tense => Anteriority => Polarity => BaseCl) -> QClause = \b ->
|
||||
{s = \\t,a,p => (b ! t ! a ! p).beforeSTM ++ (b ! t ! a ! p).afterSTM} ;
|
||||
|
||||
predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
|
||||
let cl = predVP np vps in {s = table {
|
||||
@@ -775,9 +779,10 @@ oper
|
||||
bind : Str = case <vp.isPassive,vp.obj2.a, vp.c2, vp.pred> of {
|
||||
<False,P3_Prep,NoPrep,NoPred> => [] ;
|
||||
_ => BIND } ;
|
||||
in case p of {
|
||||
Pos => o ;
|
||||
Neg => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} -- object pronoun, prepositions and negation all contract
|
||||
in case <cltyp,p> of {
|
||||
<Statement,Neg> => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} ;
|
||||
_ => o
|
||||
-- object pronoun, prepositions and negation all contract
|
||||
} ;
|
||||
stm : Str = case cltyp of {
|
||||
Subord => if_then_Pol p [] "aan" ++ subjpron ; -- if we form a ClSlash, no sentence type marker; negation with aan (Sayeed p. 210)
|
||||
@@ -793,11 +798,12 @@ oper
|
||||
subj = case vps.isPassive of {True => impersNP ; _ => np}
|
||||
} ;
|
||||
|
||||
wordOrder : (sn,sp,stm : Str) -> {p1,p2 : Str} -> {fin,inf : Str} -> VerbPhrase -> Str =
|
||||
\subjnoun,subjpron,stm,obj,pred,vp -> vp.berri -- AdV
|
||||
wordOrder : (sn,sp,stm : Str) -> {p1,p2 : Str} -> {fin,inf : Str} -> VerbPhrase -> BaseCl =
|
||||
\subjnoun,subjpron,stm,obj,pred,vp -> {
|
||||
beforeSTM = vp.berri -- AdV
|
||||
++ subjnoun -- subject if it's a noun
|
||||
++ obj.p1 -- object if it's a noun
|
||||
++ stm -- sentence type marker + possible subj. pronoun
|
||||
++ obj.p1 ; -- object if it's a noun
|
||||
afterSTM = stm -- sentence type marker + possible subj. pronoun
|
||||
++ obj.p2 -- object if it's a pronoun
|
||||
++ vp.sii -- restricted set of particles
|
||||
++ vp.dhex -- restricted set of nouns/adverbials
|
||||
@@ -805,7 +811,7 @@ oper
|
||||
++ vp.vComp -- VV complement
|
||||
++ pred.inf -- potential infinitive/participle
|
||||
++ pred.fin -- the verb inflected
|
||||
++ vp.miscAdv ; ---- NB. Only used if there are several adverbs.
|
||||
++ vp.miscAdv } ; ---- NB. Only used if there are several adverbs.
|
||||
---- Primary places for adverbs are obj, sii or dhex.
|
||||
|
||||
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> Verb
|
||||
@@ -841,8 +847,9 @@ oper
|
||||
} ; -- TODO other relative forms
|
||||
|
||||
infVP : VerbPhrase -> Str = \vp ->
|
||||
let inf = {inf = vp.s ! VInf ; fin=[]}
|
||||
in wordOrder [] [] [] (vp.comp ! Pl3) inf vp ;
|
||||
let inf = {inf = vp.s ! VInf ; fin=[]} ;
|
||||
wo = wordOrder [] [] [] (vp.comp ! Pl3) inf vp ;
|
||||
in wo.beforeSTM ++ wo.afterSTM ;
|
||||
|
||||
stmarkerContr : Agreement => Polarity => Str = \\a,b =>
|
||||
let stm = if_then_Pol b "w" "m"
|
||||
|
||||
@@ -27,7 +27,7 @@ lin
|
||||
|
||||
-}
|
||||
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
|
||||
UseSlash t p cls = {s = \\b => t.s ++ p.s ++ cls.s ! b ! t.t ! t.a ! p.p} ;
|
||||
--UseSlash t p cls = {s = \\b => t.s ++ p.s ++ cls.s ! b ! t.t ! t.a ! p.p} ;
|
||||
|
||||
--2 Imperatives
|
||||
-- : VP -> Imp ;
|
||||
@@ -50,8 +50,9 @@ lin
|
||||
-}
|
||||
-- : Temp -> Pol -> Cl -> S ;
|
||||
UseCl t p cl = {s = \\b =>
|
||||
let cltyp = if_then_else ClType b Subord Statement in
|
||||
t.s ++ p.s ++ cl.s ! cltyp ! t.t ! t.a ! p.p
|
||||
let cltyp = if_then_else ClType b Subord Statement ;
|
||||
sent = cl.s ! cltyp ! t.t ! t.a ! p.p in
|
||||
sent ** {beforeSTM = t.s ++ p.s ++ sent.beforeSTM} ;
|
||||
} ;
|
||||
|
||||
-- : Temp -> Pol -> QCl -> QS ;
|
||||
@@ -73,7 +74,7 @@ lin
|
||||
|
||||
oper
|
||||
|
||||
advS : Adverb -> S -> S = \a,s -> s ** {s = \\b =>
|
||||
linAdv a ++ s.s ! b} ;
|
||||
advS : Adverb -> S -> S = \a,s -> s ** {s = \\b => let ss = s.s ! b in
|
||||
ss ** {beforeSTM = linAdv a ++ ss.beforeSTM}} ;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user