1
0
forked from GitHub/gf-rgl

li in PredVP

This commit is contained in:
2026-04-04 19:47:02 -06:00
parent d2568cf869
commit eccbdcfb97
12 changed files with 281 additions and 125 deletions

View File

@@ -1,3 +1,4 @@
--# -path=.:../abstract:../common:../prelude
concrete CatTok of Cat = CommonX ** open ResTok, Coordination, Prelude in {
flags optimize=all_subs ;
@@ -51,7 +52,8 @@ concrete CatTok of Cat = CommonX ** open ResTok, Coordination, Prelude in {
CN = ResTok.LinCN ;
NP = ResTok.LinNP ;
Pron = SS ; -- NB. Pronouns need enough info to become NP or Quant.
-- NB. Pronouns need enough info to become NP or Quant.
Pron = ResTok.LinPron ;
Det = ResTok.LinDet ; -- s : Str , n : Number
Predet = SS ;
Quant = ResTok.LinQuant ; -- s : Number => Str
@@ -68,14 +70,12 @@ concrete CatTok of Cat = CommonX ** open ResTok, Coordination, Prelude in {
Numeral = ResTok.LinNumeral ;
Digits = ResTok.LinNumeral ;
Decimal = SS ;
--2 Structural words
-- Constructed in StructuralTok.
Conj = Coordination.ConjunctionDistr ** {
-- n : Number -- The number of the NP that results from
-- coordinating a list of NPs with that Conj.
} ; -- "[Ann and Bob] are children" → and_Conj.n = Pl
Conj = Coordination.ConjunctionDistr ;
Subj = SS ;
Prep = SS ;

View File

@@ -10,7 +10,7 @@ concrete LexiconTok of Lexicon = CatTok **
-- lin already_Adv = mkA "" ;
lin animal_N = mkN "soweli" ;
-- lin answer_V2S = mkV2S (mkV "") ;
lin apartment_N = mkN "taso" ;
lin apartment_N = mkN "tomo" ;
-- lin apple_N = mkN "" ;
-- lin art_N = mkN "" ;
-- lin ashes_N = mkN "" ;
@@ -153,7 +153,7 @@ lin dog_N = mkN "soweli" ;
-- lin glove_N = mkN "" ;
-- lin go_V = mkV "" ;
-- lin gold_N = mkN "" ;
-- lin good_A = mkA "" ;
-- lin good_A = mkA "pona" ;
-- lin grammar_N = mkN "" ;
-- lin grass_N = mkN "" ;
-- lin green_A = mkA "" ;
@@ -202,7 +202,7 @@ lin dog_N = mkN "soweli" ;
-- lin lake_N = mkN "" ;
-- lin lamp_N = mkN "" ;
-- lin language_N = mkN "" ;
lin language_N = mkN "toki" ;
-- lin laugh_V = mkV "" ;
-- lin leaf_N = mkN "" ;
-- lin learn_V2 = mkV2 "" ;
@@ -217,8 +217,8 @@ lin dog_N = mkN "soweli" ;
-- lin long_A = mkA "" ;
-- lin lose_V2 = mkV2 "" ;
-- lin louse_N = mkN "" ;
-- lin love_N = mkN "" ;
-- lin love_V2 = mkV2 "" ;
lin love_N = mkN "olin" ;
-- lin love_V2 = mkV2 "olin" ;
----
-- M
@@ -281,7 +281,7 @@ lin play_V = mkV "musi" ;
-- lin read_V2 = mkV2 "" ;
-- lin ready_A = mkA "" ;
-- lin reason_N = mkN "" ;
-- lin red_A = mkA "loje" ;
lin red_A = mkA "loje" ;
-- lin religion_N = mkN "" ;
-- lin restaurant_N = mkN "" ;
-- lin river_N = mkN "" ;

View File

@@ -11,15 +11,15 @@ concrete NounTok of Noun = CatTok ** open ResTok, Prelude in {
DetCN det cn = emptyNP ** {
s = cn.s ++ det.s
} ;
{-
-- : PN -> NP ;
-- Assuming that lincat PN = lincat NP
UsePN pn = pn ;
-- UsePN pn = pn ;
-- : Pron -> NP ;
-- Assuming that lincat Pron = lincat NP
UsePron pron = pron ;
{-
-- : Predet -> NP -> NP ; -- only the man
PredetNP predet np =

View File

@@ -121,16 +121,16 @@ oper
-- TODO: more overload instances
} ;
{-
mkPN = overload {
mkPN : Str -> PN =
mkPN : Str -> PN = \s -> ss s ;
} ;
--2 Adjectives
mkA = overload {
mkA : Str -> A = \s ->
mkA : Str -> A = \s -> ss s
} ;
{-
mkA2 = overload {
mkA2 : Str -> A2 = \s -> …

View File

@@ -1,3 +1,4 @@
--# -path=.:../abstract:../common:../prelude
resource ResTok = open Prelude, Predef in {
--------------------------------------------------------------------------------
@@ -51,6 +52,8 @@ https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#my-naming-scheme-for-l
param
Person = P1 | P2 | P3 ;
LiSubject = MiSina | NotMiSina ;
oper
LinN : Type = {s : Str ;} ;
@@ -111,13 +114,18 @@ oper
LinPron : Type = {
s : Str ;
p : Person ;
li : LiSubject ;
-- Alternative to the `n` and `p` fields:
-- a : Agr -- sketched above, lines 97-103
} ;
mkPron : (_ : Str) -> Person -> LinPron = \str,per -> {
s = str ;
p = per
p = per ;
li = case str of {
"mi"|"sina" => MiSina ;
_ => NotMiSina
} ;
} ;
---------------------------------------------
@@ -135,6 +143,8 @@ That's why I'm copying over the definition below, instead of the neater `LinNP :
LinNP : Type = {
s : Str ;
p : Person ;
li : LiSubject ;
-- Alternative to the `n` and `p` fields:
-- a : Agr -- sketched on lines 97-101
} ;
@@ -144,6 +154,7 @@ That's why I'm copying over the definition below, instead of the neater `LinNP :
emptyNP : LinNP = { -- Change when you change LinNP
s = [] ;
p = P3 ;
li = NotMiSina
} ;
--------------------------------------------------------------------------------
@@ -235,6 +246,11 @@ oper
pred : Str ; -- TODO: depend on Temp and Pol
} ;
-- linCl : LinCl -> Str = \cl -> case cl.subj of {
-- "mi"|"sina" => cl.subj ++ cl.pred ;
-- _ => cl.subj ++ "li" ++ cl.pred
-- } ;
linCl : LinCl -> Str = \cl -> cl.subj ++ cl.pred ;
}

View File

@@ -11,12 +11,10 @@ lin
-- : NP -> VP -> Cl
PredVP np vp = {
subj = np.s ; -- ! Nom, if there are cases
pred =
-- table {something with tense+polarity =>
vp.s
-- TODO: all of the VP's tense and polarity should be open here!
-- PredVP only decides the subject.
-- }
pred = case np.li of {
MiSina => vp.s ;
NotMiSina => "li" ++ vp.s
} ;
} ;
{-

View File

@@ -3,39 +3,39 @@ concrete StructuralTok of Structural = CatTok **
-------
-- Ad*
{-
lin almost_AdA =
lin almost_AdN =
lin at_least_AdN =
lin at_most_AdN =
lin so_AdA =
lin too_AdA =
lin very_AdA =
lin as_CAdv =
lin less_CAdv =
lin more_CAdv =
-- lin almost_AdA =
-- lin almost_AdN =
-- lin at_least_AdN =
-- lin at_most_AdN =
-- lin so_AdA =
-- lin too_AdA =
-- lin very_AdA =
lin how8much_IAdv =
lin when_IAdv =
-- lin as_CAdv =
-- lin less_CAdv =
-- lin more_CAdv =
lin how_IAdv =
lin where_IAdv =
lin why_IAdv =
-- lin how8much_IAdv =
-- lin when_IAdv =
lin always_AdV = ss "" ;
-- lin how_IAdv =
-- lin where_IAdv =
-- lin why_IAdv =
-- lin always_AdV = ss "" ;
-- lin everywhere_Adv = ss "" ;
-- lin here7from_Adv = ss "" ;
-- lin here7to_Adv = ss "" ;
-- lin here_Adv = ss "" ;
-- lin quite_Adv = ss "" ;
-- lin somewhere_Adv = ss "" ;
-- lin there7from_Adv = ss "" ;
-- lin there7to_Adv = ss "" ;
-- lin there_Adv = ss "" ;
lin everywhere_Adv = ss "" ;
lin here7from_Adv = ss "" ;
lin here7to_Adv = ss "" ;
lin here_Adv = ss "" ;
lin quite_Adv = ss "" ;
lin somewhere_Adv = ss "" ;
lin there7from_Adv = ss "" ;
lin there7to_Adv = ss "" ;
lin there_Adv = ss "" ;
-}
-------
-- Conj
@@ -43,10 +43,10 @@ lin there_Adv = ss "" ;
-- which means that there are two fields for the strings, and
-- n:Number which specifies the number of the resulting NP.
lin and_Conj = {s1 = [] ; s2 = "and" } ;
-- lin and_Conj = {s1 = [] ; s2 = "and" } ;
-- lin or_Conj =
-- lin if_then_Conj =
lin both7and_DConj = {s1 = "both" ; s2 = "and" } ;
-- lin both7and_DConj = {s1 = "both" ; s2 = "and" } ;
-- lin either7or_DConj =
-- lin but_PConj =
@@ -56,116 +56,116 @@ lin both7and_DConj = {s1 = "both" ; s2 = "and" } ;
-----------------
-- *Det and Quant
{-
lin how8many_IDet =
lin every_Det =
lin all_Predet = {s = ""} ;
lin not_Predet = { s = "" } ;
lin only_Predet = { s = "" } ;
lin most_Predet = {s = ""} ;
-- lin how8many_IDet =
-- lin every_Det =
lin few_Det = R.indefDet "" pl ;
lin many_Det = R.indefDet "" pl ;
lin much_Det = R.indefDet "" sg ;
-- lin all_Predet = {s = ""} ;
-- lin not_Predet = { s = "" } ;
-- lin only_Predet = { s = "" } ;
-- lin most_Predet = {s = ""} ;
lin somePl_Det =
lin someSg_Det =
-- lin few_Det = R.indefDet "" pl ;
-- lin many_Det = R.indefDet "" pl ;
-- lin much_Det = R.indefDet "" sg ;
lin no_Quant =
lin that_Quant = mkQuant "" ;
lin this_Quant = mkQuant "" ;
lin which_IQuant = mkQuant "" ;
-- lin somePl_Det =
-- lin someSg_Det =
-- lin no_Quant =
-- lin that_Quant = mkQuant "" ;
-- lin this_Quant = mkQuant "" ;
-- lin which_IQuant = mkQuant "" ;
-----
-- NP
lin somebody_NP =
-- lin somebody_NP =
lin everybody_NP =
lin everything_NP =
lin nobody_NP =
lin nothing_NP =
lin somebody_NP =
lin something_NP =
-- lin everybody_NP =
-- lin everything_NP =
-- lin nobody_NP =
-- lin nothing_NP =
-- lin somebody_NP =
-- lin something_NP =
-------
-- Prep
lin above_Prep = mkPrep "" ;
lin after_Prep = mkPrep "" ;
lin before_Prep = mkPrep "" ;
lin behind_Prep = mkPrep "" ;
lin between_Prep = = mkPrep "" ;
lin by8agent_Prep = mkPrep "" ;
lin by8means_Prep = mkPrep "" ;
lin during_Prep = mkPrep "" ;
lin except_Prep = mkPrep "" ;
lin for_Prep = mkPrep "" ;
lin from_Prep = mkPrep "" ;
lin in8front_Prep = mkPrep "" ;
lin in_Prep = mkPrep "" ;
lin on_Prep = mkPrep "" ;
lin part_Prep = mkPrep ;
lin possess_Prep = mkPrep "" ;
lin through_Prep = mkPrep "" ;
lin to_Prep = mkPrep "k" ;
lin under_Prep = mkPrep "" ;
lin with_Prep = mkPrep "" ;
lin without_Prep = mkPrep "" ;
-- lin above_Prep = mkPrep "" ;
-- lin after_Prep = mkPrep "" ;
-- lin before_Prep = mkPrep "" ;
-- lin behind_Prep = mkPrep "" ;
-- lin between_Prep = = mkPrep "" ;
-- lin by8agent_Prep = mkPrep "" ;
-- lin by8means_Prep = mkPrep "" ;
-- lin during_Prep = mkPrep "" ;
-- lin except_Prep = mkPrep "" ;
-- lin for_Prep = mkPrep "" ;
-- lin from_Prep = mkPrep "" ;
-- lin in8front_Prep = mkPrep "" ;
-- lin in_Prep = mkPrep "" ;
-- lin on_Prep = mkPrep "" ;
-- lin part_Prep = mkPrep ;
-- lin possess_Prep = mkPrep "" ;
-- lin through_Prep = mkPrep "" ;
-- lin to_Prep = mkPrep "k" ;
-- lin under_Prep = mkPrep "" ;
-- lin with_Prep = mkPrep "" ;
-- lin without_Prep = mkPrep "" ;
-------
-- Pron
-- Pronouns are closed class, no constructor in ParadigmsTok.
lin it_Pron =
lin i_Pron =
lin youPol_Pron =
lin youSg_Pron =
lin he_Pron =
lin she_Pron =
lin we_Pron =
lin youPl_Pron =
lin they_Pron =
-- lin it_Pron =
lin i_Pron = mkPron "mi" P1 ;
-- lin youPol_Pron =
lin youSg_Pron = mkPron "sina" P2 ;
-- lin he_Pron =
-- lin she_Pron =
lin we_Pron = mkPron "mi" P1 ;
lin youPl_Pron = mkPron "sina" P2 ;
-- lin they_Pron =
lin whatPl_IP =
lin whatSg_IP =
lin whoPl_IP =
lin whoSg_IP =
-- lin whatPl_IP =
-- lin whatSg_IP =
-- lin whoPl_IP =
-- lin whoSg_IP =
-------
-- Subj
lin although_Subj =
lin because_Subj =
lin if_Subj =
lin that_Subj =
lin when_Subj =
-- lin although_Subj =
-- lin because_Subj =
-- lin if_Subj =
-- lin that_Subj =
-- lin when_Subj =
------
-- Utt
lin language_title_Utt = ss "" ;
lin no_Utt = ss "" ;
lin yes_Utt = ss "" ;
-- lin language_title_Utt = ss "" ;
-- lin no_Utt = ss "" ;
-- lin yes_Utt = ss "" ;
-------
-- Verb
lin have_V2 =
-- lin have_V2 =
lin can8know_VV = -- can (capacity)
lin can_VV = -- can (possibility)
lin must_VV =
lin want_VV =
-- lin can8know_VV = -- can (capacity)
-- lin can_VV = -- can (possibility)
-- lin must_VV =
-- lin want_VV =
------
-- Voc
lin please_Voc = ss "" ;
-}
-- lin please_Voc = ss "" ;
}