forked from GitHub/gf-rgl
yep the morpho sucks, but let's fix it in next commits
This commit is contained in:
@@ -55,8 +55,8 @@ concrete CatGla of Cat = CommonX ** open ResGla, Coordination, Prelude in {
|
|||||||
Det = ResGla.LinDet ; -- s : Str , n : Number
|
Det = ResGla.LinDet ; -- s : Str , n : Number
|
||||||
Predet = SS ;
|
Predet = SS ;
|
||||||
Quant = ResGla.LinQuant ; -- s : Number => Str
|
Quant = ResGla.LinQuant ; -- s : Number => Str
|
||||||
Num = ResGla.LinDet ;
|
Num = ResGla.LinNum ;
|
||||||
Card = ResGla.LinDet ;
|
Card = ResGla.LinNum ;
|
||||||
ACard = SS ;
|
ACard = SS ;
|
||||||
Ord = SS ;
|
Ord = SS ;
|
||||||
DAP = SS ;
|
DAP = SS ;
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ lin big_A = mkA "" ;
|
|||||||
lin bike_N = mkN "" ;
|
lin bike_N = mkN "" ;
|
||||||
lin bird_N = mkN "" ;
|
lin bird_N = mkN "" ;
|
||||||
lin bite_V2 = mkV2 "" ;
|
lin bite_V2 = mkV2 "" ;
|
||||||
lin black_A = mkA "" ; -}
|
lin black_A = mkA "" ;
|
||||||
lin blood_N = mkN "blood" ;
|
lin blood_N = mkN "" ;
|
||||||
{-lin blow_V = mkV "" ;
|
lin blow_V = mkV "" ;
|
||||||
lin blue_A = mkA "" ;
|
lin blue_A = mkA "" ;
|
||||||
lin boat_N = mkN "" ;
|
lin boat_N = mkN "" ;
|
||||||
lin bone_N = mkN "" ;
|
lin bone_N = mkN "" ;
|
||||||
@@ -195,11 +195,12 @@ lin know_V2 = mkV2 "" ;
|
|||||||
lin know_VQ = mkVQ (mkV "") ;
|
lin know_VQ = mkVQ (mkV "") ;
|
||||||
lin know_VS = mkV "" ;
|
lin know_VS = mkV "" ;
|
||||||
|
|
||||||
|
-}
|
||||||
----
|
----
|
||||||
-- L
|
-- L
|
||||||
|
|
||||||
lin lake_N = mkN "" ;
|
lin lake_N = smartN "loch" "locha" "lochan" Masc ;
|
||||||
|
{-
|
||||||
lin lamp_N = mkN "" ;
|
lin lamp_N = mkN "" ;
|
||||||
lin language_N = mkN "" ;
|
lin language_N = mkN "" ;
|
||||||
lin laugh_V = mkV "" ;
|
lin laugh_V = mkV "" ;
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
|
|||||||
|
|
||||||
-- : Det -> CN -> NP
|
-- : Det -> CN -> NP
|
||||||
DetCN det cn = emptyNP ** {
|
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 ;
|
-- : PN -> NP ;
|
||||||
@@ -53,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 = linCN cn
|
s = cn.s ! Sg ! Indef
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
|
|||||||
-- : Quant -> Num -> Det ;
|
-- : Quant -> Num -> Det ;
|
||||||
DetQuant quant num = quant ** {
|
DetQuant quant num = quant ** {
|
||||||
s = quant.s ! num.n ++ num.s ;
|
s = quant.s ! num.n ++ num.s ;
|
||||||
|
s2 = "DUMMY" ; -- "teen" from numbers like seventeen
|
||||||
n = num.n ;
|
n = num.n ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -121,10 +123,10 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
|
|||||||
-}
|
-}
|
||||||
|
|
||||||
-- : Quant
|
-- : Quant
|
||||||
DefArt = mkQuant "the" "the" ;
|
DefArt = mkQuant "an" "nan" Def ;
|
||||||
|
|
||||||
-- : Quant
|
-- : Quant
|
||||||
IndefArt = mkQuant "a" [] ;
|
IndefArt = mkQuant [] [] Indef ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
-- : Pron -> Quant -- my
|
-- : Pron -> Quant -- my
|
||||||
@@ -136,7 +138,7 @@ concrete NounGla of Noun = CatGla ** open ResGla, Prelude in {
|
|||||||
--2 Common nouns
|
--2 Common nouns
|
||||||
|
|
||||||
-- : N -> CN
|
-- : N -> CN
|
||||||
UseN n = n ;
|
UseN = useN ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
-- : N2 -> CN ;
|
-- : N2 -> CN ;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
concrete NumeralGla of Numeral = CatGla [Numeral,Digits] **
|
concrete NumeralGla of Numeral = CatGla [Numeral,Digits] **
|
||||||
open Prelude, ResGla in {
|
open Prelude, ResGla in {
|
||||||
|
{-
|
||||||
lincat
|
lincat
|
||||||
Digit = LinNumeral ; -- 2..9
|
Digit = LinNumeral ; -- 2..9
|
||||||
Sub10, -- 1..9
|
Sub10, -- 1..9
|
||||||
@@ -112,4 +112,6 @@ concrete NumeralGla of Numeral = CatGla [Numeral,Digits] **
|
|||||||
} ;
|
} ;
|
||||||
n = Pl ; -- TODO: handle number 1
|
n = Pl ; -- TODO: handle number 1
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,7 +117,7 @@ oper
|
|||||||
-- https://inariksit.github.io/gf/2018/05/25/subtyping-gf.html#lock-fields
|
-- https://inariksit.github.io/gf/2018/05/25/subtyping-gf.html#lock-fields
|
||||||
|
|
||||||
mkN = overload {
|
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
|
-- TODO: more overload instances
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,21 @@ oper
|
|||||||
g : Gender
|
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 = {
|
LinPN : Type = {
|
||||||
s : Str ;
|
s : Str ;
|
||||||
n : Number ; -- Proper nouns often have already an inherent number; you don't usually say "a Paris / many Parises"
|
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)'
|
s, -- quantifier in a context, e.g. 'this (cat) (is nice)'
|
||||||
sp -- quantifier as standalone, e.g. 'this (is nice)'
|
sp -- quantifier as standalone, e.g. 'this (is nice)'
|
||||||
: Number => Str ;
|
: Number => Str ;
|
||||||
|
d : Definiteness ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
LinDet : Type = {
|
LinDet : Type = {
|
||||||
s,s2 : Str ;
|
s,s2 : Str ;
|
||||||
n : Number ;
|
n : Number ;
|
||||||
|
d : Definiteness ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
LinNum : Type = {
|
||||||
|
s : Str ;
|
||||||
|
n : Number ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Can you reuse your mkNoun? Do nouns and quantifiers inflect the same way?
|
-- 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,
|
s,
|
||||||
sp = table {
|
sp = table {
|
||||||
Sg => this ;
|
Sg => this ;
|
||||||
_ => these } ;
|
_ => these } ;
|
||||||
|
d = d ;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkDet : (seven, teen : Str) -> Number -> LinDet = \aon, deug, num -> {
|
mkDet : (seven, teen : Str) -> Number -> LinDet = \aon, deug, num -> {
|
||||||
s = aon ;
|
s = aon ;
|
||||||
s2 = deug ;
|
s2 = deug ;
|
||||||
n = num
|
n = num ;
|
||||||
|
d = Indef ----
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ lin
|
|||||||
|
|
||||||
-- : NP -> VP -> Cl
|
-- : NP -> VP -> Cl
|
||||||
PredVP np vp = {
|
PredVP np vp = {
|
||||||
subj = np.s ; -- ! Nom, if there are cases
|
subj = np.s ! 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