1
0
forked from GitHub/gf-rgl

WIP more preposition contractions + phonological mutation rules

This commit is contained in:
Inari Listenmaa
2025-08-27 17:22:33 +02:00
parent ed745708b2
commit d652c81fa7
4 changed files with 57 additions and 25 deletions

View File

@@ -15,7 +15,9 @@ lin
PrepNP prep np = { PrepNP prep np = {
s = prepAndArt ++ noun s = prepAndArt ++ noun
} where { } where {
complCase : Case = CC (prep.c2 ! getDefi np.a) ; complCase : NPCase = case np.a of {
NotPron (DPoss _ (Sg1|Sg2|Sg3 Masc)) => NPLenited ;
_ => NPC (prep.c2 ! getDefi np.a) } ;
prepStr : Str = prep.s ! agr2pagr np.a ; -- can be Prep or Prep+Pron merged prepStr : Str = prep.s ! agr2pagr np.a ; -- can be Prep or Prep+Pron merged
artStr : Str = np.art ! complCase ; artStr : Str = np.art ! complCase ;
prepAndArt : Str = case np.a of { prepAndArt : Str = case np.a of {

View File

@@ -8,7 +8,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
-- : Det -> CN -> NP -- : Det -> CN -> NP
DetCN det cn = emptyNP ** { DetCN det cn = emptyNP ** {
art = \\c => det.s ! cn.g ! c ; art = \\c => det.s ! cn.g ! npc2c c ;
s = \\c => cn.s ! getNForm det.dt c ; s = \\c => cn.s ! getNForm det.dt c ;
a = NotPron det.dt ; a = NotPron det.dt ;
} ; } ;
@@ -19,7 +19,10 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
-- : Pron -> NP ; -- : Pron -> NP ;
-- Assuming that lincat Pron = lincat NP -- Assuming that lincat Pron = lincat NP
UsePron pron = emptyNP ** pron ** {a = IsPron pron.a} ; UsePron pron = emptyNP ** pron ** {
s = \\c => pron.s ! npc2cc c ;
a = IsPron pron.a
} ;
{- {-
-- : Predet -> NP -> NP ; -- only the man -- : Predet -> NP -> NP ; -- only the man
PredetNP predet np = PredetNP predet np =

View File

@@ -31,26 +31,47 @@ param
Gender = Masc | Fem ; Gender = Masc | Fem ;
CoreCase = Nom | Gen | Dat ; CoreCase = Nom | Gen | Dat ;
Case = CC CoreCase | Voc ; Case = CC CoreCase | Voc ;
NPCase = NPC CoreCase | NPVoc | NPLenited ;
Number = Sg Number = Sg
| Pl | Pl
; ;
Person = P1 | P2 | P3 ; Person = P1 | P2 | P3 ;
Definiteness = Definite | Indefinite ; -- Some prepositions govern different case when definite vs. indefinite Definiteness = Definite | Indefinite ; -- Some prepositions govern different case when definite vs. indefinite
oper
npc2cc : NPCase -> CoreCase = \npc -> case npc of {
NPC c => c ;
_ => Nom ------ TODO check? NPVoc and NPLenited (which is not a case but this is cheaper)
} ;
npc2c : NPCase -> Case = \npc -> case npc of {
NPC c => CC c ;
NPVoc => Voc ;
_ => CC Nom ---- this is just lenited TODO does this make any sense
} ;
param
NForm = NForm =
Indef Number CoreCase Indef Number CoreCase
| Def Number Case | Def Number Case
| Lenited -- keep this separate from case, because some prepositions' requirement of lenited form overrides the usual case requirement
| Dual -- only after number 2, only for a handful of nouns. TODO: does it have different cases? | Dual -- only after number 2, only for a handful of nouns. TODO: does it have different cases?
; ;
{-
* The 1st person singular, 2nd person singular and 3rd person singular masculine forms here trigger lenition (indicated with a superscript L).
* 1st and 2nd person plurals trigger the prefixation of n- onto words beginning with vowels (nasalization), This is indicated with a superscript N. the pronunciation of the a consonant following these and the 3rd person plural is also frequently voiced or nasalized.
* Finally the 3rd person feminine forms prefix an <h> onto words beginning with a vowel. This is indicated with H.
-}
oper oper
getNForm : DType -> Case -> NForm = \d,c -> getNForm : DType -> NPCase -> NForm = \d,c ->
case <d,c> of { case <d,c> of {
<DDef n Indefinite,Voc> => Def n Voc ; <_, NPLenited> => Lenited ; -- bit of a hack
<DDef n Indefinite,CC c> => Indef n c ; <DDef n Indefinite,NPVoc> => Def n Voc ;
<DDef n Definite,c> => Def n c ; <DDef n Indefinite,NPC c> => Indef n c ;
<DPoss n _,Voc> => Indef n Nom ; -- as per Michal on Discord https://discord.com/channels/865093807343140874/865094084683366400/1409838154550087711 . TODO: Def or Indef nom ???? <DDef n Definite,npc> => Def n (npc2c npc) ;
<DPoss n _,c> => Def n c -- ???????????????? <DPoss n _,NPVoc> => Indef n Nom ; -- as per Michal on Discord https://discord.com/channels/865093807343140874/865094084683366400/1409838154550087711 . TODO: Def or Indef nom ????
<DPoss n _,npc> => Def n (npc2c npc) -- ????????????????
} ; } ;
LinN : Type = { LinN : Type = {
@@ -142,7 +163,8 @@ oper
Def Pl (CC Gen) => n.base ; Def Pl (CC Gen) => n.base ;
Def Pl (CC Dat) => n.pl ; Def Pl (CC Dat) => n.pl ;
Def Pl Voc => glue n.lenited "a" ; Def Pl Voc => glue n.lenited "a" ;
Dual => fm n.palatalised n.base -- TODO: is this correct? only for 1-syllable feminine nouns? Dual => fm n.palatalised n.base ; -- TODO: is this correct? only for 1-syllable feminine nouns?
Lenited => n.lenited
} }
} where { } where {
fm : Str -> Str -> Str = \fem,masc -> case n.g of { fm : Str -> Str -> Str = \fem,masc -> case n.g of {
@@ -218,7 +240,7 @@ oper
oper oper
LinPron : Type = { LinPron : Type = {
s : Case => Str ; s : CoreCase => Str ;
a : PronAgr ; a : PronAgr ;
poss : Str ; -- if a case is needed, it comes from the Prep! TODO verify this (do we ever need a dative for poss pron without a prep present? some preps merge, others not, but the pronoun is present in all the preps. why this way—I counted on there being fewer pronouns than prepositions.) poss : Str ; -- if a case is needed, it comes from the Prep! TODO verify this (do we ever need a dative for poss pron without a prep present? some preps merge, others not, but the pronoun is present in all the preps. why this way—I counted on there being fewer pronouns than prepositions.)
empty : Str ; -- to prevent metavariables empty : Str ; -- to prevent metavariables
@@ -228,8 +250,8 @@ oper
-- not this weird unintuitive Agr param -- not this weird unintuitive Agr param
mkPron : (subj,poss : Str) -> PronAgr -> LinPron = \subj,poss,agr -> { mkPron : (subj,poss : Str) -> PronAgr -> LinPron = \subj,poss,agr -> {
s = table { s = table {
CC Nom => subj ; Nom => subj ;
_ => "gam" -- TODO fix this _ => "gam" -- TODO fix this
} ; } ;
poss = poss ; poss = poss ;
a = agr ; a = agr ;
@@ -256,12 +278,12 @@ oper
-- does that param need to be kept in LinNP, and Prep need an inflection table from that param? -- does that param need to be kept in LinNP, and Prep need an inflection table from that param?
-- or do we have an exhaustive list of prepositions that merge, and we can make that into a param and put on a LHS here? -- or do we have an exhaustive list of prepositions that merge, and we can make that into a param and put on a LHS here?
s : Case => Str ; -- TODO: is lenition a separate dimension from case? s : NPCase => Str ; -- TODO: is lenition a separate dimension from case?
empty : Str ; -- to avoid metavariables empty : Str ; -- to avoid metavariables
a : Agr ; -- includes whether it's pron and whether it's definite. TODO: probably can make even leaner (wasn't a prio so far). a : Agr ; -- includes whether it's pron and whether it's definite. TODO: probably can make even leaner (wasn't a prio so far).
} ; } ;
linNP : LinNP -> Str = \np -> np.art ! (CC Nom) ++ np.s ! (CC Nom) ; linNP : LinNP -> Str = \np -> np.art ! (NPC Nom) ++ np.s ! (NPC Nom) ;
emptyNP : LinNP = { emptyNP : LinNP = {
s,art = \\_ => [] ; s,art = \\_ => [] ;
@@ -290,9 +312,9 @@ oper
getQuantForm : Number -> Gender -> Case -> QuantForm = \n,g,c -> case <n,c> of { getQuantForm : Number -> Gender -> Case -> QuantForm = \n,g,c -> case <n,c> of {
<Sg,CC c> => QSg g c ; <Sg,CC c> => QSg g c ;
<Sg,Voc> => QSg g Nom ; --- ?????? <Sg,_> => QSg g Nom ; --- ??????
<Pl,CC c> => QPl c ; <Pl,CC c> => QPl c ;
<Pl,Voc> => QPl Nom --- ?????? <Pl,_> => QPl Nom --- ??????
} ; } ;
getArt : LinQuant -> Number -> Gender -> Case -> Str = \quant,n,g,c -> case c of { getArt : LinQuant -> Number -> Gender -> Case -> Str = \quant,n,g,c -> case c of {
@@ -409,9 +431,14 @@ oper
PrepForms : Type = {base, sg1, sg2, sg3M, sg3F, pl1, pl2, pl3 : Str} ; PrepForms : Type = {base, sg1, sg2, sg3M, sg3F, pl1, pl2, pl3 : Str} ;
H, N : Str ;
H = pre {#vowel => "h" ++ BIND ; _ => []} ;
N = pre {#vowel => "n-" ++ BIND ; _ => []} ;
invarPrepForms : Str -> PrepForms = \str -> invarPrepForms : Str -> PrepForms = \str ->
{base=str ; sg1=str+"mo^L"; sg2=str+"do^L"; sg3M=str+"a^L"; {base=str ; sg1=str++"mo^L"; sg2=str++"do^L"; sg3M=str++"a^L";
sg3F=str+"a^H"; pl1=str+"àr^N"; pl2=str+"ùr^N"; pl3=str+AN} ; -- AN is defined as an allomorph to def art, TODO does the possessive add t- before vowel? sg3F=str++"a"++H; pl1=str++"àr"++N; pl2=str++"ùr"++N; pl3=str++AN} ; -- AN is defined as an allomorph to def art, TODO does the possessive add t- before vowel?
mkPrep : (replacesObjPron : Bool) mkPrep : (replacesObjPron : Bool)
-> (indef,defi : CoreCase) -> (indef,defi : CoreCase)
@@ -460,7 +487,7 @@ oper
aigPrep : LinPrep = aigPrep : LinPrep =
smartPrep smartPrep
{base="aig"; sg1="agam"; sg2="agad"; sg3M="aige"; sg3F="aice"; pl1="againn"; pl2="agaibh"; pl3="aca"} {base="aig"; sg1="agam"; sg2="agad"; sg3M="aige"; sg3F="aice"; pl1="againn"; pl2="agaibh"; pl3="aca"}
{base="aig"; sg1="'gam^L"; sg2="'gad^L"; sg3M="'ga^L"; sg3F="'ga^H"; pl1="'gar^N"; pl2="'gur^N"; pl3="'gan"} ; {base="aig"; sg1="'gam^L"; sg2="'gad^L"; sg3M="'ga^L"; sg3F="'ga"++H; pl1="'gar"++N; pl2="'gur"++N; pl3="'gan"} ;
airPrep : LinPrep = airPrep : LinPrep =
smartPrep smartPrep
{base="air"; sg1="orm"; sg2="ort"; sg3M="air"; sg3F="oirre"; pl1="oirrn"; pl2="oirbh"; pl3="orra"} {base="air"; sg1="orm"; sg2="ort"; sg3M="air"; sg3F="oirre"; pl1="oirrn"; pl2="oirbh"; pl3="orra"}
@@ -469,7 +496,7 @@ oper
annPrep : LinPrep = annPrep : LinPrep =
smartPrep smartPrep
{base="ann"; sg1="annam"; sg2="annad"; sg3M="ann"; sg3F="innte"; pl1="annainn"; pl2="annaibh"; pl3="annta"} {base="ann"; sg1="annam"; sg2="annad"; sg3M="ann"; sg3F="innte"; pl1="annainn"; pl2="annaibh"; pl3="annta"}
{base="ann"; sg1="'nam^L"; sg2="'nad^L"; sg3M="'na^L"; sg3F="'na^H"; pl1="'nar^N"; pl2="'nur^N"; pl3="'nan"} ; {base="ann"; sg1="'nam^L"; sg2="'nad^L"; sg3M="'na^L"; sg3F="'na"++H; pl1="'nar"++N; pl2="'nur"++N; pl3="'nan"} ;
àsPrep : LinPrep = àsPrep : LinPrep =
smartPrep smartPrep
@@ -479,20 +506,20 @@ oper
bhoPrep : LinPrep = bhoPrep : LinPrep =
smartPrep smartPrep
{base="bho"; sg1="bhuam"; sg2="bhuat"; sg3M="bhuaithe"; sg3F="bhuaipe"; pl1="bhuainn"; pl2="buaibh"; pl3="bhuapa"} {base="bho"; sg1="bhuam"; sg2="bhuat"; sg3M="bhuaithe"; sg3F="bhuaipe"; pl1="bhuainn"; pl2="buaibh"; pl3="bhuapa"}
{base="bho"; sg1="bhom^L"; sg2="bhod^L"; sg3M="bho a^L"; sg3F="bho a^H"; pl1="bhor^N"; pl2="bhu^N"; pl3="bhon"} ; {base="bho"; sg1="bhom^L"; sg2="bhod^L"; sg3M="bho a^L"; sg3F="bho a"++H; pl1="bhor"++N; pl2="bhu"++N; pl3="bhon"} ;
{- dePrep : LinPrep = …-} {- dePrep : LinPrep = …-}
doPrep : LinPrep = doPrep : LinPrep =
smartPrep smartPrep
{base="do"; sg1="dhomh"; sg2="dhut"; sg3M="dha"; sg3F="dhi"; pl1="dhuinn"; pl2="dhuibh"; pl3="dhiubh"} {base="do"; sg1="dhomh"; sg2="dhut"; sg3M="dha"; sg3F="dhi"; pl1="dhuinn"; pl2="dhuibh"; pl3="dhiubh"}
{base="bho"; sg1="dom^L"; sg2="dod^L"; sg3M="dhaL^"; sg3F="dha^H"; pl1="dor^N"; pl2="dhur^N"; pl3="don"} ; {base="bho"; sg1="dom^L"; sg2="dod^L"; sg3M="dha^L"; sg3F="dha"++H; pl1="dor"++N; pl2="dhur"++N; pl3="don"} ;
{- eadarPrep : LinPrep = …-} {- eadarPrep : LinPrep = …-}
{- foPrep : LinPrep = …-} {- foPrep : LinPrep = …-}
guPrep : LinPrep = guPrep : LinPrep =
smartPrep smartPrep
{base="gu"; sg1="ugam"; sg2="ugad"; sg3M="uige"; sg3F="uice"; pl1="ugainn"; pl2="ugaibh"; pl3="uca"} {base="gu"; sg1="ugam"; sg2="ugad"; sg3M="uige"; sg3F="uice"; pl1="ugainn"; pl2="ugaibh"; pl3="uca"}
{base="gu"; sg1="gum^L"; sg2="gud^L"; sg3M="gu a^L"; sg3F="gu a^H"; pl1="gar^N"; pl2="gur^N"; pl3="gun"} ; {base="gu"; sg1="gum^L"; sg2="gud^L"; sg3M="gu a^L"; sg3F="gu a"++H; pl1="gar"++N; pl2="gur"++N; pl3="gun"} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Adjectives -- Adjectives

View File

@@ -10,7 +10,7 @@ lin
-- : NP -> VP -> Cl -- : NP -> VP -> Cl
PredVP np vp = { PredVP np vp = {
subj = np.s ! CC Nom ; subj = np.s ! NPC Nom ;
pred = pred =
-- table {something with tense+polarity => -- table {something with tense+polarity =>
vp.s ! VPres (nagr2vagr np.a) vp.s ! VPres (nagr2vagr np.a)