Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Herbert Lange
2019-06-24 18:22:15 +02:00
14 changed files with 591 additions and 348 deletions

View File

@@ -11,12 +11,12 @@ lin
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs -- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
-- : Prep -> NP -> Adv ; -- : Prep -> NP -> Adv ;
PrepNP prep np = {s = prep.s ! np.a ; s2 = np.s ! Abs} ; ---- ? PrepNP prep np = prep ** {s = [] ; np = np} ;
-- Adverbs can be modified by 'adadjectives', just like adjectives. -- Adverbs can be modified by 'adadjectives', just like adjectives.
--AdAdv : AdA -> Adv -> Adv ; -- very quickly --AdAdv : AdA -> Adv -> Adv ; -- very quickly
AdAdv ada adv = adv ** { s = ada.s ++ adv.s } ; AdAdv ada adv = adv ** {s = ada.s ++ adv.s} ;
-- Like adverbs, adadjectives can be produced by adjectives. -- Like adverbs, adadjectives can be produced by adjectives.
-- : A -> AdA ; -- extremely -- : A -> AdA ; -- extremely

View File

@@ -72,7 +72,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
Predet = {s : Str} ; Predet = {s : Str} ;
Quant = ResSom.Quant ; Quant = ResSom.Quant ;
Num = ResSom.Num ; Num = ResSom.Num ;
Card, Ord = {s : Str ; n : Number} ; Ord = {s : Str ; n : Number} ;
DAP = ResSom.Determiner ; DAP = ResSom.Determiner ;
@@ -80,7 +80,8 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
-- Constructed in NumeralSom. -- Constructed in NumeralSom.
Numeral = {s : Str ; n : Number} ; Card = {s : State => Str ; n : Number} ;
Numeral = {s : CardOrd => State => Str ; n : Number} ;
Digits = {s : CardOrd => Str ; n : Number} ; Digits = {s : CardOrd => Str ; n : Number} ;
@@ -90,7 +91,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
-- Constructed in StructuralSom. -- Constructed in StructuralSom.
Conj = { s1,s2 : Str ; n : Number } ; Conj = { s1,s2 : Str ; n : Number } ;
Subj = { s : Str ; isPre : Bool } ; --ba+dut vs. dut+en Subj = { s : Str ; isPre : Bool } ; --ba+dut vs. dut+en
Prep = ResSom.Prep ; Prep = ResSom.Prep ** {c2 : Preposition} ;
@@ -121,7 +122,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
N3 = ResSom.Noun3 ; N3 = ResSom.Noun3 ;
PN = ResSom.PNoun ; PN = ResSom.PNoun ;
Adv = ResSom.Adverb ; Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.
linref linref
-- Cl = linCl ; -- Cl = linCl ;

View File

