forked from GitHub/gf-rgl
(Som) Shaving off parameters here and there
This commit is contained in:
@@ -11,7 +11,7 @@ lin
|
||||
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
||||
|
||||
-- : Prep -> NP -> Adv ;
|
||||
PrepNP prep np = prep ** {s = [] ; np = np} ;
|
||||
PrepNP prep np = prep ** {s = [] ; np = nplite np} ;
|
||||
|
||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ lin house_N = mkN "guri" ;
|
||||
-- lin industry_N = mkN "" ;
|
||||
-- lin iron_N = mkN "" ;
|
||||
-- lin john_PN = mkPN "Jon" ;
|
||||
-- lin jump_V = mkV "" ;
|
||||
lin jump_V = mkV "bood" ;
|
||||
-- lin kill_V2 = mkV2 "" ;
|
||||
-- lin king_N = mkN "" ;
|
||||
-- lin knee_N = mkN "" ;
|
||||
|
||||
@@ -7,11 +7,11 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
--2 Noun phrases
|
||||
|
||||
-- : Det -> CN -> NP
|
||||
DetCN det cn = useN cn ** {
|
||||
s = sTable ;
|
||||
a = getAgr det.n (gender cn) } where {
|
||||
sTable : Case => Str = \\c =>
|
||||
let nfc : {nf : NForm ; c : Case} =
|
||||
DetCN det cn = useN cn ** {
|
||||
s = sTable ;
|
||||
a = getAgr det.n (gender cn) } where {
|
||||
sTable : Case => Str = \\c =>
|
||||
let nfc : {nf : NForm ; c : Case} =
|
||||
case <det.isNum,c,cn.hasMod,det.st,det.n> of {
|
||||
-- Numbers
|
||||
<True,_,_,_,_> => {nf=Numerative ; c=c} ;
|
||||
@@ -26,7 +26,7 @@ DetCN det cn = useN cn ** {
|
||||
<_,Nom,True,_,_> => {nf=Def det.n ; c=Abs} ;
|
||||
_ => {nf=Def det.n ; c=c} -- TODO check
|
||||
} ;
|
||||
art = case det.n of {Sg => cn.sg ; Pl => cn.pl} ;
|
||||
art = gda2da cn.gda ! det.n ;
|
||||
num = case det.isNum of {True => Sg ; _ => det.n} ;
|
||||
dt : {pref,s : Str} =
|
||||
case <nfc.nf,cn.isPoss,andB det.isPoss cn.shortPoss> of {
|
||||
@@ -159,7 +159,7 @@ DetCN det cn = useN cn ** {
|
||||
-}
|
||||
|
||||
-- : Quant
|
||||
DefArt = defQuant "a" "kan" "tan" "kuwan" NA ;
|
||||
DefArt = defQuant "a" "kan" "tan" "kuwan" False ;
|
||||
|
||||
-- : Quant
|
||||
IndefArt = indefQuant ** {sp = \\gn,c => "1"} ; -- TODO sp forms
|
||||
@@ -190,11 +190,11 @@ DetCN det cn = useN cn ** {
|
||||
Def n => n ;
|
||||
Indef n => n ;
|
||||
_ => Sg } ;
|
||||
art = case num of {Sg => cn.sg ; Pl => cn.pl} ;
|
||||
art = gda2da cn.gda ! num ;
|
||||
qnt = PossPron (pronTable ! np.a) ;
|
||||
det = case cn.shortPoss of {
|
||||
True => qnt.shortPoss ! art ;
|
||||
_ => qnt.s ! n2.sg ! Abs } ;
|
||||
_ => qnt.s ! sg n2.gda ! Abs } ;
|
||||
noun = case np.isPron of {
|
||||
True => (pronTable ! np.a).sp ; -- long subject pronoun
|
||||
False => np.s ! Abs }
|
||||
|
||||
@@ -123,7 +123,7 @@ oper
|
||||
mkAdv : Str -> Adv = \s -> lin Adv {
|
||||
berri = s ;
|
||||
c2 = noPrep ;
|
||||
np = emptyNP ;
|
||||
np = {s = [] ; a = NotPronP3} ;
|
||||
sii,dhex = []
|
||||
} ;
|
||||
|
||||
|
||||
@@ -27,16 +27,43 @@ param
|
||||
-- Allomorphs for the definite article
|
||||
DefTA = TA | DA | SHA | DHA ;
|
||||
DefKA = KA | GA | A_ | HA ;
|
||||
DefArticle = M DefKA | F DefTA ;
|
||||
DefArticle = F DefTA | M DefKA ;
|
||||
GenderDefArt = FM DefTA DefKA
|
||||
| MF DefKA DefTA
|
||||
| MM DefKA DefKA ;
|
||||
|
||||
oper
|
||||
|
||||
defAllomorph : Str -> DefArticle = \wiilka ->
|
||||
case wiilka of {
|
||||
_ + "ta" => F DA ; _ + "sha" => F SHA ;
|
||||
_ + "da" => F DA ; _ + "dha" => F DHA ;
|
||||
_ + "ka" => M KA ; _ + "aha" => M HA ;
|
||||
_ + "ga" => M GA ; _ => M A_ } ;
|
||||
sg : GenderDefArt -> DefArticle = \gda -> gda2da gda ! Sg ;
|
||||
pl : GenderDefArt -> DefArticle = \gda -> gda2da gda ! Pl ;
|
||||
|
||||
gda2da : GenderDefArt -> Number => DefArticle = \gda ->
|
||||
let da : {sg,pl:DefArticle} = case gda of {
|
||||
FM s p => {sg = F s ; pl = M p} ;
|
||||
MM s p => {sg = M s ; pl = M p} ;
|
||||
MF s p => {sg = M s ; pl = F p} } ;
|
||||
in table {Sg => da.sg ; Pl => da.pl} ;
|
||||
|
||||
defAllomorph : (_,_ : Str) -> GenderDefArt = \wiilka,wiilasha ->
|
||||
case <getGender wiilka, getGender wiilasha> of {
|
||||
<Masc,Fem> => MF (allomM wiilka) (allomF wiilasha) ;
|
||||
<Masc,Masc> => MM (allomM wiilka) (allomM wiilasha) ;
|
||||
_ => FM (allomF wiilka) (allomM wiilasha)
|
||||
} where {
|
||||
allomF : Str -> DefTA = \wiilka ->
|
||||
case wiilka of {
|
||||
_ + "ta" => DA ; _ + "sha" => SHA ;
|
||||
_ + "da" => DA ; _ + "dha" => DHA } ;
|
||||
allomM : Str -> DefKA = \wiilka ->
|
||||
case wiilka of {
|
||||
_ + "ka" => KA ; _ + "aha" => HA ;
|
||||
_ + "ga" => GA ; _ + "a" => A_ } ;
|
||||
getGender : Str -> Gender = \word ->
|
||||
case word of {
|
||||
_ + ("ta"|"sha"|"da"|"dha") => Fem ;
|
||||
_ + "a" => Masc ;
|
||||
_ => Predef.error ("defAllomorph: expecting definite form, given" ++ word)}
|
||||
} ;
|
||||
|
||||
-- Use always via quantTable!
|
||||
defStems : DefArticle => Str = table {
|
||||
@@ -97,7 +124,6 @@ oper
|
||||
param
|
||||
Case = Nom | Abs ;
|
||||
Gender = Masc | Fem ;
|
||||
Vowel = vA | vE | vI | vO | vU | NA ; -- For vowel assimilation
|
||||
GenNum = SgMasc | SgFem | PlInv ; -- For Quant
|
||||
|
||||
Inclusion = Excl | Incl ;
|
||||
@@ -111,8 +137,7 @@ param
|
||||
| Impers ; -- Verb agrees with Sg3, but needed for preposition contraction
|
||||
|
||||
AgreementPlus =
|
||||
Unassigned -- Dummy value: shows that the slot for object hasn't been filled.
|
||||
| IsPron Agreement -- Any of Sg1 … Pl3 can be a pronoun.
|
||||
IsPron Agreement -- Any of Sg1 … Pl3 can be a pronoun.
|
||||
| NotPronP3 ; -- Sg3 Gender and Pl3 can be pronouns or not.
|
||||
|
||||
State = Definite | Indefinite ;
|
||||
@@ -130,6 +155,9 @@ oper
|
||||
agr2agrplus : (isPron : Bool) -> Agreement -> AgreementPlus = \isPron,a ->
|
||||
case isPron of {True => IsPron a ; False => NotPronP3} ;
|
||||
|
||||
agrplus2agr : AgreementPlus -> Agreement = \a ->
|
||||
case a of {IsPron a => a ; _ => Pl3} ;
|
||||
|
||||
isP3 = overload {
|
||||
isP3 : Agreement -> Bool = \agr ->
|
||||
case agr of {Sg3 _ | Pl3 | Impers => True ; _ => False} ;
|
||||
@@ -137,18 +165,12 @@ oper
|
||||
case agr of {
|
||||
IsPron (Sg3 _ | Pl3 | Impers) => True ;
|
||||
NotPronP3 => True ;
|
||||
Unassigned => True ; -- meaningful for "does it leave an overt pronoun"
|
||||
-- Unassigned => True ; -- meaningful for "does it leave an overt pronoun"
|
||||
_ => False}
|
||||
} ;
|
||||
|
||||
-- gn2gennum : Gender -> Number -> GenNum = \g,n ->
|
||||
-- case <g,n> of {
|
||||
-- <Masc,Sg> => SgMasc ;
|
||||
-- <Fem,Sg> => SgFem ;
|
||||
-- _ => PlInv } ;
|
||||
|
||||
gender : {sg : DefArticle} -> Gender = \n ->
|
||||
case n.sg of {M _ => Masc ; F _ => Fem} ;
|
||||
gender : {gda : GenderDefArt} -> Gender = \n ->
|
||||
case n.gda of {FM _ _ => Fem ; _ => Masc} ;
|
||||
--------------------------------------------------------------------------------
|
||||
-- Numerals
|
||||
|
||||
@@ -179,7 +201,7 @@ oper
|
||||
let oneWay : PrepositionPlus => Preposition => PrepCombination =
|
||||
\\x,y => case <x,y> of {
|
||||
<Passive,NoPrep> => Single Passive ;
|
||||
<Passive,p> => Single (P p) ; -- TODO check if this ever happens
|
||||
<Passive,p> => Single (P p) ; -- FIXME p "waa lagu arkay" gives infinitely many trees now, because the passive is ignored here. Is there a combination for passive + personal pronoun + preposition?
|
||||
<P z,_> => case <z,y> of {
|
||||
<U,U|Ku> => Ugu ;
|
||||
<U,Ka> => Uga ;
|
||||
@@ -226,12 +248,19 @@ param
|
||||
|
||||
VForm =
|
||||
VInf
|
||||
| VPres Aspect Agreement Polarity
|
||||
| VPres Aspect VAgr Polarity
|
||||
| VNegPast Aspect
|
||||
| VPast Aspect Agreement
|
||||
| VPast Aspect VAgr
|
||||
| VRel -- "som är/har/…" TODO is this used in other verbs?
|
||||
| VImp Number Polarity ;
|
||||
|
||||
VAgr =
|
||||
Sg1_Sg3Masc
|
||||
| Sg2_Sg3Fem
|
||||
| Pl1_
|
||||
| Pl2_
|
||||
| Pl3_ ;
|
||||
|
||||
PredType = NoPred | Copula | NoCopula ;
|
||||
|
||||
oper
|
||||
@@ -239,9 +268,14 @@ oper
|
||||
case p of {Pos => t ; Neg => f } ;
|
||||
|
||||
forceAgr : Agreement -> (VForm=>Str) -> (VForm=>Str) = \agr,tbl -> table {
|
||||
VPres asp _a pol => tbl ! VPres asp agr pol ;
|
||||
VPast asp _a => tbl ! VPast asp agr ;
|
||||
VPres asp _a pol => tbl ! VPres asp (agr2vagr agr) pol ;
|
||||
VPast asp _a => tbl ! VPast asp (agr2vagr agr) ;
|
||||
x => tbl ! x
|
||||
} ;
|
||||
|
||||
agr2vagr : Agreement -> VAgr = \agr -> case agr of {
|
||||
Sg1|Sg3 Masc|Impers => Sg1_Sg3Masc ;
|
||||
Sg2|Sg3 Fem => Sg2_Sg3Fem ;
|
||||
Pl1 _ => Pl1_ ; Pl2 => Pl2_ ; Pl3 => Pl3_
|
||||
} ;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,7 @@ oper
|
||||
|
||||
Noun : Type = {
|
||||
s : NForm => Str ;
|
||||
sg,
|
||||
pl : DefArticle ;
|
||||
gda : GenderDefArt ;
|
||||
shortPoss : Bool ;
|
||||
} ;
|
||||
Noun2 : Type = Noun ; -- TODO eventually more parameters?
|
||||
@@ -33,8 +32,7 @@ oper
|
||||
-- Special forms for feminine nouns
|
||||
NomSg => bisadi ; Numerative => bisadood
|
||||
} ;
|
||||
sg = defAllomorph wiilka ;
|
||||
pl = defAllomorph wiilasha ;
|
||||
gda = defAllomorph wiilka wiilasha ;
|
||||
shortPoss = False
|
||||
} where {
|
||||
hooya : Str = case wiilka of {
|
||||
@@ -141,6 +139,15 @@ oper
|
||||
|
||||
NounPhrase : Type = BaseNP ** {s : Case => Str} ;
|
||||
|
||||
NPLite : Type = {s : Str ; a : AgreementPlus} ; -- Used in Adv and as an object in VP
|
||||
|
||||
nplite : NounPhrase -> NPLite = \np ->
|
||||
let aplus : AgreementPlus = agr2agrplus np.isPron np.a in
|
||||
case <np.isPron,np.a> of {
|
||||
<False,_> => {s = np.s ! Abs ; a = aplus} ;
|
||||
-- <True,(Sg3 _|Pl3)> => {s = np.empty ++ (pronTable ! np.a).sp ; a = aplus} ; -- uncomment if you want to add long object pronoun for 3rd person object
|
||||
_ => {s = np.empty ; a = aplus} } ; -- no long object for other pronouns
|
||||
|
||||
useN : Noun -> CNoun ** BaseNP = \n -> n **
|
||||
{ mod = \\_,_ => [] ; hasMod = False ;
|
||||
a = Sg3 (gender n) ; isPron,isPoss = False ;
|
||||
@@ -228,15 +235,13 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
-- Second series object pronouns, Sayeed p. 74-75
|
||||
-- For two non-3rd person object pronouns, e.g. "They took you away from me"
|
||||
secondObject : Agreement => Str = table {
|
||||
Sg1 => "kay" ;
|
||||
Sg2 => "kaa" ;
|
||||
Pl1 Excl => "kayo" ;
|
||||
Pl1 Incl => "keen" ;
|
||||
Pl2 => "kiin" ;
|
||||
_ => []
|
||||
secondObject : AgreementPlus => Str = table {
|
||||
IsPron Sg1 => "kay" ;
|
||||
IsPron Sg2 => "kaa" ;
|
||||
IsPron (Pl1 Excl) => "kayo" ;
|
||||
IsPron (Pl1 Incl) => "keen" ;
|
||||
IsPron Pl2 => "kiin" ;
|
||||
_ => []
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -291,11 +296,11 @@ oper
|
||||
|
||||
defQuant = defQuantBind True ;
|
||||
|
||||
defQuantBind : (bind : Bool) -> (s, kan, tan, kuwan : Str) -> Vowel -> Quant = \b,s,spm,spf,spp,v ->
|
||||
defQuantBind : (bind : Bool) -> (s, kan, tan, kuwan : Str) -> (vowIsI : Bool) -> Quant = \b,s,spm,spf,spp,v ->
|
||||
let bind : Str -> Str = \x -> case b of {False => x ; True => BIND ++ x} ;
|
||||
in baseQuant ** {
|
||||
s = \\allomorph,c =>
|
||||
let nom = case v of {NA => "u" ; _ => s + "i"}
|
||||
let nom = case v of {False => "u" ; _ => s + "i"}
|
||||
in case c of {
|
||||
Nom => bind (quantTable nom ! allomorph) ;
|
||||
_ => bind (quantTable s ! allomorph) } ;
|
||||
@@ -312,15 +317,11 @@ oper
|
||||
s = \\da,c => [] ;
|
||||
sp = \\gn,c => [] ;
|
||||
st = Indefinite ;
|
||||
-- v = NA ; -- Will be ignored in DetQuant
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Prepositions
|
||||
|
||||
-- Prepositionen u dras obligatoriskt samman med föregående pronomen
|
||||
-- så att /a/ + /u/ > /oo/.
|
||||
|
||||
Prep : Type = {s : Agreement => Str} ;
|
||||
|
||||
mkPrep : (x1,_,_,_,_,x6 : Str) -> Prep = \ku,ii,kuu,noo,idiin,loo -> {
|
||||
@@ -486,36 +487,36 @@ oper
|
||||
_ => "in" } ;
|
||||
|
||||
in { s = table {
|
||||
VPres Simple (Sg1|Sg3 Masc|Impers) pol
|
||||
VPres Simple Sg1_Sg3Masc pol
|
||||
=> qaat + if_then_Pol pol "aa" "o" ;
|
||||
VPres Simple (Sg2|Sg3 Fem) pol
|
||||
VPres Simple Sg2_Sg3Fem pol
|
||||
=> arag + t + if_then_Pol pol "aa" "o" ;
|
||||
VPres Simple (Pl1 _) pol => arag + n + if_then_Pol pol "aa" "o" ;
|
||||
VPres Simple Pl2 pol => arag + t + "aan" ;
|
||||
VPres Simple Pl3 pol => qaat + "aan" ;
|
||||
VPres Simple Pl1_ pol => arag + n + if_then_Pol pol "aa" "o" ;
|
||||
VPres Simple Pl2_ pol => arag + t + "aan" ;
|
||||
VPres Simple Pl3_ pol => qaat + "aan" ;
|
||||
|
||||
VPres Progressive (Sg1|Sg3 Masc|Impers) pol
|
||||
=> progr + if_then_Pol pol "aa" "o" ;
|
||||
VPres Progressive (Sg2|Sg3 Fem) pol
|
||||
=> progr + if_then_Pol pol "saa" "so" ;
|
||||
VPres Progressive (Pl1 _) pol
|
||||
=> progr + if_then_Pol pol "naa" "no" ;
|
||||
VPres Progressive Pl2 pol => progr + "saan" ;
|
||||
VPres Progressive Pl3 pol => progr + "aan" ;
|
||||
VPres Progressive Sg1_Sg3Masc pol
|
||||
=> progr + if_then_Pol pol "aa" "o" ;
|
||||
VPres Progressive Sg2_Sg3Fem pol
|
||||
=> progr + if_then_Pol pol "saa" "so" ;
|
||||
VPres Progressive Pl1_ pol
|
||||
=> progr + if_then_Pol pol "naa" "no" ;
|
||||
VPres Progressive Pl2_ pol => progr + "saan" ;
|
||||
VPres Progressive Pl3_ pol => progr + "aan" ;
|
||||
|
||||
VPast Simple (Sg1|Sg3 Masc|Impers)
|
||||
VPast Simple Sg1_Sg3Masc
|
||||
=> qaat + ay ;
|
||||
VPast Simple (Sg2|Sg3 Fem) => arag + t + ay ; -- t, d or s
|
||||
VPast Simple (Pl1 _) => arag + n + ay ;
|
||||
VPast Simple Pl2 => arag + t + "een" ; -- t, d or s
|
||||
VPast Simple Pl3 => qaat + "een" ;
|
||||
VPast Simple Sg2_Sg3Fem => arag + t + ay ; -- t, d or s
|
||||
VPast Simple Pl1_ => arag + n + ay ;
|
||||
VPast Simple Pl2_ => arag + t + "een" ; -- t, d or s
|
||||
VPast Simple Pl3_ => qaat + "een" ;
|
||||
|
||||
VPast Progressive (Sg1|Sg3 Masc|Impers)
|
||||
VPast Progressive Sg1_Sg3Masc
|
||||
=> progr + "ey" ;
|
||||
VPast Progressive (Sg2|Sg3 Fem) => progr + "sey" ;
|
||||
VPast Progressive (Pl1 _) => progr + "ney" ;
|
||||
VPast Progressive Pl2 => progr + "seen" ;
|
||||
VPast Progressive Pl3 => progr + "een" ;
|
||||
VPast Progressive Sg2_Sg3Fem => progr + "sey" ;
|
||||
VPast Progressive Pl1_ => progr + "ney" ;
|
||||
VPast Progressive Pl2_ => progr + "seen" ;
|
||||
VPast Progressive Pl3_ => progr + "een" ;
|
||||
|
||||
VNegPast Simple => arkin ;
|
||||
VNegPast Progressive => progr + "n" ;
|
||||
@@ -569,46 +570,44 @@ oper
|
||||
|
||||
------------------
|
||||
-- Irregular verbs
|
||||
presCopula : {agr:Agreement ; pol:Polarity} => Str =
|
||||
\\a => case <a.agr,a.pol> of {
|
||||
<Sg1,pol> => if_then_Pol pol "ahay" "ihi" ;
|
||||
<Sg2,pol> => if_then_Pol pol "tahay" "ihid" ;
|
||||
<(Sg3 Masc|Impers),pol> => if_then_Pol pol "yahay" "aha" ;
|
||||
<(Sg3 Fem),pol> => if_then_Pol pol "tahay" "aha" ;
|
||||
<(Pl1 _),pol> => if_then_Pol pol "nahay" "ihin" ;
|
||||
<Pl2,pol> => if_then_Pol pol "tihiin" "ihidin" ;
|
||||
<Pl3,pol> => if_then_Pol pol "yihiin" "aha"
|
||||
} ;
|
||||
|
||||
copula : Verb = {
|
||||
s = table {
|
||||
VPres _ Sg1 pol => if_then_Pol pol "ahay" "ihi" ;
|
||||
VPres _ Sg2 pol => if_then_Pol pol "tahay" "ihid" ;
|
||||
VPres _ (Sg3 Masc|Impers) pol => if_then_Pol pol "yahay" "aha" ;
|
||||
VPres _ (Sg3 Fem) pol => if_then_Pol pol "tahay" "aha" ;
|
||||
VPres _ (Pl1 _) pol => if_then_Pol pol "nahay" "ihin" ;
|
||||
VPres _ Pl2 pol => if_then_Pol pol "tihiin" "ihidin" ;
|
||||
VPres _ Pl3 pol => if_then_Pol pol "yihiin" "aha" ;
|
||||
VImp Sg pol => if_then_Pol pol "ahaw" "ahaanin" ;
|
||||
VImp Pl pol => if_then_Pol pol "ahaada" "ahaanina" ;
|
||||
|
||||
VPast _ (Sg1|Sg3 Masc|Impers)
|
||||
VPast _ Sg1_Sg3Masc
|
||||
=> "ahaa" ;
|
||||
VPast _ (Sg2|Sg3 Fem)
|
||||
VPast _ Sg2_Sg3Fem
|
||||
=> "ahayd" ;
|
||||
VPast _ (Pl1 _) => "ahayn" ;
|
||||
VPast _ Pl2 => "ahaydeen" ;
|
||||
VPast _ Pl3 => "ahaayeen" ;
|
||||
VNegPast _ => "ahi" ;
|
||||
VPast _ Pl1_ => "ahayn" ;
|
||||
VPast _ Pl2_ => "ahaydeen" ;
|
||||
VPast _ Pl3_ => "ahaayeen" ;
|
||||
VNegPast _ => "ahi" ;
|
||||
VRel => "ah" ;
|
||||
VInf => "ahaan" } ;
|
||||
VInf => "ahaan" ;
|
||||
VImp Sg pol => if_then_Pol pol "ahaw" "ahaanin" ;
|
||||
VImp Pl pol => if_then_Pol pol "ahaada" "ahaanina" ;
|
||||
VPres _ _ _ => nonExist -- use presCopula instead
|
||||
} ;
|
||||
sii, dhex = []
|
||||
} ;
|
||||
-- I somaliskan används inte något kopulaverb motsvarande svenskans är mellan
|
||||
-- två substantivfraser som utgör subjekt respektive predikatsfyllnad.
|
||||
-- Observera också att kopulaverbet vara alltid hamnar efter det adjektiv
|
||||
-- som utgör predikatsfyllnaden.
|
||||
|
||||
have_V : Verb =
|
||||
let hold_V = mkVerb "hayso" "haysat" "haysa" in hold_V ** {
|
||||
s = table {
|
||||
VPres _ Sg1 Pos => "leeyahay" ;
|
||||
VPres _ Sg2 Pos => "leedahay" ;
|
||||
VPres _ (Sg3 Fem) Pos => "leedahay" ;
|
||||
VPres _ (Sg3 Masc|Impers) Pos
|
||||
=> "leeyahay" ;
|
||||
VPres _ (Pl1 _) Pos => "leenahay" ;
|
||||
VPres _ Pl2 Pos => "leedihiin" ;
|
||||
VPres _ Pl3 Pos => "leeyihiin" ;
|
||||
VPres _ Sg1_Sg3Masc Pos => "leeyahay" ;
|
||||
VPres _ Sg2_Sg3Fem Pos => "leedahay" ;
|
||||
VPres _ Pl1_ Pos => "leenahay" ;
|
||||
VPres _ Pl2_ Pos => "leedihiin" ;
|
||||
VPres _ Pl3_ Pos => "leeyihiin" ;
|
||||
VPast asp agr => "l" + copula.s ! VPast asp agr ;
|
||||
VRel => "leh" ;
|
||||
x => hold_V.s ! x }
|
||||
@@ -636,7 +635,7 @@ oper
|
||||
|
||||
Adverb : Type = BaseAdv ** {
|
||||
c2 : Preposition ; -- adverbs can contribute to preposition contraction.
|
||||
np : NounPhrase -- NP from PrepNP can be promoted into a core argument.
|
||||
np : NPLite ; -- NP from PrepNP can be promoted into a core argument.
|
||||
} ;
|
||||
|
||||
Complement : Type = {
|
||||
@@ -648,7 +647,7 @@ oper
|
||||
-- Prepositions can combine together and with object pronoun.
|
||||
c2 : PrepositionPlus ; -- hack to implement passives more efficiently:
|
||||
c3 : Preposition ; -- if c2 is Passive, the real preposition is in c3.
|
||||
obj2 : {s : Str ; a : AgreementPlus} ;
|
||||
obj2 : NPLite ; -- {s : Str ; a : AgreementPlus}
|
||||
secObj : Str ; -- if two overt pronoun objects
|
||||
vComp : Str ; -- VV complement
|
||||
refl : Str ; -- reflexive is put here, if the verb has an obj2.
|
||||
@@ -663,7 +662,7 @@ oper
|
||||
vComp,berri,miscAdv,refl = [] ;
|
||||
c2 = P NoPrep ;
|
||||
c3 = NoPrep ;
|
||||
obj2 = {s = [] ; a = Unassigned} ;
|
||||
obj2 = {s = [] ; a = NotPronP3} ;
|
||||
secObj = []
|
||||
} ;
|
||||
|
||||
@@ -696,42 +695,35 @@ oper
|
||||
} ;
|
||||
|
||||
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
|
||||
let noun : Str = case <np.isPron,np.a> of {
|
||||
<False,_> => np.s ! Abs ;
|
||||
-- <True,(Sg3 _|Pl3)> => np.empty ++ (pronTable ! np.a).sp ; -- uncomment if you want to add long object pronoun for 3rd person object
|
||||
_ => np.empty } -- no long object for other pronouns
|
||||
in case vp.obj2.a of {
|
||||
Unassigned =>
|
||||
vp ** {obj2 = {
|
||||
s = noun ;
|
||||
a = agr2agrplus np.isPron np.a}
|
||||
} ;
|
||||
insertCompAgrPlus vp (nplite np) ;
|
||||
|
||||
-- If the old object is 3rd person, we can safely replace its agreement.
|
||||
insertCompAgrPlus : VPSlash -> NPLite -> VerbPhrase = \vp,nplite ->
|
||||
case vp.obj2.a of {
|
||||
-- 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.
|
||||
NotPronP3|IsPron (Sg3 _|Pl3|Impers) =>
|
||||
vp ** {obj2 = {
|
||||
s = vp.obj2.s ++ noun ;
|
||||
a = agr2agrplus np.isPron np.a} ; --
|
||||
} ; -- no secObj, because there's ≤1 non-3rd-person pronoun.
|
||||
vp ** {obj2 = nplite ** {
|
||||
s = vp.obj2.s ++ nplite.s}
|
||||
} ; -- no secObj, because there's ≤1 non-3rd-person pronoun.
|
||||
|
||||
-- If old object was non-3rd person, we keep its agreement.
|
||||
-- The new object is put in the secondObject field.
|
||||
_ =>
|
||||
vp ** {obj2 = vp.obj2 ** {
|
||||
s = vp.obj2.s ++ noun
|
||||
s = vp.obj2.s ++ nplite.s
|
||||
} ;
|
||||
secObj = vp.secObj ++ secondObject ! np.a}
|
||||
secObj = vp.secObj ++ secondObject ! nplite.a}
|
||||
|
||||
} ;
|
||||
|
||||
insertAdv : VerbPhrase -> Adverb -> VerbPhrase = \vp,adv ->
|
||||
case <adv.c2, isP3 adv.np.a, adv.np.isPron> of {
|
||||
<NoPrep,_,_> => vp ** adv'' ; -- a) the adverb is not formed with PrepNP, e.g. "tomorrow"
|
||||
<_,True,False> => vp ** adv'' ; -- b) is formed with PrepNP, and has 3rd person obj, which is a noun.
|
||||
_ => case <vp.c2,vp.obj2.a,vp.c3> of {
|
||||
case <adv.c2, adv.np.a> of { --isP3 adv.np.a, adv.np.isPron> of {
|
||||
<NoPrep,_> => vp ** adv'' ; -- a) the adverb is not formed with PrepNP, e.g. "tomorrow"
|
||||
<_,NotPronP3> => vp ** adv'' ; -- b) is formed with PrepNP, and has 3rd person obj, which is a noun.
|
||||
_ => case <vp.c2,isP3 vp.obj2.a,vp.c3> of {
|
||||
-- if free complement slots, introduce adv.np with insertComp
|
||||
<P NoPrep,Unassigned,_> => insertComp (vp ** {c2 = P adv.c2}) adv.np ** adv' ;
|
||||
<_ ,_ ,NoPrep> => insertComp (vp ** {c3 = adv.c2}) adv.np ** adv' ;
|
||||
<P NoPrep,True,_> => insertCompAgrPlus (vp ** {c2 = P adv.c2}) adv.np ** adv' ;
|
||||
<_ ,_ ,NoPrep> => insertCompAgrPlus (vp ** {c3 = adv.c2}) adv.np ** adv' ;
|
||||
|
||||
-- if complement slots are full, just insert strings.
|
||||
_ => vp ** adv''
|
||||
@@ -739,8 +731,8 @@ oper
|
||||
} where {
|
||||
adv' : {sii,dhex,berri : Str} = adv ; -- adv.np done with insertComp
|
||||
adv'' : {sii,dhex,berri,miscAdv : Str} -- adv.np inserted into miscAdv
|
||||
= adv ** {dhex = (prepTable ! P adv.c2).s ! adv.np.a ++ adv.dhex ;
|
||||
miscAdv = adv.np.s ! Abs} -- TODO: check case
|
||||
= adv ** {dhex = (prepTable ! P adv.c2).s ! agrplus2agr adv.np.a ++ adv.dhex ;
|
||||
miscAdv = adv.np.s}
|
||||
} ;
|
||||
--------------------------------------------------------------------------------
|
||||
-- Sentences etc.
|
||||
@@ -755,10 +747,11 @@ oper
|
||||
let predRaw : {fin : Str ; inf : Str} = vf t a p subj.a vp ;
|
||||
pred : {fin : Str ; inf : Str} = case <isQ,p,vp.pred> of {
|
||||
<False,Pos,NoCopula> => {fin,inf = []} ;
|
||||
<_ , _,Copula> => {fin = presCopula ! {agr=subj.a ; pol=p} ; inf=[]} ;
|
||||
_ => predRaw
|
||||
} ;
|
||||
subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ;
|
||||
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ;
|
||||
subjnoun : Str = if_then_Str np.isPron np.empty (subj.s ! Nom) ;
|
||||
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) np.empty ;
|
||||
obj : {p1,p2 : Str} =
|
||||
let o : {p1,p2 : Str} = vp.comp ! subj.a ;
|
||||
bind : Str = case <isP3 vp.obj2.a, vp.c2> of {
|
||||
@@ -804,8 +797,8 @@ oper
|
||||
-> {fin : Str ; inf : Str} = \t,ant,p,agr,vp ->
|
||||
case <t,ant> of {
|
||||
<Pres,Simul> => {fin = presV vp ; inf = [] } ;
|
||||
<Pres,Anter> => {fin = presV copula ; inf = vp.s ! VInf } ; ---- just guessing
|
||||
<Past,Simul> => {fin = pastV vp ; inf = [] } ;
|
||||
<Pres,Anter> => {fin = presCopula ! agrPol ; inf = vp.s ! VInf } ; ---- just guessing
|
||||
<Past,Anter> => {fin = pastV (cSug "jir") ; inf = vp.s ! VInf} ;
|
||||
<Fut,Simul> => {fin = presV (cSug "doon") ; inf = vp.s ! VInf} ;
|
||||
<Fut,Anter> => {fin = pastV (cSug "doon") ; inf = vp.s ! VInf} ;
|
||||
@@ -813,11 +806,12 @@ oper
|
||||
<Cond,Anter> => {fin = pastV have_V ; inf = vp.s ! VInf} -- TODO check
|
||||
}
|
||||
where {
|
||||
agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ;
|
||||
pastV : Verb -> Str = \v ->
|
||||
case p of { Neg => v.s ! VNegPast Simple ;
|
||||
Pos => v.s ! VPast Simple agr } ;
|
||||
Pos => v.s ! VPast Simple (agr2vagr agr) } ;
|
||||
|
||||
presV : Verb -> Str = \v -> v.s ! VPres Simple agr p ;
|
||||
presV : Verb -> Str = \v -> v.s ! VPres Simple (agr2vagr agr) p ;
|
||||
} ;
|
||||
|
||||
infVP : VerbPhrase -> Str = \vp ->
|
||||
@@ -849,8 +843,8 @@ oper
|
||||
linAdv : Adverb -> Str = \adv ->
|
||||
adv.berri
|
||||
++ adv.sii
|
||||
++ (prepTable ! P adv.c2).s ! adv.np.a
|
||||
++ (prepTable ! P adv.c2).s ! Pl3 --adv.np.a
|
||||
++ adv.dhex
|
||||
++ adv.np.s ! Abs ;
|
||||
++ adv.np.s ;
|
||||
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ lin someSg_Det = R.indefDet "" sg ;
|
||||
|
||||
lin no_Quant = mkPrep no_Quant
|
||||
-}
|
||||
lin that_Quant = defQuant "aas" "kaas" "taas" "kuwaas" vA ;
|
||||
lin this_Quant = defQuant "an" "kan" "tan" "kuwan" vA ;
|
||||
lin that_Quant = defQuant "aas" "kaas" "taas" "kuwaas" True ;
|
||||
lin this_Quant = defQuant "an" "kan" "tan" "kuwan" True ;
|
||||
--lin which_IQuant = defQuant
|
||||
{-
|
||||
|
||||
@@ -125,7 +125,7 @@ lin with_Prep = mkPrep la ;
|
||||
youSg_Pron = pronTable ! Sg2 ;
|
||||
he_Pron = pronTable ! Sg3 Masc ;
|
||||
she_Pron = pronTable ! Sg3 Fem ;
|
||||
we_Pron = pronTable ! Pl1 Excl ;
|
||||
we_Pron = pronTable ! Pl1 Incl ;
|
||||
youPl_Pron = pronTable ! Pl2 ;
|
||||
they_Pron = pronTable ! Pl3 ;
|
||||
{-
|
||||
|
||||
@@ -15,8 +15,10 @@ lin
|
||||
ReflVP = ResSom.insertRefl ;
|
||||
|
||||
-- : VV -> VP -> VP ;
|
||||
ComplVV vv vp = useV vv ** { -- check Sayeed p. 169
|
||||
vComp = infVP vp
|
||||
ComplVV vv vp = vp ** { -- check Sayeed p. 169
|
||||
s = vv.s ;
|
||||
vComp = vp.vComp ++ vp.s ! VInf ;
|
||||
pred = NoPred ;
|
||||
} ;
|
||||
{-
|
||||
-- : VS -> S -> VP ;
|
||||
|
||||
Reference in New Issue
Block a user