forked from GitHub/gf-rgl
(Som) Restructure relatives and questions
This commit is contained in:
@@ -31,8 +31,7 @@ lin
|
|||||||
-- Subordinate clauses can function as adverbs.
|
-- Subordinate clauses can function as adverbs.
|
||||||
|
|
||||||
-- : Subj -> S -> Adv ;
|
-- : Subj -> S -> Adv ;
|
||||||
SubjS subj s = let subs = s.s ! True in
|
SubjS subj s = mkAdv (s.s ! True) ;
|
||||||
mkAdv (subs.beforeSTM ++ subj.s ++ subs.stm ++ subs.afterSTM) ;
|
|
||||||
|
|
||||||
-- Comparison adverbs also work as numeral adverbs.
|
-- Comparison adverbs also work as numeral adverbs.
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
|||||||
-- relative sentence. Tense and polarity fixed,
|
-- relative sentence. Tense and polarity fixed,
|
||||||
-- but agreement may depend on the CN/NP it modifies.
|
-- but agreement may depend on the CN/NP it modifies.
|
||||||
|
|
||||||
Cl = ResSom.Clause ;
|
Cl = ResSom.ClSlash ;
|
||||||
ClSlash = ResSom.ClSlash ;
|
ClSlash = ResSom.ClSlash ;
|
||||||
SSlash = ResSom.Sentence ; -- sentence missing NP; e.g. "she has looked at"
|
SSlash = ResSom.Sentence ; -- sentence missing NP; e.g. "she has looked at"
|
||||||
Imp = SS ; -- imperative e.g. "look at this"
|
Imp = SS ; -- imperative e.g. "look at this"
|
||||||
@@ -127,5 +127,4 @@ linref
|
|||||||
VP = infVP ;
|
VP = infVP ;
|
||||||
CN = linCN ;
|
CN = linCN ;
|
||||||
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ++ prep.miscAdv ! Sg3 Masc ;
|
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ++ prep.miscAdv ! Sg3 Masc ;
|
||||||
S = \s -> linBaseCl (s.s ! False) ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 = let basecl = s.s ! False in {s = linBaseCl basecl} ;
|
UttS s = {s = s.s ! False} ;
|
||||||
UttQS qs = qs ;
|
UttQS qs = qs ;
|
||||||
|
|
||||||
UttImpSg pol imp =
|
UttImpSg pol imp =
|
||||||
|
|||||||
@@ -6,17 +6,17 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> QCl ;
|
-- : Cl -> QCl ;
|
||||||
QuestCl cl = mergeQCl (cl.s ! Question) ;
|
QuestCl = cl2qcl ;
|
||||||
|
|
||||||
-- : IP -> VP -> QCl ;
|
-- : IP -> VP -> QCl ;
|
||||||
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
|
QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP
|
||||||
let clRaw : ClLite = predVPlite ip vp ;
|
let clRaw : ClSlash = predVP ip vp ;
|
||||||
cl : ClLite = clRaw ** {
|
cl : ClSlash = clRaw ** {
|
||||||
stm = \\clt,p => case <clt,p> of {
|
stm = \\clt,p => case <clt,p> of {
|
||||||
<_,Pos> => "baa" ;
|
<_,Pos> => "baa" ;
|
||||||
_ => clRaw.stm ! clt ! p }
|
_ => clRaw.stm ! clt ! p }
|
||||||
}
|
}
|
||||||
in wordOrderLite Question cl ;
|
in cl2qcl cl ;
|
||||||
|
|
||||||
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
-- : IP -> ClSlash -> QCl ; -- whom does John love
|
||||||
--QuestSlash ip cls = ;
|
--QuestSlash ip cls = ;
|
||||||
|
|||||||
@@ -14,19 +14,19 @@ lin
|
|||||||
them in manually in RelVP.
|
them in manually in RelVP.
|
||||||
-}
|
-}
|
||||||
RelVP rp vp = {s = \\gn,c,t,a,p =>
|
RelVP rp vp = {s = \\gn,c,t,a,p =>
|
||||||
let cls = predVPSlash impersNP vp ;
|
let cls = predVP impersNP vp ;
|
||||||
rclSubord = mergeRCl (cls.s ! True) ;
|
rclSubord = cl2rcl cls ;
|
||||||
rclStatement = mergeRCl (cls.s ! False) ;
|
rclStatement = cl2rclNom cls ;
|
||||||
in rp.s ++ case <gn,c,t,a,p> of {
|
in rp.s ++ case <gn,c,t,a,p> of {
|
||||||
<g,Abs,Pres,Simul,Pos> => linVP (VRel g) Subord vp ; -- reduced present only in absolutive
|
<g,Abs,Pres,Simul,Pos> => linVP (VRel g) Subord vp ; -- reduced present only in absolutive
|
||||||
<_,Abs,Pres,Simul,Neg> => linVP VRelNeg Subord vp ; -- special form for have and be
|
<_,Abs,Pres,Simul,Neg> => linVP VRelNeg Subord vp ; -- special form for have and be
|
||||||
<_,Nom,Pres,Simul,Pos> => rclStatement.s ! t ! a ! p ; -- the usual forms, not subordinate
|
<_,Nom,Pres,Simul,Pos> => rclStatement.s ! t ! a ! p ; -- as nominative, use the usual forms, not subordinate
|
||||||
_ => rclSubord.s ! t ! a ! p } -- the rest is Subord because of negation.
|
_ => rclSubord.s ! t ! a ! p } -- the rest is Subord because of negation.
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
-- : RP -> ClSlash -> RCl ; -- whom John loves
|
||||||
RelSlash rp cls =
|
RelSlash rp cls =
|
||||||
let rcl = mergeQCl (cls.s ! True) -- in subordinate clause, STM is not included but subject pronoun is
|
let rcl = cl2relslash cls -- in subordinate clause, STM is not included but subject pronoun is
|
||||||
in rcl ** {s = \\g,c,t,a,p => rp.s ++ rcl.s ! t ! a ! p} ;
|
in rcl ** {s = \\g,c,t,a,p => rp.s ++ rcl.s ! t ! a ! p} ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -698,8 +698,8 @@ oper
|
|||||||
c2 : PrepCombination ; -- Prepositions can combine together and with object pronoun.
|
c2 : PrepCombination ; -- Prepositions can combine together and with object pronoun.
|
||||||
obj2 : NPLite ; -- {s : Str ; a : PrepAgr}
|
obj2 : NPLite ; -- {s : Str ; a : PrepAgr}
|
||||||
secObj : Str ; -- if two overt pronoun objects
|
secObj : Str ; -- if two overt pronoun objects
|
||||||
vComp : {subjunc : Str ; -- if it's "waa in" or subjunctive construction, there's "in" in there
|
vComp : {subjunc : Str ; -- "waa in" or subjunctive construction: "in" is placed here
|
||||||
inf : Str ;
|
inf : Str ; -- auxiliary VV with infinitive argument
|
||||||
subcl : Agreement => Str} -- VV complement if it's a subordinate clause
|
subcl : Agreement => Str} -- VV complement if it's a subordinate clause
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -803,9 +803,9 @@ oper
|
|||||||
{- After PredVP, we might still want to add more adverbs (QuestIAdv),
|
{- After PredVP, we might still want to add more adverbs (QuestIAdv),
|
||||||
but we're done with verb inflection.
|
but we're done with verb inflection.
|
||||||
-}
|
-}
|
||||||
ClLite : Type = BaseAdv ** {
|
ClSlash : Type = BaseAdv ** {
|
||||||
-- Fixed in Cl
|
-- Fixed in Cl
|
||||||
subj : {noun, pron : Str} ; -- noun and subject pronoun if applicable
|
subj : {noun, pron : Str ; isP3 : Bool} ; -- noun and subject pronoun if applicable
|
||||||
obj2 : NPLite ;
|
obj2 : NPLite ;
|
||||||
secObj : Str ;
|
secObj : Str ;
|
||||||
c2 : PrepCombination ; -- NB. QuestIAdv can add more prepositions
|
c2 : PrepCombination ; -- NB. QuestIAdv can add more prepositions
|
||||||
@@ -813,52 +813,27 @@ oper
|
|||||||
vComp : {inf,subcl,subjunc : Str} ;
|
vComp : {inf,subcl,subjunc : Str} ;
|
||||||
|
|
||||||
-- Still open
|
-- Still open
|
||||||
pred : ClType => Tense => Anteriority => Polarity => {fin,inf : Str} ;
|
pred : ClType => Tense => Anteriority => Polarity => Str ;
|
||||||
stm : ClType => Polarity => Str
|
stm : ClType => Polarity => Str
|
||||||
{- If formed with PredVP:
|
|
||||||
Pos,Statement => waxa or waa depending on what STM was
|
|
||||||
Pos,Question => ma
|
|
||||||
Neg,Statement => ma
|
|
||||||
Neg,Question => ma aan or sow (TODO implement this)
|
|
||||||
Pos,Subord => []
|
|
||||||
Neg,Subord => aan
|
|
||||||
Contrast QCl formed with QuestVP:
|
|
||||||
Pos => baa
|
|
||||||
Neg => ?? -}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
||||||
|
QClause = Clause ;
|
||||||
BaseCl : Type = {beforeSTM, stm, 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} ;
|
|
||||||
RClause : Type = {s : GenNum => Case => Tense => Anteriority => Polarity => Str} ;
|
RClause : Type = {s : GenNum => Case => Tense => Anteriority => Polarity => Str} ;
|
||||||
QClause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
Sentence : Type = {s : Bool {-is subordinate-} => Str} ;
|
||||||
|
|
||||||
mergeQCl : (Tense => Anteriority => Polarity => BaseCl) -> QClause = mergeSTM True ;
|
predVPslash = predVP ; -- Cl and ClSlash are the same category
|
||||||
mergeRCl : (Tense => Anteriority => Polarity => BaseCl) -> QClause = mergeSTM False ;
|
|
||||||
|
|
||||||
mergeSTM : Bool -> (Tense => Anteriority => Polarity => BaseCl) -> QClause = \includeSTM,bcl ->
|
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vps -> vp ** {
|
||||||
{s = \\t,a,p => (bcl ! t ! a ! p).beforeSTM
|
subj = {noun = subjnoun ; pron = subjpron ; isP3 = isP3 subj.a} ;
|
||||||
++ case <includeSTM,p> of {
|
|
||||||
<False,Pos> => [] ;
|
|
||||||
<False,Neg> => "aan" ; -- include negation even if not including STM otherwise.
|
|
||||||
<True> => (bcl ! t ! a ! p).stm
|
|
||||||
}
|
|
||||||
++ (bcl ! t ! a ! p).afterSTM
|
|
||||||
} ;
|
|
||||||
|
|
||||||
predVPlite : NounPhrase -> VerbPhrase -> ClLite = \np,vps -> vp ** {
|
|
||||||
subj = {noun = subjnoun ; pron = subjpron} ;
|
|
||||||
pred = \\cltyp,t,a,p =>
|
pred = \\cltyp,t,a,p =>
|
||||||
let predRaw = vf cltyp t a p subj.a vp ;
|
let predRaw = vf cltyp t a p subj.a vp ;
|
||||||
in case <cltyp, p, t, vp.stm, subj.a> of {
|
in case <cltyp, p, t, vp.stm, subj.a> of {
|
||||||
<Statement, Pos, Pres, Waa NoCopula, Sg3 _|Pl3> -- VP comes from CompNP/CompCN + P3 subject
|
<Statement, Pos, Pres, Waa NoCopula, Sg3 _|Pl3> -- VP comes from CompNP/CompCN + P3 subject
|
||||||
=> {fin,inf = []} ;
|
=> [] ;
|
||||||
|
|
||||||
<_, _, Pres, Waa (Copula|NoCopula), _> -- Comp* present tense + any subject
|
<_, _, Pres, Waa (Copula|NoCopula), _> -- Comp* present tense + any subject
|
||||||
=> {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ;
|
=> presCopula ! {agr=subj.a ; pol=p} ;
|
||||||
|
|
||||||
_ => predRaw -- Any other verb
|
_ => predRaw -- Any other verb
|
||||||
} ;
|
} ;
|
||||||
@@ -872,10 +847,6 @@ oper
|
|||||||
<Subord,Pos> => [] ;
|
<Subord,Pos> => [] ;
|
||||||
<Subord,Neg> => "aan"
|
<Subord,Neg> => "aan"
|
||||||
} ;
|
} ;
|
||||||
--c2 = vp.c2 ;
|
|
||||||
--obj2 = vp.obj2 ;
|
|
||||||
--secObj = vp.secObj ;
|
|
||||||
-- sii, dhex, berri, miscAdv = from VP
|
|
||||||
comp = vp.comp ! subj.a ;
|
comp = vp.comp ! subj.a ;
|
||||||
vComp = vp.vComp ** {
|
vComp = vp.vComp ** {
|
||||||
subcl = vp.vComp.subcl ! subj.a
|
subcl = vp.vComp.subcl ! subj.a
|
||||||
@@ -887,123 +858,75 @@ oper
|
|||||||
subj : NounPhrase = case isPassive vps of {
|
subj : NounPhrase = case isPassive vps of {
|
||||||
True => impersNP ;
|
True => impersNP ;
|
||||||
_ => np } ;
|
_ => np } ;
|
||||||
subjnoun : Str = if_then_Str np.isPron np.empty (subj.s ! Nom) ;
|
subjnoun : Str = case np.isPron of {
|
||||||
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
|
True => np.empty ;
|
||||||
|
False => subj.s ! Nom
|
||||||
|
} ;
|
||||||
|
subjpron : Str = case <vp.stm,subj.a> of {
|
||||||
|
<Waa (Copula|NoCopula),Pl3|Sg3 _|Impers>
|
||||||
|
=> np.empty ;
|
||||||
|
_ => (pronTable ! subj.a).s ! Nom
|
||||||
|
}
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- just like complSlash but for ClLite
|
-- just like complSlash but for Cl
|
||||||
complCl : ClLite -> ClLite = \cl -> let np = cl.obj2 in cl ** {
|
complCl : ClSlash -> ClSlash = \cl -> let np = cl.obj2 in cl ** {
|
||||||
comp = {p1 = np.s ++ cl.comp.p1 ;
|
comp = {p1 = np.s ++ cl.comp.p1 ;
|
||||||
p2 = cl.comp.p2 ++ prepCombTable ! np.a ! cl.c2}
|
p2 = cl.comp.p2 ++ prepCombTable ! np.a ! cl.c2}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
predVPSlash : NounPhrase -> VPSlash -> ClSlash = \np,vps ->
|
-- RelVP: subject pronoun is never included
|
||||||
let cl = predVP np vps in {s = table {
|
cl2rcl : ClSlash -> Clause =
|
||||||
True => cl.s ! Subord ;
|
let hasSubjPron : Bool = False ;
|
||||||
False => cl.s ! Statement }
|
hasSTM : Bool = False ;
|
||||||
} ;
|
isRel : Bool = True ;
|
||||||
|
in wordOrder Subord isRel hasSubjPron hasSTM ;
|
||||||
|
|
||||||
predVP : NounPhrase -> VerbPhrase -> Clause = \np,vps -> {
|
-- No subject pronoun, no STM, but use verb forms from Statement
|
||||||
s = \\cltyp,t,a,p =>
|
cl2rclNom : ClSlash -> Clause = \cls ->
|
||||||
let predRaw : {fin : Str ; inf : Str} = vf cltyp t a p subj.a vp ;
|
let hasSubjPron : Bool = False ;
|
||||||
pred : {fin : Str ; inf : Str} = case <cltyp, p, t, vp.stm, subj.a> of {
|
hasSTM : Bool = False ;
|
||||||
<Statement, Pos, Pres, Waa NoCopula, Sg3 _|Pl3> -- VP comes from CompNP/CompCN + P3 subject
|
isRel : Bool = True ;
|
||||||
=> {fin,inf = []} ;
|
in wordOrder Statement isRel hasSubjPron hasSTM cls ;
|
||||||
|
|
||||||
<_, _, Pres, Waa (Copula|NoCopula), _> -- Comp* present tense + any subject
|
-- RelSlash: subject pronoun is included if it's not 3rd person
|
||||||
=> {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ;
|
-- TODO check this rule with more example sentences
|
||||||
|
cl2relslash : ClSlash -> Clause =
|
||||||
|
let hasSubjPron : Bool = True ;
|
||||||
|
hasSTM : Bool = False ;
|
||||||
|
isRel : Bool = True ;
|
||||||
|
in wordOrder Subord isRel hasSubjPron hasSTM ;
|
||||||
|
|
||||||
_ => predRaw -- Any other verb
|
-- Question clauses: subject pronoun not included, STM is
|
||||||
} ;
|
cl2qcl : ClSlash -> Clause =
|
||||||
|
let hasSubjPron : Bool = False ;
|
||||||
|
hasSTM : Bool = True ;
|
||||||
|
isRel : Bool = False ;
|
||||||
|
in wordOrder Question isRel hasSubjPron hasSTM ;
|
||||||
|
|
||||||
subjnoun : Str = if_then_Str np.isPron np.empty (subj.s ! Nom) ;
|
-- Sentence: include subject pronoun and STM.
|
||||||
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
|
-- When subordinate, include "in".
|
||||||
|
cl2sentence : Bool -> ClSlash -> Clause = \isSubord,cls -> {
|
||||||
obj : {p1,p2 : Str} =
|
|
||||||
let o : {p1,p2 : Str} = vp.comp ! subj.a ;
|
|
||||||
bind : Str =
|
|
||||||
case <isPassive vp, vp.obj2.a, vp.c2> of {
|
|
||||||
<False,P3_Prep,Single NoPrep> => [] ; -- nothing to attach to the STM
|
|
||||||
_ => BIND } ; -- something to attach, use BIND
|
|
||||||
in case <cltyp,p> of {
|
|
||||||
<Statement,Neg> -- object pronoun and prepositions contract with negation
|
|
||||||
=> {p2 = [] ; p1 = o.p1 ++ o.p2 ++ bind} ;
|
|
||||||
_ => o
|
|
||||||
|
|
||||||
} ;
|
|
||||||
|
|
||||||
stm : {p1,p2 : Str} = case cltyp of {
|
|
||||||
Subord => {p1 = if_then_Pol p [] "aan" ; -- if we form a ClSlash, no sentence type marker; negation with aan (Saeed p. 210)
|
|
||||||
p2 = if_then_Pol p subjpron []} ; -- no subjpron in negation
|
|
||||||
|
|
||||||
Question => {p1 = "ma" ; p2 = []} ; -- TODO find out how negative questions work
|
|
||||||
{-
|
|
||||||
The first type of negative question has the QM ma and the negative word áan 'noť.
|
|
||||||
These questions usually include clitic subject pronouns and the three elements
|
|
||||||
coalesce as follows: ma - aan 'not' + aan 'I' → miyaanan
|
|
||||||
he second type of negative question uses a distinct question word sow (show) which
|
|
||||||
is a marker of speaker uncertainty also found in potential sentences
|
|
||||||
(though with a distinct verbal inflection). This type of sentence has the negative
|
|
||||||
word ma 'not'; for example:
|
|
||||||
Sow Faarax ma ihid?
|
|
||||||
QM Farah not be:NEG
|
|
||||||
'Are you not Farah?'
|
|
||||||
|
|
||||||
-}
|
|
||||||
|
|
||||||
Statement => case <p,vp.stm,subj.a> of {
|
|
||||||
<Pos,Waa (Copula|NoCopula),Pl3|Sg3 _> -- no subjpron in predicative sentences:
|
|
||||||
=> {p1 = "waa" ; p2 = []} ; -- "Axmed waa macallin" not "*Axmed waa uu macallin"
|
|
||||||
<_,Waxa,_>
|
|
||||||
=> waxaNoContr ! subj.a ! p ;
|
|
||||||
_ => waaNoContr ! subj.a ! p } -- if we want wuu, waad etc. swap to stmarkerContr
|
|
||||||
} ;
|
|
||||||
in wordOrder subj.a subjnoun stm obj pred vp cltyp ;
|
|
||||||
} where {
|
|
||||||
vp : VerbPhrase = case isPassive vps of {
|
|
||||||
True => complSlash (insertComp vps np) ;
|
|
||||||
_ => complSlash vps } ;
|
|
||||||
subj : NounPhrase = case isPassive vps of {
|
|
||||||
True => impersNP ;
|
|
||||||
_ => np }
|
|
||||||
} ;
|
|
||||||
|
|
||||||
wordOrder : Agreement -> (sn : Str) -> (stm,obj : {p1,p2 : Str}) -> {fin,inf : Str} -> VerbPhrase -> ClType -> BaseCl =
|
|
||||||
\agr,subjnoun,stm,obj,pred,vp,cltyp -> {
|
|
||||||
{- Saeed p. 210-211: "The relative clause resembles a main clause in syntax
|
|
||||||
except that the tendency for verb final order is much stronger. [..] Certain
|
|
||||||
elements such as subject clitic pronouns, and the negative word aan 'not' are
|
|
||||||
attracted to the head nominal and thus move away from the verbal group."
|
|
||||||
-}
|
|
||||||
beforeSTM = vp.berri -- AdV
|
|
||||||
++ subjnoun -- subject if it's a noun
|
|
||||||
++ case cltyp of {
|
|
||||||
Subord => [] ;
|
|
||||||
_ => obj.p1 } ; -- noun object if it's a statement
|
|
||||||
|
|
||||||
stm = stm.p1 ; -- sentence type marker; empty if subordinate and positive
|
|
||||||
|
|
||||||
afterSTM = vp.vComp.subjunc -- "waa in" construction
|
|
||||||
++ stm.p2 -- possible subj. pronoun
|
|
||||||
++ case cltyp of {
|
|
||||||
Subord => obj.p1 ; -- noun object if it's subordinate clause
|
|
||||||
_ => [] }
|
|
||||||
++ obj.p2 -- object if it's a pronoun
|
|
||||||
++ vp.sii -- restricted set of particles
|
|
||||||
++ vp.dhex -- restricted set of nouns/adverbials
|
|
||||||
++ vp.secObj -- "second object"
|
|
||||||
++ vp.vComp.inf -- VV complement, if it's infinitive
|
|
||||||
++ pred.inf -- potential infinitive/participle
|
|
||||||
++ pred.fin -- the verb inflected
|
|
||||||
++ vp.vComp.subcl ! agr -- VV complement, if it's subordinate clause
|
|
||||||
++ vp.miscAdv } ; ---- NB. Only used if there are several adverbs, or for "waa in" construction.
|
|
||||||
---- Primary places for adverbs are obj, sii or dhex.
|
|
||||||
|
|
||||||
wordOrderLite : ClType -> ClLite -> QClause = \cltyp,cllite -> {
|
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let cl = complCl cllite ;
|
let cltyp : ClType = case isSubord of {
|
||||||
|
True => Subord ;
|
||||||
|
False => Statement } ;
|
||||||
|
cl : ClSlash = case isSubord of { -- add "in" to the clause if used as subordinate
|
||||||
|
True => cls ** {vComp = cls.vComp ** {subjunc = "in"}} ;
|
||||||
|
False => cls } ;
|
||||||
|
sent = wordOrder cltyp False True True cl
|
||||||
|
in sent.s ! t ! a ! p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
wordOrder : ClType -> (rel,sp,stm : Bool) -> ClSlash -> Clause = \cltyp,isRel,hasSubjPron,hasSTM,incomplCl -> {
|
||||||
|
s = \\t,a,p =>
|
||||||
|
let -- Put all arguments in their right place
|
||||||
|
cl : ClSlash = complCl incomplCl ;
|
||||||
|
|
||||||
|
-- Contractions
|
||||||
bind : Str = case <isPassive cl, cl.obj2.a, cl.c2> of {
|
bind : Str = case <isPassive cl, cl.obj2.a, cl.c2> of {
|
||||||
<False,P3_Prep,Single NoPrep> => [] ; -- nothing to attach to the STM
|
<False,P3_Prep,Single NoPrep> => [] ; -- nothing to attach to the STM
|
||||||
_ => BIND } ; -- something to attach, use BIND
|
_ => BIND } ; -- something to attach, use BIND
|
||||||
@@ -1011,55 +934,65 @@ oper
|
|||||||
<Statement,Neg> -- object pronoun and prepositions contract with negation
|
<Statement,Neg> -- object pronoun and prepositions contract with negation
|
||||||
=> {p2 = [] ; p1 = cl.comp.p1 ++ cl.comp.p2 ++ bind} ;
|
=> {p2 = [] ; p1 = cl.comp.p1 ++ cl.comp.p2 ++ bind} ;
|
||||||
_ => cl.comp } ;
|
_ => cl.comp } ;
|
||||||
|
|
||||||
|
-- Placement of object noun varies depending on type of clause
|
||||||
statementNounObj = case cltyp of {
|
statementNounObj = case cltyp of {
|
||||||
Statement => obj.p1 ;
|
Statement => obj.p1 ;
|
||||||
_ => [] } ;
|
_ => [] } ;
|
||||||
subordNounObj = case cltyp of {
|
subordNounObj = case cltyp of {
|
||||||
Subord => obj.p1 ; -- noun object if it's subordinate clause
|
Subord => obj.p1 ;
|
||||||
_ => [] } ;
|
_ => [] } ;
|
||||||
questionNounObj = case cltyp of {
|
questionNounObj = case cltyp of {
|
||||||
Question => obj.p1 ; -- noun object if it's subordinate clause
|
Question => obj.p1 ;
|
||||||
_ => [] } ;
|
_ => [] } ;
|
||||||
pred = cl.pred ! cltyp ! t ! a ! p in
|
|
||||||
|
|
||||||
cl.berri -- AdV
|
-- Control whether to include subject pronoun and STM
|
||||||
|
subjpron : Str = case <hasSubjPron,p,cl.subj.isP3,isRel> of {
|
||||||
|
<True,Pos,True,True> => [] ;
|
||||||
|
<True,Pos,_,_> => cl.subj.pron ;
|
||||||
|
_ => [] } ;
|
||||||
|
stm : Str = case <hasSTM,p> of {
|
||||||
|
<True,_> => cl.stm ! cltyp ! p ;
|
||||||
|
<_,Neg> => cl.stm ! cltyp ! p ; -- negation overrides hasSTM=False
|
||||||
|
_ => [] }
|
||||||
|
in cl.berri -- AdV
|
||||||
++ cl.subj.noun -- subject if it's a noun
|
++ cl.subj.noun -- subject if it's a noun
|
||||||
++ statementNounObj -- noun object if it's a statement
|
++ statementNounObj -- noun object if it's a statement
|
||||||
|
|
||||||
++ cl.stm ! cltyp ! p -- STM
|
++ stm
|
||||||
|
|
||||||
++ cl.vComp.subjunc -- "waa in" construction
|
++ cl.vComp.subjunc -- "waa in" construction /
|
||||||
++ cl.subj.pron -- subject pronoun
|
++ subjpron -- subject pronoun
|
||||||
|
|
||||||
++ subordNounObj -- noun object if it's subordinate clause
|
++ subordNounObj -- noun object if it's subordinate clause: "timir aan /laf/ lahayn" (Saeed p. 210-211)
|
||||||
++ obj.p2 -- object if it's a pronoun
|
++ obj.p2 -- object if it's a pronoun
|
||||||
++ cl.sii -- restricted set of particles
|
++ cl.sii -- restricted set of particles
|
||||||
++ cl.dhex -- restricted set of nouns/adverbials
|
++ cl.dhex -- restricted set of nouns/adverbials
|
||||||
++ cl.secObj -- "second object"
|
++ cl.secObj -- "second object"
|
||||||
++ cl.vComp.inf -- VV complement, if it's infinitive
|
++ cl.vComp.inf -- VV complement, if it's infinitive
|
||||||
++ pred.inf -- potential infinitive/participle
|
++ cl.pred ! cltyp ! t ! a ! p -- the inflecting verb
|
||||||
++ pred.fin -- the verb inflected
|
|
||||||
++ questionNounObj -- noun object if it's a question
|
++ questionNounObj -- noun object if it's a question
|
||||||
++ cl.vComp.subcl -- VV complement, if it's subordinate clause
|
++ cl.vComp.subcl -- VV complement, if it's subordinate clause
|
||||||
++ cl.miscAdv ---- NB. Only used if there are several adverbs, or for "waa in" construction.
|
++ cl.miscAdv ---- NB. Only used if there are several adverbs, or for "waa in" construction.
|
||||||
} ; ---- Primary places for adverbs are obj, sii or dhex.
|
} ; ---- Primary places for adverbs are obj, sii or dhex.
|
||||||
|
|
||||||
|
|
||||||
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> BaseVerb
|
VFun : Type = Tense -> Anteriority -> Polarity -> Agreement -> BaseVerb
|
||||||
-> {fin : Str ; inf : Str} ;
|
-> Str ;
|
||||||
|
|
||||||
vf : ClType -> VFun = \clt -> case clt of {
|
vf : ClType -> VFun = \clt -> case clt of {
|
||||||
Subord => vfSubord ; _ => vfStatement } ;
|
Subord => vfSubord ; _ => vfStatement } ;
|
||||||
|
|
||||||
vfStatement : VFun = \t,ant,p,agr,vp ->
|
vfStatement : VFun = \t,ant,p,agr,vp ->
|
||||||
case <t,ant,p> of {
|
case <t,ant,p> of {
|
||||||
<Cond,_,Pos> => {fin = pastV have_V ; inf = vp.s ! VInf} ;
|
<Cond,_,Pos> => vp.s ! VInf ++ pastV have_V ;
|
||||||
<Cond,_,Neg> => {fin = condNegV vp ; inf = []} ;
|
<Cond,_,Neg> => condNegV vp ;
|
||||||
<Pres,Simul> => {fin = presV vp ; inf = [] } ;
|
<Pres,Simul> => presV vp ;
|
||||||
<Past,Simul> => {fin = pastV vp ; inf = [] } ;
|
<Past,Simul> => pastV vp ;
|
||||||
<Pres,Anter> => {fin = presCopula ! agrPol ; inf = vp.s ! VInf } ; ---- just guessing
|
<Pres,Anter> => vp.s ! VInf ++ presCopula ! agrPol ; ---- just guessing
|
||||||
<Past,Anter> => {fin = pastV (cSug "jir") ; inf = vp.s ! VInf} ;
|
<Past,Anter> => vp.s ! VInf ++ pastV (cSug "jir") ;
|
||||||
<Fut,Simul> => {fin = presV (cSug "doon") ; inf = vp.s ! VInf} ;
|
<Fut,Simul> => vp.s ! VInf ++ presV (cSug "doon") ;
|
||||||
<Fut,Anter> => {fin = pastV (cSug "doon") ; inf = vp.s ! VInf}
|
<Fut,Anter> => vp.s ! VInf ++ pastV (cSug "doon")
|
||||||
}
|
}
|
||||||
where {
|
where {
|
||||||
agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ;
|
agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ;
|
||||||
@@ -1112,13 +1045,13 @@ oper
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
linVP : VForm -> ClType -> VerbPhrase -> Str = \vf,cltyp,vp ->
|
linVP : VForm -> ClType -> VerbPhrase -> Str = \vf,cltyp,vp ->
|
||||||
let vp' = complSlash vp ;
|
let pred = vp.s ! vf ;
|
||||||
inf = {inf = vp.s ! vf ; fin=[]} ;
|
vp' = complSlash vp ;
|
||||||
stm = case <cltyp,isNeg vf> of {
|
stm = case <cltyp,isNeg vf> of {
|
||||||
<Subord,True> => {p1 = "aan" ; p2 = []} ;
|
<Subord,True> => {p1 = "aan" ; p2 = []} ;
|
||||||
_ => {p1,p2 = []}
|
_ => {p1,p2 = []}
|
||||||
} ;
|
} ;
|
||||||
wo = wordOrder (Sg3 Masc) [] stm (vp'.comp ! pagr2agr vp.obj2.a) inf vp' cltyp ;
|
wo = wordOrderOld (Sg3 Masc) [] stm (vp'.comp ! pagr2agr vp.obj2.a) pred vp' cltyp ;
|
||||||
in wo.beforeSTM ++ wo.stm ++ wo.afterSTM ;
|
in wo.beforeSTM ++ wo.stm ++ wo.afterSTM ;
|
||||||
|
|
||||||
linCN : CNoun -> Str = \cn -> cn.s ! Indef Sg ++ cn.mod ! Indefinite ! Sg ! Abs ;
|
linCN : CNoun -> Str = \cn -> cn.s ! Indef Sg ++ cn.mod ! Indefinite ! Sg ! Abs ;
|
||||||
@@ -1131,4 +1064,32 @@ oper
|
|||||||
++ adv.miscAdv ;
|
++ adv.miscAdv ;
|
||||||
linBaseCl : BaseCl -> Str = \b -> b.beforeSTM ++ b.stm ++ b.afterSTM ;
|
linBaseCl : BaseCl -> Str = \b -> b.beforeSTM ++ b.stm ++ b.afterSTM ;
|
||||||
|
|
||||||
|
|
||||||
|
-- TODO: deprecate eventually
|
||||||
|
BaseCl : Type = {beforeSTM, stm, afterSTM : Str} ; -- adverbs, subjects, all that comes before sentence type marker. Eventual Subj attaches to the part after STM.
|
||||||
|
|
||||||
|
wordOrderOld : Agreement -> (sn : Str) -> (stm,obj : {p1,p2 : Str}) -> Str -> VerbPhrase -> ClType -> BaseCl =
|
||||||
|
\agr,subjnoun,stm,obj,pred,vp,cltyp -> {
|
||||||
|
beforeSTM = vp.berri -- AdV
|
||||||
|
++ subjnoun -- subject if it's a noun
|
||||||
|
++ case cltyp of {
|
||||||
|
Subord => [] ;
|
||||||
|
_ => obj.p1 } ; -- noun object if it's a statement
|
||||||
|
|
||||||
|
stm = stm.p1 ; -- sentence type marker; empty if subordinate and positive
|
||||||
|
|
||||||
|
afterSTM = vp.vComp.subjunc -- "waa in" construction
|
||||||
|
++ stm.p2 -- possible subj. pronoun
|
||||||
|
++ case cltyp of {
|
||||||
|
Subord => obj.p1 ; -- noun object if it's subordinate clause
|
||||||
|
_ => [] }
|
||||||
|
++ obj.p2 -- object if it's a pronoun
|
||||||
|
++ vp.sii -- restricted set of particles
|
||||||
|
++ vp.dhex -- restricted set of nouns/adverbials
|
||||||
|
++ vp.secObj -- "second object"
|
||||||
|
++ vp.vComp.inf -- VV complement, if it's infinitive
|
||||||
|
++ pred -- the verb inflected
|
||||||
|
++ vp.vComp.subcl ! agr -- VV complement, if it's subordinate clause
|
||||||
|
++ vp.miscAdv } ; ---- NB. Only used if there are several adverbs, or for "waa in" construction.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ lin
|
|||||||
|
|
||||||
--2 Clauses missing object noun phrases
|
--2 Clauses missing object noun phrases
|
||||||
-- : NP -> VPSlash -> ClSlash ;
|
-- : NP -> VPSlash -> ClSlash ;
|
||||||
SlashVP = predVPSlash ;
|
SlashVP = predVP ;
|
||||||
{-
|
{-
|
||||||
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
-- : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today
|
||||||
AdvSlash cls adv = cls ** insertAdv adv cls ;
|
AdvSlash cls adv = cls ** insertAdv adv cls ;
|
||||||
@@ -27,9 +27,9 @@ 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 =>
|
UseSlash t p cls = {
|
||||||
let sent = cls.s ! b ! t.t ! t.a ! p.p in
|
s = \\isSubord => let cl = cl2sentence isSubord cls in
|
||||||
sent ** {beforeSTM = t.s ++ p.s ++ sent.beforeSTM}
|
t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--2 Imperatives
|
--2 Imperatives
|
||||||
@@ -52,10 +52,9 @@ lin
|
|||||||
|
|
||||||
-}
|
-}
|
||||||
-- : Temp -> Pol -> Cl -> S ;
|
-- : Temp -> Pol -> Cl -> S ;
|
||||||
UseCl t p cl = {s = \\b =>
|
UseCl t p cls = {
|
||||||
let cltyp = if_then_else ClType b Subord Statement ;
|
s = \\isSubord => let cl = cl2sentence isSubord cls in
|
||||||
sent = cl.s ! cltyp ! t.t ! t.a ! p.p in
|
t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p
|
||||||
sent ** {beforeSTM = t.s ++ p.s ++ sent.beforeSTM} ;
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> QCl -> QS ;
|
-- : Temp -> Pol -> QCl -> QS ;
|
||||||
@@ -77,7 +76,8 @@ lin
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
advS : Adverb -> S -> S = \a,s -> s ** {s = \\b => let ss = s.s ! b in
|
advS : Adverb -> S -> S = \a,sent -> sent ** {
|
||||||
ss ** {beforeSTM = linAdv a ++ ss.beforeSTM}} ;
|
s = \\b => sent.s ! b ++ linAdv a
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,9 +27,9 @@ lin
|
|||||||
vComp = vc ** { -- The whole previous VP becomes the subordinate clause
|
vComp = vc ** { -- The whole previous VP becomes the subordinate clause
|
||||||
subcl = \\agr =>
|
subcl = \\agr =>
|
||||||
let subj = pronTable ! agr ;
|
let subj = pronTable ! agr ;
|
||||||
cls = predVPSlash subj vp ;
|
cls = predVPslash subj vp ;
|
||||||
rcl = mergeRCl (cls.s ! True) ;
|
scl = cl2sentence True cls ;
|
||||||
in "in" ++ rcl.s ! Pres ! Simul ! Pos
|
in scl.s ! Pres ! Simul ! Pos
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user