forked from GitHub/gf-rgl
make leaner param for CN (morpho still as wrong as always)
This commit is contained in:
@@ -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 ** {
|
||||||
s = \\c => det.s ++ cn.s ! det.n ! det.d ! c ;
|
s = \\c => det.s ++ cn.s ! getNForm det.n det.d c ;
|
||||||
d = det.d
|
d = det.d
|
||||||
} ;
|
} ;
|
||||||
{-
|
{-
|
||||||
@@ -54,7 +54,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
|
|||||||
-}
|
-}
|
||||||
-- MassNP : CN -> NP ;
|
-- MassNP : CN -> NP ;
|
||||||
MassNP cn = emptyNP ** {
|
MassNP cn = emptyNP ** {
|
||||||
s = cn.s ! Sg ! Indef
|
s = \\c => cn.s ! getNForm Sg Indefinite c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -123,10 +123,10 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
|
|||||||
-}
|
-}
|
||||||
|
|
||||||
-- : Quant
|
-- : Quant
|
||||||
DefArt = mkQuant "an" "nan" Def ;
|
DefArt = mkQuant "an" "nan" Definite ;
|
||||||
|
|
||||||
-- : Quant
|
-- : Quant
|
||||||
IndefArt = mkQuant [] [] Indef ;
|
IndefArt = mkQuant [] [] Indefinite ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
-- : Pron -> Quant -- my
|
-- : Pron -> Quant -- my
|
||||||
|
|||||||
@@ -29,16 +29,28 @@ https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#my-naming-scheme-for-l
|
|||||||
|
|
||||||
param
|
param
|
||||||
Gender = Masc | Fem ;
|
Gender = Masc | Fem ;
|
||||||
Case = Nom | Gen | Dat | Voc ;
|
CoreCase = Nom | Gen | Dat ;
|
||||||
|
Case = CC CoreCase | Voc ;
|
||||||
Number = Sg
|
Number = Sg
|
||||||
| Pl
|
| Pl
|
||||||
| Dual -- only after number 2
|
|
||||||
;
|
;
|
||||||
Person = P1 | P2 | P3 ;
|
Person = P1 | P2 | P3 ;
|
||||||
Definiteness = Def | Indef ; -- Some prepositions govern different case when definite vs. indefinite
|
Definiteness = Definite | Indefinite ; -- Some prepositions govern different case when definite vs. indefinite
|
||||||
|
|
||||||
|
NForm =
|
||||||
|
Indef Number CoreCase
|
||||||
|
| Def Number Case
|
||||||
|
| Dual -- only after number 2, only for a handful of nouns. TODO: does it have different cases?
|
||||||
|
;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
getNForm : Number -> Definiteness -> Case -> NForm = \n,d,c ->
|
||||||
|
case <d,c> of {
|
||||||
|
<Indefinite,Voc> => Indef n Nom ; ---- ???
|
||||||
|
<Indefinite,CC c> => Indef n c ;
|
||||||
|
<Definite,c> => Def n c
|
||||||
|
} ;
|
||||||
|
|
||||||
LinN : Type = {
|
LinN : Type = {
|
||||||
base, -- tunnag fuil loch fear litir
|
base, -- tunnag fuil loch fear litir
|
||||||
gen, -- tunnaige fala locha fir litreach ("de-palatalised")
|
gen, -- tunnaige fala locha fir litreach ("de-palatalised")
|
||||||
@@ -65,85 +77,6 @@ oper
|
|||||||
-- smartN : (…,…,…,… : Str)
|
-- smartN : (…,…,…,… : Str)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
{-
|
|
||||||
|
|
||||||
PL.VOC: lenited + non-palatalized + -a
|
|
||||||
|
|
||||||
class 1 masculine noun
|
|
||||||
boireannach SG.*.NOM, SG.INDEF.DAT, PL.DEF.GEN
|
|
||||||
boireannaich SG.INDEF.GEN, PL.*.NOM, PL.*.DAT
|
|
||||||
bhoireannach PL.INDEF.GEN, SG.DEF.DAT
|
|
||||||
bhoireannaich SG.DEF.GEN, SG.VOC
|
|
||||||
bhoireannacha PL.VOC
|
|
||||||
|
|
||||||
indefinite
|
|
||||||
singular plural
|
|
||||||
nominative boireannach boireannaich
|
|
||||||
genitive boireannaich bhoireannach
|
|
||||||
dative boireannach boireannaich; boireannachaibh✝
|
|
||||||
definite
|
|
||||||
singular plural
|
|
||||||
nominative (am) boireannach (na) boireannaich
|
|
||||||
genitive (a') bhoireannaich (nam) boireannach
|
|
||||||
dative (a') bhoireannach (na) boireannaich; boireannachaibh✝
|
|
||||||
vocative bhoireannaich bhoireannacha
|
|
||||||
|
|
||||||
|
|
||||||
class 2 feminine noun
|
|
||||||
not affected by lenition?
|
|
||||||
làmh SG.*.NOM, PL.*.GEN, SG.VOC
|
|
||||||
làmh (imagine there was lenition) PL.INDEF.GEN, SG.VOC
|
|
||||||
làimh SG.*.DAT
|
|
||||||
làimhe SG.*.GEN
|
|
||||||
làmhan PL.*.NOM, PL.*.DAT
|
|
||||||
làmha PL.VOC
|
|
||||||
|
|
||||||
indefinite
|
|
||||||
singular plural
|
|
||||||
nominative làmh làmhan
|
|
||||||
genitive làimhe làmh
|
|
||||||
dative làimh làmhan
|
|
||||||
definite
|
|
||||||
singular plural
|
|
||||||
nominative (an) làmh (na) làmhan
|
|
||||||
genitive (na) làimhe (nan) làmh
|
|
||||||
dative (an) làimh (na) làmhan
|
|
||||||
vocative làmh làmha
|
|
||||||
|
|
||||||
class 2a feminine noun
|
|
||||||
tunnag SG.*.NOM, PL.DEF.GEN
|
|
||||||
thunnag PL.INDEF.GEN, SG.VOC
|
|
||||||
tunnaig SG.*.DAT, SG.*.GEN (allomorph (secondary?)),
|
|
||||||
tunnaige SG.*.GEN (allomorph (primary?))
|
|
||||||
tunnagan PL.*.NOM, PL.*.DAT
|
|
||||||
thunnaga PL.VOC
|
|
||||||
|
|
||||||
indefinite
|
|
||||||
singular plural
|
|
||||||
nominative tunnag tunnagan
|
|
||||||
genitive tunnaige, thunnag
|
|
||||||
tunnaig
|
|
||||||
dative tunnaig tunnagan
|
|
||||||
definite
|
|
||||||
singular plural
|
|
||||||
nominative (an) tunnag (na) tunnagan
|
|
||||||
genitive (na) tunnaige, (nan) tunnag
|
|
||||||
tunnaig
|
|
||||||
dative (an) tunnaig (na) tunnagan
|
|
||||||
vocative thunnag thunnaga
|
|
||||||
|
|
||||||
class 3
|
|
||||||
|
|
||||||
|
|
||||||
-}
|
|
||||||
oper
|
|
||||||
LinPN : Type = {
|
|
||||||
s : Str ;
|
|
||||||
n : Number ; -- Proper nouns often have already an inherent number; you don't usually say "a Paris / many Parises"
|
|
||||||
g : Gender ; -- inherent gender/noun class, if your language has that
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- For inflection paradigms, see http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html#toc56
|
-- For inflection paradigms, see http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html#toc56
|
||||||
mkNoun : (b,g,pl,l,p,lp : Str) -> Gender -> LinN = \b,gen,pl,l,p,lp,g -> {
|
mkNoun : (b,g,pl,l,p,lp : Str) -> Gender -> LinN = \b,gen,pl,l,p,lp,g -> {
|
||||||
base = b ; -- tunnag fuil loch fear litir
|
base = b ; -- tunnag fuil loch fear litir
|
||||||
@@ -159,29 +92,21 @@ oper
|
|||||||
-- can always replace morphology with Katya's automated tool
|
-- can always replace morphology with Katya's automated tool
|
||||||
useN : LinN -> LinCN = \n -> n ** {
|
useN : LinN -> LinCN = \n -> n ** {
|
||||||
s = table {
|
s = table {
|
||||||
Pl => table {
|
Indef Sg Nom => n.base ;
|
||||||
Indef => table {
|
Indef Sg Gen => n.gen ;
|
||||||
Nom|Dat => n.pl ;
|
Indef Sg Dat => fm n.palatalised n.base ;
|
||||||
Gen => n.gen ;
|
Def Sg (CC Nom) => n.base ;
|
||||||
Voc => glue n.lenited "a" } ;
|
Def Sg (CC Gen) => fm n.gen n.lenited_palatalised ;
|
||||||
Def => table {
|
Def Sg (CC Dat) => fm n.palatalised n.lenited ;
|
||||||
Nom|Dat => n.pl ;
|
Def Sg Voc => n.lenited ;
|
||||||
Gen => n.base ;
|
Indef Pl Nom => n.pl ;
|
||||||
Voc => fm n.lenited n.lenited_palatalised }
|
Indef Pl Gen => n.base ;
|
||||||
} ;
|
Indef Pl Dat => n.palatalised ;
|
||||||
_ => table { -- Sg and Dl
|
Def Pl (CC Nom) => n.pl ;
|
||||||
Indef => table {
|
Def Pl (CC Gen) => n.base ;
|
||||||
Nom => n.base ;
|
Def Pl (CC Dat) => n.pl ;
|
||||||
Gen => n.gen ;
|
Def Pl Voc => glue n.lenited "a" ;
|
||||||
Dat => fm n.palatalised n.base ;
|
Dual => "TODO FIXME I AM DUAL"}
|
||||||
Voc => fm n.lenited n.lenited_palatalised } ;
|
|
||||||
Def => table {
|
|
||||||
Nom => n.base ;
|
|
||||||
Gen => n.gen ;
|
|
||||||
Dat => fm n.palatalised n.lenited ;
|
|
||||||
Voc => fm n.lenited n.lenited_palatalised }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} where {
|
} where {
|
||||||
fm : Str -> Str -> Str = \fem,masc -> case n.g of {
|
fm : Str -> Str -> Str = \fem,masc -> case n.g of {
|
||||||
Fem => fem ;
|
Fem => fem ;
|
||||||
@@ -190,15 +115,13 @@ oper
|
|||||||
};
|
};
|
||||||
|
|
||||||
LinCN : Type = {
|
LinCN : Type = {
|
||||||
s : Number =>
|
s : NForm =>
|
||||||
Definiteness => -- ???? is this needed ??????
|
|
||||||
Case =>
|
|
||||||
Str ;
|
Str ;
|
||||||
g : Gender ;
|
g : Gender ;
|
||||||
-- ** postmod/premod/… : Str -- if needed? determiners can put stuff after head but it only comes at NP
|
-- ** postmod/premod/… : Str -- if needed? determiners can put stuff after head but it only comes at NP
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
linCN : LinCN -> Str = \cn -> cn.s ! Sg ! Indef ! Nom
|
linCN : LinCN -> Str = \cn -> cn.s ! Indef Sg Nom
|
||||||
-- ++ cn.postmod -- If there is another field, use here
|
-- ++ cn.postmod -- If there is another field, use here
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -224,6 +147,16 @@ boireannach_N : LinN = {
|
|||||||
g = Masc ;
|
g = Masc ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
---------------------------------------------
|
||||||
|
-- Proper noun
|
||||||
|
|
||||||
|
oper
|
||||||
|
LinPN : Type = {
|
||||||
|
s : Str ;
|
||||||
|
n : Number ; -- Proper nouns often have already an inherent number; you don't usually say "a Paris / many Parises"
|
||||||
|
g : Gender ; -- inherent gender/noun class, if your language has that
|
||||||
|
} ;
|
||||||
|
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
@@ -288,13 +221,13 @@ oper
|
|||||||
d : Definiteness ;
|
d : Definiteness ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
linNP : LinNP -> Str = \np -> np.s ! Nom ;
|
linNP : LinNP -> Str = \np -> np.s ! (CC Nom) ;
|
||||||
|
|
||||||
emptyNP : LinNP = {
|
emptyNP : LinNP = {
|
||||||
s = \\_ => [] ;
|
s = \\_ => [] ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
p = P3 ;
|
p = P3 ;
|
||||||
d = Indef ;
|
d = Indefinite ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
@@ -334,7 +267,7 @@ oper
|
|||||||
s = aon ;
|
s = aon ;
|
||||||
s2 = deug ;
|
s2 = deug ;
|
||||||
n = num ;
|
n = num ;
|
||||||
d = Indef ----
|
d = Indefinite -- TODO fix
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ lin
|
|||||||
|
|
||||||
-- : NP -> VP -> Cl
|
-- : NP -> VP -> Cl
|
||||||
PredVP np vp = {
|
PredVP np vp = {
|
||||||
subj = np.s ! Nom ;
|
subj = np.s ! CC Nom ;
|
||||||
pred =
|
pred =
|
||||||
-- table {something with tense+polarity =>
|
-- table {something with tense+polarity =>
|
||||||
vp.s ! TODOVF np.n np.p
|
vp.s ! TODOVF np.n np.p
|
||||||
|
|||||||
Reference in New Issue
Block a user