mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 01:18:57 -06:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -11,12 +11,12 @@ lin
|
||||
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
|
||||
|
||||
-- : 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.
|
||||
|
||||
--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.
|
||||
|
||||
-- : A -> AdA ; -- extremely
|
||||
|
||||
@@ -72,7 +72,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
Predet = {s : Str} ;
|
||||
Quant = ResSom.Quant ;
|
||||
Num = ResSom.Num ;
|
||||
Card, Ord = {s : Str ; n : Number} ;
|
||||
Ord = {s : Str ; n : Number} ;
|
||||
DAP = ResSom.Determiner ;
|
||||
|
||||
|
||||
@@ -80,7 +80,8 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
|
||||
-- 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} ;
|
||||
|
||||
|
||||
@@ -90,7 +91,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
-- Constructed in StructuralSom.
|
||||
Conj = { s1,s2 : Str ; n : Number } ;
|
||||
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 ;
|
||||
PN = ResSom.PNoun ;
|
||||
|
||||
Adv = ResSom.Adverb ;
|
||||
Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.
|
||||
|
||||
linref
|
||||
-- Cl = linCl ;
|
||||
|
||||
@@ -32,11 +32,12 @@ concrete IdiomSom of Idiom = CatSom ** open Prelude, ResSom, VerbSom in {
|
||||
-- : 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"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
concrete LexiconSom of Lexicon = CatSom **
|
||||
open ParadigmsSom in {
|
||||
open ParadigmsSom,ResSom in {
|
||||
|
||||
----
|
||||
-- A
|
||||
@@ -105,7 +105,7 @@ lin drink_V2 = mkV2 "cab" ;
|
||||
--
|
||||
-- lin ear_N = mkN "" ;
|
||||
-- lin earth_N = mkN "" ;
|
||||
-- lin eat_V2 = mkV2 "" ;
|
||||
lin eat_V2 = mkV2 "cun" ;
|
||||
-- lin egg_N = mkN "" ;
|
||||
-- lin empty_A = mkA "" ;
|
||||
-- lin enemy_N = mkN "" ;
|
||||
@@ -118,7 +118,7 @@ lin drink_V2 = mkV2 "cab" ;
|
||||
-- lin fall_V = mkV "" ;
|
||||
-- lin far_Adv = mkA "" ;
|
||||
-- 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_VS = mkVS "" ;
|
||||
-- lin feather_N = mkN "" ;
|
||||
@@ -148,9 +148,9 @@ lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) noPrep ;
|
||||
|
||||
-- lin garden_N = mkN "" ;
|
||||
lin girl_N = mkN "gabadh" "gabdho" fem ;
|
||||
lin give_V3 = mkV3 "bixiyo" ;
|
||||
lin give_V3 = mkV3 "sii" ;
|
||||
-- lin glove_N = mkN "" ;
|
||||
-- lin go_V = joan_V ;
|
||||
lin go_V = mkV "tag" ;
|
||||
-- lin gold_N = mkN "" ;
|
||||
-- lin good_A = mkA "" ;
|
||||
-- lin grammar_N = mkN "" ;
|
||||
@@ -176,7 +176,7 @@ lin give_V3 = mkV3 "bixiyo" ;
|
||||
-- lin horn_N = mkN "" ;
|
||||
-- lin horse_N = mkN "" ;
|
||||
-- lin hot_A = mkA "" ;
|
||||
lin house_N = mkN "aqal" ;
|
||||
lin house_N = mkN "guri" ;
|
||||
-- lin hunt_V2 = mkV2 "" ;
|
||||
-- lin husband_N = mkN "" ;
|
||||
|
||||
@@ -227,7 +227,7 @@ lin man_N = mkN "nin" ;
|
||||
-- lin meat_N = mkN "" ;
|
||||
-- lin milk_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 mouth_N = mkN "" ;
|
||||
-- lin music_N = mkN "" ;
|
||||
@@ -360,7 +360,7 @@ lin speak_V2 = mkV2 "hadlo" ;
|
||||
-- lin table_N = mkN "" ;
|
||||
-- lin tail_N = mkN "" ;
|
||||
-- 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 television_N = mkN "" ;
|
||||
-- lin thick_A = mkA "" ;
|
||||
@@ -389,13 +389,13 @@ lin teach_V2 = mkV2 "baray" ku ; -- I suppose this creates progressive forms? TO
|
||||
--------
|
||||
-- W - Y
|
||||
|
||||
-- lin wait_V2 = mkV2 "" ;
|
||||
lin wait_V2 = mkV2 "sug" ;
|
||||
-- lin walk_V = mkV "" ;
|
||||
-- lin war_N = mkN "" ;
|
||||
-- lin warm_A = mkA "" ;
|
||||
-- lin wash_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 white_A = mkA "" ;
|
||||
-- lin wide_A = mkA "" ;
|
||||
|
||||
@@ -9,23 +9,32 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
-- : Det -> CN -> NP
|
||||
DetCN det cn = useN cn ** {
|
||||
s = sTable ;
|
||||
a = getAgr det.d cn.g ;
|
||||
sp = sTable ! Nom }
|
||||
where {
|
||||
a = getAgr det.d cn.g } where {
|
||||
sTable : Case => Str = \\c =>
|
||||
let nfc : {nf : NForm ; c : Case} =
|
||||
case <c,cn.hasMod,det.d> of {
|
||||
<Nom,False,Indef Sg> => {nf=IndefNom ; c=Nom} ; -- special form for fem. nouns
|
||||
<Nom,False,Def x NA> => {nf=Def x vU ; c=Nom} ; -- special case for DefArt
|
||||
<Nom,True,_> => {nf=det.d ; c=Abs} ; -- If cn has modifier, the Nom ending attaches to the modifier
|
||||
-- special form for fem. nouns
|
||||
<Nom,False,Indef Sg> => {nf=NomSg ; c=c} ;
|
||||
|
||||
-- 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}
|
||||
} ;
|
||||
detStr : Str =
|
||||
case <det.isPoss,cn.shortPoss> of {
|
||||
<True,True> => det.shortPoss ;
|
||||
_ => det.s ! nfc.c
|
||||
case <cn.isPoss,det.d,det.isPoss,cn.shortPoss> of {
|
||||
<True, _,_,_> => det.sp ! cn.g ! nfc.c ; -- CN has undergone ComplN2 and is already quantified
|
||||
<_,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
|
||||
++ detStr -- non-numeral det
|
||||
++ cn.mod ! getNum (getAgr det.d Masc) ! c
|
||||
@@ -34,11 +43,11 @@ DetCN det cn = useN cn ** {
|
||||
-- : PN -> NP ;
|
||||
UsePN pn = pn ** {
|
||||
s = \\c => pn.s ;
|
||||
isPron = False ;
|
||||
sp = pn.s } ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
-- : Pron -> NP ;
|
||||
UsePron pron = lin NP pron ;
|
||||
UsePron pron = pron ;
|
||||
|
||||
-- : Predet -> NP -> NP ; -- only the man
|
||||
PredetNP predet np = np ** {
|
||||
@@ -66,13 +75,13 @@ DetCN det cn = useN cn ** {
|
||||
DetNP det = {
|
||||
s = det.sp ! Masc ; ---- Any way to decide for gender here?
|
||||
a = getAgr det.d Masc ;
|
||||
isPron = False ; sp = []
|
||||
isPron = False ;
|
||||
} ;
|
||||
|
||||
-- MassNP : CN -> NP ;
|
||||
MassNP cn = useN cn ** {
|
||||
s = table { Nom => cn.s ! IndefNom ++ cn.mod ! Sg ! Nom ;
|
||||
Abs => cn.s ! Indef Sg ++ cn.mod ! Sg ! Abs }
|
||||
s = table { Nom => cn.s ! NomSg ++ cn.mod ! Sg ! Nom ;
|
||||
c => cn.s ! Indef Sg ++ cn.mod ! Sg ! c }
|
||||
} ;
|
||||
|
||||
|
||||
@@ -83,11 +92,18 @@ DetCN det cn = useN cn ** {
|
||||
|
||||
-- : Quant -> Num -> Det ;
|
||||
DetQuant quant num = quant ** {
|
||||
pref = num.s ;
|
||||
sp = \\g => case <num.n,g> of {
|
||||
<Sg,Masc> => quant.sp ! SgMasc ;
|
||||
<Sg,Fem> => quant.sp ! SgFem ;
|
||||
<Pl,_> => quant.sp ! InvarPl } ;
|
||||
s = \\g,c => case <num.n,g> of {
|
||||
<Sg,Masc> => num.s ! quant.st ++ quant.s ! SgMasc ! c ;
|
||||
<Sg,Fem> => num.s ! quant.st ++ quant.s ! SgFem ! c ;
|
||||
-- gender-flipped allomorphs in plural; TODO needs more fine-grained rules
|
||||
<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 {
|
||||
<True,_> => Numerative ;
|
||||
@@ -98,7 +114,7 @@ DetCN det cn = useN cn ** {
|
||||
-- : Quant -> Num -> Ord -> Det ; -- these five best
|
||||
DetQuantOrd quant num ord =
|
||||
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
|
||||
} ;
|
||||
|
||||
@@ -109,27 +125,29 @@ DetCN det cn = useN cn ** {
|
||||
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
|
||||
-- the inherent number.
|
||||
|
||||
NumSg = {s = [] ; n = Sg ; isNum = False} ;
|
||||
NumPl = {s = [] ; n = Pl ; isNum = False} ;
|
||||
{-
|
||||
NumSg = {s = \\_ => [] ; n = Sg ; isNum = False} ;
|
||||
NumPl = {s = \\_ => [] ; n = Pl ; isNum = False} ;
|
||||
|
||||
-- : Card -> Num ;
|
||||
NumCard card = (card ** { isNum = True }) ;
|
||||
NumCard card = card ** {isNum = True} ;
|
||||
|
||||
-- : Digits -> Card ;
|
||||
NumDigits dig = { s = dig.s ! NCard ; n = dig.n } ;
|
||||
-- NumDigits dig = { s = dig.s ! NCard ; n = dig.n } ;
|
||||
|
||||
-- : Numeral -> Card ;
|
||||
NumNumeral num = num ;
|
||||
NumNumeral num = num ** {s = num.s ! NCard};
|
||||
|
||||
{-
|
||||
-- : AdN -> Card -> Card ;
|
||||
AdNum adn card = card ** { s = adn.s ++ card.s } ;
|
||||
|
||||
-- : Digits -> Ord ;
|
||||
OrdDigits digs = digs ** { s = digs.s ! NOrd } ;
|
||||
|
||||
-}
|
||||
-- : Numeral -> Ord ;
|
||||
OrdNumeral num = num ;
|
||||
OrdNumeral num = num ** {s = num.s ! NOrd ! Indefinite} ;
|
||||
|
||||
{-
|
||||
-- : A -> Ord ;
|
||||
OrdSuperl a = { } ;
|
||||
|
||||
@@ -150,12 +168,12 @@ DetCN det cn = useN cn ** {
|
||||
let p = pron.poss ;
|
||||
gntbl = gnTable (BIND ++ p.sp ! SgMasc)
|
||||
(BIND ++ p.sp ! SgFem)
|
||||
(BIND ++ p.sp ! InvarPl)
|
||||
(BIND ++ p.sp ! PlInv)
|
||||
in DefArt ** {
|
||||
shortPoss = BIND ++ p.s ;
|
||||
isPoss = True ;
|
||||
s = \\c => let casevow = case c of {Nom => "u" ; Abs => "a"}
|
||||
in gntbl ! SgMasc ++ BIND ++ casevow ;
|
||||
s = \\gn,c => let casevow = case c of {Nom => "u" ; Abs => "a"}
|
||||
in gntbl ! gn ++ BIND ++ casevow ;
|
||||
sp = \\gn,c => let prefix = case gn of {SgFem => "t" ; _ => "k"} ;
|
||||
casevow = case c of {Nom => "u" ; Abs => "a"}
|
||||
in prefix ++ gntbl ! gn ++ BIND ++ casevow ;
|
||||
@@ -168,12 +186,24 @@ DetCN det cn = useN cn ** {
|
||||
-- : N2 -> CN ;
|
||||
UseN,UseN2 = ResSom.useN ;
|
||||
|
||||
{-
|
||||
-- : N2 -> NP -> CN ; -- mother of the king
|
||||
ComplN2 n2 np =
|
||||
let compl = applyPost n2.compl1 np ;
|
||||
in useN n2 ** { s = \\agr => compl ++ n2.s } ;
|
||||
-- : N2 -> NP -> CN ; -- Sahra hooyadeed
|
||||
ComplN2 n2 np = let cn = useN n2 in cn ** {s = \\nf =>
|
||||
let qnt = PossPron (pronTable ! np.a) ;
|
||||
|
||||
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)
|
||||
ComplN3 n3 np =
|
||||
let compl = applyPost n3.c3 np ;
|
||||
@@ -187,9 +217,12 @@ DetCN det cn = useN cn ** {
|
||||
Use3N3 n3 = lin N2 n3 ;
|
||||
-- : 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 } ;
|
||||
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 ;
|
||||
hasMod = True
|
||||
} ;
|
||||
@@ -216,13 +249,13 @@ DetCN det cn = useN cn ** {
|
||||
|
||||
-- : CN -> NP -> CN ; -- city Paris (, numbers x and y)
|
||||
ApposCN cn np = cn ** { s = } ;
|
||||
|
||||
-}
|
||||
|
||||
--2 Possessive and partitive constructs
|
||||
|
||||
-- : 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
|
||||
PartNP cn np = cn ** { } ;
|
||||
|
||||
|
||||
@@ -1,88 +1,91 @@
|
||||
concrete NumeralSom of Numeral = CatSom [Numeral,Digits] **
|
||||
open Prelude, ResSom in {
|
||||
open Prelude, ResSom, ParamSom in {
|
||||
|
||||
oper LinDigit : Type = { s : DForm => Str ;
|
||||
n : Number ;
|
||||
even20 : Even20 } ;
|
||||
oper
|
||||
LinDigit : Type = {
|
||||
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 ->
|
||||
{ s = table { Unit => tri ;
|
||||
Teen => t ;
|
||||
Twenty => fiche ;
|
||||
Hund => h + "TODO"} ;
|
||||
even20 = Ten ;
|
||||
n = Pl } ;
|
||||
mkNum3 : (ucard,tcard,uord : Str) -> Gender -> LinDigit = \uc,tc,uo,g -> {s =
|
||||
\\df,co,s => case <co,df,s> of {
|
||||
<NOrd,Unit,_> => uo ;
|
||||
<NOrd,Ten, _> => tc + "aad" ;
|
||||
<NCard,Unit,s> => nf2state (mkNg uc g) ! s ;
|
||||
<NCard,Ten, s> => nf2state (mkN1 tc) ! s }
|
||||
} ;
|
||||
|
||||
oper mkeven20 : Str -> Str -> Str -> Str -> LinDigit = \se,t,trifichid,h ->
|
||||
{ s = table { Unit => se ;
|
||||
Teen => t ;
|
||||
Twenty => trifichid ;
|
||||
Hund => h + "TODO" } ;
|
||||
even20 = Even ;
|
||||
n = Pl } ;
|
||||
mkNum2 : (ucard,tcard : Str) -> LinDigit = \uc,tc ->
|
||||
let uo : Str = case uc of {
|
||||
x + "a" => x + "aad" ; -- ??
|
||||
x + #v + c@#c => x + c + "aad" ;
|
||||
_ => uc + "aad" } ;
|
||||
in mkNum3 uc tc uo Fem ;
|
||||
|
||||
param Even20 = Ten | Even ;
|
||||
param DForm = Unit | Teen | Twenty | Hund ;
|
||||
mkNum2Masc : (ucard,tcard : Str) -> LinDigit = \uc,tc ->
|
||||
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 ;
|
||||
lin num x0 = lin Numeral x0 ;
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mkeven20 "TODO" "TODO" "TODO" "TODO" ;
|
||||
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" ;
|
||||
oper kow : Str = "kow" ; --pre {"iyo" => "koob" ; _ => "kow"} ;
|
||||
|
||||
lin pot01 =
|
||||
{s = table {Unit => "TODO" ; Hund => "TODO" ; _ => []} ; even20 = Ten ; n = Sg };
|
||||
lin pot0 d = d ;
|
||||
lin pot110 = {s = "TODO" ; n = Pl} ;
|
||||
lin pot111 = {s = variants {"TODO" ; "TODO"} ; n = Pl} ;
|
||||
lin pot1to19 d = {s = d.s ! Teen ; n = Pl} ;
|
||||
lin pot0as1 n = {s = n.s ! Unit ; n = n.n} ;
|
||||
lin pot1 d =
|
||||
{s = case d.even20 of {
|
||||
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} ;
|
||||
oper n1 = mkNum3 kow "toban" "kowaad" Fem ;
|
||||
lin n2 = mkNum2 "laba" "labaatan" ;
|
||||
lin n3 = mkNum2 "saddex" "soddon" ;
|
||||
lin n4 = mkNum2 "afar" "afartan";
|
||||
lin n5 = mkNum2 "shan" "konton";
|
||||
lin n6 = mkNum2 "lix" "lixdan" ;
|
||||
lin n7 = mkNum2 "toddoba" "toddobaatan" ;
|
||||
lin n8 = mkNum2Masc "siddeed" "siddeetan" ;
|
||||
lin n9 = mkNum2Masc "sagaal" "sagaaashan" ;
|
||||
|
||||
lin pot1as2 n = n ** { isHundred = False } ;
|
||||
lin pot2 d = {s = d.s ! Hund ; n = Pl ; isHundred = True } ;
|
||||
lin pot2plus d e =
|
||||
{ s = d.s ! Hund ++ "TODO" ++ e.s ;
|
||||
n = Pl ;
|
||||
isHundred = True } ;
|
||||
lin pot01 = {s = n1.s ! Unit ; n = Sg} ;
|
||||
|
||||
lin pot0 d = {s = d.s ! Unit ; n = Pl} ;
|
||||
|
||||
lin pot110 = {s = n1.s ! Ten ; n = Pl} ;
|
||||
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 pot3 n =
|
||||
{s = table {Sg => [] ; Pl => n.s } ! n.n ++ "TODO" ;
|
||||
n = n.n } ;
|
||||
lin pot3 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 =
|
||||
let ta = if_then_Str m.isHundred [] "TODO" ; --no `ta' between 1000 and 100
|
||||
in
|
||||
{ s = table {Sg => [] ; Pl => n.s } ! n.n ++ "TODO" ++ ta ++ m.s ;
|
||||
n = n.n } ;
|
||||
|
||||
--TODO:
|
||||
-- my three cats
|
||||
-- * saddexd &+ ayg &+ a bisadood
|
||||
-- => saddexd &+ ayd &+ a bisadood
|
||||
-- my *two* thousand small cats
|
||||
-- => laba kun oo bisadood oo yar (kun is an attribute, bisadood is an attribute)
|
||||
----------------------------------------------------------------------------
|
||||
|
||||
lincat Dig = TDigit ;
|
||||
@@ -93,7 +96,7 @@ oper
|
||||
|
||||
mk2Dig : Str -> Number -> TDigit = \c,num ->
|
||||
{ s = table { NCard => c ;
|
||||
NOrd => c + "TODO" } ;
|
||||
NOrd => c + "aan" } ;
|
||||
n = num } ;
|
||||
|
||||
|
||||
|
||||
@@ -43,9 +43,8 @@ oper
|
||||
} ;
|
||||
|
||||
mkN2 : overload {
|
||||
mkN2 : Str -> N2 ; -- Predictable N2, no preposition
|
||||
mkN2 : Str -> Preposition -> N2 ; -- Predictable N2, given preposition
|
||||
mkN2 : N -> Preposition -> N2 -- N2 out of noun and preposition
|
||||
mkN2 : Str -> N2 ; -- Predictable N2
|
||||
mkN2 : N -> N2 -- N2 out of noun
|
||||
} ;
|
||||
|
||||
mkPN : overload {
|
||||
@@ -104,11 +103,11 @@ oper
|
||||
|
||||
mkPrep = overload {
|
||||
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 ->
|
||||
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 ->
|
||||
lin Prep (prepTable ! p) ;
|
||||
lin Prep (prep p) ;
|
||||
} ;
|
||||
|
||||
-- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num ->
|
||||
@@ -117,7 +116,7 @@ oper
|
||||
-- mkSubj : Str -> Bool -> Subj = \s,b ->
|
||||
-- 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} ;
|
||||
|
||||
@@ -165,9 +164,8 @@ oper
|
||||
= \n -> n ** {shortPoss = True} ;
|
||||
|
||||
mkN2 = overload {
|
||||
mkN2 : Str -> N2 = \s -> lin N2 (mkN1 s ** {c2 = noPrep}) ;
|
||||
mkN2 : Str -> Preposition -> N2 = \s,p -> lin N2 (mkN1 s ** {c2 = p}) ;
|
||||
mkN2 : N -> Preposition -> N2 = \n,p -> lin N2 (n ** {c2=p})
|
||||
mkN2 : Str -> N2 = \s -> lin N2 (mkN1 s) ;
|
||||
mkN2 : N -> N2 = \n -> lin N2 n ;
|
||||
} ;
|
||||
|
||||
mkPN = overload {
|
||||
|
||||
@@ -63,7 +63,7 @@ param
|
||||
Case = Nom | Abs ;
|
||||
Gender = Masc | Fem ;
|
||||
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 ;
|
||||
Agreement =
|
||||
@@ -75,14 +75,19 @@ param
|
||||
| Pl3
|
||||
| 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 ;
|
||||
|
||||
NForm =
|
||||
Indef Number
|
||||
| Def Number Vowel -- Stems for definite and determinative suffixes
|
||||
| Numerative -- When modified by a number (only distinct for some feminine nouns)
|
||||
| IndefNom ; -- Special form, only fem. nouns ending in consonant
|
||||
|
||||
-- Special forms only for fem. nouns ending in consonant.
|
||||
| Numerative -- When modified by a number: either pl gen or sg abs
|
||||
| NomSg ;
|
||||
|
||||
oper
|
||||
getAgr : NForm -> Gender -> Agreement = \n,g ->
|
||||
@@ -91,24 +96,48 @@ oper
|
||||
getNum : Agreement -> Number = \a ->
|
||||
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
|
||||
|
||||
param
|
||||
AForm = AF Number Case ; ---- TODO: past tense
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Numerals
|
||||
|
||||
-- TODO: is this necessary?
|
||||
param
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Prepositions
|
||||
|
||||
param
|
||||
Preposition = u | ku | ka | la | noPrep ;
|
||||
Preposition = u | ku | ka | la | noPrep | passive ;
|
||||
PrepCombination = ugu | uga | ula | kaga | kula | kala
|
||||
| Single Preposition ;
|
||||
|
||||
@@ -133,20 +162,46 @@ oper
|
||||
--------------------------------------------------------------------------------
|
||||
-- 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
|
||||
|
||||
Aspect = Simple | Progressive ;
|
||||
|
||||
VForm =
|
||||
VInf
|
||||
| VPres Agreement Polarity
|
||||
| VNegPast
|
||||
| VPast Agreement
|
||||
| VPres Aspect Agreement Polarity
|
||||
| VNegPast Aspect
|
||||
| VPast Aspect Agreement
|
||||
| VRel -- "som är/har/…" TODO is this used in other verbs?
|
||||
| VImp Number Polarity ; -- TODO negation
|
||||
| VImp Number Polarity ;
|
||||
|
||||
oper
|
||||
if_then_Pol : Polarity -> Str -> Str -> Str = \p,t,f ->
|
||||
case p of {Pos => t ; Neg => f } ;
|
||||
|
||||
-- TODO:
|
||||
-- tre aspekter (enkel, progressiv, habituell),
|
||||
-- fem modus (indikativ, imperativ, konjunktiv, kontiditonalis, optativ)
|
||||
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 ;
|
||||
x => tbl ! x
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ concrete PhraseSom of Phrase = CatSom ** open Prelude, ResSom in {
|
||||
UttVP vp = { s = linVP vp } ;
|
||||
UttAdv adv = adv ;
|
||||
UttCN n = {s = linCN n } ;
|
||||
UttCard n = n ;
|
||||
UttCard n = {s = n.s ! Indefinite} ;
|
||||
UttAP ap = { s = ap.s ! AF Sg Abs } ;
|
||||
UttInterj i = i ;
|
||||
|
||||
|
||||
@@ -6,6 +6,12 @@ lin
|
||||
-- : Cl -> RCl ; -- such that John loves her
|
||||
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 ;
|
||||
RelVP rp vp = ;
|
||||
|
||||
|
||||
@@ -4,11 +4,15 @@ resource ResSom = ParamSom ** open Prelude, Predef, ParamSom in {
|
||||
-- Nouns
|
||||
oper
|
||||
|
||||
Noun : Type = {s : NForm => Str ; g : Gender ; shortPoss : Bool} ;
|
||||
Noun2 : Type = Noun ** {c2 : Preposition} ;
|
||||
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
|
||||
Noun : Type = {s : NForm => Str; g : Gender ; shortPoss : Bool} ;
|
||||
Noun2 : Type = Noun ; -- TODO eventually more parameters?
|
||||
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} ;
|
||||
|
||||
@@ -18,8 +22,8 @@ oper
|
||||
let bisadi = case gender of
|
||||
{ Fem => case wiil of { _ + #c => wiil+"i" ; _ => wiil} ;
|
||||
Masc => wiil } ;
|
||||
bisadood = case gender of
|
||||
{ Fem => case wiilal of { _ + "o" => wiilal+"od" ; _ => wiil} ;
|
||||
bisadood = case gender of
|
||||
{ Fem => case wiilal of {_ + "o" => wiilal+"od" ; _ => wiil} ;
|
||||
Masc => wiil } ;
|
||||
defStems : Str -> Vowel => Str = \s -> case s of {
|
||||
ilk + "aha" =>
|
||||
@@ -35,10 +39,11 @@ oper
|
||||
in { s = table {
|
||||
Indef Sg => wiil ;
|
||||
Indef Pl => wiilal ;
|
||||
IndefNom => bisadi ;
|
||||
Numerative => bisadood ;
|
||||
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 ;
|
||||
shortPoss = False} ;
|
||||
|
||||
@@ -106,7 +111,7 @@ oper
|
||||
_ => nXayawaan n } ;
|
||||
|
||||
mkNg : Str -> Gender -> Noun = \n,g -> case n of {
|
||||
_ + ("r"|"n"|"l"|"g")
|
||||
_ -- + ("r"|"n"|"l"|"g")
|
||||
=> case g of {
|
||||
Fem => nUl n ;
|
||||
Masc => mkN1 n } ;
|
||||
@@ -119,65 +124,125 @@ oper
|
||||
BaseNP : Type = {
|
||||
a : Agreement ;
|
||||
isPron : Bool ;
|
||||
sp : Str } ;
|
||||
} ;
|
||||
|
||||
NounPhrase : Type = BaseNP ** {s : Case => Str} ;
|
||||
|
||||
useN : Noun -> CNoun ** BaseNP = \n -> n **
|
||||
{ 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
|
||||
-- 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 ** {
|
||||
poss : { -- for PossPron : Pron -> Quant
|
||||
--s, -- possessive suffix
|
||||
sp : GenNum => Str ; -- independent forms
|
||||
s : Str ; -- special case: e.g. family members, name
|
||||
v : Vowel}
|
||||
sp : GenNum => Str ; -- independent forms, e.g. M:kayga F:tayda Pl:kuwayga
|
||||
s : Str ; -- short possessive suffix: e.g. family members, my/your name
|
||||
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
|
||||
|
||||
BaseQuant : Type = {
|
||||
s : Case => Str ;
|
||||
isPoss : Bool ;
|
||||
shortPoss : Str ; -- short form of possessive, e.g. family members
|
||||
} ;
|
||||
|
||||
Determiner : Type = BaseQuant ** {
|
||||
pref : Str ; -- Numerals ?
|
||||
s,
|
||||
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 ** {
|
||||
s,
|
||||
sp : GenNum => Case => Str ;
|
||||
st : State ;
|
||||
v : Vowel ;
|
||||
} ;
|
||||
|
||||
Num : Type = {
|
||||
s : Str ; -- TODO check if enough
|
||||
s : State => Str ; -- TODO check if enough
|
||||
n : Number ; -- singular or plural
|
||||
isNum : Bool -- whether to choose Numerative as the value of NForm
|
||||
} ;
|
||||
|
||||
baseQuant : BaseQuant = {
|
||||
s = \\_ => [] ;
|
||||
isPoss = False ;
|
||||
shortPoss = []
|
||||
} ;
|
||||
@@ -187,11 +252,11 @@ oper
|
||||
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} ;
|
||||
in baseQuant ** {
|
||||
s = \\c =>
|
||||
s = \\gn,c =>
|
||||
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 =>
|
||||
let i = case c of {Nom => "i"; Abs => []}
|
||||
let i = case c of {Nom => "i"; _ => []}
|
||||
in gnTable (spm + i) (spf + i) (spp + i) ! gn ;
|
||||
st = Definite ;
|
||||
v = v ;
|
||||
@@ -201,6 +266,7 @@ oper
|
||||
table {SgMasc => m ; SgFem => f ; _ => p} ;
|
||||
|
||||
indefQuant : Quant = baseQuant ** {
|
||||
s,
|
||||
sp = \\gn,c => [] ;
|
||||
st = Indefinite ;
|
||||
v = NA ; -- Will be ignored in DetQuant
|
||||
@@ -225,13 +291,16 @@ oper
|
||||
_ => ku
|
||||
}
|
||||
} ;
|
||||
prep : Preposition -> (Prep ** {c2 : Preposition}) = \p -> prepTable ! p ** {c2 = p} ;
|
||||
|
||||
prepTable : Preposition => Prep = table {
|
||||
ku => mkPrep "ku" "igu" "kugu" "nagu" "idinku" "lagu" ;
|
||||
ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "laga" ;
|
||||
la => mkPrep "la" "ila" "kula" "nala" "idinla" "lala" ;
|
||||
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 {
|
||||
@@ -263,7 +332,6 @@ oper
|
||||
ula => "loola" ; kaga => "lagaga" ;
|
||||
kula => "lagula" ; kala => "lagala" ;
|
||||
Single p => (prepTable ! p).s ! Impers } ;
|
||||
--
|
||||
a => table { ugu => "ugu" ; uga => "uga" ;
|
||||
ula => "ula" ; kaga => "kaga" ;
|
||||
kula => "kula" ; kala => "kala" ;
|
||||
@@ -285,7 +353,7 @@ oper
|
||||
-- ugu horrayntii (det att komma) allra först
|
||||
|
||||
Adjective : Type = {s : AForm => Str} ;
|
||||
Adjective2 : Type = Adjective ** { c2 : Preposition } ;
|
||||
Adjective2 : Type = Adjective ** {c2 : Preposition} ;
|
||||
|
||||
|
||||
duplA : Str -> Adjective = \yar ->
|
||||
@@ -294,10 +362,10 @@ oper
|
||||
|
||||
mkAdj : (str,pl : Str) -> Adjective = \sg,pl -> {
|
||||
s = table {
|
||||
AF Sg Abs => sg ;
|
||||
AF Pl Abs => pl ;
|
||||
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 {
|
||||
@@ -327,6 +395,7 @@ oper
|
||||
Verb2 : Type = Verb ** {c2 : Preposition} ;
|
||||
Verb3 : Type = Verb2 ** {c3 : Preposition} ;
|
||||
|
||||
|
||||
-- Saeed page 79:
|
||||
-- "… the reference form is the imperative singular form
|
||||
-- since it corresponds to the form of the basic root."
|
||||
@@ -346,6 +415,14 @@ oper
|
||||
"n" => arki ; -- if infinitive ends in n, no change;
|
||||
_ => 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
|
||||
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
|
||||
@@ -360,32 +437,50 @@ oper
|
||||
an : Str = case qaado of {
|
||||
_ + "o" => "an" ; -- Allomorph for imperatives
|
||||
_ => "in" } ;
|
||||
|
||||
in { s = table {
|
||||
VPres (Sg1|Sg3 Masc|Impers) pol
|
||||
=> qaat + if_then_Pol pol "aa" "o" ;
|
||||
VPres (Sg2|Sg3 Fem) pol
|
||||
=> arag + t + if_then_Pol pol "aa" "o" ;
|
||||
VPres (Pl1 _) pol
|
||||
=> arag + n + if_then_Pol pol "aa" "o" ;
|
||||
VPres Pl2 pol => arag + t + "aan" ;
|
||||
VPres Pl3 pol => qaat + "aan" ;
|
||||
VPres Simple (Sg1|Sg3 Masc|Impers) pol
|
||||
=> qaat + if_then_Pol pol "aa" "o" ;
|
||||
VPres Simple (Sg2|Sg3 Fem) 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" ;
|
||||
|
||||
VPast (Sg1|Sg3 Masc|Impers)
|
||||
=> qaat + ay ;
|
||||
VPast (Sg2|Sg3 Fem)
|
||||
=> arag + t + ay ; -- t, d or s
|
||||
VPast (Pl1 _) => arag + n + ay ;
|
||||
VPast Pl2 => arag + t + "een" ; -- t, d or s
|
||||
VPast Pl3 => qaat + "een" ;
|
||||
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" ;
|
||||
|
||||
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 Sg Neg => arag + an ;
|
||||
VImp Pl Neg => qaat + "ina" ;
|
||||
|
||||
VInf => arki ;
|
||||
VRel => arki ; -- TODO does this exist?
|
||||
VNegPast => arkin }
|
||||
VRel => arki } ; -- TODO does this exist?
|
||||
} ;
|
||||
|
||||
-------------------------
|
||||
@@ -393,18 +488,26 @@ oper
|
||||
|
||||
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 =
|
||||
let cabb : Str = case sug of {
|
||||
_ + "b" => sug + "b" ; -- TODO: more duplication patterns
|
||||
_ => 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 ;
|
||||
|
||||
-- 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 =
|
||||
let joogsa = init joogso + "a" ;
|
||||
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 =
|
||||
let qaa = init (init qaado)
|
||||
in mkVerb qaado -- Imperative sg, with the vowel
|
||||
@@ -421,24 +524,24 @@ oper
|
||||
|
||||
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" ;
|
||||
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|Sg3 Masc|Impers)
|
||||
=> "ahaa" ;
|
||||
VPast (Sg2|Sg3 Fem)
|
||||
VPast _ (Sg2|Sg3 Fem)
|
||||
=> "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" }
|
||||
} ;
|
||||
@@ -449,15 +552,15 @@ oper
|
||||
have_V : Verb =
|
||||
let hold_V = mkVerb "hayso" "haysat" "haysa" in {
|
||||
s = table {
|
||||
VPres Sg1 Pos => "leeyahay" ;
|
||||
VPres Sg2 Pos => "leedahay" ;
|
||||
VPres (Sg3 Fem) Pos => "leedahay" ;
|
||||
VPres (Sg3 Masc|Impers) Pos
|
||||
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" ;
|
||||
VPast x => "l" + copula.s ! VPast x ;
|
||||
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 }
|
||||
} ;
|
||||
@@ -475,32 +578,101 @@ oper
|
||||
|
||||
------------------
|
||||
-- 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 = {
|
||||
comp : Agreement => {p1,p2 : Str} -- Agreement for AP complements
|
||||
} ;
|
||||
|
||||
VerbPhrase : Type = Verb ** Complement ** {
|
||||
isPred : Bool ; -- to choose right sentence type marker
|
||||
adv : Adverb ; -- they're ~complicated~
|
||||
c2, c3 : Preposition -- can combine together and with object pronouns
|
||||
isPred : Bool ; -- to choose right sentence type marker
|
||||
adv : Str ;
|
||||
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 ** {
|
||||
comp = \\_ => <[],[]> ;
|
||||
isPred = False ;
|
||||
adv = {s,s2 = []} ;
|
||||
adv = [] ;
|
||||
c2,c3 = noPrep ;
|
||||
obj2 = {s = [] ; a = Unassigned} ;
|
||||
secObj = []
|
||||
} ;
|
||||
|
||||
compl : NounPhrase -> VerbPhrase -> Str = \np,vp ->
|
||||
prepCombTable ! np.a ! combine vp.c2 vp.c3 ;
|
||||
useVc : Verb2 -> VPSlash = \v2 -> useV v2 ** {
|
||||
c2 = v2.c2
|
||||
} ;
|
||||
|
||||
complV2 : NounPhrase -> Verb2 -> Str = \np,vp ->
|
||||
prepCombTable ! np.a ! combine vp.c2 noPrep ;
|
||||
complSlash : VPSlash -> VerbPhrase = \vps -> let np = vps.obj2 in vps ** {
|
||||
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.
|
||||
Clause : Type = {s : Tense => Anteriority => Polarity => Str} ;
|
||||
@@ -508,25 +680,28 @@ oper
|
||||
ClSlash,
|
||||
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
|
||||
-> {fin : Str ; inf : Str} = \t,ant,p,agr,vp ->
|
||||
let pastV : Verb -> Str = \v ->
|
||||
case p of { Neg => v.s ! VNegPast ;
|
||||
Pos => v.s ! VPast agr } ;
|
||||
presV : Verb -> Str = \v -> v.s ! VPres agr p ;
|
||||
in 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 = [] } ;
|
||||
<Past,Anter> => {fin = pastV copula ; inf = vp.s ! VInf } ; ---- TODO: habitual aspect
|
||||
<Fut,Simul> => {fin = presV (doonaa (vp.s ! VInf)) ; inf = []} ;
|
||||
<Fut,Anter> => {fin = pastV (doonaa (vp.s ! VInf)) ; inf = []} ;
|
||||
<_,Simul> => {fin = presV vp ; inf = []} ; -- TODO conditional
|
||||
<_,Anter> => {fin = pastV vp ; inf = []} -- TODO conditional
|
||||
} ;
|
||||
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 = [] } ;
|
||||
<Past,Anter> => {fin = pastV (aux "jir" vp) ; inf = []} ;
|
||||
<Fut,Simul> => {fin = presV (aux "doon" vp) ; inf = []} ;
|
||||
<Fut,Anter> => {fin = pastV (aux "doon" vp) ; inf = []} ;
|
||||
<_,Simul> => {fin = presV vp ; inf = []} ; -- TODO conditional
|
||||
<_,Anter> => {fin = pastV vp ; inf = []} -- TODO conditional
|
||||
}
|
||||
where {
|
||||
pastV : Verb -> Str = \v ->
|
||||
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 =>
|
||||
let stm = if_then_Pol b "w" "m"
|
||||
@@ -537,9 +712,11 @@ oper
|
||||
in stm ++ subjpron ! a ;
|
||||
|
||||
subjpron : Agreement => Str = table {
|
||||
Sg1|Pl1 _ => "aan" ;
|
||||
Sg1|Pl1 Excl => "aan" ;
|
||||
Pl1 Incl => "aynu" ;
|
||||
Sg2|Pl2 => "aad" ;
|
||||
Sg3 Masc => "uu" ;
|
||||
Impers => [] ;
|
||||
_ => "ay" } ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
@@ -547,5 +724,5 @@ oper
|
||||
|
||||
oper
|
||||
linVP : VerbPhrase -> Str = \vp -> vp.s ! VInf ; ----
|
||||
linCN : CNoun -> Str = \cn -> cn.s ! IndefNom ;
|
||||
linCN : CNoun -> Str = \cn -> cn.s ! NomSg ;
|
||||
}
|
||||
|
||||
@@ -8,27 +8,31 @@ lin
|
||||
--2 Clauses
|
||||
|
||||
-- : NP -> VP -> Cl
|
||||
PredVP np vp = {
|
||||
s = \\t,a,p =>
|
||||
let pred : {fin : Str ; inf : Str} = vf t a p np.a vp ;
|
||||
subj : Str = if_then_Str np.isPron [] (np.s ! Nom) ;
|
||||
obj : {p1,p2 : Str} = vp.comp ! np.a ;
|
||||
PredVP np vps =
|
||||
let vp = case vps.c2 of {
|
||||
passive => complSlash (insertComp vps np) ;
|
||||
_ => complSlash vps } ;
|
||||
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 =
|
||||
case <p,vp.isPred,np.a> of {
|
||||
<Pos,True,Sg3 _> => "waa" ;
|
||||
case <p,vp.isPred,subj.a> of {
|
||||
<Pos,True,Sg3 _|Impers> => "waa" ;
|
||||
-- _ => stmarker ! np.a ! b } -- marker+pronoun contract
|
||||
_ => case <np.isPron,p> of {
|
||||
<True,Pos> => "waa" ++ np.s ! Nom ; -- to force some string from NP to show in the tree
|
||||
<True,Neg> => "ma" ++ np.s ! Nom ;
|
||||
<False> => stmarkerNoContr ! np.a ! p }} ;
|
||||
in subj -- subject if it's a noun
|
||||
<True,Pos> => "waa" ++ subjpron ; -- to force some string from NP to show in the tree
|
||||
<True,Neg> => "ma" ++ subjpron ;
|
||||
<False> => stmarkerNoContr ! subj.a ! p }} ;
|
||||
in subjnoun -- subject if it's a noun
|
||||
++ obj.p1 -- object if it's a noun
|
||||
++ 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
|
||||
++ pred.fin -- the verb inflected
|
||||
++ pred.inf -- potential participle
|
||||
++ vp.adv.s2 ---- I have no idea /IL
|
||||
} ;
|
||||
{-
|
||||
-- : SC -> VP -> Cl ; -- that she goes is good
|
||||
|
||||
@@ -104,14 +104,14 @@ oper
|
||||
-- lin for_Prep = mkPrep ;
|
||||
-- lin from_Prep = mkPrep "" ;
|
||||
-- lin in8front_Prep = mkPrep "" ;
|
||||
lin in_Prep = prepTable ! ku ;
|
||||
lin on_Prep = prepTable ! ku ;
|
||||
lin in_Prep = prep ku ;
|
||||
lin on_Prep = prep ku ;
|
||||
-- lin part_Prep = mkPrep ;
|
||||
-- lin possess_Prep = mkPrep ;
|
||||
-- lin through_Prep = mkPrep ;
|
||||
-- lin to_Prep = mkPrep ;
|
||||
-- lin under_Prep = mkPrep "" ;
|
||||
lin with_Prep = prepTable ! la ;
|
||||
lin with_Prep = prep la ;
|
||||
-- lin without_Prep = mkPrep ;
|
||||
|
||||
|
||||
@@ -119,43 +119,15 @@ lin with_Prep = prepTable ! la ;
|
||||
-- Pron
|
||||
|
||||
-- Pronouns are closed class, no constructor in ParadigmsSom.
|
||||
|
||||
i_Pron = {
|
||||
s = table {Nom => "aan" ; Abs => "i"} ;
|
||||
a = Sg1 ; isPron = True ; sp = "aniga" ;
|
||||
poss = {s = "ay" ; v = vA ; sp = gnTable "ayg" "ayd" "uwayg"}
|
||||
} ;
|
||||
it_Pron = he_Pron ** {s = \\_ => []} ;
|
||||
i_Pron = pronTable ! Sg1 ;
|
||||
youPol_Pron, -- TODO check
|
||||
youSg_Pron = {
|
||||
s = table {Nom => "aad" ; Abs => "ku"} ;
|
||||
a = Sg2 ; isPron = True ; sp = "adiga" ;
|
||||
poss = {s = "aa" ; v = vA ; sp = gnTable "aag" "aad" "uwaag"}
|
||||
} ;
|
||||
he_Pron = {
|
||||
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"}
|
||||
} ;
|
||||
youSg_Pron = pronTable ! Sg2 ;
|
||||
he_Pron = pronTable ! Sg3 Masc ;
|
||||
she_Pron = pronTable ! Sg3 Fem ;
|
||||
we_Pron = pronTable ! Pl1 Excl ;
|
||||
youPl_Pron = pronTable ! Pl2 ;
|
||||
they_Pron = pronTable ! Pl3 ;
|
||||
{-
|
||||
lin whatPl_IP = ;
|
||||
lin whatSg_IP = ;
|
||||
|
||||
@@ -5,13 +5,15 @@ lin
|
||||
|
||||
-----
|
||||
-- VP
|
||||
|
||||
-- : V -> VP
|
||||
UseV = ResSom.useV ;
|
||||
|
||||
-- : V2 -> VP ; -- be loved
|
||||
PassV2 = ResSom.passV2 ;
|
||||
{-
|
||||
-- : VV -> VP -> VP ;
|
||||
ComplVV vv vp = ;
|
||||
|
||||
|
||||
-- : VS -> S -> VP ;
|
||||
ComplVS vs s = ;
|
||||
|
||||
@@ -21,30 +23,21 @@ lin
|
||||
-- : VA -> AP -> VP ; -- they become red
|
||||
ComplVA va ap = ResSom.insertComp (CompAP ap).s (useV va) ;
|
||||
|
||||
|
||||
-}
|
||||
--------
|
||||
-- Slash
|
||||
|
||||
-- : V2 -> VPSlash
|
||||
SlashV2a = ResSom.slashDObj ;
|
||||
|
||||
SlashV2a = useVc ;
|
||||
|
||||
-- : 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
|
||||
Slash3V3 v3 npNor = slashIObj v3 **
|
||||
{ dobj = npNor ** { s = mkDObj npNor }
|
||||
} ;
|
||||
|
||||
|
||||
Slash2V3,
|
||||
Slash3V3 = \v3 -> insertComp (useVc v3) ;
|
||||
{-
|
||||
-- : V2V -> VP -> VPSlash ; -- beg (her) to go
|
||||
SlashV2V v2v vp = ;
|
||||
|
||||
|
||||
-- : V2S -> S -> VPSlash ; -- answer (to him) that it is good
|
||||
SlashV2S v2s s = ;
|
||||
|
||||
@@ -55,11 +48,11 @@ lin
|
||||
SlashV2A v2a ap = slashDObj v2a **
|
||||
{ comp = (CompAP ap).s } ;
|
||||
|
||||
|
||||
-}
|
||||
-- : VPSlash -> NP -> VP
|
||||
ComplSlash vps np = ResSom.complSlash vps np ;
|
||||
|
||||
ComplSlash = insertComp ;
|
||||
|
||||
{-
|
||||
-- : VV -> VPSlash -> VPSlash ;
|
||||
-- Just like ComplVV except missing subject!
|
||||
SlashVV vv vps = ComplVV vv vps ** { missing = vps.missing ;
|
||||
@@ -84,21 +77,21 @@ lin
|
||||
UseComp comp = UseCopula ** comp ** {
|
||||
isPred = True
|
||||
} ;
|
||||
{-
|
||||
-- : V2 -> VP ; -- be loved
|
||||
PassV2 v2 =
|
||||
|
||||
-- : 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 ...
|
||||
ExtAdvVP vp adv = ;
|
||||
|
||||
-- : AdV -> VP -> VP ; -- always sleep
|
||||
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)
|
||||
AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ;
|
||||
@@ -125,7 +118,7 @@ lin
|
||||
CompAP ap = {
|
||||
comp = \\a => <[], ap.s ! AF (getNum a) Abs> ;
|
||||
} ;
|
||||
{-}
|
||||
{-
|
||||
-- : CN -> Comp ;
|
||||
CompCN cn = { } ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user