mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
(Som) Rename obj2,secObj-> obj,obj2. Remove commented out code+old TODOs
This commit is contained in:
@@ -24,8 +24,8 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
subj = cls.subj ** { -- keep old subject pronoun,
|
subj = cls.subj ** { -- keep old subject pronoun,
|
||||||
noun = ip.s ! Nom -- and place IP first.
|
noun = ip.s ! Nom -- and place IP first.
|
||||||
} ;
|
} ;
|
||||||
obj2 = cls.obj2 ** { -- move old subject noun before object.
|
obj = cls.obj ** { -- move old subject noun before object.
|
||||||
s = cls.subj.noun ++ cls.obj2.s
|
s = cls.subj.noun ++ cls.obj.s
|
||||||
} ;
|
} ;
|
||||||
stm = modSTM "baa" baan cls.stm
|
stm = modSTM "baa" baan cls.stm
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -426,17 +426,9 @@ oper
|
|||||||
|
|
||||||
-- Sequences of adjectives follow the rules for restrictive relatives clauses, i.e. are linked by oo 'and' on an indefinite head NounPhrase and by ee 'and' on a definite NounPhrase (8.1).
|
-- Sequences of adjectives follow the rules for restrictive relatives clauses, i.e. are linked by oo 'and' on an indefinite head NounPhrase and by ee 'and' on a definite NounPhrase (8.1).
|
||||||
|
|
||||||
-- Komparativ
|
|
||||||
-- För att uttrycka motsvarigheten till svenskans komparativ placerar man på somaliska helt enkelt prepositionen ká 'från, av, än' framför adjektivet i fråga. Adjektivet får ingen ändelse.
|
|
||||||
-- Shan waa ay ká yar tahay siddéed. Fem är mindre än åtta.
|
|
||||||
-- Superlativ
|
|
||||||
-- Motsvarigheten till svenskans superlativ bildas med prepositionsklustret ugú som till sin betydelse närmast motsvarar svenskans allra, t.ex.
|
|
||||||
-- ugu horrayntii (det att komma) allra först
|
|
||||||
|
|
||||||
Adjective : Type = {s : AForm => Str} ;
|
Adjective : Type = {s : AForm => Str} ;
|
||||||
Adjective2 : Type = Adjective ** {c2 : Preposition} ;
|
Adjective2 : Type = Adjective ** {c2 : Preposition} ;
|
||||||
|
|
||||||
|
|
||||||
duplA : Str -> Adjective = \yar ->
|
duplA : Str -> Adjective = \yar ->
|
||||||
let yaryar = duplicate yar
|
let yaryar = duplicate yar
|
||||||
in mkAdj yar yaryar ;
|
in mkAdj yar yaryar ;
|
||||||
@@ -738,8 +730,8 @@ oper
|
|||||||
|
|
||||||
VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** {
|
VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** {
|
||||||
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}
|
obj : NPLite ; -- {s : Str ; a : PrepAgr}
|
||||||
secObj : Str ; -- if two overt pronoun objects
|
obj2 : Str ; -- if two overt pronoun objects
|
||||||
vComp : {subjunc : Str ; -- "waa in" or subjunctive construction: "in" is placed here
|
vComp : {subjunc : Str ; -- "waa in" or subjunctive construction: "in" is placed here
|
||||||
inf : Str ; -- auxiliary VV with infinitive argument
|
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
|
||||||
@@ -759,8 +751,8 @@ oper
|
|||||||
subcl = \\_ => []} ;
|
subcl = \\_ => []} ;
|
||||||
berri,miscAdv = [] ;
|
berri,miscAdv = [] ;
|
||||||
c2 = Single NoPrep ;
|
c2 = Single NoPrep ;
|
||||||
obj2 = {s = [] ; a = P3_Prep} ;
|
obj = {s = [] ; a = P3_Prep} ;
|
||||||
secObj = []
|
obj2 = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
|
useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
|
||||||
@@ -784,10 +776,10 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertRefl : VPSlash -> VPSlash = \vps -> vps ** {
|
insertRefl : VPSlash -> VPSlash = \vps -> vps ** {
|
||||||
obj2 = vps.obj2 ** {a = Reflexive_Prep} ;
|
obj = vps.obj ** {a = Reflexive_Prep} ;
|
||||||
|
|
||||||
-- If old obj2 was something else than P3, it is now shown in secObj
|
-- If old obj was something else than P3, it is now shown in obj2
|
||||||
secObj = vps.secObj ++ secondObject ! vps.obj2.a ;
|
obj2 = vps.obj2 ++ secondObject ! vps.obj.a ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
||||||
@@ -805,25 +797,25 @@ oper
|
|||||||
-- To generalise insertAdv and insertComp
|
-- To generalise insertAdv and insertComp
|
||||||
VPLite : Type = {
|
VPLite : Type = {
|
||||||
c2 : PrepCombination ;
|
c2 : PrepCombination ;
|
||||||
obj2 : NPLite ;
|
obj : NPLite ;
|
||||||
sii,dhex,berri,miscAdv,secObj : Str} ;
|
sii,dhex,berri,miscAdv,obj2 : Str} ;
|
||||||
|
|
||||||
insertCompLite : VPLite -> NPLite -> VPLite = \vp,nplite ->
|
insertCompLite : VPLite -> NPLite -> VPLite = \vp,nplite ->
|
||||||
case vp.obj2.a of {
|
case vp.obj.a of {
|
||||||
-- If the old object is 3rd person (or nonexistent), we replace its agreement.
|
-- If the old object is 3rd person (or nonexistent), we replace its agreement.
|
||||||
-- We keep both old and new string (=noun, if there was one) in obj2.s.
|
-- We keep both old and new string (=noun, if there was one) in obj.s.
|
||||||
P3_Prep =>
|
P3_Prep =>
|
||||||
vp ** {obj2 = nplite ** {
|
vp ** {obj = nplite ** {
|
||||||
s = nplite.s ++ vp.obj2.s}
|
s = nplite.s ++ vp.obj.s}
|
||||||
} ; -- no secObj, because there's ≤1 non-3rd-person pronoun.
|
} ; -- no obj2, because there's ≤1 non-3rd-person pronoun.
|
||||||
|
|
||||||
-- If old object was non-3rd person, we keep its agreement.
|
-- If old object was non-3rd person, we keep its agreement.
|
||||||
-- The new object is put in the secondObject field.
|
-- The new object is put in the secondObject field.
|
||||||
_ =>
|
_ =>
|
||||||
vp ** {obj2 = vp.obj2 ** {
|
vp ** {obj = vp.obj ** {
|
||||||
s = nplite.s ++ vp.obj2.s
|
s = nplite.s ++ vp.obj.s
|
||||||
} ;
|
} ;
|
||||||
secObj = vp.secObj ++ secondObject ! nplite.a}
|
obj2 = vp.obj2 ++ secondObject ! nplite.a}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertAdvLite : VPLite -> Adverb -> VPLite = \vp,adv ->
|
insertAdvLite : VPLite -> Adverb -> VPLite = \vp,adv ->
|
||||||
@@ -857,8 +849,8 @@ oper
|
|||||||
ClSlash : Type = BaseAdv ** {
|
ClSlash : Type = BaseAdv ** {
|
||||||
-- Fixed in Cl
|
-- Fixed in Cl
|
||||||
subj : {noun, pron : Str ; isP3 : Bool} ; -- noun and subject pronoun if applicable
|
subj : {noun, pron : Str ; isP3 : Bool} ; -- noun and subject pronoun if applicable
|
||||||
obj2 : NPLite ;
|
obj : NPLite ;
|
||||||
secObj : Str ;
|
obj2 : Str ;
|
||||||
c2 : PrepCombination ; -- NB. QuestIAdv can add more prepositions
|
c2 : PrepCombination ; -- NB. QuestIAdv can add more prepositions
|
||||||
aComp : Str ;
|
aComp : Str ;
|
||||||
nComp : Str ;
|
nComp : Str ;
|
||||||
@@ -878,7 +870,7 @@ oper
|
|||||||
|
|
||||||
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vps -> vp ** {
|
predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vps -> vp ** {
|
||||||
subj = {noun = subjnoun ; pron = subjpron ; isP3 = isP3 subj.a} ;
|
subj = {noun = subjnoun ; pron = subjpron ; isP3 = isP3 subj.a} ;
|
||||||
obj2 = vp.obj2 ** {s = vp.obj2.s ++ vp.compar} ;
|
obj = vp.obj ** {s = vp.obj.s ++ vp.compar} ;
|
||||||
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 {
|
||||||
@@ -937,10 +929,10 @@ oper
|
|||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let -- Put all arguments in their right place
|
let -- Put all arguments in their right place
|
||||||
--cl : ClSlash = complCl incomplCl ;
|
--cl : ClSlash = complCl incomplCl ;
|
||||||
prepComb = prepCombTable ! cl.obj2.a ! cl.c2 ;
|
prepComb = prepCombTable ! cl.obj.a ! cl.c2 ;
|
||||||
|
|
||||||
-- Contractions
|
-- Contractions
|
||||||
bind : Str = case <isPassive cl, cl.obj2.a, cl.c2> of {
|
bind : Str = case <isPassive cl, cl.obj.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
|
||||||
prepCombNeg : Str = case <cltyp,p> of {
|
prepCombNeg : Str = case <cltyp,p> of {
|
||||||
@@ -954,7 +946,7 @@ oper
|
|||||||
|
|
||||||
-- Placement of object noun varies depending on type of clause
|
-- Placement of object noun varies depending on type of clause
|
||||||
statementNounObj = case cltyp of {
|
statementNounObj = case cltyp of {
|
||||||
Statement => cl.obj2.s ;
|
Statement => cl.obj.s ;
|
||||||
_ => [] } ;
|
_ => [] } ;
|
||||||
statementNounComp = case cltyp of {
|
statementNounComp = case cltyp of {
|
||||||
Statement => cl.nComp ;
|
Statement => cl.nComp ;
|
||||||
@@ -962,11 +954,11 @@ oper
|
|||||||
|
|
||||||
-- for subord and question, NP predicatives and objects behave the same
|
-- for subord and question, NP predicatives and objects behave the same
|
||||||
subordNounObj = case cltyp of {
|
subordNounObj = case cltyp of {
|
||||||
Subord => cl.obj2.s ++ cl.nComp ;
|
Subord => cl.obj.s ++ cl.nComp ;
|
||||||
_ => [] } ;
|
_ => [] } ;
|
||||||
questionNounObj = case cltyp of {
|
questionNounObj = case cltyp of {
|
||||||
PolarQuestion|WhQuestion
|
PolarQuestion|WhQuestion
|
||||||
=> cl.obj2.s ++ cl.nComp ;
|
=> cl.obj.s ++ cl.nComp ;
|
||||||
_ => [] } ;
|
_ => [] } ;
|
||||||
|
|
||||||
-- Control whether to include subject pronoun and STM
|
-- Control whether to include subject pronoun and STM
|
||||||
@@ -996,7 +988,7 @@ oper
|
|||||||
|
|
||||||
++ 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.obj2 -- "second object"
|
||||||
++ cl.vComp.inf -- VV complement, if it's infinitive
|
++ cl.vComp.inf -- VV complement, if it's infinitive
|
||||||
++ cl.pred ! cltyp ! t ! a ! p -- the inflecting verb
|
++ cl.pred ! cltyp ! t ! a ! p -- the inflecting verb
|
||||||
++ questionNounObj -- noun object if it's a question
|
++ questionNounObj -- noun object if it's a question
|
||||||
@@ -1102,31 +1094,30 @@ oper
|
|||||||
|
|
||||||
linVP : VForm -> ClType -> VerbPhrase -> Str = \vf,cltyp,vp ->
|
linVP : VForm -> ClType -> VerbPhrase -> Str = \vf,cltyp,vp ->
|
||||||
let pred = vp.s ! vf ;
|
let pred = vp.s ! vf ;
|
||||||
pr = prepCombTable ! vp.obj2.a ! vp.c2 ;
|
pr = prepCombTable ! vp.obj.a ! vp.c2 ;
|
||||||
-- obj = {p1 = np.s ;
|
|
||||||
-- p2 = vp.aComp ! pagr2agr np.a ++ prepCombTable ! np.a ! vps.c2} ;
|
|
||||||
neg = case <cltyp,isNeg vf> of {
|
neg = case <cltyp,isNeg vf> of {
|
||||||
<Subord,True> => "aan" ;
|
<Subord,True> => "aan" ;
|
||||||
_ => []
|
_ => []
|
||||||
} ;
|
} ;
|
||||||
in wordOrder cltyp neg pred pr vp ;
|
in wordOrder cltyp neg pred pr vp ;
|
||||||
|
|
||||||
|
-- Light version of the word order complexity in mkClause.
|
||||||
wordOrder : ClType -> (neg,pred,prepcomb : Str) -> VerbPhrase -> Str =
|
wordOrder : ClType -> (neg,pred,prepcomb : Str) -> VerbPhrase -> Str =
|
||||||
\cltyp,neg,pred,pr,vp ->
|
\cltyp,neg,pred,pr,vp ->
|
||||||
vp.berri -- AdV
|
vp.berri -- AdV
|
||||||
++ case cltyp of {
|
++ case cltyp of {
|
||||||
Subord => [] ;
|
Subord => [] ;
|
||||||
_ => vp.obj2.s {-obj.p1-} } -- noun object if it's a statement
|
_ => vp.obj.s } -- noun object if it's a statement
|
||||||
++ neg
|
++ neg
|
||||||
++ vp.vComp.subjunc -- "waa in" construction
|
++ vp.vComp.subjunc -- "waa in" construction
|
||||||
++ case cltyp of {
|
++ case cltyp of {
|
||||||
Subord => vp.obj2.s ; -- noun object if it's subordinate clause
|
Subord => vp.obj.s ; -- noun object if it's subordinate clause
|
||||||
_ => [] }
|
_ => [] }
|
||||||
++ vp.aComp ! pagr2agr vp.obj2.a -- AP complement agreeing with object
|
++ vp.aComp ! pagr2agr vp.obj.a -- AP complement agreeing with object
|
||||||
++ pr -- object if it's a pronoun
|
++ pr -- 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
|
||||||
++ vp.secObj -- "second object"
|
++ vp.obj2 -- "second object"
|
||||||
++ vp.vComp.inf -- VV complement, if it's infinitive
|
++ vp.vComp.inf -- VV complement, if it's infinitive
|
||||||
++ pred -- the verb inflected
|
++ pred -- the verb inflected
|
||||||
++ vp.vComp.subcl ! Sg3 Masc -- VV complement, if it's subordinate clause
|
++ vp.vComp.subcl ! Sg3 Masc -- VV complement, if it's subordinate clause
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ lin
|
|||||||
ComplVV vv vp = let vc = vp.vComp in case vv.vvtype of {
|
ComplVV vv vp = let vc = vp.vComp in case vv.vvtype of {
|
||||||
Waa_In => vp ** {
|
Waa_In => vp ** {
|
||||||
vComp = vc ** {subjunc = vv.s ! VInf} ; -- it's always the word "in", and it will be placed before subject pronoun. it's placed in vv.s!VInf so that the VV would contribute with some string. /IL
|
vComp = vc ** {subjunc = vv.s ! VInf} ; -- it's always the word "in", and it will be placed before subject pronoun. it's placed in vv.s!VInf so that the VV would contribute with some string. /IL
|
||||||
obj2 = vp.obj2 ** {s = []} ; -- word order hack to avoid more parameters:
|
obj = vp.obj ** {s = []} ; -- word order hack to avoid more parameters:
|
||||||
miscAdv = vp.miscAdv ++ vp.obj2.s -- dump the object to miscAdv
|
miscAdv = vp.miscAdv ++ vp.obj.s -- dump the object to miscAdv
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
Subjunctive => useV vv ** {
|
Subjunctive => useV vv ** {
|
||||||
@@ -46,7 +46,7 @@ lin
|
|||||||
ComplVS vs s =
|
ComplVS vs s =
|
||||||
let vps = useV vs ;
|
let vps = useV vs ;
|
||||||
subord = SubjS {s="in"} s ;
|
subord = SubjS {s="in"} s ;
|
||||||
in vps ** {obj2 = {s = subord.berri ; a = P3_Prep}} ;
|
in vps ** {obj = {s = subord.berri ; a = P3_Prep}} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
-- : VQ -> QS -> VP ;
|
-- : VQ -> QS -> VP ;
|
||||||
|
|||||||
Reference in New Issue
Block a user