mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Som) Quants, Dets + more morphophonological rules
This commit is contained in:
@@ -71,8 +71,8 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
Det = ResSom.Determiner ;
|
||||
Predet = {s : Str} ;
|
||||
Quant = ResSom.Quant ;
|
||||
Num = { s : Str ; n : Number ; isNum : Bool } ;
|
||||
Card, Ord = { s : Str ; n : Number } ;
|
||||
Num = ResSom.Num ;
|
||||
Card, Ord = {s : Str ; n : Number} ;
|
||||
DAP = ResSom.Determiner ;
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
|
||||
-- Constructed in NumeralSom.
|
||||
|
||||
Numeral = { s : Str ; n : Number } ;
|
||||
Digits = { s : CardOrd => Str ; n : Number } ;
|
||||
Numeral = {s : Str ; n : Number} ;
|
||||
Digits = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
|
||||
|
||||
@@ -100,8 +100,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
-- additional lexicon modules.
|
||||
|
||||
V,
|
||||
V2,
|
||||
V3,
|
||||
-- TODO: eventually proper lincats
|
||||
VV, -- verb-phrase-complement verb e.g. "want"
|
||||
VS, -- sentence-complement verb e.g. "claim"
|
||||
VQ, -- question-complement verb e.g. "wonder"
|
||||
@@ -111,6 +110,9 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
|
||||
V2Q, -- verb with NP and Q complement e.g. "ask"
|
||||
V2A = ResSom.Verb ; -- verb with NP and AP complement e.g. "paint"
|
||||
|
||||
V2 = ResSom.Verb2 ;
|
||||
V3 = ResSom.Verb3 ;
|
||||
|
||||
A = ResSom.Adjective ;
|
||||
A2 = ResSom.Adjective2 ;
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ lin city_N = mkN "magaalo" ;
|
||||
-- lin fall_V = mkV "" ;
|
||||
-- lin far_Adv = mkA "" ;
|
||||
-- lin fat_N = mkN "" ;
|
||||
-- lin father_N2 = mkN "" ;
|
||||
lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) noPrep ;
|
||||
-- lin fear_V2 = mkV2 "" ;
|
||||
-- lin fear_VS = mkVS "" ;
|
||||
-- lin feather_N = mkN "" ;
|
||||
@@ -148,7 +148,7 @@ lin city_N = mkN "magaalo" ;
|
||||
|
||||
-- lin garden_N = mkN "" ;
|
||||
lin girl_N = mkN "gabadh" "gabdho" fem ;
|
||||
-- lin give_V3 = mkV3 "" ;
|
||||
lin give_V3 = mkV3 "bixiyo" ;
|
||||
-- lin glove_N = mkN "" ;
|
||||
-- lin go_V = joan_V ;
|
||||
-- lin gold_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 = mkN "" ;
|
||||
lin mother_N2 = mkN2 (shortPossN (mkN "hooyo")) noPrep ;
|
||||
-- lin mountain_N = mkN "" ;
|
||||
-- lin mouth_N = mkN "" ;
|
||||
-- lin music_N = mkN "" ;
|
||||
@@ -235,7 +235,7 @@ lin man_N = mkN "nin" ;
|
||||
----
|
||||
-- N
|
||||
|
||||
-- lin name_N = mkN "" ;
|
||||
lin name_N = mkN "magac" ;
|
||||
-- lin narrow_A = mkA "" ;
|
||||
-- lin near_A = mkA "" ;
|
||||
-- lin neck_N = mkN "" ;
|
||||
@@ -333,7 +333,7 @@ lin small_A = mkA "yar" ;
|
||||
-- lin snow_N = mkN "" ;
|
||||
-- lin sock_N = mkN "" ;
|
||||
-- lin song_N = mkN "" ;
|
||||
-- lin speak_V2 = mkV2 "" ;
|
||||
lin speak_V2 = mkV2 "hadlo" ;
|
||||
-- lin spit_V = mkV "" ;
|
||||
-- lin split_V2 = mkV2 "" ;
|
||||
-- lin squeeze_V2 = mkV2 "" ;
|
||||
|
||||
@@ -6,26 +6,29 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
|
||||
--2 Noun phrases
|
||||
|
||||
-- The three main types of noun phrases are
|
||||
-- - common nouns with determiners
|
||||
-- - proper names
|
||||
-- - pronouns
|
||||
|
||||
-- : Det -> CN -> NP
|
||||
DetCN det cn = useN cn ** {
|
||||
s = \\c =>
|
||||
let nfc : {nf : NForm ; c : Case} =
|
||||
case <c,cn.hasMod,det.d> of {
|
||||
<Nom,True, Indef Sg> => {nf=Indef Sg ; c=Abs} ;
|
||||
<Nom,False,Indef Sg> => {nf=IndefNom ; c=Nom} ; -- special form for fem. nouns
|
||||
<Nom,True,Def x vA> => {nf=Def x vA ; c=Abs} ;
|
||||
<Nom,False,Def x vA> => {nf=Def x vU ; c=Nom} ;
|
||||
_ => {nf=det.d ; c=c}
|
||||
} ;
|
||||
in cn.s ! nfc.nf
|
||||
++ det.s ! nfc.c
|
||||
++ cn.mod ! getNum (getAgr det.d Masc) ! c ;
|
||||
a = getAgr det.d cn.g
|
||||
-- : Det -> CN -> NP
|
||||
DetCN det cn = useN cn ** {
|
||||
s = sTable ;
|
||||
a = getAgr det.d cn.g ;
|
||||
sp = sTable ! Nom }
|
||||
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
|
||||
_ => {nf=det.d ; c=c}
|
||||
} ;
|
||||
detStr : Str =
|
||||
case <det.isPoss,cn.shortPoss> of {
|
||||
<True,True> => det.shortPoss ;
|
||||
_ => det.s ! nfc.c
|
||||
} ;
|
||||
in det.pref -- if det is numeral. TODO find out if gender/case/other distinction.
|
||||
++ cn.s ! nfc.nf
|
||||
++ detStr -- non-numeral det
|
||||
++ cn.mod ! getNum (getAgr det.d Masc) ! c
|
||||
} ;
|
||||
|
||||
-- : PN -> NP ;
|
||||
@@ -37,7 +40,6 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
-- : Pron -> NP ;
|
||||
UsePron pron = lin NP pron ;
|
||||
|
||||
|
||||
-- : Predet -> NP -> NP ; -- only the man
|
||||
PredetNP predet np = np ** {
|
||||
s = \\c => predet.s ++ np.s ! c ---- ?
|
||||
@@ -80,13 +82,25 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
-- quantifier and an optional numeral can be discerned.
|
||||
|
||||
-- : Quant -> Num -> Det ;
|
||||
-- DetQuant quant num = quant **
|
||||
-- { } ;
|
||||
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 } ;
|
||||
|
||||
d = case <num.isNum,quant.st> of {
|
||||
<True,_> => Numerative ;
|
||||
<False,Definite> => Def num.n quant.v ;
|
||||
<False,Indefinite> => Indef num.n } ;
|
||||
} ;
|
||||
|
||||
-- : Quant -> Num -> Ord -> Det ; -- these five best
|
||||
-- DetQuantOrd quant num ord =
|
||||
-- let theseFive = DetQuant quant num
|
||||
-- in theseFive ** { s = \\c,ph => theseFive.s ! c ! ph ++ ord.s } ; --TODO: dummy implementation
|
||||
DetQuantOrd quant num ord =
|
||||
let theseFive = DetQuant quant num in theseFive ** {
|
||||
s = \\c => theseFive.s ! c ++ ord.s ;
|
||||
sp = \\g,c => theseFive.sp ! g ! c ++ ord.s
|
||||
} ;
|
||||
|
||||
-- Whether the resulting determiner is singular or plural depends on the
|
||||
-- cardinal.
|
||||
@@ -94,10 +108,10 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
-- All parts of the determiner can be empty, except $Quant$, which is
|
||||
-- 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 }) ;
|
||||
|
||||
@@ -117,27 +131,37 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
|
||||
OrdNumeral num = num ;
|
||||
|
||||
-- : A -> Ord ;
|
||||
OrdSuperl a = { } ; -- why force Sg?
|
||||
OrdSuperl a = { } ;
|
||||
|
||||
-- One can combine a numeral and a superlative.
|
||||
|
||||
-- : Numeral -> A -> Ord ; -- third largest
|
||||
OrdNumeralSuperl num a = num ** { } ;
|
||||
-}
|
||||
|
||||
-- : Quant
|
||||
DefArt = { } ;
|
||||
DefArt = defQuant "a" "kan" "tan" "kuwan" NA ;
|
||||
|
||||
-- : Quant
|
||||
IndefArt = { s = artDef ;
|
||||
indep = False ;
|
||||
pref = [] ;
|
||||
isDef = False } ; --has suffix, but turns into partitive in negative!
|
||||
IndefArt = indefQuant ** {sp = \\gn,c => "1"} ; -- TODO sp forms
|
||||
|
||||
-- : Pron -> Quant
|
||||
PossPron pron = { s = artDef ;
|
||||
indep = True ;
|
||||
pref = pron.s ! Gen ;
|
||||
isDef = True } ;
|
||||
-}
|
||||
PossPron pron =
|
||||
let p = pron.poss ;
|
||||
gntbl = gnTable (BIND ++ p.sp ! SgMasc)
|
||||
(BIND ++ p.sp ! SgFem)
|
||||
(BIND ++ p.sp ! InvarPl)
|
||||
in DefArt ** {
|
||||
shortPoss = BIND ++ p.s ;
|
||||
isPoss = True ;
|
||||
s = \\c => let casevow = case c of {Nom => "u" ; Abs => "a"}
|
||||
in gntbl ! SgMasc ++ 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 ;
|
||||
v = p.v
|
||||
} ;
|
||||
|
||||
--2 Common nouns
|
||||
|
||||
-- : N -> CN
|
||||
|
||||
@@ -30,6 +30,7 @@ oper
|
||||
ku : Preposition ;
|
||||
la : Preposition ;
|
||||
u : Preposition ;
|
||||
noPrep : Preposition ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
@@ -41,6 +42,12 @@ oper
|
||||
--mkN : N -> Gender -> N ; -- Otherwise predictable but not gender (TODO does this even happen?)
|
||||
} ;
|
||||
|
||||
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
|
||||
} ;
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : Str -> PN ; -- Proper noun, default agr. P3 Sg Masc.
|
||||
mkPN : Str -> Agr -> PN -- Proper noun, another agr.
|
||||
@@ -50,7 +57,7 @@ oper
|
||||
|
||||
mkA : overload {
|
||||
mkA : (yar : Str) -> A ;
|
||||
mkA : (sg,pl : Str) -> A
|
||||
mkA : (sg,pl : Str) -> A
|
||||
} ;
|
||||
|
||||
-- mkA2 : Str -> Prep -> A2 ;
|
||||
@@ -72,6 +79,12 @@ oper
|
||||
mkV2 : V -> Preposition -> V2 ; -- Already constructed verb with preposition
|
||||
} ;
|
||||
|
||||
mkV3 : overload {
|
||||
mkV3 : (sug : Str) -> V3 ; -- Predictable verb: imperative form, no preposition
|
||||
mkV3 : (sug : Str) -> (_,_ : Preposition) -> V2 ; -- Regular verb, imperative and preposition
|
||||
mkV3 : V -> (_,_ : Preposition) -> V2 ; -- Already constructed verb with preposition
|
||||
} ;
|
||||
|
||||
-- TODO: actual constructors
|
||||
-- mkVA : Str -> VA = \s -> lin VA (mkVerb s) ;
|
||||
--
|
||||
@@ -138,6 +151,7 @@ oper
|
||||
ku = ResSom.ku ;
|
||||
la = ResSom.la ;
|
||||
u = ResSom.u ;
|
||||
noPrep = ResSom.noPrep ;
|
||||
------------------------
|
||||
|
||||
mkN = overload {
|
||||
@@ -147,8 +161,17 @@ oper
|
||||
--mkN : N -> Gender -> N = \n,g -> n ** {g = g }
|
||||
} ;
|
||||
|
||||
shortPossN : N -> N -- force N to take short form of possessive suffix, e.g. family members
|
||||
= \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})
|
||||
} ;
|
||||
|
||||
mkPN = overload {
|
||||
mkPN : Str -> PN = \s -> lin PN (mkPNoun s sgMasc) ;
|
||||
mkPN : Str -> PN = \s -> lin PN (mkPNoun s sgMasc) ;
|
||||
mkPN : Str -> Agr -> PN = \s,a -> lin PN (mkPNoun s a)
|
||||
} ;
|
||||
|
||||
@@ -178,6 +201,12 @@ oper
|
||||
mkV2 : Str -> Preposition -> V2 = \s,p -> lin V2 (regV s ** {c2 = p}) ;
|
||||
mkV2 : V -> Preposition -> V2 = \v,p -> lin V2 (v ** {c2 = p}) ;
|
||||
} ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : (sug : Str) -> V3 = \s -> lin V3 (regV s ** {c2,c3 = noPrep}) ;
|
||||
mkV3 : (sug : Str) -> (_,_ : Preposition) -> V3 = \s,p,q -> lin V3 (regV s ** {c2 = p ; c3 = q}) ;
|
||||
mkV3 : V -> (_,_ : Preposition) -> V2 = \v,p,q -> lin V3 (v ** {c2 = p ; c3 = q}) ;
|
||||
} ;
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ oper
|
||||
|
||||
param
|
||||
Morpheme = mO | mKa | mTa ;
|
||||
-- | mKii | mTii ; -- TODO check if needed
|
||||
|
||||
oper
|
||||
allomorph : Morpheme -> Str -> Str = \x,stem ->
|
||||
@@ -34,18 +35,24 @@ oper
|
||||
"c"|"g"|"i"|"j"|"x"|"s" => "yo" ;
|
||||
_ => "o" } ;
|
||||
|
||||
-- Based on the table on page 21--TODO find generalisations in patterns
|
||||
mTa => case stem of {
|
||||
_ + ("dh") => "a" ; ---- ??? just guessing
|
||||
_ + ("d"|"c"|"h"|"x"|"q"|"'"|"i"|"y"|"w") => "da" ;
|
||||
_ + "l" => "sha" ;
|
||||
_ => "ta" } ;
|
||||
mTa => case stem of { -- Saeed p. 29
|
||||
_ + ("dh") => "dha" ; ---- ???
|
||||
_ + (#v|"'"|"c"|"d"|"h"|"kh"|"q"|"w"|"x"|"y") => "da" ;
|
||||
_ + "l" => "sha" ;
|
||||
_ {- b,f,g,n,r,s -} => "ta" } ;
|
||||
|
||||
mKa => case stem of {
|
||||
_ + ("g"|"aa"|"i"|"y"|"w") => "ga" ;
|
||||
_ + ("c"|"h"|"x"|"q"|"'") => "a" ;
|
||||
_ + ("e"|"o") => "ha" ;
|
||||
_ => "ka" }
|
||||
mKa => case stem of { -- Saeed p. 28-29
|
||||
_ + ("r"|"g"|"w"|"y"|"i"|"u"|"aa"|"oo"|"uu") => "ga" ;
|
||||
_ + ("q"|"'"|"kh"|"x"|"c"|"h") => "a" ;
|
||||
_ + ("e"|"o") => "ha" ;
|
||||
_ {- b,d,dh,f,j,l,n,r,sh-} => "ka" }
|
||||
|
||||
{-- TODO check if needed/implement elsewhere:
|
||||
mKii => case stem of {
|
||||
_+ #vv + #c => init (allomorph mKa stem) ++ "ii" ; -- Should not change stem vowel
|
||||
_ + ("'"|"x"|"c") => "ii" ; -- Should change stem vowel
|
||||
_ => init (allomorph mKa stem) ++ "ii" } ;
|
||||
mTii => init (allomorph mTa stem) ++ "ii" -}
|
||||
} ;
|
||||
|
||||
|
||||
@@ -55,7 +62,8 @@ oper
|
||||
param
|
||||
Case = Nom | Abs ;
|
||||
Gender = Masc | Fem ;
|
||||
Vowel = vA | vE | vI | vO | vU ; -- For vowel assimilation
|
||||
Vowel = vA | vE | vI | vO | vU | NA ; -- For vowel assimilation
|
||||
GenNum = SgMasc | SgFem | InvarPl ; -- For Quant
|
||||
|
||||
Inclusion = Excl | Incl ;
|
||||
Agreement =
|
||||
@@ -67,6 +75,8 @@ param
|
||||
| Pl3
|
||||
| Impers ; -- Verb agrees with Sg3, but needed for preposition contraction
|
||||
|
||||
State = Definite | Indefinite ;
|
||||
|
||||
NForm =
|
||||
Indef Number
|
||||
| Def Number Vowel -- Stems for definite and determinative suffixes
|
||||
|
||||
@@ -4,7 +4,7 @@ resource ResSom = ParamSom ** open Prelude, Predef, ParamSom in {
|
||||
-- Nouns
|
||||
oper
|
||||
|
||||
Noun : Type = {s : NForm => Str ; g : Gender} ;
|
||||
Noun : Type = {s : NForm => Str ; g : Gender ; shortPoss : Bool} ;
|
||||
Noun2 : Type = Noun ** {c2 : Preposition} ;
|
||||
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
|
||||
|
||||
@@ -23,11 +23,11 @@ oper
|
||||
Masc => wiil } ;
|
||||
defStems : Str -> Vowel => Str = \s -> case s of {
|
||||
ilk + "aha" =>
|
||||
table { vA => ilk+"ah" ;
|
||||
vE => ilk+"eh" ;
|
||||
table { vE => ilk+"eh" ;
|
||||
vI => ilk+"ih" ;
|
||||
vO => ilk+"oh" ;
|
||||
vU => ilk+"uh"
|
||||
vU => ilk+"uh" ;
|
||||
_ => ilk+"ah"
|
||||
} ;
|
||||
_ => table { _ => init s }
|
||||
} ;
|
||||
@@ -39,7 +39,8 @@ oper
|
||||
Numerative => bisadood ;
|
||||
Def Sg vow => defStems wiilka ! vow ;
|
||||
Def Pl vow => defStems wiilasha ! vow } ;
|
||||
g = gender } ;
|
||||
g = gender ;
|
||||
shortPoss = False} ;
|
||||
|
||||
-------------------------
|
||||
-- Regular noun paradigms
|
||||
@@ -55,10 +56,11 @@ oper
|
||||
|
||||
-- 3) Masculine, plural with duplication
|
||||
nMas mas = let s = last mas ;
|
||||
a = last (init mas) ;
|
||||
ka = allomorph mKa mas ;
|
||||
ta = allomorph mTa mas ;
|
||||
sha = case ta of {"sha" => ta ; _ => s + ta } in
|
||||
mkNoun mas (mas + ka) (mas + "a" + s) (mas + "a" + sha) Masc ;
|
||||
mkNoun mas (mas + ka) (mas + a + s) (mas + a + sha) Masc ;
|
||||
|
||||
-- 4a) Feminine, plural with ó
|
||||
nUl ul = let o = case last ul of { "i" => "yo" ; _ => "o" } ;
|
||||
@@ -139,30 +141,70 @@ oper
|
||||
-- keenna teenna kuweenna (1 pl. inkl.)
|
||||
-- kiinna tiinna kuwiinna
|
||||
-- kooda tooda kuwooda
|
||||
Pronoun : Type = NounPhrase ;
|
||||
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}
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Det, Quant, Card, Ord
|
||||
Quant : Type = SS ; ---- TODO
|
||||
|
||||
Determiner : Type = {
|
||||
BaseQuant : Type = {
|
||||
s : Case => Str ;
|
||||
sp : Gender => Case => Str ;
|
||||
d : NForm
|
||||
isPoss : Bool ;
|
||||
shortPoss : Str ; -- short form of possessive, e.g. family members
|
||||
} ;
|
||||
|
||||
mkDeterminer : (x1,_,x3 : Str) -> NForm -> Determiner = \an,kani,tani,nf ->
|
||||
let ani : Str = case an of { _ + #c => an+"i" ;
|
||||
_ => case nf of { Def _ _ => "u" ;
|
||||
_ => [] }
|
||||
} ;
|
||||
bind : Str -> Str = \x -> case x of { "" => [] ; _ => BIND ++ x } ;
|
||||
in { s = table { Nom => bind ani ; Abs => bind an } ;
|
||||
sp = table { Fem => table { Nom => tani ; Abs => init tani } ;
|
||||
Masc => table { Nom => kani ; Abs => init kani }
|
||||
} ;
|
||||
d = nf
|
||||
} ;
|
||||
Determiner : Type = BaseQuant ** {
|
||||
pref : Str ; -- Numerals ?
|
||||
sp : Gender => Case => Str ;
|
||||
d : NForm -- a combination of number, state and vowel
|
||||
} ;
|
||||
|
||||
Quant : Type = BaseQuant ** {
|
||||
sp : GenNum => Case => Str ;
|
||||
st : State ;
|
||||
v : Vowel ;
|
||||
} ;
|
||||
|
||||
Num : Type = {
|
||||
s : 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 = []
|
||||
} ;
|
||||
|
||||
defQuant = defQuantBind True ;
|
||||
|
||||
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 =>
|
||||
let nom = case v of {NA => "u" ; _ => s + "i"}
|
||||
in case c of {Abs => bind s ; Nom => bind nom} ;
|
||||
sp = \\gn,c =>
|
||||
let i = case c of {Nom => "i"; Abs => []}
|
||||
in gnTable (spm + i) (spf + i) (spp + i) ! gn ;
|
||||
st = Definite ;
|
||||
v = v ;
|
||||
} ;
|
||||
|
||||
gnTable : (m,f,p : Str) -> (GenNum => Str) = \m,f,p ->
|
||||
table {SgMasc => m ; SgFem => f ; _ => p} ;
|
||||
|
||||
indefQuant : Quant = baseQuant ** {
|
||||
sp = \\gn,c => [] ;
|
||||
st = Indefinite ;
|
||||
v = NA ; -- Will be ignored in DetQuant
|
||||
} ;
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Prepositions
|
||||
@@ -305,10 +347,10 @@ oper
|
||||
_ => arki + "n" } ; -- otherwise add n.
|
||||
|
||||
-- Some predictable sound changes
|
||||
t : Str = case arag of { -- kari+seen, 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
|
||||
_ + ("x"|"q"|"c") => "d" ; -- t changes into d in front of x/q/c
|
||||
_ => "t" } ;
|
||||
_ => "t" } ;
|
||||
ay : Str = case ark of {
|
||||
_ + ("i"|"e") => "ey" ;
|
||||
_ => "ay" } ;
|
||||
@@ -419,7 +461,7 @@ oper
|
||||
VRel => "leh" ;
|
||||
x => hold_V.s ! x }
|
||||
} ;
|
||||
|
||||
|
||||
-- Till VERBFRASEN ansluter sig
|
||||
-- · satstypsmarkörer (waa, ma...),
|
||||
-- · subjekts-pronomenet la man,
|
||||
@@ -466,7 +508,7 @@ oper
|
||||
ClSlash,
|
||||
Sentence : Type = SS ; ---- TODO
|
||||
|
||||
doonaa : Str -> Verb = \inf ->
|
||||
doonaa : Str -> Verb = \inf ->
|
||||
let doon : Verb = cSug "doon" in {s = \\vf => inf ++ doon.s ! vf} ;
|
||||
|
||||
vf : Tense -> Anteriority -> Polarity -> Agreement -> Verb
|
||||
|
||||
@@ -69,11 +69,11 @@ lin somePl_Det = R.indefDet "" pl ;
|
||||
lin someSg_Det = R.indefDet "" sg ;
|
||||
|
||||
lin no_Quant = mkPrep no_Quant
|
||||
|
||||
lin that_Quant = R.defDet [] sg ** { s = R.quantHori } ;
|
||||
lin this_Quant = R.defDet [] sg ** { s = R.quantHau } ;
|
||||
lin which_IQuant = R.defDet "" sg ** { s = R.artDef } ;
|
||||
|
||||
-}
|
||||
lin that_Quant = defQuant "aas" "kaas" "taas" "kuwaas" vA ;
|
||||
lin this_Quant = defQuant "an" "kan" "tan" "kuwan" vA ;
|
||||
--lin which_IQuant = defQuant
|
||||
{-
|
||||
|
||||
-----
|
||||
-- NP
|
||||
@@ -123,30 +123,38 @@ lin with_Prep = prepTable ! la ;
|
||||
i_Pron = {
|
||||
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
|
||||
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"}
|
||||
} ;
|
||||
{-
|
||||
lin whatPl_IP = ;
|
||||
|
||||
Reference in New Issue
Block a user