forked from GitHub/gf-rgl
(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.
|
-- Subordinate clauses can function as adverbs.
|
||||||
|
|
||||||
-- : Subj -> S -> Adv ;
|
-- : 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.
|
-- Comparison adverbs also work as numeral adverbs.
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
|
|||||||
lin
|
lin
|
||||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
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 ;
|
UttQS qs = qs ;
|
||||||
|
|
||||||
UttImpSg pol imp =
|
UttImpSg pol imp =
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> QCl ;
|
-- : Cl -> QCl ;
|
||||||
QuestCl cl = {s = cl.s ! Question} ;
|
QuestCl cl = mergeSTM (cl.s ! Question) ;
|
||||||
|
|
||||||
-- : IP -> VP -> QCl ;
|
-- : IP -> VP -> QCl ;
|
||||||
-- QuestVP ip vp = ;
|
-- 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) ;
|
RelVP rp vp = RelSlash rp (predVPSlash emptyNP vp) ;
|
||||||
|
|
||||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||||
RelSlash rp cls = {
|
RelSlash rp cls =
|
||||||
s = \\t,a,p => rp.s ++ cls.s ! True ! t ! a ! p
|
let rcl = mergeSTM (cls.s ! True)
|
||||||
} ;
|
in rcl ** {s = \\t,a,p => rp.s ++ rcl.s ! t ! a ! p} ;
|
||||||
|
|
||||||
|
|
||||||
-- : RP ;
|
-- : RP ;
|
||||||
|
|||||||
@@ -749,10 +749,14 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Sentences etc.
|
-- 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} ;
|
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 ->
|
predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
|
||||||
let cl = predVP np vps in {s = table {
|
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 {
|
bind : Str = case <vp.isPassive,vp.obj2.a, vp.c2, vp.pred> of {
|
||||||
<False,P3_Prep,NoPrep,NoPred> => [] ;
|
<False,P3_Prep,NoPrep,NoPred> => [] ;
|
||||||
_ => BIND } ;
|
_ => BIND } ;
|
||||||
in case p of {
|
in case <cltyp,p> of {
|
||||||
Pos => o ;
|
<Statement,Neg> => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} ;
|
||||||
Neg => {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} -- object pronoun, prepositions and negation all contract
|
_ => o
|
||||||
|
-- object pronoun, prepositions and negation all contract
|
||||||
} ;
|
} ;
|
||||||
stm : Str = case cltyp of {
|
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)
|
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}
|
subj = case vps.isPassive of {True => impersNP ; _ => np}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
wordOrder : (sn,sp,stm : Str) -> {p1,p2 : Str} -> {fin,inf : Str} -> VerbPhrase -> Str =
|
wordOrder : (sn,sp,stm : Str) -> {p1,p2 : Str} -> {fin,inf : Str} -> VerbPhrase -> BaseCl =
|
||||||
\subjnoun,subjpron,stm,obj,pred,vp -> vp.berri -- AdV
|
\subjnoun,subjpron,stm,obj,pred,vp -> {
|
||||||
|
beforeSTM = vp.berri -- AdV
|
||||||
++ subjnoun -- subject if it's a noun
|
++ subjnoun -- subject if it's a noun
|
||||||
++ obj.p1 -- object if it's a noun
|
++ obj.p1 ; -- object if it's a noun
|
||||||
++ stm -- sentence type marker + possible subj. pronoun
|
afterSTM = stm -- sentence type marker + possible subj. pronoun
|
||||||
++ obj.p2 -- object if it's a pronoun
|
++ obj.p2 -- object if it's a pronoun
|
||||||
++ vp.sii -- restricted set of particles
|
++ vp.sii -- restricted set of particles
|
||||||
++ vp.dhex -- restricted set of nouns/adverbials
|
++ vp.dhex -- restricted set of nouns/adverbials
|
||||||
@@ -805,7 +811,7 @@ oper
|
|||||||
++ vp.vComp -- VV complement
|
++ vp.vComp -- VV complement
|
||||||
++ pred.inf -- potential infinitive/participle
|
++ pred.inf -- potential infinitive/participle
|
||||||
++ pred.fin -- the verb inflected
|
++ 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.
|
---- Primary places for adverbs are obj, sii or dhex.
|
||||||
|
|
||||||
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> Verb
|
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> Verb
|
||||||
@@ -841,8 +847,9 @@ oper
|
|||||||
} ; -- TODO other relative forms
|
} ; -- TODO other relative forms
|
||||||
|
|
||||||
infVP : VerbPhrase -> Str = \vp ->
|
infVP : VerbPhrase -> Str = \vp ->
|
||||||
let inf = {inf = vp.s ! VInf ; fin=[]}
|
let inf = {inf = vp.s ! VInf ; fin=[]} ;
|
||||||
in wordOrder [] [] [] (vp.comp ! Pl3) inf vp ;
|
wo = wordOrder [] [] [] (vp.comp ! Pl3) inf vp ;
|
||||||
|
in wo.beforeSTM ++ wo.afterSTM ;
|
||||||
|
|
||||||
stmarkerContr : Agreement => Polarity => Str = \\a,b =>
|
stmarkerContr : Agreement => Polarity => Str = \\a,b =>
|
||||||
let stm = if_then_Pol b "w" "m"
|
let stm = if_then_Pol b "w" "m"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ lin
|
|||||||
|
|
||||||
-}
|
-}
|
||||||
-- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen
|
-- : 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
|
--2 Imperatives
|
||||||
-- : VP -> Imp ;
|
-- : VP -> Imp ;
|
||||||
@@ -50,8 +50,9 @@ lin
|
|||||||
-}
|
-}
|
||||||
-- : Temp -> Pol -> Cl -> S ;
|
-- : Temp -> Pol -> Cl -> S ;
|
||||||
UseCl t p cl = {s = \\b =>
|
UseCl t p cl = {s = \\b =>
|
||||||
let cltyp = if_then_else ClType b Subord Statement in
|
let cltyp = if_then_else ClType b Subord Statement ;
|
||||||
t.s ++ p.s ++ cl.s ! cltyp ! t.t ! t.a ! p.p
|
sent = cl.s ! cltyp ! t.t ! t.a ! p.p in
|
||||||
|
sent ** {beforeSTM = t.s ++ p.s ++ sent.beforeSTM} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> QCl -> QS ;
|
-- : Temp -> Pol -> QCl -> QS ;
|
||||||
@@ -73,7 +74,7 @@ lin
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
advS : Adverb -> S -> S = \a,s -> s ** {s = \\b =>
|
advS : Adverb -> S -> S = \a,s -> s ** {s = \\b => let ss = s.s ! b in
|
||||||
linAdv a ++ s.s ! b} ;
|
ss ** {beforeSTM = linAdv a ++ ss.beforeSTM}} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user