mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
@@ -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.stm ++ subs.afterSTM) ;
|
||||||
|
|
||||||
-- Comparison adverbs also work as numeral adverbs.
|
-- Comparison adverbs also work as numeral adverbs.
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
|||||||
|
|
||||||
S = ResSom.Sentence ;
|
S = ResSom.Sentence ;
|
||||||
QS = SS ;
|
QS = SS ;
|
||||||
RS = {s : {-Agreement =>-} Str} ; -- TODO
|
RS = {s : Gender => Case => Str} ;
|
||||||
-- 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.
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
|||||||
|
|
||||||
--2 Subord clauses and pronouns
|
--2 Subord clauses and pronouns
|
||||||
|
|
||||||
RCl = ResSom.QClause ;
|
RCl = ResSom.RClause ;
|
||||||
RP = SS ;
|
RP = SS ;
|
||||||
|
|
||||||
--2 Verb phrases
|
--2 Verb phrases
|
||||||
@@ -119,7 +119,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
|||||||
|
|
||||||
linref
|
linref
|
||||||
-- Cl = linCl ;
|
-- Cl = linCl ;
|
||||||
VP = linVP ;
|
VP = linVP VInf ;
|
||||||
CN = linCN ;
|
CN = linCN ;
|
||||||
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ;
|
Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
|
|
||||||
-- : NP -> RS -> NP ; -- Paris, which is here
|
-- : NP -> RS -> NP ; -- Paris, which is here
|
||||||
RelNP np rs = np ** {
|
RelNP np rs = np ** {
|
||||||
s = \\c => np.s ! c ++ rs.s
|
s = \\c => np.s ! c ++ rs.s ! npgender np ! c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Determiners can form noun phrases directly.
|
-- Determiners can form noun phrases directly.
|
||||||
@@ -230,7 +230,8 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
|||||||
|
|
||||||
-- : CN -> RS -> CN ;
|
-- : CN -> RS -> CN ;
|
||||||
RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
mod = \\n,c => cn.mod ! n ! c ++ rs.s
|
mod = \\n,c => cn.mod ! n ! c ++ rs.s ! gender cn ! c ;
|
||||||
|
hasMod = True ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
|
|||||||
@@ -171,8 +171,12 @@ oper
|
|||||||
case agr of {P3_Prep => True ; _ => False} ;
|
case agr of {P3_Prep => True ; _ => False} ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
gender : {gda : GenderDefArt} -> Gender = \n ->
|
gender : {gda : GenderDefArt} -> Gender = \n ->
|
||||||
case n.gda of {FM _ _ => Fem ; _ => Masc} ;
|
case n.gda of {FM _ _ => Fem ; _ => Masc} ;
|
||||||
|
npgender : {a : Agreement} -> Gender = \n ->
|
||||||
|
case n.a of {Sg3 Fem => Fem ; _ => Masc} ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Numerals
|
-- Numerals
|
||||||
|
|
||||||
@@ -198,28 +202,28 @@ param
|
|||||||
| Single Preposition ;
|
| Single Preposition ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
combine : (isPassive : Bool) -> Preposition -> Preposition -> PrepCombination = \isPass,p1,p2 ->
|
combine : Preposition -> Preposition -> PrepCombination = \p1,p2 ->
|
||||||
let oneWay : Preposition => Preposition => PrepCombination =
|
let oneWay : Preposition => Preposition => PrepCombination = \\x,y =>
|
||||||
\\x,y => case <isPass,x,y> of {
|
case <x,y> of {
|
||||||
<True,NoPrep,NoPrep> => Passive ;
|
<U,U|Ku> => Ugu ;
|
||||||
<True,Ku,NoPrep> => Lagu ;
|
<U,Ka> => Uga ;
|
||||||
<True,Ka,NoPrep> => Laga ;
|
<U,La> => Ula ;
|
||||||
<True,U,NoPrep> => Loo ;
|
<Ku|Ka,
|
||||||
<True,p,_> => Single p ; -- TODO all combinations
|
Ku|Ka> => Kaga ;
|
||||||
<False,_,_> => case <x,y> of {
|
<Ku,La> => Kula ;
|
||||||
<U,U|Ku> => Ugu ;
|
<Ka,La> => Kala ;
|
||||||
<U,Ka> => Uga ;
|
<NoPrep,p> => Single p ;
|
||||||
<U,La> => Ula ;
|
<p,NoPrep> => Single x ;
|
||||||
<Ku|Ka,
|
<p,_> => Single x } -- for trying both ways
|
||||||
Ku|Ka> => Kaga ;
|
in case oneWay ! p2 ! p1 of {
|
||||||
<Ku,La> => Kula ;
|
Single _ => oneWay ! p1 ! p2 ;
|
||||||
<Ka,La> => Kala ;
|
z => z } ;
|
||||||
<NoPrep,p> => Single p ;
|
|
||||||
<p,NoPrep> => Single x ;
|
isPassive : {c2 : PrepCombination} -> Bool = \vp ->
|
||||||
<p,_> => Single x }} -- for trying both ways
|
case vp.c2 of {
|
||||||
in case oneWay ! p2 ! p1 of {
|
Passive | Lagu | Laga | Loo | Lala => True ;
|
||||||
Single _ => oneWay ! p1 ! p2 ;
|
_ => False
|
||||||
z => z } ;
|
} ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Verbs
|
-- Verbs
|
||||||
@@ -253,7 +257,8 @@ param
|
|||||||
| VPres Aspect VAgr Polarity
|
| VPres Aspect VAgr Polarity
|
||||||
| VNegPast Aspect
|
| VNegPast Aspect
|
||||||
| VPast Aspect VAgr
|
| VPast Aspect VAgr
|
||||||
| VRel -- "som är/har/…" TODO is this used in other verbs?
|
-- | VRelShort -- "som är/har/…" TODO is this used in other verbs?
|
||||||
|
| VRel Gender -- Reduced present general in relative clauses
|
||||||
| VImp Number Polarity ;
|
| VImp Number Polarity ;
|
||||||
|
|
||||||
VAgr =
|
VAgr =
|
||||||
|
|||||||
@@ -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 = linBaseCl basecl} ;
|
||||||
UttQS qs = qs ;
|
UttQS qs = qs ;
|
||||||
|
|
||||||
UttImpSg pol imp =
|
UttImpSg pol imp =
|
||||||
@@ -15,7 +15,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
|
|||||||
UttIP ip = { s = ip.s ! Abs} ;
|
UttIP ip = { s = ip.s ! Abs} ;
|
||||||
UttIAdv iadv = iadv ;
|
UttIAdv iadv = iadv ;
|
||||||
UttNP np = { s = np.s ! Abs} ;
|
UttNP np = { s = np.s ! Abs} ;
|
||||||
UttVP vp = { s = linVP vp } ;
|
UttVP vp = { s = infVP vp } ;
|
||||||
UttAdv adv = {s = linAdv adv} ;
|
UttAdv adv = {s = linAdv adv} ;
|
||||||
UttCN n = {s = linCN n } ;
|
UttCN n = {s = linCN n } ;
|
||||||
UttCard n = {s = n.s ! Mid} ;
|
UttCard n = {s = n.s ! Mid} ;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ concrete QuestionSom of Question = CatSom ** open
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
-- : Cl -> QCl ;
|
-- : Cl -> QCl ;
|
||||||
QuestCl cl = {s = cl.s ! Question} ;
|
QuestCl cl = mergeQCl (cl.s ! Question) ;
|
||||||
|
|
||||||
-- : IP -> VP -> QCl ;
|
-- : IP -> VP -> QCl ;
|
||||||
-- QuestVP ip vp = ;
|
-- QuestVP ip vp = ;
|
||||||
|
|||||||
@@ -19,16 +19,23 @@ Reduced present general in relative clauses; as absolutive
|
|||||||
books-the men-the bring 'the books which the men bring'
|
books-the men-the bring 'the books which the men bring'
|
||||||
-}
|
-}
|
||||||
-- : RP -> VP -> RCl ;
|
-- : RP -> VP -> RCl ;
|
||||||
RelVP rp vp = RelSlash rp (predVPSlash emptyNP vp) ;
|
RelVP rp vp = {s = \\g,c,t,a,p =>
|
||||||
|
let cls = predVPSlash impersNP vp ;
|
||||||
|
rcl = mergeRCl (cls.s ! False) ; -- Other than present tense, just use normal verb forms
|
||||||
|
in rp.s ++ case <g,c,t,a,p> of {
|
||||||
|
<Fem,Abs,Pres,Simul,Pos> => linVP (VRel Fem) vp ;
|
||||||
|
<Masc,Abs,Pres,Simul,Pos> => linVP (VRel Masc) vp ;
|
||||||
|
_ => rcl.s ! t ! a ! p }
|
||||||
|
} ;
|
||||||
|
|
||||||
-- : 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 True (cls.s ! True) -- 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} ;
|
||||||
|
|
||||||
|
|
||||||
-- : RP ;
|
-- : RP ;
|
||||||
IdRP = {s = "waxa"} ;
|
IdRP = {s = ""} ; -- no overt relative pronoun "that, which". For "what" e.g. "tell me what you saw", use waxa. (Nilsson p. 107)
|
||||||
|
|
||||||
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
-- : Prep -> NP -> RP -> RP ; -- the mother of whom
|
||||||
--FunRP prep np rp = {} ;
|
--FunRP prep np rp = {} ;
|
||||||
|
|||||||
@@ -540,7 +540,9 @@ oper
|
|||||||
VImp Pl Neg => qaat + "ina" ;
|
VImp Pl Neg => qaat + "ina" ;
|
||||||
|
|
||||||
VInf => arki ;
|
VInf => arki ;
|
||||||
VRel => arki } ; -- TODO does this exist?
|
-- VRelShort => arki ; -- TODO does this exist?
|
||||||
|
VRel Masc => qaat + "a" ;
|
||||||
|
VRel Fem => arag + t + "a" } ;
|
||||||
sii, dhex = [] ;
|
sii, dhex = [] ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -603,7 +605,8 @@ oper
|
|||||||
VPast _ Pl2_ => "ahaydeen" ;
|
VPast _ Pl2_ => "ahaydeen" ;
|
||||||
VPast _ Pl3_ => "ahaayeen" ;
|
VPast _ Pl3_ => "ahaayeen" ;
|
||||||
VNegPast _ => "ahi" ;
|
VNegPast _ => "ahi" ;
|
||||||
VRel => "ah" ;
|
--VRelShort => "ah" ;
|
||||||
|
VRel _ => "ah" ; -- TODO find right forms
|
||||||
VInf => "ahaan" ;
|
VInf => "ahaan" ;
|
||||||
VImp Sg pol => if_then_Pol pol "ahaw" "ahaanin" ;
|
VImp Sg pol => if_then_Pol pol "ahaw" "ahaanin" ;
|
||||||
VImp Pl pol => if_then_Pol pol "ahaada" "ahaanina" ;
|
VImp Pl pol => if_then_Pol pol "ahaada" "ahaanina" ;
|
||||||
@@ -621,7 +624,8 @@ oper
|
|||||||
VPres _ Pl2_ Pos => "leedihiin" ;
|
VPres _ Pl2_ Pos => "leedihiin" ;
|
||||||
VPres _ Pl3_ Pos => "leeyihiin" ;
|
VPres _ Pl3_ Pos => "leeyihiin" ;
|
||||||
VPast asp agr => "l" + copula.s ! VPast asp agr ;
|
VPast asp agr => "l" + copula.s ! VPast asp agr ;
|
||||||
VRel => "leh" ;
|
-- VRelShort => "leh" ;
|
||||||
|
VRel _ => "leh" ; -- TODO find right forms
|
||||||
x => hold_V.s ! x }
|
x => hold_V.s ! x }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -656,13 +660,10 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** {
|
VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** {
|
||||||
-- Prepositions can combine together and with object pronoun.
|
c2 : PrepCombination ; -- Prepositions can combine together and with object pronoun.
|
||||||
isPassive : Bool ;
|
|
||||||
c2,c3 : Preposition ; -- if c2 is Passive, the real preposition is in c3.
|
|
||||||
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 : Str ; -- VV complement
|
vComp : Str ; -- VV complement
|
||||||
-- refl : Str ; -- reflexive is put here, if the verb has an obj2.
|
|
||||||
miscAdv : Str ; -- dump for any other kind of adverb, that isn't
|
miscAdv : Str ; -- dump for any other kind of adverb, that isn't
|
||||||
} ; -- in a closed class of particles or made with PrepNP.
|
} ; -- in a closed class of particles or made with PrepNP.
|
||||||
|
|
||||||
@@ -672,32 +673,38 @@ oper
|
|||||||
comp = \\_ => <[],[]> ;
|
comp = \\_ => <[],[]> ;
|
||||||
pred = NoPred ;
|
pred = NoPred ;
|
||||||
vComp,berri,miscAdv,refl = [] ;
|
vComp,berri,miscAdv,refl = [] ;
|
||||||
c2, c3 = NoPrep ;
|
c2 = Single NoPrep ;
|
||||||
isPassive = False ;
|
|
||||||
obj2 = {s = [] ; a = P3_Prep} ;
|
obj2 = {s = [] ; a = P3_Prep} ;
|
||||||
secObj = []
|
secObj = []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
|
useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
|
||||||
c2 = v2.c2
|
c2 = Single v2.c2
|
||||||
|
} ;
|
||||||
|
|
||||||
|
useVc3 : Verb3 -> VPSlash = \v3 -> useV v3 ** {
|
||||||
|
c2 = combine v3.c2 v3.c3 ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
passV2 : Verb2 -> VerbPhrase = \v2 -> passVP (useV v2) ;
|
passV2 : Verb2 -> VerbPhrase = \v2 -> passVP (useV v2) ;
|
||||||
|
|
||||||
passVP : VerbPhrase -> VerbPhrase = \vp -> vp ** {
|
passVP : VerbPhrase -> VerbPhrase = \vp -> vp ** {
|
||||||
isPassive = True ;
|
c2 = case vp.c2 of {
|
||||||
|
Single NoPrep => Passive ;
|
||||||
|
Single Ku => Lagu ;
|
||||||
|
Single Ka => Laga ;
|
||||||
|
Single U => Loo ;
|
||||||
|
Single La => Lala ;
|
||||||
|
_ => vp.c2 }
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
complSlash : VPSlash -> VerbPhrase = \vps -> let np = vps.obj2 in vps ** {
|
complSlash : VPSlash -> VerbPhrase = \vps -> let np = vps.obj2 in vps ** {
|
||||||
comp = \\agr => let cmp = vps.comp ! agr in
|
comp = \\agr => let cmp = vps.comp ! agr in
|
||||||
{p1 = np.s ++ cmp.p1 ; -- if object is a noun, it will come before verb in the sentence.
|
{p1 = np.s ++ cmp.p1 ; -- if object is a noun, it will come before verb in the sentence.
|
||||||
-- if object is a pronoun, np.s is empty.
|
-- if object is a pronoun, np.s is empty.
|
||||||
p2 = cmp.p2 ++ compl np.a vps} -- object combines with the preposition of the verb.
|
p2 = cmp.p2 ++ prepCombTable ! np.a ! vps.c2} -- object combines with the preposition of the verb.
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
compl : PrepAgr -> VerbPhrase -> Str = \agr,vp ->
|
|
||||||
prepCombTable ! agr ! combine vp.isPassive vp.c2 vp.c3 ;
|
|
||||||
|
|
||||||
insertRefl : VPSlash -> VPSlash = \vps -> vps ** {
|
insertRefl : VPSlash -> VPSlash = \vps -> vps ** {
|
||||||
obj2 = vps.obj2 ** {a = Reflexive_Prep} ;
|
obj2 = vps.obj2 ** {a = Reflexive_Prep} ;
|
||||||
|
|
||||||
@@ -730,10 +737,10 @@ oper
|
|||||||
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
||||||
case adv.c2 of {
|
case adv.c2 of {
|
||||||
NoPrep => vp ** adv'' ; -- the adverb is not formed with PrepNP, e.g. "tomorrow"
|
NoPrep => vp ** adv'' ; -- the adverb is not formed with PrepNP, e.g. "tomorrow"
|
||||||
_ => case <vp.c2,vp.c3> of {
|
_ => case vp.c2 of {
|
||||||
-- if free complement slots, introduce adv.np with insertComp
|
-- if free complement slots, introduce adv.np with insertComp
|
||||||
<NoPrep,_> => insertCompAgrPlus (vp ** {c2 = adv.c2}) adv.np ** adv' ;
|
Single NoPrep => insertCompAgrPlus (vp ** {c2 = Single adv.c2}) adv.np ** adv' ;
|
||||||
<_,NoPrep> => insertCompAgrPlus (vp ** {c3 = adv.c2}) adv.np ** adv' ;
|
Single p => insertCompAgrPlus (vp ** {c2 = combine p adv.c2}) adv.np ** adv' ;
|
||||||
|
|
||||||
-- if complement slots are full, just insert strings.
|
-- if complement slots are full, just insert strings.
|
||||||
_ => vp ** adv''
|
_ => vp ** adv''
|
||||||
@@ -749,10 +756,21 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
-- Sentences etc.
|
-- Sentences etc.
|
||||||
Clause : Type = {s : ClType => Tense => Anteriority => Polarity => Str} ;
|
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 : Gender => Case => Tense => Anteriority => Polarity => Str} ;
|
||||||
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} ;
|
mergeQCl : (Tense => Anteriority => Polarity => BaseCl) -> QClause = mergeSTM True ;
|
||||||
|
mergeRCl : (Tense => Anteriority => Polarity => BaseCl) -> QClause = mergeSTM False ;
|
||||||
|
|
||||||
|
mergeSTM : Bool -> (Tense => Anteriority => Polarity => BaseCl) -> QClause = \includeSTM,b ->
|
||||||
|
{s = \\t,a,p => (b ! t ! a ! p).beforeSTM
|
||||||
|
++ if_then_Str includeSTM (b ! t ! a ! p).stm []
|
||||||
|
++ (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 {
|
||||||
@@ -772,12 +790,13 @@ oper
|
|||||||
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
|
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
|
||||||
obj : {p1,p2 : Str} =
|
obj : {p1,p2 : Str} =
|
||||||
let o : {p1,p2 : Str} = vp.comp ! subj.a ;
|
let o : {p1,p2 : Str} = vp.comp ! subj.a ;
|
||||||
bind : Str = case <vp.isPassive,vp.obj2.a, vp.c2, vp.pred> of {
|
bind : Str = case <isPassive vp,vp.obj2.a, vp.c2, vp.pred> of {
|
||||||
<False,P3_Prep,NoPrep,NoPred> => [] ;
|
<False,P3_Prep,Single 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)
|
||||||
@@ -787,25 +806,26 @@ oper
|
|||||||
_ => stmarkerNoContr ! subj.a ! p }} ;
|
_ => stmarkerNoContr ! subj.a ! p }} ;
|
||||||
in wordOrder subjnoun subjpron stm obj pred vp ;
|
in wordOrder subjnoun subjpron stm obj pred vp ;
|
||||||
} where {
|
} where {
|
||||||
vp = case vps.isPassive of {
|
vp = case isPassive vps of {
|
||||||
True => complSlash (insertComp vps np) ;
|
True => complSlash (insertComp vps np) ;
|
||||||
_ => complSlash vps } ;
|
_ => complSlash vps } ;
|
||||||
subj = case vps.isPassive of {True => impersNP ; _ => np}
|
subj = case isPassive vps 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
|
stm = stm ; -- sentence type marker + possible subj. pronoun
|
||||||
++ obj.p2 -- object if it's a pronoun
|
afterSTM = 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
|
||||||
++ vp.secObj -- "second object"
|
++ vp.secObj -- "second object"
|
||||||
++ 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
|
||||||
@@ -840,9 +860,7 @@ oper
|
|||||||
_ => vfStatement t ant p agr vp
|
_ => vfStatement t ant p agr vp
|
||||||
} ; -- TODO other relative forms
|
} ; -- TODO other relative forms
|
||||||
|
|
||||||
infVP : VerbPhrase -> Str = \vp ->
|
infVP : VerbPhrase -> Str = linVP VInf ;
|
||||||
let inf = {inf = vp.s ! VInf ; fin=[]}
|
|
||||||
in wordOrder [] [] [] (vp.comp ! Pl3) inf vp ;
|
|
||||||
|
|
||||||
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"
|
||||||
@@ -865,7 +883,11 @@ oper
|
|||||||
-- linrefs
|
-- linrefs
|
||||||
|
|
||||||
oper
|
oper
|
||||||
linVP : VerbPhrase -> Str = infVP ;
|
linVP : VForm -> VerbPhrase -> Str = \vf,vp ->
|
||||||
|
let inf = {inf = vp.s ! vf ; fin=[]} ;
|
||||||
|
wo = wordOrder [] [] [] (vp.comp ! Pl3) inf vp ;
|
||||||
|
in wo.beforeSTM ++ wo.afterSTM ;
|
||||||
|
|
||||||
linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ;
|
linCN : CNoun -> Str = \cn -> cn.s ! NomSg ++ cn.mod ! Sg ! Abs ;
|
||||||
linAdv : Adverb -> Str = \adv ->
|
linAdv : Adverb -> Str = \adv ->
|
||||||
adv.berri
|
adv.berri
|
||||||
@@ -873,5 +895,6 @@ oper
|
|||||||
++ (prepTable ! adv.c2).s ! adv.np.a
|
++ (prepTable ! adv.c2).s ! adv.np.a
|
||||||
++ adv.dhex
|
++ adv.dhex
|
||||||
++ adv.np.s ;
|
++ adv.np.s ;
|
||||||
|
linBaseCl : BaseCl -> Str = \b -> b.beforeSTM ++ b.stm ++ b.afterSTM ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,15 +50,16 @@ 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 ;
|
||||||
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
||||||
|
|
||||||
-- : Temp -> Pol -> RCl -> RS ;
|
-- : Temp -> Pol -> RCl -> RS ;
|
||||||
UseRCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p} ;
|
UseRCl t p cl = {s = \\g,c => t.s ++ p.s ++ cl.s ! g ! c ! t.t ! t.a ! p.p} ;
|
||||||
|
|
||||||
-- AdvS : Adv -> S -> S ; -- then I will go home
|
-- AdvS : Adv -> S -> S ; -- then I will go home
|
||||||
-- ExtAdvS : Adv -> S -> S ; -- next week, I will go home
|
-- ExtAdvS : Adv -> S -> S ; -- next week, I will go home
|
||||||
@@ -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}} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ lin with_Prep = mkPrep la ;
|
|||||||
-- Pron
|
-- Pron
|
||||||
|
|
||||||
-- Pronouns are closed class, no constructor in ParadigmsSom.
|
-- Pronouns are closed class, no constructor in ParadigmsSom.
|
||||||
it_Pron = he_Pron ** {s = \\_ => [] ; sp = []} ; -- TODO check should there be Sg3 Neutr?
|
it_Pron = he_Pron ** {s = \\_ => [] ; sp = [] ; a = Impers} ;
|
||||||
i_Pron = pronTable ! Sg1 ;
|
i_Pron = pronTable ! Sg1 ;
|
||||||
youPol_Pron,
|
youPol_Pron,
|
||||||
youSg_Pron = pronTable ! Sg2 ;
|
youSg_Pron = pronTable ! Sg2 ;
|
||||||
@@ -141,7 +141,7 @@ lin whoSg_IP = ;
|
|||||||
-- lin although_Subj = mkSubj "" False ;
|
-- lin although_Subj = mkSubj "" False ;
|
||||||
-- lin because_Subj = mkSubj "" False ;
|
-- lin because_Subj = mkSubj "" False ;
|
||||||
-- lin if_Subj = mkSubj "" True ;
|
-- lin if_Subj = mkSubj "" True ;
|
||||||
lin that_Subj = {s = "in" ++ BIND} ;
|
lin that_Subj = {s = "in"} ;
|
||||||
-- lin when_Subj = mkSubj "" False ;
|
-- lin when_Subj = mkSubj "" False ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ lin
|
|||||||
-- : V3 -> NP -> VPSlash ; -- give it (to her)
|
-- : V3 -> NP -> VPSlash ; -- give it (to her)
|
||||||
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
-- : V3 -> NP -> VPSlash ; -- give (it) to her
|
||||||
Slash2V3,
|
Slash2V3,
|
||||||
Slash3V3 = \v3 -> insertComp (useVc v3) ;
|
Slash3V3 = \v3 -> insertComp (useVc3 v3) ;
|
||||||
{-
|
{-
|
||||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||||
SlashV2V v2v vp = ;
|
SlashV2V v2v vp = ;
|
||||||
|
|||||||
Reference in New Issue
Block a user