@@ -32,11 +32,12 @@ concrete IdiomSom of Idiom = CatSom ** open Prelude, ResSom, VerbSom in {
-- : VP -> VP ; -- : VP -> VP ;
--ProgrVP vp = vp ** { } ; --ProgrVP vp = vp ** { } ;
-- : VP -> Utt ; -- let's go
--ImpPl1 vp = { } ;
{-
ImpP3 : NP -> VP -> Utt ; -- let John walk {- TODO: Sayeed p. 92 optative
-- : VP -> Utt ; -- let's go
ImpPl1 vp = { } ;
ImpP3 : NP -> VP -> Utt ; -- let John walk
-- 3/12/2013 non-reflexive uses of "self" -- 3/12/2013 non-reflexive uses of "self"

View File

@@ -1,5 +1,5 @@
concrete LexiconSom of Lexicon = CatSom ** concrete LexiconSom of Lexicon = CatSom **
open ParadigmsSom in { open ParadigmsSom,ResSom in {
---- ----
-- A -- A
@@ -105,7 +105,7 @@ lin drink_V2 = mkV2 "cab" ;
-- --
-- lin ear_N = mkN "" ; -- lin ear_N = mkN "" ;
-- lin earth_N = mkN "" ; -- lin earth_N = mkN "" ;
-- lin eat_V2 = mkV2 "" ; lin eat_V2 = mkV2 "cun" ;
-- lin egg_N = mkN "" ; -- lin egg_N = mkN "" ;
-- lin empty_A = mkA "" ; -- lin empty_A = mkA "" ;
-- lin enemy_N = mkN "" ; -- lin enemy_N = mkN "" ;
@@ -118,7 +118,7 @@ lin drink_V2 = mkV2 "cab" ;
-- lin fall_V = mkV "" ; -- lin fall_V = mkV "" ;
-- lin far_Adv = mkA "" ; -- lin far_Adv = mkA "" ;
-- lin fat_N = mkN "" ; -- lin fat_N = mkN "" ;
lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) noPrep ; lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) ;
-- lin fear_V2 = mkV2 "" ; -- lin fear_V2 = mkV2 "" ;
-- lin fear_VS = mkVS "" ; -- lin fear_VS = mkVS "" ;
-- lin feather_N = mkN "" ; -- lin feather_N = mkN "" ;
@@ -148,9 +148,9 @@ lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) noPrep ;
-- lin garden_N = mkN "" ; -- lin garden_N = mkN "" ;
lin girl_N = mkN "gabadh" "gabdho" fem ; lin girl_N = mkN "gabadh" "gabdho" fem ;
lin give_V3 = mkV3 "bixiyo" ; lin give_V3 = mkV3 "sii" ;
-- lin glove_N = mkN "" ; -- lin glove_N = mkN "" ;
-- lin go_V = joan_V ; lin go_V = mkV "tag" ;
-- lin gold_N = mkN "" ; -- lin gold_N = mkN "" ;
-- lin good_A = mkA "" ; -- lin good_A = mkA "" ;
-- lin grammar_N = mkN "" ; -- lin grammar_N = mkN "" ;
@@ -176,7 +176,7 @@ lin give_V3 = mkV3 "bixiyo" ;
-- lin horn_N = mkN "" ; -- lin horn_N = mkN "" ;
-- lin horse_N = mkN "" ; -- lin horse_N = mkN "" ;
-- lin hot_A = mkA "" ; -- lin hot_A = mkA "" ;
lin house_N = mkN "aqal" ; lin house_N = mkN "guri" ;
-- lin hunt_V2 = mkV2 "" ; -- lin hunt_V2 = mkV2 "" ;
-- lin husband_N = mkN "" ; -- lin husband_N = mkN "" ;
@@ -227,7 +227,7 @@ lin man_N = mkN "nin" ;
-- lin meat_N = mkN "" ; -- lin meat_N = mkN "" ;
-- lin milk_N = mkN "" ; -- lin milk_N = mkN "" ;
-- lin moon_N = mkN "" ; -- lin moon_N = mkN "" ;
lin mother_N2 = mkN2 (shortPossN (mkN "hooyo")) noPrep ; lin mother_N2 = mkN2 (shortPossN (mkN "hooyo")) ;
-- lin mountain_N = mkN "" ; -- lin mountain_N = mkN "" ;
-- lin mouth_N = mkN "" ; -- lin mouth_N = mkN "" ;
-- lin music_N = mkN "" ; -- lin music_N = mkN "" ;
@@ -360,7 +360,7 @@ lin speak_V2 = mkV2 "hadlo" ;
-- lin table_N = mkN "" ; -- lin table_N = mkN "" ;
-- lin tail_N = mkN "" ; -- lin tail_N = mkN "" ;
-- lin talk_V3 = mkV3 "" ; -- lin talk_V3 = mkV3 "" ;
lin teach_V2 = mkV2 "baray" ku ; -- I suppose this creates progressive forms? TODO implement all forms of verbs properly. lin teach_V2 = mkV2 "bar" ku ;
-- lin teacher_N = mkN "" ; -- lin teacher_N = mkN "" ;
-- lin television_N = mkN "" ; -- lin television_N = mkN "" ;
-- lin thick_A = mkA "" ; -- lin thick_A = mkA "" ;
@@ -389,13 +389,13 @@ lin teach_V2 = mkV2 "baray" ku ; -- I suppose this creates progressive forms? TO
-------- --------
-- W - Y -- W - Y
-- lin wait_V2 = mkV2 "" ; lin wait_V2 = mkV2 "sug" ;
-- lin walk_V = mkV "" ; -- lin walk_V = mkV "" ;
-- lin war_N = mkN "" ; -- lin war_N = mkN "" ;
-- lin warm_A = mkA "" ; -- lin warm_A = mkA "" ;
-- lin wash_V2 = mkV2 "" ; -- lin wash_V2 = mkV2 "" ;
-- lin watch_V2 = mkV2 "" ; -- lin watch_V2 = mkV2 "" ;
-- lin water_N = mkN "" ; lin water_N = mkNoun "biyo" "biyaha" "biyo" "biyaha" Masc ; -- ?? gender
-- lin wet_A = mkA "" ; -- lin wet_A = mkA "" ;
-- lin white_A = mkA "" ; -- lin white_A = mkA "" ;
-- lin wide_A = mkA "" ; -- lin wide_A = mkA "" ;

View File

@@ -9,23 +9,32 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
-- : Det -> CN -> NP -- : Det -> CN -> NP
DetCN det cn = useN cn ** { DetCN det cn = useN cn ** {
s = sTable ; s = sTable ;
a = getAgr det.d cn.g ; a = getAgr det.d cn.g } where {
sp = sTable ! Nom }
where {
sTable : Case => Str = \\c => sTable : Case => Str = \\c =>
let nfc : {nf : NForm ; c : Case} = let nfc : {nf : NForm ; c : Case} =
case <c,cn.hasMod,det.d> of { case <c,cn.hasMod,det.d> of {
<Nom,False,Indef Sg> => {nf=IndefNom ; c=Nom} ; -- special form for fem. nouns -- special form for fem. nouns
<Nom,False,Def x NA> => {nf=Def x vU ; c=Nom} ; -- special case for DefArt <Nom,False,Indef Sg> => {nf=NomSg ; c=c} ;
<Nom,True,_> => {nf=det.d ; c=Abs} ; -- If cn has modifier, the Nom ending attaches to the modifier
-- special case for DefArt+Nom: override vowel
<Nom,False,Def x NA> => {nf=Def x vU ; c=c} ;
-- If cn has modifier, Nom ending attaches to the modifier
<Nom,True,_> => {nf=det.d ; c=Abs} ;
_ => {nf=det.d ; c=c} _ => {nf=det.d ; c=c}
} ; } ;
detStr : Str = detStr : Str =
case <det.isPoss,cn.shortPoss> of { case <cn.isPoss,det.d,det.isPoss,cn.shortPoss> of {
<True,True> => det.shortPoss ; <True, _,_,_> => det.sp ! cn.g ! nfc.c ; -- CN has undergone ComplN2 and is already quantified
_ => det.s ! nfc.c <_,Numerative,_,_> => [] ; -- s is in pref
<_,_, True,True> => det.shortPoss ;
_ => det.s ! cn.g ! nfc.c
} ; } ;
in det.pref -- if det is numeral. TODO find out if gender/case/other distinction. pref : Str = case det.d of {
Numerative => det.s ! cn.g ! nfc.c ;
_ => []
} ;
in pref -- if det is numeral.
++ cn.s ! nfc.nf ++ cn.s ! nfc.nf
++ detStr -- non-numeral det ++ detStr -- non-numeral det
++ cn.mod ! getNum (getAgr det.d Masc) ! c ++ cn.mod ! getNum (getAgr det.d Masc) ! c
@@ -34,11 +43,11 @@ DetCN det cn = useN cn ** {
-- : PN -> NP ; -- : PN -> NP ;
UsePN pn = pn ** { UsePN pn = pn ** {
s = \\c => pn.s ; s = \\c => pn.s ;
isPron = False ; isPron = False
sp = pn.s } ; } ;
-- : Pron -> NP ; -- : Pron -> NP ;
UsePron pron = lin NP pron ; UsePron pron = pron ;
-- : Predet -> NP -> NP ; -- only the man -- : Predet -> NP -> NP ; -- only the man
PredetNP predet np = np ** { PredetNP predet np = np ** {
@@ -66,13 +75,13 @@ DetCN det cn = useN cn ** {
DetNP det = { DetNP det = {
s = det.sp ! Masc ; ---- Any way to decide for gender here? s = det.sp ! Masc ; ---- Any way to decide for gender here?
a = getAgr det.d Masc ; a = getAgr det.d Masc ;
isPron = False ; sp = [] isPron = False ;
} ; } ;
-- MassNP : CN -> NP ; -- MassNP : CN -> NP ;
MassNP cn = useN cn ** { MassNP cn = useN cn ** {
s = table { Nom => cn.s ! IndefNom ++ cn.mod ! Sg ! Nom ; s = table { Nom => cn.s ! NomSg ++ cn.mod ! Sg ! Nom ;
Abs => cn.s ! Indef Sg ++ cn.mod ! Sg ! Abs } c => cn.s ! Indef Sg ++ cn.mod ! Sg ! c }
} ; } ;
@@ -83,11 +92,18 @@ DetCN det cn = useN cn ** {
-- : Quant -> Num -> Det ; -- : Quant -> Num -> Det ;
DetQuant quant num = quant ** { DetQuant quant num = quant ** {
pref = num.s ; s = \\g,c => case <num.n,g> of {
sp = \\g => case <num.n,g> of { <Sg,Masc> => num.s ! quant.st ++ quant.s ! SgMasc ! c ;
<Sg,Masc> => quant.sp ! SgMasc ; <Sg,Fem> => num.s ! quant.st ++ quant.s ! SgFem ! c ;
<Sg,Fem> => quant.sp ! SgFem ; -- gender-flipped allomorphs in plural; TODO needs more fine-grained rules
<Pl,_> => quant.sp ! InvarPl } ; <Pl,Fem> => num.s ! quant.st ++ quant.s ! SgMasc ! c ;
<Pl,Masc> => num.s ! quant.st ++ quant.s ! SgFem ! c } ;
sp = \\g,c => case <num.n,g> of {
<Sg,Masc> => num.s ! quant.st ++ quant.sp ! SgMasc ! c ;
<Sg,Fem> => num.s ! quant.st ++ quant.sp ! SgFem ! c ;
-- Independent form uses plural morpheme, not gender-flipped allomorph
<Pl,_> => num.s ! quant.st ++ quant.sp ! PlInv ! c } ;
d = case <num.isNum,quant.st> of { d = case <num.isNum,quant.st> of {
<True,_> => Numerative ; <True,_> => Numerative ;
@@ -98,7 +114,7 @@ DetCN det cn = useN cn ** {
-- : Quant -> Num -> Ord -> Det ; -- these five best -- : Quant -> Num -> Ord -> Det ; -- these five best
DetQuantOrd quant num ord = DetQuantOrd quant num ord =
let theseFive = DetQuant quant num in theseFive ** { let theseFive = DetQuant quant num in theseFive ** {
s = \\c => theseFive.s ! c ++ ord.s ; s = \\g,c => theseFive.s ! g ! c ++ ord.s ;
sp = \\g,c => theseFive.sp ! g ! c ++ ord.s sp = \\g,c => theseFive.sp ! g ! c ++ ord.s
} ; } ;
@@ -109,27 +125,29 @@ DetCN det cn = useN cn ** {
-- the "kernel" of a determiner. It is, however, the $Num$ that determines -- the "kernel" of a determiner. It is, however, the $Num$ that determines
-- the inherent number. -- the inherent number.
NumSg = {s = [] ; n = Sg ; isNum = False} ; NumSg = {s = \\_ => [] ; n = Sg ; isNum = False} ;
NumPl = {s = [] ; n = Pl ; isNum = False} ; NumPl = {s = \\_ => [] ; n = Pl ; isNum = False} ;
{-
-- : Card -> Num ; -- : Card -> Num ;
NumCard card = (card ** { isNum = True }) ; NumCard card = card ** {isNum = True} ;
-- : Digits -> Card ; -- : Digits -> Card ;
NumDigits dig = { s = dig.s ! NCard ; n = dig.n } ; -- NumDigits dig = { s = dig.s ! NCard ; n = dig.n } ;
-- : Numeral -> Card ; -- : Numeral -> Card ;
NumNumeral num = num ; NumNumeral num = num ** {s = num.s ! NCard};
{-
-- : AdN -> Card -> Card ; -- : AdN -> Card -> Card ;
AdNum adn card = card ** { s = adn.s ++ card.s } ; AdNum adn card = card ** { s = adn.s ++ card.s } ;
-- : Digits -> Ord ; -- : Digits -> Ord ;
OrdDigits digs = digs ** { s = digs.s ! NOrd } ; OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
-}
-- : Numeral -> Ord ; -- : Numeral -> Ord ;
OrdNumeral num = num ; OrdNumeral num = num ** {s = num.s ! NOrd ! Indefinite} ;
{-
-- : A -> Ord ; -- : A -> Ord ;
OrdSuperl a = { } ; OrdSuperl a = { } ;
@@ -150,12 +168,12 @@ DetCN det cn = useN cn ** {
let p = pron.poss ; let p = pron.poss ;
gntbl = gnTable (BIND ++ p.sp ! SgMasc) gntbl = gnTable (BIND ++ p.sp ! SgMasc)
(BIND ++ p.sp ! SgFem) (BIND ++ p.sp ! SgFem)
(BIND ++ p.sp ! InvarPl) (BIND ++ p.sp ! PlInv)
in DefArt ** { in DefArt ** {
shortPoss = BIND ++ p.s ; shortPoss = BIND ++ p.s ;
isPoss = True ; isPoss = True ;
s = \\c => let casevow = case c of {Nom => "u" ; Abs => "a"} s = \\gn,c => let casevow = case c of {Nom => "u" ; Abs => "a"}
in gntbl ! SgMasc ++ BIND ++ casevow ; in gntbl ! gn ++ BIND ++ casevow ;
sp = \\gn,c => let prefix = case gn of {SgFem => "t" ; _ => "k"} ; sp = \\gn,c => let prefix = case gn of {SgFem => "t" ; _ => "k"} ;
casevow = case c of {Nom => "u" ; Abs => "a"} casevow = case c of {Nom => "u" ; Abs => "a"}
in prefix ++ gntbl ! gn ++ BIND ++ casevow ; in prefix ++ gntbl ! gn ++ BIND ++ casevow ;
@@ -168,12 +186,24 @@ DetCN det cn = useN cn ** {
-- : N2 -> CN ; -- : N2 -> CN ;
UseN,UseN2 = ResSom.useN ; UseN,UseN2 = ResSom.useN ;
{- -- : N2 -> NP -> CN ; -- Sahra hooyadeed
-- : N2 -> NP -> CN ; -- mother of the king ComplN2 n2 np = let cn = useN n2 in cn ** {s = \\nf =>
ComplN2 n2 np = let qnt = PossPron (pronTable ! np.a) ;
let compl = applyPost n2.compl1 np ;
in useN n2 ** { s = \\agr => compl ++ n2.s } ;
det = case cn.shortPoss of {
True => qnt.shortPoss ;
_ => qnt.s ! nf2gennum nf cn.g ! Abs } ;
num = case nf of {
Indef n => n ;
Def n v => n ;
_ => Sg } ;
noun = case np.isPron of {
True => (pronTable ! np.a).sp ; -- long subject pronoun
False => np.s ! Abs }
in noun ++ cn.s ! Def num qnt.v ++ det ;
isPoss = True} ;
{-
-- : N3 -> NP -> N2 ; -- distance from this city (to Paris) -- : N3 -> NP -> N2 ; -- distance from this city (to Paris)
ComplN3 n3 np = ComplN3 n3 np =
let compl = applyPost n3.c3 np ; let compl = applyPost n3.c3 np ;
@@ -187,9 +217,12 @@ DetCN det cn = useN cn ** {
Use3N3 n3 = lin N2 n3 ; Use3N3 n3 = lin N2 n3 ;
-- : AP -> CN -> CN -- : AP -> CN -> CN
AdjCN ap cn = cn ** { AdjCN ap cn = cn ** {
s = table { IndefNom => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker. s = table { NomSg => cn.s ! Indef Sg ; -- When an adjective is added, noun loses case marker.
x => cn.s ! x } ; x => cn.s ! x } ;
mod = \\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs mod = \\n,c => cn.mod ! n ! Abs -- If there was something before, it is now in Abs
++ case cn.hasMod of {
True => "oo" ;
False => [] }
++ ap.s ! AF n c ; ++ ap.s ! AF n c ;
hasMod = True hasMod = True
} ; } ;
@@ -216,13 +249,13 @@ DetCN det cn = useN cn ** {
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y) -- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
ApposCN cn np = cn ** { s = } ; ApposCN cn np = cn ** { s = } ;
-}
--2 Possessive and partitive constructs --2 Possessive and partitive constructs
-- : PossNP : CN -> NP -> CN ; -- : PossNP : CN -> NP -> CN ;
PossNP cn np = cn ** { } ; PossNP cn np = cn ** {mod = \\n,c => cn.mod ! n ! c ++ np.s ! Abs} ; -- guriga Axmed, not Axmed gurigiisa
{-
-- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples -- : CN -> NP -> CN ; -- glass of wine / two kilos of red apples
PartNP cn np = cn ** { } ; PartNP cn np = cn ** { } ;

View File

@@ -1,88 +1,91 @@
concrete NumeralSom of Numeral = CatSom [Numeral,Digits] ** concrete NumeralSom of Numeral = CatSom [Numeral,Digits] **
open Prelude, ResSom in { open Prelude, ResSom, ParamSom in {
oper LinDigit : Type = { s : DForm => Str ; oper
n : Number ; LinDigit : Type = {
even20 : Even20 } ; s : DForm => CardOrd => State => Str -- TODO: for 1, hal and mid. variation kow-koob implemented with pre.
} ;
oper mk20Ten : Str -> Str -> Str -> Str -> LinDigit = \tri,t,fiche,h -> mkNum3 : (ucard,tcard,uord : Str) -> Gender -> LinDigit = \uc,tc,uo,g -> {s =
{ s = table { Unit => tri ; \\df,co,s => case <co,df,s> of {
Teen => t ; <NOrd,Unit,_> => uo ;
Twenty => fiche ; <NOrd,Ten, _> => tc + "aad" ;
Hund => h + "TODO"} ; <NCard,Unit,s> => nf2state (mkNg uc g) ! s ;
even20 = Ten ; <NCard,Ten, s> => nf2state (mkN1 tc) ! s }
n = Pl } ; } ;
oper mkeven20 : Str -> Str -> Str -> Str -> LinDigit = \se,t,trifichid,h -> mkNum2 : (ucard,tcard : Str) -> LinDigit = \uc,tc ->
{ s = table { Unit => se ; let uo : Str = case uc of {
Teen => t ; x + "a" => x + "aad" ; -- ??
Twenty => trifichid ; x + #v + c@#c => x + c + "aad" ;
Hund => h + "TODO" } ; _ => uc + "aad" } ;
even20 = Even ; in mkNum3 uc tc uo Fem ;
n = Pl } ;
param Even20 = Ten | Even ; mkNum2Masc : (ucard,tcard : Str) -> LinDigit = \uc,tc ->
param DForm = Unit | Teen | Twenty | Hund ; let uo : Str = case uc of {
x + "a" => x + "aad" ; -- ??
x + #v + c@#c => x + c + "aad" ;
_ => uc + "aad" } ;
in mkNum3 uc tc uo Masc ;
--lincat Numeral = {s : Str} ;
lincat Digit = LinDigit ;
lincat Sub10 = LinDigit ;
lincat Sub100 = {s : Str ; n : Number } ;
lincat Sub1000 = {s : Str ; n : Number ; isHundred : Bool } ;
lincat Sub1000000 = {s : Str ; n : Number } ;
lincat
Digit = LinDigit ;
Sub10, Sub100, Sub1000, Sub1000000 =
{s : CardOrd => State => Str ; n : Number} ;
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
-- num : Sub1000000 -> Numeral ; -- num : Sub1000000 -> Numeral ;
lin num x0 = lin Numeral x0 ; lin num x = x ;
lin n2 = mkeven20 "TODO" "TODO" "TODO" "TODO" ; oper kow : Str = "kow" ; --pre {"iyo" => "koob" ; _ => "kow"} ;
lin n3 = mk20Ten "TODO" "TODO" "TODO" "TODO";
lin n4 = mkeven20 "TODO" "TODO" "TODO" "TODO";
lin n5 = mk20Ten "TODO" "TODO" "TODO" "TODO";
lin n6 = mkeven20 "TODO" "TODO" "TODO" "TODO" ;
lin n7 = mk20Ten "TODO" "TODO" "TODO" "TODO" ;
lin n8 = mkeven20 "TODO" "TODO" "TODO" "TODO" ;
lin n9 = mk20Ten "TODO" "TODO" "TODO" "TODO" ;
lin pot01 = oper n1 = mkNum3 kow "toban" "kowaad" Fem ;
{s = table {Unit => "TODO" ; Hund => "TODO" ; _ => []} ; even20 = Ten ; n = Sg }; lin n2 = mkNum2 "laba" "labaatan" ;
lin pot0 d = d ; lin n3 = mkNum2 "saddex" "soddon" ;
lin pot110 = {s = "TODO" ; n = Pl} ; lin n4 = mkNum2 "afar" "afartan";
lin pot111 = {s = variants {"TODO" ; "TODO"} ; n = Pl} ; lin n5 = mkNum2 "shan" "konton";
lin pot1to19 d = {s = d.s ! Teen ; n = Pl} ; lin n6 = mkNum2 "lix" "lixdan" ;
lin pot0as1 n = {s = n.s ! Unit ; n = n.n} ; lin n7 = mkNum2 "toddoba" "toddobaatan" ;
lin pot1 d = lin n8 = mkNum2Masc "siddeed" "siddeetan" ;
{s = case d.even20 of { lin n9 = mkNum2Masc "sagaal" "sagaaashan" ;
Even => d.s ! Twenty ;
Ten => glue (d.s ! Twenty) "TODO" } ;
n = Pl} ;
lin pot1plus d e =
{s = case d.even20 of {
Even => d.s ! Twenty ++ "TODO" ++ e.s ! Unit ;
Ten => d.s ! Twenty ++ "TODO" ++ e.s ! Teen } ;
n = Pl} ;
lin pot1as2 n = n ** { isHundred = False } ; lin pot01 = {s = n1.s ! Unit ; n = Sg} ;
lin pot2 d = {s = d.s ! Hund ; n = Pl ; isHundred = True } ;
lin pot2plus d e = lin pot0 d = {s = d.s ! Unit ; n = Pl} ;
{ s = d.s ! Hund ++ "TODO" ++ e.s ;
n = Pl ; lin pot110 = {s = n1.s ! Ten ; n = Pl} ;
isHundred = True } ; lin pot111 = {s = \\co,s => "koob iyo" ++ n1.s ! Ten ! co ! s ; n = Pl} ;
lin pot1to19 d = {s = \\co,s => d.s ! Unit ! co ! s ++ n1.s ! Ten ! co ! s ; n=Pl} ;
lin pot0as1 n = n ;
lin pot1 d = {s = d.s ! Ten ; n=Pl};
-- {s = d.s ! Unit ;
-- n = Pl} ;
lin pot1plus d e = {
s = \\co,s => e.s ! co ! Indefinite ++ "iyo" ++ d.s ! Ten ! co ! s ;
n = Pl} ;
lin pot1as2 n = n ;
lin pot2 d = d ** {s = \\co,s => d.s ! co ! s ++ "boqol"} ; -- TODO
lin pot2plus d e = {
s = \\co,s => d.s ! co ! Indefinite ++ "boqol iyo" ++ e.s ! co ! s ;
n = Pl} ;
lin pot2as3 n = n ; lin pot2as3 n = n ;
lin pot3 n = lin pot3 n = n ;
{s = table {Sg => [] ; Pl => n.s } ! n.n ++ "TODO" ;
n = n.n } ; lin pot3plus n m = {
s = \\co,s => n.s ! co ! s ++ "iyo" ++ m.s ! co ! s ;
n = n.n } ;
lin pot3plus n m = --TODO:
let ta = if_then_Str m.isHundred [] "TODO" ; --no `ta' between 1000 and 100 -- my three cats
in -- * saddexd &+ ayg &+ a bisadood
{ s = table {Sg => [] ; Pl => n.s } ! n.n ++ "TODO" ++ ta ++ m.s ; -- => saddexd &+ ayd &+ a bisadood
n = n.n } ; -- my *two* thousand small cats
-- => laba kun oo bisadood oo yar (kun is an attribute, bisadood is an attribute)
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
lincat Dig = TDigit ; lincat Dig = TDigit ;
@@ -93,7 +96,7 @@ oper
mk2Dig : Str -> Number -> TDigit = \c,num -> mk2Dig : Str -> Number -> TDigit = \c,num ->
{ s = table { NCard => c ; { s = table { NCard => c ;
NOrd => c + "TODO" } ; NOrd => c + "aan" } ;
n = num } ; n = num } ;

View File

@@ -43,9 +43,8 @@ oper
} ; } ;
mkN2 : overload { mkN2 : overload {
mkN2 : Str -> N2 ; -- Predictable N2, no preposition mkN2 : Str -> N2 ; -- Predictable N2
mkN2 : Str -> Preposition -> N2 ; -- Predictable N2, given preposition mkN2 : N -> N2 -- N2 out of noun
mkN2 : N -> Preposition -> N2 -- N2 out of noun and preposition
} ; } ;
mkPN : overload { mkPN : overload {
@@ -104,11 +103,11 @@ oper
mkPrep = overload { mkPrep = overload {
mkPrep : Str -> CatSom.Prep = \s -> mkPrep : Str -> CatSom.Prep = \s ->
lin Prep (ResSom.mkPrep s s s s s s) ; lin Prep ((ResSom.mkPrep s s s s s s) ** {c2=noPrep}) ;
mkPrep : (x1,_,_,_,_,x6 : Str) -> CatSom.Prep = \a,b,c,d,e,f -> mkPrep : (x1,_,_,_,_,x6 : Str) -> CatSom.Prep = \a,b,c,d,e,f ->
lin Prep (ResSom.mkPrep a b c d e f) ; lin Prep ((ResSom.mkPrep a b c d e f) ** {c2=noPrep}) ;
mkPrep : Preposition -> CatSom.Prep = \p -> mkPrep : Preposition -> CatSom.Prep = \p ->
lin Prep (prepTable ! p) ; lin Prep (prep p) ;
} ; } ;
-- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num ->
@@ -117,7 +116,7 @@ oper
-- mkSubj : Str -> Bool -> Subj = \s,b -> -- mkSubj : Str -> Bool -> Subj = \s,b ->
-- lin Subj { } ; -- lin Subj { } ;
mkAdv : Str -> Adv = \s -> lin Adv {s = s ; s2 = []} ; mkAdv : Str -> Adv = \s -> lin Adv {s = s ; c2 = noPrep ; np = emptyNP} ;
mkAdV : Str -> AdV = \s -> lin AdV {s = s} ; mkAdV : Str -> AdV = \s -> lin AdV {s = s} ;
@@ -165,9 +164,8 @@ oper
= \n -> n ** {shortPoss = True} ; = \n -> n ** {shortPoss = True} ;
mkN2 = overload { mkN2 = overload {
mkN2 : Str -> N2 = \s -> lin N2 (mkN1 s ** {c2 = noPrep}) ; mkN2 : Str -> N2 = \s -> lin N2 (mkN1 s) ;
mkN2 : Str -> Preposition -> N2 = \s,p -> lin N2 (mkN1 s ** {c2 = p}) ; mkN2 : N -> N2 = \n -> lin N2 n ;
mkN2 : N -> Preposition -> N2 = \n,p -> lin N2 (n ** {c2=p})
} ; } ;
mkPN = overload { mkPN = overload {

View File

@@ -63,7 +63,7 @@ param
Case = Nom | Abs ; Case = Nom | Abs ;
Gender = Masc | Fem ; Gender = Masc | Fem ;
Vowel = vA | vE | vI | vO | vU | NA ; -- For vowel assimilation Vowel = vA | vE | vI | vO | vU | NA ; -- For vowel assimilation
GenNum = SgMasc | SgFem | InvarPl ; -- For Quant GenNum = SgMasc | SgFem | PlInv ; -- For Quant
Inclusion = Excl | Incl ; Inclusion = Excl | Incl ;
Agreement = Agreement =
@@ -75,14 +75,19 @@ param
| Pl3 | Pl3
| Impers ; -- Verb agrees with Sg3, but needed for preposition contraction | 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.
| NotPronP3 ; -- Sg3 Gender and Pl3 can be pronouns or not.
State = Definite | Indefinite ; State = Definite | Indefinite ;
NForm = NForm =
Indef Number Indef Number
| Def Number Vowel -- Stems for definite and determinative suffixes | Def Number Vowel -- Stems for definite and determinative suffixes
| Numerative -- When modified by a number (only distinct for some feminine nouns) -- Special forms only for fem. nouns ending in consonant.
| IndefNom ; -- Special form, only fem. nouns ending in consonant | Numerative -- When modified by a number: either pl gen or sg abs
| NomSg ;
oper oper
getAgr : NForm -> Gender -> Agreement = \n,g -> getAgr : NForm -> Gender -> Agreement = \n,g ->
@@ -91,24 +96,48 @@ oper
getNum : Agreement -> Number = \a -> getNum : Agreement -> Number = \a ->
case a of { Sg1|Sg2|Sg3 _ => Sg ; _ => Pl } ; case a of { Sg1|Sg2|Sg3 _ => Sg ; _ => Pl } ;
agr2agrplus : (isPron : Bool) -> Agreement -> AgreementPlus = \isPron,a ->
case isPron of {True => IsPron a ; False => NotPronP3} ;
nf2state : {s:NForm=>Str} -> State=>Str = \ss -> table {
Definite => ss.s ! Def Sg vA ;
Indefinite => ss.s ! Indef Sg
} ;
gn2gennum : Gender -> Number -> GenNum = \g,n ->
case <g,n> of {
<Masc,Sg> => SgMasc ;
<Fem,Sg> => SgFem ;
_ => PlInv } ;
nf2gennum : NForm -> Gender -> GenNum = \nf,g ->
gn2gennum g (getNum (getAgr nf g)) ;
--------------------------------------------------------------------------------
-- Numerals
param
DForm = Unit | Ten ;
-- If need to optimise: can remove one multiple of 2, but harder to understand
-- CardOrdDFS = Odfs DForm | Cdfs DForm State ;
--
-- CardOrdState = Ost | Cst State ;
CardOrd = NOrd | NCard ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Adjectives -- Adjectives
param param
AForm = AF Number Case ; ---- TODO: past tense AForm = AF Number Case ; ---- TODO: past tense
--------------------------------------------------------------------------------
-- Numerals
-- TODO: is this necessary?
param
CardOrd = NCard | NOrd ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Prepositions -- Prepositions
param param
Preposition = u | ku | ka | la | noPrep ; Preposition = u | ku | ka | la | noPrep | passive ;
PrepCombination = ugu | uga | ula | kaga | kula | kala PrepCombination = ugu | uga | ula | kaga | kula | kala
| Single Preposition ; | Single Preposition ;
@@ -133,20 +162,46 @@ oper
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Verbs -- Verbs
-- Sayeed p. 84-85
-- Tense: Past/Present/Future
-- Aspect: Simple/Progressive/Habitual
-- Mood: Declarative/Imperative/Conditional/Optative/Potential
-- Negation: Positive/Negative
-- Sentence subordination: Main/Subordinate
-- Not every possible combination of these categories occurs, as we shall see: for example, tense and aspect are only marked in declarative sentences; there is no negation in potential sentences, etc. We can group the possible combinations into the twelve verbal paradigms below, details of which are given in the next three sections for suffix verbs, prefix verbs and yahay 'be':
-- 1. Imperative
-- 2. Infinitive
-- 3. Past simple
-- 4. Past progressive
-- 5. Past habitual
-- 6. Present habitual
-- 7. Present progressive
-- 8. Future
-- 9. Conditional
-- 10. Optative
-- 11. Potential
-- 12. Subordinate clause forms -- same as negative present. But they carry subject markers when made into SC.
param param
Aspect = Simple | Progressive ;
VForm = VForm =
VInf VInf
| VPres Agreement Polarity | VPres Aspect Agreement Polarity
| VNegPast | VNegPast Aspect
| VPast Agreement | VPast Aspect Agreement
| VRel -- "som är/har/…" TODO is this used in other verbs? | VRel -- "som är/har/…" TODO is this used in other verbs?
| VImp Number Polarity ; -- TODO negation | VImp Number Polarity ;
oper oper
if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f -> if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f ->
case p of {Pos => t ; Neg => f } ; case p of {Pos => t ; Neg => f } ;
-- TODO: forceAgr : Agreement -> (VForm=>Str) -> (VForm=>Str) = \agr,tbl -> table {
-- tre aspekter (enkel, progressiv, habituell), VPres asp _a pol => tbl ! VPres asp agr pol ;
-- fem modus (indikativ, imperativ, konjunktiv, kontiditonalis, optativ) VPast asp _a => tbl ! VPast asp agr ;
x => tbl ! x
} ;
} }

View File

@@ -18,7 +18,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
UttVP vp = { s = linVP vp } ; UttVP vp = { s = linVP vp } ;
UttAdv adv = adv ; UttAdv adv = adv ;
UttCN n = {s = linCN n } ; UttCN n = {s = linCN n } ;
UttCard n = n ; UttCard n = {s = n.s ! Indefinite} ;
UttAP ap = { s = ap.s ! AF Sg Abs } ; UttAP ap = { s = ap.s ! AF Sg Abs } ;
UttInterj i = i ; UttInterj i = i ;

View File

@@ -6,6 +6,12 @@ lin
-- : Cl -> RCl ; -- such that John loves her -- : Cl -> RCl ; -- such that John loves her
RelCl cl = { } ; RelCl cl = { } ;
-- Sayeed p. 95-96 + ch 8
Reduced present general in relative clauses; as absolutive
1/2SG/3SG M/2PL/3PL sugá -- same as imperative (TODO check if for all conjugations)
3 SG F sugtá -- doesn't exist
1PL sugná -- doesn't exist
-- : RP -> VP -> RCl ; -- : RP -> VP -> RCl ;
RelVP rp vp = ; RelVP rp vp = ;

View File

@@ -4,11 +4,15 @@ resource ResSom = ParamSom ** open Prelude, Predef, ParamSom in {
-- Nouns -- Nouns
oper oper
Noun : Type = {s : NForm => Str ; g : Gender ; shortPoss : Bool} ; Noun : Type = {s : NForm => Str; g : Gender ; shortPoss : Bool} ;
Noun2 : Type = Noun ** {c2 : Preposition} ; Noun2 : Type = Noun ; -- TODO eventually more parameters?
Noun3 : Type = Noun2 ** {c3 : Preposition} ; Noun3 : Type = Noun ;
CNoun : Type = Noun ** {mod : Number => Case => Str ; hasMod : Bool} ; CNoun : Type = Noun ** {
mod : Number => Case => Str ;
hasMod : Bool ;
isPoss : Bool -- to prevent impossible forms in ComplN2 with Ns that have short possessive, e.g. "the father of NP".
} ;
PNoun : Type = {s : Str ; a : Agreement} ; PNoun : Type = {s : Str ; a : Agreement} ;
@@ -18,8 +22,8 @@ oper
let bisadi = case gender of let bisadi = case gender of
{ Fem => case wiil of { _ + #c => wiil+"i" ; _ => wiil} ; { Fem => case wiil of { _ + #c => wiil+"i" ; _ => wiil} ;
Masc => wiil } ; Masc => wiil } ;
bisadood = case gender of bisadood = case gender of
{ Fem => case wiilal of { _ + "o" => wiilal+"od" ; _ => wiil} ; { Fem => case wiilal of {_ + "o" => wiilal+"od" ; _ => wiil} ;
Masc => wiil } ; Masc => wiil } ;
defStems : Str -> Vowel => Str = \s -> case s of { defStems : Str -> Vowel => Str = \s -> case s of {
ilk + "aha" => ilk + "aha" =>
@@ -35,10 +39,11 @@ oper
in { s = table { in { s = table {
Indef Sg => wiil ; Indef Sg => wiil ;
Indef Pl => wiilal ; Indef Pl => wiilal ;
IndefNom => bisadi ;
Numerative => bisadood ;
Def Sg vow => defStems wiilka ! vow ; Def Sg vow => defStems wiilka ! vow ;
Def Pl vow => defStems wiilasha ! vow } ; Def Pl vow => defStems wiilasha ! vow ;
NomSg => bisadi ; -- Special form for fem. nouns ending in consonant
Numerative => case bisadood of {_+"ood" => bisadood ; _ => wiil}
} ;
g = gender ; g = gender ;
shortPoss = False} ; shortPoss = False} ;
@@ -106,7 +111,7 @@ oper
_ => nXayawaan n } ; _ => nXayawaan n } ;
mkNg : Str -> Gender -> Noun = \n,g -> case n of { mkNg : Str -> Gender -> Noun = \n,g -> case n of {
_ + ("r"|"n"|"l"|"g") _ -- + ("r"|"n"|"l"|"g")
=> case g of { => case g of {
Fem => nUl n ; Fem => nUl n ;
Masc => mkN1 n } ; Masc => mkN1 n } ;
@@ -119,65 +124,125 @@ oper
BaseNP : Type = { BaseNP : Type = {
a : Agreement ; a : Agreement ;
isPron : Bool ; isPron : Bool ;
sp : Str } ; } ;
NounPhrase : Type = BaseNP ** {s : Case => Str} ; NounPhrase : Type = BaseNP ** {s : Case => Str} ;
useN : Noun -> CNoun ** BaseNP = \n -> n ** useN : Noun -> CNoun ** BaseNP = \n -> n **
{ mod = \\_,_ => [] ; hasMod = False ; { mod = \\_,_ => [] ; hasMod = False ;
a = Sg3 n.g ; isPron = False ; sp = [] a = Sg3 n.g ; isPron,isPoss = False ;
} ; } ;
emptyNP : NounPhrase = {
s = \\_ => [] ;
a = Pl3 ;
isPron = False
} ;
impersNP : NounPhrase = emptyNP ** {
a = Impers ;
isPron = True
} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Pronouns -- Pronouns
-- De somaliska possessiva pronomenen, precis som de svenska, har två olika genusformer i singular och en enda form i plural.
-- ägaren då det ägda föremålet är
-- m.sg. f.sg.plural
-- kayga tayda kuwayga
-- kaaga taada kuwaaga
-- kiisa tiisa kuwiisa
-- keeda teeda kuweeda
--
-- kaayaga taayada kuwayaga (1 pl. exkl.)
-- keenna teenna kuweenna (1 pl. inkl.)
-- kiinna tiinna kuwiinna
-- kooda tooda kuwooda
Pronoun : Type = NounPhrase ** { Pronoun : Type = NounPhrase ** {
poss : { -- for PossPron : Pron -> Quant poss : { -- for PossPron : Pron -> Quant
--s, -- possessive suffix sp : GenNum => Str ; -- independent forms, e.g. M:kayga F:tayda Pl:kuwayga
sp : GenNum => Str ; -- independent forms s : Str ; -- short possessive suffix: e.g. family members, my/your name
s : Str ; -- special case: e.g. family members, name v : Vowel} ;
v : Vowel} sp : Str ;
} ;
pronTable : Agreement => Pronoun = table {
Sg1 => {
s = table {Nom => "aan" ; Abs => "i"} ;
a = Sg1 ; isPron = True ; sp = "aniga" ;
poss = {s = "ay" ; v = vA ; sp = gnTable "ayg" "ayd" "uwayg"}
} ;
Sg2 => {
s = table {Nom => "aad" ; Abs => "ku"} ;
a = Sg2 ; isPron = True ; sp ="adiga" ;
poss = {s = "aa" ; v = vA ; sp = gnTable "aag" "aad" "uwaag"}
} ;
Sg3 Masc => {
s = table {Nom => "uu" ; Abs => []} ;
a = Sg3 Masc ; isPron = True ; sp ="isaga" ;
poss = {s = "iis" ; v = vI ; sp = gnTable "iis" "iis" "uwiis"}
} ;
Sg3 Fem => {
s = table {Nom => "ay" ; Abs => []} ;
a = Sg3 Fem ; isPron = True ; sp = "iyada" ;
poss = {s = "eed" ; v = vE ; sp = gnTable "eed" "eed" "uweed"}
} ;
Pl1 Excl => {
s = table {Nom => "aan" ; Abs => "na"} ;
a = Pl1 Incl ; isPron = True ; sp ="annaga" ;
poss = {s = "een" ; v = vE ; sp = gnTable "eenn" "eenn" "uweenn"}
} ;
Pl1 Incl => {
s = table {Nom => "aynu" ; Abs => "ina"} ;
a = Pl1 Incl ; isPron = True ; sp ="innaga" ;
poss = {s = "een" ; v = vE ; sp = gnTable "eenn" "eenn" "uweenn"}
} ;
Pl2 => {
s = table {Nom => "aad" ; Abs => "idin"} ;
a = Pl2 ; isPron = True ; sp ="idinka" ;
poss = {s = "iin" ; v = vI ; sp = gnTable "iinn" "iinn" "uwiinn"}
} ;
Pl3 => {
s = table {Nom => "ay" ; Abs => []} ;
a = Pl3 ; isPron = True ; sp = "iyaga" ;
poss = {s = "ood" ; v = vO ; sp = gnTable "ood" "ood" "uwood"}
} ;
Impers => {
s = table {Nom => "la" ; Abs => "??"} ;
a = Impers ; isPron = True ; sp = "??" ;
poss = {s = "??" ; v = vA ; sp = gnTable "??" "??" "??"}
}
} ;
-- 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" ;
_ => []
} ; } ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Det, Quant, Card, Ord -- Det, Quant, Card, Ord
BaseQuant : Type = { BaseQuant : Type = {
s : Case => Str ;
isPoss : Bool ; isPoss : Bool ;
shortPoss : Str ; -- short form of possessive, e.g. family members shortPoss : Str ; -- short form of possessive, e.g. family members
} ; } ;
Determiner : Type = BaseQuant ** { Determiner : Type = BaseQuant ** {
pref : Str ; -- Numerals ? s,
sp : Gender => Case => Str ; sp : Gender => Case => Str ;
d : NForm -- a combination of number, state and vowel d : NForm ; -- combination of number, state and vowel
-- isNum : Bool ; -- placement in NP + whether to choose Numerative from CN
} ; } ;
Quant : Type = BaseQuant ** { Quant : Type = BaseQuant ** {
s,
sp : GenNum => Case => Str ; sp : GenNum => Case => Str ;
st : State ; st : State ;
v : Vowel ; v : Vowel ;
} ; } ;
Num : Type = { Num : Type = {
s : Str ; -- TODO check if enough s : State => Str ; -- TODO check if enough
n : Number ; -- singular or plural n : Number ; -- singular or plural
isNum : Bool -- whether to choose Numerative as the value of NForm isNum : Bool -- whether to choose Numerative as the value of NForm
} ; } ;
baseQuant : BaseQuant = { baseQuant : BaseQuant = {
s = \\_ => [] ;
isPoss = False ; isPoss = False ;
shortPoss = [] shortPoss = []
} ; } ;
@@ -187,11 +252,11 @@ oper
defQuantBind : (bind : Bool) -> (s, kan, tan, kuwan : Str) -> Vowel -> Quant = \b,s,spm,spf,spp,v -> defQuantBind : (bind : Bool) -> (s, kan, tan, kuwan : Str) -> Vowel -> Quant = \b,s,spm,spf,spp,v ->
let bind : Str -> Str = \x -> case b of {False => x ; True => BIND ++ x} ; let bind : Str -> Str = \x -> case b of {False => x ; True => BIND ++ x} ;
in baseQuant ** { in baseQuant ** {
s = \\c => s = \\gn,c =>
let nom = case v of {NA => "u" ; _ => s + "i"} let nom = case v of {NA => "u" ; _ => s + "i"}
in case c of {Abs => bind s ; Nom => bind nom} ; in case c of {Nom => bind nom ; _ => bind s} ;
sp = \\gn,c => sp = \\gn,c =>
let i = case c of {Nom => "i"; Abs => []} let i = case c of {Nom => "i"; _ => []}
in gnTable (spm + i) (spf + i) (spp + i) ! gn ; in gnTable (spm + i) (spf + i) (spp + i) ! gn ;
st = Definite ; st = Definite ;
v = v ; v = v ;
@@ -201,6 +266,7 @@ oper
table {SgMasc => m ; SgFem => f ; _ => p} ; table {SgMasc => m ; SgFem => f ; _ => p} ;
indefQuant : Quant = baseQuant ** { indefQuant : Quant = baseQuant ** {
s,
sp = \\gn,c => [] ; sp = \\gn,c => [] ;
st = Indefinite ; st = Indefinite ;
v = NA ; -- Will be ignored in DetQuant v = NA ; -- Will be ignored in DetQuant
@@ -225,13 +291,16 @@ oper
_ => ku _ => ku
} }
} ; } ;
prep : Preposition -> (Prep ** {c2 : Preposition}) = \p -> prepTable ! p ** {c2 = p} ;
prepTable : Preposition => Prep = table { prepTable : Preposition => Prep = table {
ku => mkPrep "ku" "igu" "kugu" "nagu" "idinku" "lagu" ; ku => mkPrep "ku" "igu" "kugu" "nagu" "idinku" "lagu" ;
ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ; ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ;
la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ; la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ;
u => mkPrep "u" "ii" "kuu" "noo" "idiin" "loo" ; u => mkPrep "u" "ii" "kuu" "noo" "idiin" "loo" ;
noPrep => mkPrep [] "i" "ku" "na" "idin" "la" noPrep => mkPrep [] "i" "ku" "na" "idin" "la" ;
-- impersonal subject clitic combining with object clitics.
passive => mkPrep "la" "la i" "lagu" "nala" "laydin" "la"
} ; } ;
prepCombTable : Agreement => PrepCombination => Str = table { prepCombTable : Agreement => PrepCombination => Str = table {
@@ -263,7 +332,6 @@ oper
ula => "loola" ; kaga => "lagaga" ; ula => "loola" ; kaga => "lagaga" ;
kula => "lagula" ; kala => "lagala" ; kula => "lagula" ; kala => "lagala" ;
Single p => (prepTable ! p).s ! Impers } ; Single p => (prepTable ! p).s ! Impers } ;
--
a => table { ugu => "ugu" ; uga => "uga" ; a => table { ugu => "ugu" ; uga => "uga" ;
ula => "ula" ; kaga => "kaga" ; ula => "ula" ; kaga => "kaga" ;
kula => "kula" ; kala => "kala" ; kula => "kula" ; kala => "kala" ;
@@ -285,7 +353,7 @@ oper
-- ugu horrayntii (det att komma) allra först -- 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 ->
@@ -294,10 +362,10 @@ oper
mkAdj : (str,pl : Str) -> Adjective = \sg,pl -> { mkAdj : (str,pl : Str) -> Adjective = \sg,pl -> {
s = table { s = table {
AF Sg Abs => sg ;
AF Pl Abs => pl ;
AF Sg Nom => sg + "i" ; AF Sg Nom => sg + "i" ;
AF Pl Nom => pl + "i" } AF Pl Nom => pl + "i" ;
AF Sg _ => sg ;
AF Pl _ => pl }
} ; } ;
duplicate : Str -> Str = \sg -> case sg of { duplicate : Str -> Str = \sg -> case sg of {
@@ -327,6 +395,7 @@ oper
Verb2 : Type = Verb ** {c2 : Preposition} ; Verb2 : Type = Verb ** {c2 : Preposition} ;
Verb3 : Type = Verb2 ** {c3 : Preposition} ; Verb3 : Type = Verb2 ** {c3 : Preposition} ;
-- Saeed page 79: -- Saeed page 79:
-- "… the reference form is the imperative singular form -- "… the reference form is the imperative singular form
-- since it corresponds to the form of the basic root." -- since it corresponds to the form of the basic root."
@@ -346,6 +415,14 @@ oper
"n" => arki ; -- if infinitive ends in n, no change; "n" => arki ; -- if infinitive ends in n, no change;
_ => arki + "n" } ; -- otherwise add n. _ => arki + "n" } ; -- otherwise add n.
progr : Str = case qaat of { -- Progressive
_ + "eey" => stems.p2 + "nay" ; -- bireey -> bireynay
_ + ("y"|"n") => init qaat + "nay" ; -- akhriy -> akhrinay ; gashad -> gashanay
_ + #v + "t" => qaat + "ay" ;
_ + #c + "t" => init qaat + "anay" ;
_ => qaat + "ay" } ;
-- Some predictable sound changes -- Some predictable sound changes
t : Str = case arag of { -- kari+seen, bixi noq+deen, (sug|joogsa|qaada)+teen, t : Str = case arag of { -- kari+seen, bixi noq+deen, (sug|joogsa|qaada)+teen,
_ + ("i"|"y") => "s" ; -- t changes into s in front of i/y _ + ("i"|"y") => "s" ; -- t changes into s in front of i/y
@@ -360,32 +437,50 @@ oper
an : Str = case qaado of { an : Str = case qaado of {
_ + "o" => "an" ; -- Allomorph for imperatives _ + "o" => "an" ; -- Allomorph for imperatives
_ => "in" } ; _ => "in" } ;
in { s = table { in { s = table {
VPres (Sg1|Sg3 Masc|Impers) pol VPres Simple (Sg1|Sg3 Masc|Impers) pol
=> qaat + if_then_Pol pol "aa" "o" ; => qaat + if_then_Pol pol "aa" "o" ;
VPres (Sg2|Sg3 Fem) pol VPres Simple (Sg2|Sg3 Fem) pol
=> arag + t + if_then_Pol pol "aa" "o" ; => arag + t + if_then_Pol pol "aa" "o" ;
VPres (Pl1 _) pol VPres Simple (Pl1 _) pol => arag + n + if_then_Pol pol "aa" "o" ;
=> arag + n + if_then_Pol pol "aa" "o" ; VPres Simple Pl2 pol => arag + t + "aan" ;
VPres Pl2 pol => arag + t + "aan" ; VPres Simple Pl3 pol => qaat + "aan" ;
VPres Pl3 pol => qaat + "aan" ;
VPast (Sg1|Sg3 Masc|Impers) VPres Progressive (Sg1|Sg3 Masc|Impers) pol
=> qaat + ay ; => progr + if_then_Pol pol "aa" "o" ;
VPast (Sg2|Sg3 Fem) VPres Progressive (Sg2|Sg3 Fem) pol
=> arag + t + ay ; -- t, d or s => progr + if_then_Pol pol "saa" "so" ;
VPast (Pl1 _) => arag + n + ay ; VPres Progressive (Pl1 _) pol
VPast Pl2 => arag + t + "een" ; -- t, d or s => progr + if_then_Pol pol "naa" "no" ;
VPast Pl3 => qaat + "een" ; VPres Progressive Pl2 pol => progr + "saan" ;
VPres Progressive Pl3 pol => progr + "aan" ;
VImp Sg Pos => qaado ; VPast Simple (Sg1|Sg3 Masc|Impers)
=> 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 Progressive (Sg1|Sg3 Masc|Impers)
=> progr + "ey" ;
VPast Progressive (Sg2|Sg3 Fem) => progr + "sey" ;
VPast Progressive (Pl1 _) => progr + "ney" ;
VPast Progressive Pl2 => progr + "seen" ;
VPast Progressive Pl3 => progr + "een" ;
VNegPast Simple => arkin ;
VNegPast Progressive => progr + "n" ;
VImp Sg Pos => arag ;
VImp Pl Pos => qaat + "a" ; VImp Pl Pos => qaat + "a" ;
VImp Sg Neg => arag + an ; VImp Sg Neg => arag + an ;
VImp Pl Neg => qaat + "ina" ; VImp Pl Neg => qaat + "ina" ;
VInf => arki ; VInf => arki ;
VRel => arki ; -- TODO does this exist? VRel => arki } ; -- TODO does this exist?
VNegPast => arkin }
} ; } ;
------------------------- -------------------------
@@ -393,18 +488,26 @@ oper
cSug, cKari, cYaree, cJoogso, cQaado : Str -> Verb ; cSug, cKari, cYaree, cJoogso, cQaado : Str -> Verb ;
-- 1: Root verbs with no lexical affixes, e.g. sug TR 'wait for', kar INTR 'boil, cook';
cSug sug = cSug sug =
let cabb : Str = case sug of { let cabb : Str = case sug of {
_ + "b" => sug + "b" ; -- TODO: more duplication patterns _ + "b" => sug + "b" ; -- TODO: more duplication patterns
_ => sug } _ => sug }
in mkVerb sug cabb sug ; in mkVerb sug cabb sug ;
-- 2A: Verbs derived from root verbs by the causative affix -i/-is, e.g. kari TR 'cook' (from conjugation 1 kar INTR 'boil, cook');
-- 2B: Verbs derived from nouns and adjectives by the causative/factitive affix -eel-ayn, e.g. yaree 'make small' (from yar ADJ 'small');
cKari, cYaree = \kari -> mkVerb kari (kari+"y") kari ; cKari, cYaree = \kari -> mkVerb kari (kari+"y") kari ;
-- 3A: Verbs derived from verbal stems by the middle voice affix -ol­/at
-- e.g. karsó 'cook for oneself (from conjugation 2 kâri TR 'cook');
cJoogso joogso = cJoogso joogso =
let joogsa = init joogso + "a" ; let joogsa = init joogso + "a" ;
in mkVerb joogso (joogsa + "d") joogsa ; in mkVerb joogso (joogsa + "d") joogsa ;
-- 3B: As conjugation 3A but verbs whose syllable structure triggers
-- stem contraction and subsequent sandhi rules, e.g. qaadó 'take for oneself
-- (from conjugation 1 qàad TR 'take').
cQaado qaado = cQaado qaado =
let qaa = init (init qaado) let qaa = init (init qaado)
in mkVerb qaado -- Imperative sg, with the vowel in mkVerb qaado -- Imperative sg, with the vowel
@@ -421,24 +524,24 @@ oper
copula : Verb = { copula : Verb = {
s = table { s = table {
VPres Sg1 pol => if_then_Pol pol "ahay" "ihi" ; VPres _ Sg1 pol => if_then_Pol pol "ahay" "ihi" ;
VPres Sg2 pol => if_then_Pol pol "tahay" "ihid" ; VPres _ Sg2 pol => if_then_Pol pol "tahay" "ihid" ;
VPres (Sg3 Masc|Impers) pol => if_then_Pol pol "yahay" "aha" ; VPres _ (Sg3 Masc|Impers) pol => if_then_Pol pol "yahay" "aha" ;
VPres (Sg3 Fem) pol => if_then_Pol pol "tahay" "aha" ; VPres _ (Sg3 Fem) pol => if_then_Pol pol "tahay" "aha" ;
VPres (Pl1 _) pol => if_then_Pol pol "nahay" "ihin" ; VPres _ (Pl1 _) pol => if_then_Pol pol "nahay" "ihin" ;
VPres Pl2 pol => if_then_Pol pol "tihiin" "ihidin" ; VPres _ Pl2 pol => if_then_Pol pol "tihiin" "ihidin" ;
VPres Pl3 pol => if_then_Pol pol "yihiin" "aha" ; VPres _ Pl3 pol => if_then_Pol pol "yihiin" "aha" ;
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" ;
VPast (Sg1|Sg3 Masc|Impers) VPast _ (Sg1|Sg3 Masc|Impers)
=> "ahaa" ; => "ahaa" ;
VPast (Sg2|Sg3 Fem) VPast _ (Sg2|Sg3 Fem)
=> "ahayd" ; => "ahayd" ;
VPast (Pl1 _) => "ahayn" ; VPast _ (Pl1 _) => "ahayn" ;
VPast Pl2 => "ahaydeen" ; VPast _ Pl2 => "ahaydeen" ;
VPast Pl3 => "ahaayeen" ; VPast _ Pl3 => "ahaayeen" ;
VNegPast => "ahi" ; VNegPast _ => "ahi" ;
VRel => "ah" ; VRel => "ah" ;
VInf => "ahaan" } VInf => "ahaan" }
} ; } ;
@@ -449,15 +552,15 @@ oper
have_V : Verb = have_V : Verb =
let hold_V = mkVerb "hayso" "haysat" "haysa" in { let hold_V = mkVerb "hayso" "haysat" "haysa" in {
s = table { s = table {
VPres Sg1 Pos => "leeyahay" ; VPres _ Sg1 Pos => "leeyahay" ;
VPres Sg2 Pos => "leedahay" ; VPres _ Sg2 Pos => "leedahay" ;
VPres (Sg3 Fem) Pos => "leedahay" ; VPres _ (Sg3 Fem) Pos => "leedahay" ;
VPres (Sg3 Masc|Impers) Pos VPres _ (Sg3 Masc|Impers) Pos
=> "leeyahay" ; => "leeyahay" ;
VPres (Pl1 _) Pos => "leenahay" ; VPres _ (Pl1 _) Pos => "leenahay" ;
VPres Pl2 Pos => "leedihiin" ; VPres _ Pl2 Pos => "leedihiin" ;
VPres Pl3 Pos => "leeyihiin" ; VPres _ Pl3 Pos => "leeyihiin" ;
VPast x => "l" + copula.s ! VPast x ; VPast asp agr => "l" + copula.s ! VPast asp agr ;
VRel => "leh" ; VRel => "leh" ;
x => hold_V.s ! x } x => hold_V.s ! x }
} ; } ;
@@ -475,32 +578,101 @@ oper
------------------ ------------------
-- VP -- VP
Adverb : Type = {s,s2 : Str} ; Adverb : Type = {
s : Str ;
c2 : Preposition ; np : NounPhrase} ; -- So that adverbs can also contribute to preposition contraction
Complement : Type = { Complement : Type = {
comp : Agreement => {p1,p2 : Str} -- Agreement for AP complements comp : Agreement => {p1,p2 : Str} -- Agreement for AP complements
} ; } ;
VerbPhrase : Type = Verb ** Complement ** { VerbPhrase : Type = Verb ** Complement ** {
isPred : Bool ; -- to choose right sentence type marker isPred : Bool ; -- to choose right sentence type marker
adv : Adverb ; -- they're ~complicated~ adv : Str ;
c2, c3 : Preposition -- can combine together and with object pronouns c2, c3 : Preposition ; -- can combine together and with object pronoun(s?)
obj2 : {s : Str ; a : AgreementPlus} ;
secObj : Str ; -- if two overt pronoun objects
} ; } ;
VPSlash : Type = VerbPhrase ; ---- TODO more fields VPSlash : Type = VerbPhrase ;
useV : Verb -> VerbPhrase = \v -> v ** { useV : Verb -> VerbPhrase = \v -> v ** {
comp = \\_ => <[],[]> ; comp = \\_ => <[],[]> ;
isPred = False ; isPred = False ;
adv = {s,s2 = []} ; adv = [] ;
c2,c3 = noPrep ; c2,c3 = noPrep ;
obj2 = {s = [] ; a = Unassigned} ;
secObj = []
} ; } ;
compl : NounPhrase -> VerbPhrase -> Str = \np,vp -> useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
prepCombTable ! np.a ! combine vp.c2 vp.c3 ; c2 = v2.c2
} ;
complV2 : NounPhrase -> Verb2 -> Str = \np,vp -> complSlash : VPSlash -> VerbPhrase = \vps -> let np = vps.obj2 in vps ** {
prepCombTable ! np.a ! combine vp.c2 noPrep ; comp = \\agr =>
case np.a of {
Unassigned => vps.comp ! agr ;
_ => {p1 = np.s ; -- if object is a noun, it will come before verb in the sentence.
-- if object is a pronoun, np.s is empty.
p2 = compl np.a vps ++ vps.secObj} -- object combines with the preposition of the verb.
-- secObj in case there was a ditransitive verb.
-- IsPron ag => {p1 = [] ; -- object is a pronoun => nothing is placed before the verb
-- p2 = compl np.a vps ++ vps.secObj} ; -- object combines with the preposition of the verb
-- NotPronP3 => {p1 = np.s ; -- object is a noun => it will come before verb in the sentence
-- p2 = compl np.a vps ++ vps.secObj} -- object combines with the preposition of the verb
}
} ;
compl : AgreementPlus -> VerbPhrase -> Str = \a,vp ->
let agr = case a of {IsPron x => x ; _ => Pl3} ;
in prepCombTable ! agr ! combine vp.c2 vp.c3 ;
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \vp,np ->
let noun = case <np.isPron,np.a> of {
<False> => np.s ! Abs ;
<True,Sg3 _|Pl3> => (pronTable ! np.a).sp ; -- long object pronoun for 3rd person object
_ => [] } -- no long object for other pronouns
in case vp.obj2.a of {
Unassigned =>
vp ** {obj2 = {
s = noun ;
a = agr2agrplus np.isPron np.a}
} ;
-- If the old object is 3rd person, we can safely 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.
-- If old object was non-3rd person, we keep its agreement.
_ =>
vp ** {obj2 = vp.obj2 ** {
s = vp.obj2.s ++ noun
} ;
secObj = vp.secObj ++ secondObject ! np.a}
} ;
passV2 : Verb2 -> VerbPhrase = \v2 -> useVc v2 ** {
c2 = passive ;
c3 = v2.c2 ;
} ;
insertAdv : Adverb -> VerbPhrase -> VerbPhrase = \adv,vp ->
case adv.c2 of {
noPrep => vp ** {adv = adv.s} ; -- The adverb is not formed with PrepNP
prep => case <vp.c2,vp.obj2.a,vp.c3> of {
<noPrep,Unassigned,_> => insertComp <vp ** {c2 = adv.c2}:VerbPhrase> adv.np ; -- should cover for obligatory argument that is not introduced with a preposition
<_,_, noPrep> => insertComp (vp ** {c3 = adv.c2}) adv.np ;
-- if complement slots are full, put preposition just as a string. TODO check word order.
_ => vp ** {adv = (prepTable ! adv.c2).s ! adv.np.a ++ adv.np.s ! Abs}
}
} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Sentences etc. -- Sentences etc.
Clause : Type = {s : Tense => Anteriority => Polarity => Str} ; Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
@@ -508,25 +680,28 @@ oper
ClSlash, ClSlash,
Sentence : Type = SS ; ---- TODO Sentence : Type = SS ; ---- TODO
doonaa : Str -> Verb = \inf ->
let doon : Verb = cSug "doon" in {s = \\vf => inf ++ doon.s ! vf} ;
vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb
-> {fin : Str ; inf : Str} = \t,ant,p,agr,vp -> -> {fin : Str ; inf : Str} = \t,ant,p,agr,vp ->
let pastV : Verb -> Str = \v -> case <t,ant> of {
case p of { Neg => v.s ! VNegPast ; <Pres,Simul> => {fin = presV vp ; inf = [] } ;
Pos => v.s ! VPast agr } ; <Pres,Anter> => {fin = presV copula ; inf = vp.s ! VInf } ; ---- just guessing
presV : Verb -> Str = \v -> v.s ! VPres agr p ; <Past,Simul> => {fin = pastV vp ; inf = [] } ;
in case <t,ant> of { <Past,Anter> => {fin = pastV (aux "jir" vp) ; inf = []} ;
<Pres,Simul> => {fin = presV vp ; inf = [] } ; <Fut,Simul> => {fin = presV (aux "doon" vp) ; inf = []} ;
<Pres,Anter> => {fin = presV copula ; inf = vp.s ! VInf } ; ---- just guessing <Fut,Anter> => {fin = pastV (aux "doon" vp) ; inf = []} ;
<Past,Simul> => {fin = pastV vp ; inf = [] } ; <_,Simul> => {fin = presV vp ; inf = []} ; -- TODO conditional
<Past,Anter> => {fin = pastV copula ; inf = vp.s ! VInf } ; ---- TODO: habitual aspect <_,Anter> => {fin = pastV vp ; inf = []} -- TODO conditional
<Fut,Simul> => {fin = presV (doonaa (vp.s ! VInf)) ; inf = []} ; }
<Fut,Anter> => {fin = pastV (doonaa (vp.s ! VInf)) ; inf = []} ; where {
<_,Simul> => {fin = presV vp ; inf = []} ; -- TODO conditional pastV : Verb -> Str = \v ->
<_,Anter> => {fin = pastV vp ; inf = []} -- TODO conditional case p of { Neg => v.s ! VNegPast Simple ;
} ; Pos => v.s ! VPast Simple agr } ;
presV : Verb -> Str = \v -> v.s ! VPres Simple agr p ;
aux : Str -> Verb -> Verb = \jir,v ->
let jir : Verb = cSug jir in {s = \\vf => v.s ! VInf ++ jir.s ! vf}
} ;
stmarker : Agreement => Polarity => Str = \\a,b => stmarker : Agreement => Polarity => Str = \\a,b =>
let stm = if_then_Pol b "w" "m" let stm = if_then_Pol b "w" "m"
@@ -537,9 +712,11 @@ oper
in stm ++ subjpron ! a ; in stm ++ subjpron ! a ;
subjpron : Agreement => Str = table { subjpron : Agreement => Str = table {
Sg1|Pl1 _ => "aan" ; Sg1|Pl1 Excl => "aan" ;
Pl1 Incl => "aynu" ;
Sg2|Pl2 => "aad" ; Sg2|Pl2 => "aad" ;
Sg3 Masc => "uu" ; Sg3 Masc => "uu" ;
Impers => [] ;
_ => "ay" } ; _ => "ay" } ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@@ -547,5 +724,5 @@ oper
oper oper
linVP : VerbPhrase -> Str = \vp -> vp.s ! VInf ; ---- linVP : VerbPhrase -> Str = \vp -> vp.s ! VInf ; ----
linCN : CNoun -> Str = \cn -> cn.s ! IndefNom ; linCN : CNoun -> Str = \cn -> cn.s ! NomSg ;
} }

View File

@@ -8,27 +8,31 @@ lin
--2 Clauses --2 Clauses
-- : NP -> VP -> Cl -- : NP -> VP -> Cl
PredVP np vp = { PredVP np vps =
s = \\t,a,p => let vp = case vps.c2 of {
let pred : {fin : Str ; inf : Str} = vf t a p np.a vp ; passive => complSlash (insertComp vps np) ;
subj : Str = if_then_Str np.isPron [] (np.s ! Nom) ; _ => complSlash vps } ;
obj : {p1,p2 : Str} = vp.comp ! np.a ; subj = case vps.c2 of {passive => impersNP ; _ => np} ;
in { s = \\t,a,p =>
let pred : {fin : Str ; inf : Str} = vf t a p subj.a vp ;
subjnoun : Str = if_then_Str np.isPron [] (subj.s ! Nom) ;
subjpron : Str = if_then_Str np.isPron (subj.s ! Nom) [] ;
obj : {p1,p2 : Str} = vp.comp ! subj.a ;
stm : Str = stm : Str =
case <p,vp.isPred,np.a> of { case <p,vp.isPred,subj.a> of {
<Pos,True,Sg3 _> => "waa" ; <Pos,True,Sg3 _|Impers> => "waa" ;
-- _ => stmarker ! np.a ! b } -- marker+pronoun contract -- _ => stmarker ! np.a ! b } -- marker+pronoun contract
_ => case <np.isPron,p> of { _ => case <np.isPron,p> of {
<True,Pos> => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree <True,Pos> => "waa" ++ subjpron ; -- to force some string from NP to show in the tree
<True,Neg> => "ma" ++ np.s ! Nom ; <True,Neg> => "ma" ++ subjpron ;
<False> => stmarkerNoContr ! np.a ! p }} ; <False> => stmarkerNoContr ! subj.a ! p }} ;
in subj -- subject if it's a noun in 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 -- sentence type marker + possible subj. pronoun
++ vp.adv.s ---- TODO: can it contract with obj. pronoun? ++ vp.adv ---- TODO word order
++ obj.p2 -- object if it's a pronoun ++ obj.p2 -- object if it's a pronoun
++ pred.fin -- the verb inflected ++ pred.fin -- the verb inflected
++ pred.inf -- potential participle ++ pred.inf -- potential participle
++ vp.adv.s2 ---- I have no idea /IL
} ; } ;
{- {-
-- : SC -> VP -> Cl ; -- that she goes is good -- : SC -> VP -> Cl ; -- that she goes is good

View File

@@ -104,14 +104,14 @@ oper
-- lin for_Prep = mkPrep ; -- lin for_Prep = mkPrep ;
-- lin from_Prep = mkPrep "" ; -- lin from_Prep = mkPrep "" ;
-- lin in8front_Prep = mkPrep "" ; -- lin in8front_Prep = mkPrep "" ;
lin in_Prep = prepTable ! ku ; lin in_Prep = prep ku ;
lin on_Prep = prepTable ! ku ; lin on_Prep = prep ku ;
-- lin part_Prep = mkPrep ; -- lin part_Prep = mkPrep ;
-- lin possess_Prep = mkPrep ; -- lin possess_Prep = mkPrep ;
-- lin through_Prep = mkPrep ; -- lin through_Prep = mkPrep ;
-- lin to_Prep = mkPrep ; -- lin to_Prep = mkPrep ;
-- lin under_Prep = mkPrep "" ; -- lin under_Prep = mkPrep "" ;
lin with_Prep = prepTable ! la ; lin with_Prep = prep la ;
-- lin without_Prep = mkPrep ; -- lin without_Prep = mkPrep ;
@@ -119,43 +119,15 @@ lin with_Prep = prepTable ! la ;
-- Pron -- Pron
-- Pronouns are closed class, no constructor in ParadigmsSom. -- Pronouns are closed class, no constructor in ParadigmsSom.
it_Pron = he_Pron ** {s = \\_ => []} ;
i_Pron = { i_Pron = pronTable ! Sg1 ;
s = table {Nom => "aan" ; Abs => "i"} ;
a = Sg1 ; isPron = True ; sp = "aniga" ;
poss = {s = "ay" ; v = vA ; sp = gnTable "ayg" "ayd" "uwayg"}
} ;
youPol_Pron, -- TODO check youPol_Pron, -- TODO check
youSg_Pron = { youSg_Pron = pronTable ! Sg2 ;
s = table {Nom => "aad" ; Abs => "ku"} ; he_Pron = pronTable ! Sg3 Masc ;
a = Sg2 ; isPron = True ; sp = "adiga" ; she_Pron = pronTable ! Sg3 Fem ;
poss = {s = "aa" ; v = vA ; sp = gnTable "aag" "aad" "uwaag"} we_Pron = pronTable ! Pl1 Excl ;
} ; youPl_Pron = pronTable ! Pl2 ;
he_Pron = { they_Pron = pronTable ! Pl3 ;
s = table {Nom => "uu" ; Abs => []} ;
a = Sg3 Masc ; isPron = True ; sp = "isaga" ;
poss = {s = "iis" ; v = vI ; sp = gnTable "iis" "iis" "uwiis"}
} ;
she_Pron = {
s = table {Nom => "ay" ; Abs => []} ;
a = Sg3 Fem ; isPron = True ; sp = "iyada" ;
poss = {s = "eed" ; v = vE ; sp = gnTable "eed" "eed" "uweed"}
} ;
we_Pron = {
s = table {Nom => "aan" ; Abs => "na"} ;
a = Pl1 Incl ; isPron = True ; sp = "innaga" ;
poss = {s = "een" ; v = vE ; sp = gnTable "eenn" "eenn" "uweenn"}
} ;
youPl_Pron = {
s = table {Nom => "aad" ; Abs => "idin"} ;
a = Pl2 ; isPron = True ; sp = "idinka" ;
poss = {s = "iin" ; v = vI ; sp = gnTable "iinn" "iinn" "uwiinn"}
} ;
they_Pron = {
s = table {Nom => "ay" ; Abs => []} ;
a = Pl3 ; isPron = True ; sp = "iyaga" ;
poss = {s = "ood" ; v = vO ; sp = gnTable "ood" "ood" "uwood"}
} ;
{- {-
lin whatPl_IP = ; lin whatPl_IP = ;
lin whatSg_IP = ; lin whatSg_IP = ;

View File

@@ -5,13 +5,15 @@ lin
----- -----
-- VP -- VP
-- : V -> VP
UseV = ResSom.useV ; UseV = ResSom.useV ;
-- : V2 -> VP ; -- be loved
PassV2 = ResSom.passV2 ;
{- {-
-- : VV -> VP -> VP ; -- : VV -> VP -> VP ;
ComplVV vv vp = ; ComplVV vv vp = ;
-- : VS -> S -> VP ; -- : VS -> S -> VP ;
ComplVS vs s = ; ComplVS vs s = ;
@@ -21,30 +23,21 @@ lin
-- : VA -> AP -> VP ; -- they become red -- : VA -> AP -> VP ; -- they become red
ComplVA va ap = ResSom.insertComp (CompAP ap).s (useV va) ; ComplVA va ap = ResSom.insertComp (CompAP ap).s (useV va) ;
-}
-------- --------
-- Slash -- Slash
-- : V2 -> VPSlash -- : V2 -> VPSlash
SlashV2a = ResSom.slashDObj ; SlashV2a = useVc ;
-- : V3 -> NP -> VPSlash ; -- give it (to her) -- : V3 -> NP -> VPSlash ; -- give it (to her)
Slash2V3 v3 npNori = slashDObj v3 **
{ iobj = { s = npNori.s ! Dat ;
agr = npNori.agr }
} ;
-- : V3 -> NP -> VPSlash ; -- give (it) to her -- : V3 -> NP -> VPSlash ; -- give (it) to her
Slash3V3 v3 npNor = slashIObj v3 ** Slash2V3,
{ dobj = npNor ** { s = mkDObj npNor } Slash3V3 = \v3 -> insertComp (useVc v3) ;
} ; {-
-- : V2V -> VP -> VPSlash ; -- beg (her) to go -- : V2V -> VP -> VPSlash ; -- beg (her) to go
SlashV2V v2v vp = ; SlashV2V v2v vp = ;
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good -- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
SlashV2S v2s s = ; SlashV2S v2s s = ;
@@ -55,11 +48,11 @@ lin
SlashV2A v2a ap = slashDObj v2a ** SlashV2A v2a ap = slashDObj v2a **
{ comp = (CompAP ap).s } ; { comp = (CompAP ap).s } ;
-}
-- : VPSlash -> NP -> VP -- : VPSlash -> NP -> VP
ComplSlash vps np = ResSom.complSlash vps np ; ComplSlash = insertComp ;
{-
-- : VV -> VPSlash -> VPSlash ; -- : VV -> VPSlash -> VPSlash ;
-- Just like ComplVV except missing subject! -- Just like ComplVV except missing subject!
SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ; SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ;
@@ -84,21 +77,21 @@ lin
UseComp comp = UseCopula ** comp ** { UseComp comp = UseCopula ** comp ** {
isPred = True isPred = True
} ; } ;
{-
-- : V2 -> VP ; -- be loved
PassV2 v2 =
-- : VP -> Adv -> VP ; -- sleep here -- : VP -> Adv -> VP ; -- sleep here
AdvVP vp adv = vp ** {adv = adv} ; ---- TODO: how about combining adverbs? AdvVP vp adv = insertAdv adv vp ; ---- TODO: how about combining adverbs?
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
AdvVPSlash vps adv = insertAdv adv vps ;
{-
-- : VP -> Adv -> VP ; -- sleep , even though ... -- : VP -> Adv -> VP ; -- sleep , even though ...
ExtAdvVP vp adv = ; ExtAdvVP vp adv = ;
-- : AdV -> VP -> VP ; -- always sleep -- : AdV -> VP -> VP ; -- always sleep
AdVVP adv vp = vp ** {adv = adv} ; AdVVP adv vp = vp ** {adv = adv} ;
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
AdvVPSlash vps adv = vps ** { adv = vps.adv ++ adv.s } ;
-- : AdV -> VPSlash -> VPSlash ; -- always use (it) -- : AdV -> VPSlash -> VPSlash ; -- always use (it)
AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ; AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ;
@@ -125,7 +118,7 @@ lin
CompAP ap = { CompAP ap = {
comp = \\a => <[], ap.s ! AF (getNum a) Abs> ; comp = \\a => <[], ap.s ! AF (getNum a) Abs> ;
} ; } ;
{-} {-
-- : CN -> Comp ; -- : CN -> Comp ;
CompCN cn = { } ; CompCN cn = { } ;