yep the morpho sucks, but let's fix it in next commits

This commit is contained in:
Inari Listenmaa
2025-08-20 15:35:56 +02:00
parent c9c1723090
commit 4b78bd6c67
7 changed files with 47 additions and 18 deletions

View File

@@ -55,8 +55,8 @@ concrete CatGla of Cat = CommonX ** open ResGla, Coordination, Prelude in {
Det = ResGla.LinDet ; -- s : Str , n : Number
Predet = SS ;
Quant = ResGla.LinQuant ; -- s : Number => Str
Num = ResGla.LinDet ;
Card = ResGla.LinDet ;
Num = ResGla.LinNum ;
Card = ResGla.LinNum ;
ACard = SS ;
Ord = SS ;
DAP = SS ;

View File

@@ -33,9 +33,9 @@ lin big_A = mkA "" ;
lin bike_N = mkN "" ;
lin bird_N = mkN "" ;
lin bite_V2 = mkV2 "" ;
lin black_A = mkA "" ; -}
lin blood_N = mkN "blood" ;
{-lin blow_V = mkV "" ;
lin black_A = mkA "" ;
lin blood_N = mkN "" ;
lin blow_V = mkV "" ;
lin blue_A = mkA "" ;
lin boat_N = mkN "" ;
lin bone_N = mkN "" ;
@@ -195,11 +195,12 @@ lin know_V2 = mkV2 "" ;
lin know_VQ = mkVQ (mkV "") ;
lin know_VS = mkV "" ;
-}
----
-- L
lin lake_N = mkN "" ;
lin lake_N = smartN "loch" "locha" "lochan" Masc ;
{-
lin lamp_N = mkN "" ;
lin language_N = mkN "" ;
lin laugh_V = mkV "" ;

View File

@@ -8,7 +8,8 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
-- : Det -> CN -> NP
DetCN det cn = emptyNP ** {
s = det.s ++ cn.s ! det.n
s = \\c => det.s ++ cn.s ! det.n ! det.d ! c ;
d = det.d
} ;
{-
-- : PN -> NP ;
@@ -53,7 +54,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
-}
-- MassNP : CN -> NP ;
MassNP cn = emptyNP ** {
s = linCN cn
s = cn.s ! Sg ! Indef
} ;
@@ -65,6 +66,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
-- : Quant -> Num -> Det ;
DetQuant quant num = quant ** {
s = quant.s ! num.n ++ num.s ;
s2 = "DUMMY" ; -- "teen" from numbers like seventeen
n = num.n ;
} ;
@@ -121,10 +123,10 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
-}
-- : Quant
DefArt = mkQuant "the" "the" ;
DefArt = mkQuant "an" "nan" Def ;
-- : Quant
IndefArt = mkQuant "a" [] ;
IndefArt = mkQuant [] [] Indef ;
{-
-- : Pron -> Quant -- my
@@ -136,7 +138,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
--2 Common nouns
-- : N -> CN
UseN n = n ;
UseN = useN ;
{-
-- : N2 -> CN ;

View File

@@ -1,6 +1,6 @@
concrete NumeralGla of Numeral = CatGla [Numeral,Digits] **
open Prelude, ResGla in {
{-
lincat
Digit = LinNumeral ; -- 2..9
Sub10, -- 1..9
@@ -112,4 +112,6 @@ concrete NumeralGla of Numeral = CatGla [Numeral,Digits] **
} ;
n = Pl ; -- TODO: handle number 1
} ;
-}
}

View File

@@ -117,7 +117,7 @@ oper
-- https://inariksit.github.io/gf/2018/05/25/subtyping-gf.html#lock-fields
mkN = overload {
mkN : Str -> N = \s -> lin N (ResGla.mkNoun s) ;
mkN : Str -> N = \s -> lin N (ResGla.smartN s (s+"a") (s+"an") Masc) ;
-- TODO: more overload instances
} ;

View File

@@ -51,6 +51,21 @@ oper
g : Gender
} ;
smartN = overload {
smartN : (nom,gen,pl : Str) -> Gender -> LinN = \loch,locha,lochan,g -> {
base,
lenited,
palatalised,
lenited_palatalised,
suffixE = loch ;
lenited_suffixA = lochan ;
suffixAn = lochan ;
g = g
}
-- ;
-- smartN : (…,…,…,… : Str)
} ;
{-
@@ -123,7 +138,7 @@ 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"
@@ -299,25 +314,34 @@ oper
s, -- quantifier in a context, e.g. 'this (cat) (is nice)'
sp -- quantifier as standalone, e.g. 'this (is nice)'
: Number => Str ;
d : Definiteness ;
} ;
LinDet : Type = {
s,s2 : Str ;
n : Number ;
d : Definiteness ;
} ;
LinNum : Type = {
s : Str ;
n : Number ;
} ;
-- Can you reuse your mkNoun? Do nouns and quantifiers inflect the same way?
mkQuant : Str -> Str -> LinQuant = \this, these -> {
mkQuant : Str -> Str -> Definiteness -> LinQuant = \this,these,d -> {
s,
sp = table {
Sg => this ;
_ => these } ;
d = d ;
};
mkDet : (seven, teen : Str) -> Number -> LinDet = \aon, deug, num -> {
s = aon ;
s2 = deug ;
n = num
n = num ;
d = Indef ----
} ;
--------------------------------------------------------------------------------

View File

@@ -10,7 +10,7 @@ lin
-- : NP -> VP -> Cl
PredVP np vp = {
subj = np.s ; -- ! Nom, if there are cases
subj = np.s ! Nom ;
pred =
-- table {something with tense+polarity =>
vp.s ! TODOVF np.n np.p