From 2d429489bb3cf70384548a231357ef9fd0ab8840 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 23 May 2023 10:19:10 +0200 Subject: [PATCH 01/17] (Chi) add ByVP --- src/chinese/ExtendChi.gf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chinese/ExtendChi.gf b/src/chinese/ExtendChi.gf index dfcabd299..a0aa933ff 100644 --- a/src/chinese/ExtendChi.gf +++ b/src/chinese/ExtendChi.gf @@ -11,7 +11,7 @@ concrete ExtendChi of Extend = CatChi ** , MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2 , ProDrop, ComplDirectVS, ComplDirectVQ , PassVPSlash, PassAgentVPSlash - , GerundAdv, GerundNP ] + , GerundAdv, GerundNP, ByVP ] with (Grammar=GrammarChi) ** open Prelude , Coordination @@ -68,6 +68,10 @@ concrete ExtendChi of Extend = CatChi ** GerundAdv vp = mkAdv (infVP vp) ; GerundNP vp = ResChi.mkNP (infVP vp) ; + ByVP vp = + let adv : Adv = GerundAdv vp + in adv ** {s = adv.s ++ "来" ; advType = ATTime} ; + GenNP np = {s,pl = np.s ++ possessive_s ; detType = DTPoss} ; GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ; From 760210c2197b9ad4a9d0e1533666b78507b1586d Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 23 May 2023 10:19:53 +0200 Subject: [PATCH 02/17] (May) add ByVP --- src/malay/ExtendMay.gf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/malay/ExtendMay.gf b/src/malay/ExtendMay.gf index 85fec8244..da91b944b 100644 --- a/src/malay/ExtendMay.gf +++ b/src/malay/ExtendMay.gf @@ -17,6 +17,7 @@ concrete ExtendMay of Extend = CatMay ,GenModNP, GenNP, GenRP ,CompoundN ,GerundNP, GerundAdv + ,ByVP -- VPS2 ; -- have loved (binary version of VPS) @@ -97,6 +98,7 @@ concrete ExtendMay of Extend = CatMay GerundAdv vp = ss (linVP vp) ; + ByVP vp = cc2 by8means_Prep (GerundAdv vp) ; -- MkVPS2 : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved -- ConjVPS2 : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates From ccdb58de21915f20a379c4e42bae56955cc1d0f2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 25 May 2023 11:23:45 +0200 Subject: [PATCH 03/17] (Chi) add de after RelVPS --- src/chinese/ExtendChi.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chinese/ExtendChi.gf b/src/chinese/ExtendChi.gf index a0aa933ff..48b9080dd 100644 --- a/src/chinese/ExtendChi.gf +++ b/src/chinese/ExtendChi.gf @@ -44,7 +44,7 @@ concrete ExtendChi of Extend = CatChi ** -- QuestVPS ip vps = -- TODO: probably need to change structure of VPS -- : RP -> VPS -> RS ; -- which won't sleep - RelVPS rp vps = {s = rp.s ! True ++ vps.s} ; + RelVPS rp vps = {s = rp.s ! True ++ vps.s ++ "的"} ; MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; ConjVPI c = conjunctDistrSS (c.s ! CSent) ; From ed61647f867db75e8a889cbd73382b6f5ae069df Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 25 May 2023 11:27:37 +0200 Subject: [PATCH 04/17] (Chi) Fix word order in RelNP All the other changes are those needed due to changes in lincat of NP. --- src/chinese/AdjectiveChi.gf | 6 ++--- src/chinese/AdverbChi.gf | 4 +-- src/chinese/CatChi.gf | 6 +++-- src/chinese/ConjunctionChi.gf | 9 ++++--- src/chinese/ConstructionChi.gf | 18 ++++++------- src/chinese/ExtendChi.gf | 8 +++--- src/chinese/ExtraChi.gf | 6 ++--- src/chinese/IdiomChi.gf | 6 ++--- src/chinese/NounChi.gf | 49 +++++++++++++++++++--------------- src/chinese/ParadigmsChi.gf | 2 +- src/chinese/PhraseChi.gf | 4 +-- src/chinese/QuestionChi.gf | 4 +-- src/chinese/RelativeChi.gf | 2 +- src/chinese/ResChi.gf | 16 ++++++----- src/chinese/SentenceChi.gf | 6 ++--- src/chinese/StructuralChi.gf | 12 ++++----- src/chinese/SymbolChi.gf | 6 ++--- src/chinese/VerbChi.gf | 32 +++++++++++----------- 18 files changed, 104 insertions(+), 92 deletions(-) diff --git a/src/chinese/AdjectiveChi.gf b/src/chinese/AdjectiveChi.gf index ab17134ac..2db334292 100644 --- a/src/chinese/AdjectiveChi.gf +++ b/src/chinese/AdjectiveChi.gf @@ -5,7 +5,7 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in { PositA a = a ** {hasAdA = False} ; ComparA a np = a ** { - s = table {_=> than_s ++ np.s ++ a.s!Attr}; + s = table {_=> than_s ++ linNP np ++ a.s!Attr}; hasAdA = False }; @@ -26,11 +26,11 @@ concrete AdjectiveChi of Adjective = CatChi ** open ResChi, Prelude in { }; CAdvAP ad ap np = ap ** { - s = table {adjPlace => ad.s ++ np.s ++ ad.p ++ ap.s!adjPlace} + s = table {adjPlace => ad.s ++ linNP np ++ ad.p ++ ap.s!adjPlace} }; ComplA2 a np = a ** { - s= table { adjPlace => appPrep a.c2 np.s ++ a.s!adjPlace}; + s= table { adjPlace => appPrep a.c2 (linNP np) ++ a.s!adjPlace}; hasAdA = False }; diff --git a/src/chinese/AdverbChi.gf b/src/chinese/AdverbChi.gf index 206b14d57..575220566 100644 --- a/src/chinese/AdverbChi.gf +++ b/src/chinese/AdverbChi.gf @@ -4,9 +4,9 @@ concrete AdverbChi of Adverb = CatChi ** lin PositAdvAdj a = {s = a.s!Attr ++ "地" ; advType = ATManner ; hasDe = False} ; ---- for all adjs? - PrepNP prep np = ss (appPrep prep np.s) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ? + PrepNP prep np = ss (appPrep prep (linNP np)) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ? - ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ np.s) ** {advType = ATManner ; hasDe = False} ; + ComparAdvAdj cadv a np = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ (linNP np)) ** {advType = ATManner ; hasDe = False} ; ComparAdvAdjS cadv a s = ss (a.s!Attr ++ cadv.s ++ cadv.p ++ linS s) ** {advType = ATManner ; hasDe = False} ; diff --git a/src/chinese/CatChi.gf b/src/chinese/CatChi.gf index ff9966430..86360be10 100644 --- a/src/chinese/CatChi.gf +++ b/src/chinese/CatChi.gf @@ -43,7 +43,8 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu -- Noun CN = ResChi.Noun ; - NP, Pron = ResChi.NP ; + NP = ResChi.NP ; + Pron = SS ; Det = Determiner ; Quant = Determiner ** {pl : Str} ; Predet = {s : Str} ; ---- @@ -79,7 +80,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu N = ResChi.Noun ; N2 = ResChi.Noun ** {c2 : Preposition} ; N3 = ResChi.Noun ** {c2,c3 : Preposition} ; - GN, SN, PN = ResChi.NP ; + GN, SN, PN = SS ; -- overridden @@ -91,4 +92,5 @@ linref S = linS ; Prep = linPrep ; VP = infVP ; + NP = \np -> np.det ++ np.s ; } diff --git a/src/chinese/ConjunctionChi.gf b/src/chinese/ConjunctionChi.gf index 2dc17731e..1c413f527 100644 --- a/src/chinese/ConjunctionChi.gf +++ b/src/chinese/ConjunctionChi.gf @@ -11,7 +11,7 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin postJiu = ss.postJiu} } ; ConjAdv c as = conjunctDistrSS (c.s ! CSent) as ** {advType = as.advType ; hasDe = as.hasDe} ; ---- ?? - ConjNP c = conjunctDistrSS (c.s ! CPhr CNPhrase) ; + ConjNP c nps = conjunctDistrSS (c.s ! CPhr CNPhrase) nps ** {det = []} ; ConjAP c as = conjunctDistrTable AdjPlace (c.s ! CPhr CAPhrase) as ** {monoSyl = notB as.monoSyl ; hasAdA = True} ; ---- add de iff as doesn't ConjRS c = conjunctDistrSS (c.s ! CSent) ; ConjCN c ns = conjunctDistrSS (c.s ! CPhr CNPhrase) ns ** {c = ns.c} ; @@ -28,8 +28,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin BaseAdv x y = twoSS x y ** {advType = x.advType ; hasDe = y.hasDe} ; ---- ?? ConsAdv x xs = consrSS duncomma x xs ** {advType = x.advType ; hasDe = xs.hasDe} ; ---- ?? - BaseNP = twoSS ; - ConsNP = consrSS duncomma ; + BaseNP np1 np2 = twoSS (mergeNP np1) (mergeNP np2) ; + ConsNP np nps = consrSS duncomma (mergeNP np) nps ; BaseAP x y = twoTable AdjPlace x y ** {monoSyl = y.monoSyl} ; ConsAP x xs = consrTable AdjPlace duncomma x xs ** {monoSyl = xs.monoSyl} ; BaseRS = twoSS ; @@ -46,5 +46,8 @@ concrete ConjunctionChi of Conjunction = CatChi ** open ResChi, Prelude, Coordin [RS] = {s1,s2 : Str} ; [CN] = {s1,s2 : Str ; c : Str} ; + oper + mergeNP : ResChi.NP -> SS = \np -> ss (linNP np) ; + } diff --git a/src/chinese/ConstructionChi.gf b/src/chinese/ConstructionChi.gf index c6032b857..5eda5b5a0 100644 --- a/src/chinese/ConstructionChi.gf +++ b/src/chinese/ConstructionChi.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract -concrete ConstructionChi of Construction = CatChi ** +concrete ConstructionChi of Construction = CatChi ** open SyntaxChi, ParadigmsChi, (L = LexiconChi), (E = ExtraChi), (G = GrammarChi), (R = ResChi), Prelude in { flags coding=utf8 ; @@ -24,9 +24,9 @@ lin -- some more things weather_adjCl ap = mkCl (mkVP (lin AP ap)) ; - - is_right_VP = mkVP (ParadigmsChi.mkA "对") ; - is_wrong_VP = mkVP (ParadigmsChi.mkA "错") ; + + is_right_VP = mkVP (ParadigmsChi.mkA "对") ; + is_wrong_VP = mkVP (ParadigmsChi.mkA "错") ; n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP (lin CN cn)))) (lin A a) ; ---- @@ -47,8 +47,8 @@ lin monthYearAdv m y = lin Adv {s = y.s ++ "年" ++ m.s ; advType = timeAdvType ; hasDe = False} ; dayMonthYearAdv d m y = lin Adv {s = y.s ++ "年" ++ m.s ++ d.s ++ "日" ; advType = timeAdvType ; hasDe = False} ; - intYear i = lin NP i ; - intMonthday i = lin NP i ; + intYear i = lin NP (R.mkNP i.s) ; + intMonthday i = lin NP (R.mkNP i.s) ; lincat Language = N ; @@ -74,9 +74,9 @@ lin friday_Weekday = mkN "星期五" ; lin saturday_Weekday = mkN "星期六" ; lin sunday_Weekday = mkN "星期日" ; -lin january_Month = mkN "一月" ; -lin february_Month = mkN "二月" ; -lin march_Month = mkN "三月" ; +lin january_Month = mkN "一月" ; +lin february_Month = mkN "二月" ; +lin march_Month = mkN "三月" ; lin april_Month = mkN "四月" ; lin may_Month = mkN "五月" ; lin june_Month = mkN "六月" ; diff --git a/src/chinese/ExtendChi.gf b/src/chinese/ExtendChi.gf index 48b9080dd..e88b0944a 100644 --- a/src/chinese/ExtendChi.gf +++ b/src/chinese/ExtendChi.gf @@ -27,7 +27,7 @@ concrete ExtendChi of Extend = CatChi ** lin PassVPSlash vps = insertAdv (mkNP passive_s) vps ; - PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep np.s)) (insertAdv (mkNP passive_s) vps) ; + PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep (linNP np))) (insertAdv (mkNP passive_s) vps) ; MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ; ConjVPS c = conjunctDistrSS (c.s ! CSent) ; @@ -35,10 +35,10 @@ concrete ExtendChi of Extend = CatChi ** ConsVPS = consrSS duncomma ; -- : NP -> VPS -> S ; -- she [has walked and won't sleep] - PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ; + PredVPS np vps = {preJiu = (linNP np) ; postJiu = vps.s} ; -- : NP -> VPS -> QS ; -- has she walked - SQuestVPS np vps = {s = \\_ => np.s ++ vps.s ++ question_s} ; + SQuestVPS np vps = {s = \\_ => linNP np ++ vps.s ++ question_s} ; -- : IP -> VPS -> QS ; -- who has walked -- QuestVPS ip vps = -- TODO: probably need to change structure of VPS @@ -72,7 +72,7 @@ concrete ExtendChi of Extend = CatChi ** let adv : Adv = GerundAdv vp in adv ** {s = adv.s ++ "来" ; advType = ATTime} ; - GenNP np = {s,pl = np.s ++ possessive_s ; detType = DTPoss} ; + GenNP np = {s,pl = linNP np ++ possessive_s ; detType = DTPoss} ; GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ; ProDrop pron = pron ** {s = []} ; diff --git a/src/chinese/ExtraChi.gf b/src/chinese/ExtraChi.gf index 689432d3d..ef517d750 100644 --- a/src/chinese/ExtraChi.gf +++ b/src/chinese/ExtraChi.gf @@ -11,21 +11,21 @@ concrete ExtraChi of ExtraChiAbs = CatChi ** lin PassVPSlash vps = insertAdv (mkNP passive_s) vps ; - PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep np.s)) (insertAdv (mkNP passive_s) vps) ; + PassAgentVPSlash vps np = insertAdv (ss (appPrep S.by8agent_Prep (linNP np))) (insertAdv (mkNP passive_s) vps) ; MkVPS t p vp = {s = t.s ++ p.s ++ (mkClause [] vp).s ! p.p ! t.t} ; ConjVPS c = conjunctDistrSS (c.s ! CSent) ; BaseVPS = twoSS ; ConsVPS = consrSS duncomma ; - PredVPS np vps = {preJiu = np.s ; postJiu = vps.s} ; + PredVPS np vps = {preJiu = (linNP np) ; postJiu = vps.s} ; MkVPI vp = {s = (mkClause [] vp).s ! Pos ! APlain} ; --- ?? almost just a copy of VPS ConjVPI c = conjunctDistrSS (c.s ! CSent) ; BaseVPI = twoSS ; ConsVPI = consrSS duncomma ; - GenNP np = {s,pl = np.s ++ possessive_s ; detType = DTPoss} ; + GenNP np = {s,pl = linNP np ++ possessive_s ; detType = DTPoss} ; GenRP nu cn = {s = \\_ => cn.s ++ relative_s} ; ---- ?? diff --git a/src/chinese/IdiomChi.gf b/src/chinese/IdiomChi.gf index 6b803ac79..d4f945138 100644 --- a/src/chinese/IdiomChi.gf +++ b/src/chinese/IdiomChi.gf @@ -10,11 +10,11 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in { -- GenericCl vp = mkClause "有人" vp ; (meaning: there is a person) ---- it is John who did it - CleftNP np rs = mkClause rs.s copula np.s ; -- did it + de + is I + CleftNP np rs = mkClause rs.s copula (linNP np) ; -- did it + de + is I CleftAdv ad s = mkClause (linS s ++ possessive_s) copula ad.s ; -- she sleeps + de + is here - ExistNP np = mkClause [] (regVerb you_s) np.s ; ---- infl of you + ExistNP np = mkClause [] (regVerb you_s) (linNP np) ; ---- infl of you ExistIP ip = {s = \\_ => (mkClause [] (regVerb you_s) ip.s).s} ; ---- infl of you @@ -30,7 +30,7 @@ concrete IdiomChi of Idiom = CatChi ** open Prelude, ResChi in { SelfAdvVP vp = insertAdv (ss reflPron) vp ; SelfAdVVP vp = insertAdv (ss reflPron) vp ; - SelfNP np = {s = np.s ++ reflPron} ; + SelfNP np = np ** {s = linNP np ++ reflPron} ; } diff --git a/src/chinese/NounChi.gf b/src/chinese/NounChi.gf index a9a180761..9912791ef 100644 --- a/src/chinese/NounChi.gf +++ b/src/chinese/NounChi.gf @@ -1,28 +1,33 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in { lin - DetCN det cn = case det.detType of { - DTFull Sg => {s = det.s ++ cn.c ++ cn.s} ; -- this house - DTFull Pl => {s = det.s ++ xie_s ++ cn.s} ; -- these houses - DTNum => {s = det.s ++ cn.c ++ cn.s} ; -- (these) five houses - DTPoss => {s = det.s ++ cn.s} -- our (five) houses - } ; - UsePN pn = pn ; - UsePron p = p ; + DetCN det cn = cn ** { + det = case det.detType of { + DTFull Sg => det.s ++ cn.c ; -- this house + DTFull Pl => det.s ++ xie_s ; -- these houses + DTNum => det.s ++ cn.c ; -- (these) five houses + DTPoss => det.s -- our (five) houses + } + } ; - DetNP det = {s = case det.detType of { + UsePN pn = pn ** {det = []} ; + UsePron p = p ** {det = []} ; + + DetNP det = { + s = [] ; + det = case det.detType of { DTFull Pl => det.s ++ xie_s ; DTPoss => det.s ; _ => det.s ++ ge_s } ; - } ; ---- + } ; ---- - PredetNP pred np = mkNP (pred.s ++ np.s) ; ---- possessive_s ++ np.s) ; + PredetNP pred np = np ** {s = pred.s ++ np.s} ; ---- possessive_s ++ np.s) ; - PPartNP np v2 = mkNP ((predV v2 v2.part).verb.s ++ possessive_s ++ np.s) ; ---- ?? + PPartNP np v2 = np ** {s = (predV v2 v2.part).verb.s ++ possessive_s ++ np.s} ; ---- ?? - AdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ np.s) ; - ExtAdvNP np adv = mkNP (adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s) ; ---- commas? + AdvNP np adv = np ** {s = adv.s ++ possessiveIf adv.hasDe ++ np.s} ; + ExtAdvNP np adv = np ** {s = adv.s ++ possessiveIf adv.hasDe ++ embedInCommas np.s} ; ---- commas? DetQuant quant num = { s = case num.numType of { @@ -70,15 +75,15 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in { DefArt = mkQuant [] [] DTPoss ; -- use that_Quant if you want the_s IndefArt = mkQuant yi_s [] DTNum ; -- (DTFull Sg) ; -- empty in the plural - MassNP cn = cn ; + MassNP cn = mkNP cn.s ; UseN n = n ; UseN2 n = n ; Use2N3 f = {s = f.s ; c = f.c ; c2 = f.c2} ; Use3N3 f = {s = f.s ; c = f.c ; c2 = f.c3} ; - ComplN2 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c} ; - ComplN3 f x = {s = appPrep f.c2 x.s ++ f.s ; c = f.c ; c2 = f.c3} ; + ComplN2 f x = {s = appPrep f.c2 (linNP x) ++ f.s ; c = f.c} ; + ComplN3 f x = {s = appPrep f.c2 (linNP x) ++ f.s ; c = f.c ; c2 = f.c3} ; AdjCN ap cn = case ap.monoSyl of { True => {s = ap.s ! Attr ++ cn.s ; c = cn.c} ; @@ -88,13 +93,13 @@ concrete NounChi of Noun = CatChi ** open ResChi, Prelude in { RelCN cn rs = {s = rs.s ++ cn.s ; c = cn.c} ; AdvCN cn ad = {s = ad.s ++ possessiveIf ad.hasDe ++ cn.s ; c = cn.c} ; SentCN cn cs = {s = cs.s ++ cn.s ; c = cn.c} ; - ApposCN cn np = {s = np.s ++ cn.s ; c = cn.c} ; + ApposCN cn np = {s = linNP np ++ cn.s ; c = cn.c} ; - RelNP np rs = mkNP (rs.s ++ np.s) ; + RelNP np rs = np ** {s = rs.s ++ np.s} ; - PossNP cn np = {s = np.s ++ possessive_s ++ cn.s ; c = cn.c} ; - PartNP cn np = {s = np.s ++ possessive_s ++ cn.s ; c = cn.c} ; + PossNP cn np = {s = linNP np ++ possessive_s ++ cn.s ; c = cn.c} ; + PartNP cn np = {s = linNP np ++ possessive_s ++ cn.s ; c = cn.c} ; - CountNP det np = {s = det.s ++ ge_s ++ possessive_s ++ np.s} ; --- classifier from NP? + CountNP det np = np ** {det = det.s ++ ge_s ++ possessive_s ++ np.det} ; --- classifier from NP? } diff --git a/src/chinese/ParadigmsChi.gf b/src/chinese/ParadigmsChi.gf index eec89b92e..a130bd08e 100644 --- a/src/chinese/ParadigmsChi.gf +++ b/src/chinese/ParadigmsChi.gf @@ -184,7 +184,7 @@ oper emptyPrep : Preposition = mkPrep [] ; mkpNP : Str -> CatChi.NP - = \s -> lin NP {s = word s} ; + = \s -> lin NP {s = word s ; det = []} ; mkAdV : Str -> AdV = \s -> lin AdV {s = word s} ; mkAdN : Str -> AdN diff --git a/src/chinese/PhraseChi.gf b/src/chinese/PhraseChi.gf index 4f1813421..bc3a8ed88 100644 --- a/src/chinese/PhraseChi.gf +++ b/src/chinese/PhraseChi.gf @@ -11,7 +11,7 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in { UttIP ip = ip ; UttIAdv iadv = iadv ; - UttNP np = np ; + UttNP np = ss (linNP np) ; UttCN cn = cn ; UttAP ap = {s = ap.s!Attr} ; UttCard x = x ; @@ -23,6 +23,6 @@ concrete PhraseChi of Phrase = CatChi ** open Prelude, ResChi in { PConjConj conj = ss (conj.s ! CSent).s2 ; NoVoc = {s = []} ; - VocNP np = {s = np.s ++ chcomma} ; ---- ?? + VocNP np = {s = linNP np ++ chcomma} ; ---- ?? } diff --git a/src/chinese/QuestionChi.gf b/src/chinese/QuestionChi.gf index d190869d9..54b70def7 100644 --- a/src/chinese/QuestionChi.gf +++ b/src/chinese/QuestionChi.gf @@ -14,11 +14,11 @@ concrete QuestionChi of Question = CatChi ** s = \\_,p,a => ip.s ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl } ; - QuestSlash ip cls = {s = \\_ => (mkClauseCompl cls.np (insertObj (ss (appPrep cls.c2 ip.s)) cls.vp) []).s} ; + QuestSlash ip cls = {s = \\_ => (mkClauseCompl cls.np (insertObj (mkNP (appPrep cls.c2 ip.s)) cls.vp) []).s} ; QuestIAdv iadv cl = {s = \\_ => (mkClauseCompl cl.np (insertAdv iadv cl.vp) []).s} ; - QuestIComp icomp np = {s = \\_,p,a => np.s ++ icomp.s} ; ---- order + QuestIComp icomp np = {s = \\_,p,a => linNP np ++ icomp.s} ; ---- order PrepIP p ip = ss (appPrep p ip.s) ; diff --git a/src/chinese/RelativeChi.gf b/src/chinese/RelativeChi.gf index 222c187c9..5971d5e3d 100644 --- a/src/chinese/RelativeChi.gf +++ b/src/chinese/RelativeChi.gf @@ -9,7 +9,7 @@ concrete RelativeChi of Relative = CatChi ** open ResChi, Prelude in { } ; } ; ---- ?? RelSlash rp slash = {s = \\p,a => slash.s ! p ! a ++ appPrep slash.c2 (rp.s ! False)} ; - FunRP p np rp = {s = \\a => appPrep p np.s ++ rp.s ! a} ; ---- ?? + FunRP p np rp = {s = \\a => appPrep p (linNP np) ++ rp.s ! a} ; ---- ?? IdRP = {s = table {True => [] ; False => relative_s}} ; } diff --git a/src/chinese/ResChi.gf b/src/chinese/ResChi.gf index ff9040639..b4be073d9 100644 --- a/src/chinese/ResChi.gf +++ b/src/chinese/ResChi.gf @@ -112,7 +112,8 @@ oper isAdj : Bool ; -- whether it is an adjectival predication and behaves differently in relative } ; - NP = {s : Str} ; + NP = {det,s : Str} ; -- keep Det separate, because RelNP may put in a RS and that goes before the Det + linNP : NP -> Str = \np -> np.det ++ np.s ; -- for morphology @@ -192,11 +193,11 @@ oper } ; insertObj : NP -> VP -> VP = \np,vp -> vp ** { - compl = np.s ++ vp.compl ; + compl = linNP np ++ vp.compl ; } ; insertObjPost : NP -> VP -> VP = \np,vp -> vp ** { - compl = vp.compl ++ np.s ; + compl = vp.compl ++ linNP np ; } ; insertAdv : SS -> VP -> VP = \adv,vp -> vp ** { @@ -215,7 +216,7 @@ oper } ; insertExtra : SS -> VP -> VP = \ext,vp -> - insertObjPost ext vp ; + insertObjPost (mkNP ext.s) vp ; -- clauses: keep np and vp separate to enable insertion of IAdv @@ -250,7 +251,7 @@ oper mkClauseCompl : Str -> VP -> Str -> Clause = \np,vp,compl -> { s = \\p,a => vp.topic ++ np ++ vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ; np = vp.topic ++ np ; - vp = insertObj (ss compl) vp ; + vp = insertObj (mkNP compl) vp ; postJiu = \\p,a => vp.prePart ++ useVerb vp.verb ! p ! a ++ vp.compl ++ compl ; } ; @@ -278,7 +279,8 @@ oper } ; pronNP : (s : Str) -> NP = \s -> { - s = word s + s = word s ; + det = [] } ; Preposition = {prepPre : Str ; prepPost : Str ; advType : AdvType ; hasDe : Bool} ; @@ -316,7 +318,7 @@ oper -- added by AR - mkNP : Str -> NP = ss ; -- not to be used in lexicon building + mkNP : Str -> NP = \s -> {s = s ; det = []} ; -- not to be used in lexicon building appPrep : Preposition -> Str -> Str = \prep,s -> prep.prepPre ++ s ++ prep.prepPost ; diff --git a/src/chinese/SentenceChi.gf b/src/chinese/SentenceChi.gf index 9e9e1f38b..03ed7c562 100644 --- a/src/chinese/SentenceChi.gf +++ b/src/chinese/SentenceChi.gf @@ -5,7 +5,7 @@ concrete SentenceChi of Sentence = CatChi ** lin - PredVP np vp = mkClause np.s vp ; + PredVP np vp = mkClause (linNP np) vp ; PredSCVP sc vp = mkClause sc.s vp ; @@ -17,10 +17,10 @@ concrete SentenceChi of Sentence = CatChi ** } ; SlashVP np vp = - mkClauseCompl np.s vp [] + mkClauseCompl (linNP np) vp [] ** {c2 = vp.c2} ; - SlashVS np vs sslash = ** {c2 = sslash.c2} ; + SlashVS np vs sslash = ** {c2 = sslash.c2} ; -- yet another reason for discontinuity of clauses diff --git a/src/chinese/StructuralChi.gf b/src/chinese/StructuralChi.gf index 40cf45cf1..b3e9a86ea 100644 --- a/src/chinese/StructuralChi.gf +++ b/src/chinese/StructuralChi.gf @@ -142,8 +142,8 @@ either7or_DConj = {s = table { -- modified by chenpeng 11.19 conjType = NotJiu ; } ; -everybody_NP = ssword "每个人" ; -- [mark] "每个人": 每(every)+个(classifier)+人(person) -everything_NP = ssword "每件事" ; -- [mark] "每件事": 每(every)+件(classifier)+事(thing) +everybody_NP = mkNP (ssword "每个人").s ; -- [mark] "每个人": 每(every)+个(classifier)+人(person) +everything_NP = mkNP (ssword "每件事").s ; -- [mark] "每件事": 每(every)+件(classifier)+事(thing) everywhere_Adv = mkAdv "到处" ; here7from_Adv = mkAdv "从这里" ; -- from here here7to_Adv = mkAdv "到这里" ; -- to here @@ -161,13 +161,13 @@ if_then_Conj = {s = table { -- added by chenpeng 11.19 } ; conjType = Jiu ; } ; -nobody_NP = ssword "没人" ; -nothing_NP = ssword "没有什么" ; +nobody_NP = mkNP (ssword "没人").s ; +nothing_NP = mkNP (ssword "没有什么").s ; on_Prep = mkPrep "在" "上" ; only_Predet = ssword "只有" ; -- only John so_AdA = ssword "如此" ; -somebody_NP = ssword "某人" ; -something_NP = ssword "某事" ; -- [mark] in sent, it depends on the context +somebody_NP = mkNP (ssword "某人").s ; +something_NP = mkNP (ssword "某事").s ; -- [mark] in sent, it depends on the context somewhere_Adv = mkAdv "某处" ; that_Subj = mkSubj [] chcomma ; -- that + S [mark] comma there7from_Adv = mkAdv "从那里" ; -- from there diff --git a/src/chinese/SymbolChi.gf b/src/chinese/SymbolChi.gf index 264e5bee5..400e46255 100644 --- a/src/chinese/SymbolChi.gf +++ b/src/chinese/SymbolChi.gf @@ -11,12 +11,12 @@ concrete SymbolChi of Symbol = CatChi ** open Prelude, ResChi in { NumPN i = i ; CNIntNP cn i = { s = cn.s ++ i.s ; - c = cn.c + det = cn.c } ; - CNSymbNP det cn xs = ss (det.s ++ cn.s ++ xs.s) ; ---- + CNSymbNP det cn xs = {det = det.s ; s = cn.s ++ xs.s} ; ---- CNNumNP cn i = { s = cn.s ++ i.s ; - c = cn.c + det = cn.c } ; SymbS sy = simpleS sy.s ; diff --git a/src/chinese/VerbChi.gf b/src/chinese/VerbChi.gf index 9c0503d4b..2d3b4b9cc 100644 --- a/src/chinese/VerbChi.gf +++ b/src/chinese/VerbChi.gf @@ -7,14 +7,14 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in { SlashV2a v = predV v v.part ** {c2 = v.c2 ; isPre = v.hasPrep} ; - Slash2V3 v np = insertAdv (mkNP (ba_s ++ np.s)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument - Slash3V3 v np = insertObj (mkNP (appPrep v.c3 np.s)) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object + Slash2V3 v np = insertAdv (mkNP (ba_s ++ linNP np)) (predV v v.part) ** {c2 = v.c3 ; isPre = v.hasPrep} ; -- slot for third argument + Slash3V3 v np = insertObj (mkNP (appPrep v.c3 (linNP np))) (predV v v.part) ** {c2 = v.c2 ; isPre = True} ; -- slot for ba object - SlashV2A v ap = insertObj {s = ap.s ! Pred} (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; + SlashV2A v ap = insertObj (mkNP (ap.s ! Pred)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; SlashV2V v vp = insertObj (mkNP (infVP vp)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; - SlashV2S v s = insertObj (ss (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; - SlashV2Q v q = insertObj (ss (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; + SlashV2S v s = insertObj (mkNP (say_s ++ linS s)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; + SlashV2Q v q = insertObj (mkNP (say_s ++ q.s ! False)) (predV v v.part) ** {c2 = v.c2 ; isPre = v.hasPrep} ; ComplVV v vp = { verb = v ; @@ -23,14 +23,14 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in { isAdj = False ; } ; - ComplVS v s = insertObj (ss (linS s)) (predV v []) ; - ComplVQ v q = insertObj (ss (q.s ! False)) (predV v []) ; - ComplVA v ap = insertObj {s = ap.s ! Pred} (predV v []) ; + ComplVS v s = insertObj (mkNP (linS s)) (predV v []) ; + ComplVQ v q = insertObj (mkNP (q.s ! False)) (predV v []) ; + ComplVA v ap = insertObj (mkNP (ap.s ! Pred)) (predV v []) ; ComplSlash vp np = case vp.isPre of { --- True => insertAdv (mkNP (ba_s ++ np.s)) vp ; --- ba or vp.c2 ? - True => insertPP (mkNP (appPrep vp.c2 np.s)) vp ; --- ba or vp.c2 ? - False => insertObj (mkNP (appPrep vp.c2 np.s)) vp + True => insertPP (mkNP (appPrep vp.c2 (linNP np))) vp ; --- ba or vp.c2 ? + False => insertObj (mkNP (appPrep vp.c2 (linNP np))) vp } ; UseComp comp = comp ; @@ -44,13 +44,13 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in { (insertObj (mkNP (infVP vp)) (predV v v.part)) ** {c2 = vp.c2 ; isPre = vp.isPre} ; AdvVP vp adv = case adv.advType of { - ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well* + ATManner => insertObj (mkNP (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well* ATPlace True => insertAdvPost adv vp ; -- he today *in the house* sleeps ATPlace False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps } ; ExtAdvVP vp adv = case adv.advType of { ---- ExtAdvVP also ? - ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well* + ATManner => insertObj (mkNP (deVAdv_s ++ adv.s)) vp ; -- he sleeps *well* ATPlace True => insertAdvPost adv vp ; -- he today *in the house* sleeps ATPlace False => insertAdvPost (ss (zai_V.s ++ adv.s)) vp ; -- he today *here* sleeps ATTime | ATPoss => insertTopic adv vp -- *today* he here sleeps @@ -73,17 +73,17 @@ concrete VerbChi of Verb = CatChi ** open ResChi, Prelude in { CompNP np = insertObj np (predV copula []) ; ---- - CompCN cn = insertObj cn (predV copula []) ; ---- + CompCN cn = insertObj (mkNP cn.s) (predV copula []) ; ---- CompAdv adv = case adv.advType of { - ATPlace True => insertObj adv (predV noVerb []) ; - _ => insertObj adv (predV zai_V []) ---- for all others ?? + ATPlace True => insertObj (mkNP adv.s) (predV noVerb []) ; + _ => insertObj (mkNP adv.s) (predV zai_V []) ---- for all others ?? } ; VPSlashPrep vp prep = vp ** {c2 = prep ; isPre = True} ; AdvVPSlash vp adv = case adv.advType of { - ATManner => insertObj (ss (deVAdv_s ++ adv.s)) vp ; -- he sleeps well + ATManner => insertObj (mkNP (deVAdv_s ++ adv.s)) vp ; -- he sleeps well ATPlace True => insertAdv adv vp ; -- he sleeps on the table _ => insertAdv (ss (zai_V.s ++ adv.s)) vp -- he sleeps in the house / today } ** {c2 = vp.c2 ; isPre = vp.isPre} ; From a5929da02cbd10d2967e180237706c6adb5014cd Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 25 May 2023 11:34:08 +0200 Subject: [PATCH 05/17] (May) fix BaseVPS, ConsVPS and ConjVPS --- src/malay/ExtendMay.gf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/malay/ExtendMay.gf b/src/malay/ExtendMay.gf index da91b944b..a646139c3 100644 --- a/src/malay/ExtendMay.gf +++ b/src/malay/ExtendMay.gf @@ -3,7 +3,7 @@ concrete ExtendMay of Extend = CatMay ** ExtendFunctor - [ VPS -- finite VP's with tense and polarity - , ListVPS + , ListVPS, BaseVPS, ConsVPS, ConjVPS , VPI, MkVPI, ComplVPIVV , ListVPI -- infinitive VP's (TODO: with anteriority and polarity) , MkVPS @@ -38,11 +38,11 @@ concrete ExtendMay of Extend = CatMay } ; -- BaseVPS : VPS -> VPS -> ListVPS ; - BaseVPS vps vps2 = twoSS vps vps2 ; + BaseVPS = twoSS ; -- ConsVPS : VPS -> ListVPS -> ListVPS ; - ConsVPS str listvps vps = consSS "," listvps vps ; + ConsVPS = consrSS ","; -- ConjVPS : Conj -> [VPS] -> VPS ; -- has walked and won't sleep - ConjVPS conj listvps = conjunctX conj listvps ; + ConjVPS = conjunctDistrSS ; -- PredVPS : NP -> VPS -> S ; -- she [has walked and won't sleep] PredVPS np vps = { s = np.s ! Bare ++ vps.s ; From bd6faa569ef104d5f59743a4db7b1bca2daa508e Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 29 May 2023 17:06:54 +0200 Subject: [PATCH 06/17] =?UTF-8?q?(Kor)=20use=20Polite=20as=20imperative?= =?UTF-8?q?=E2=80=94not=20perfect=20but=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …works for some situations, improvements are welcome. --- src/korean/CatKor.gf | 2 +- src/korean/MissingKor.gf | 4 ---- src/korean/PhraseKor.gf | 8 ++++---- src/korean/SentenceKor.gf | 6 +++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/korean/CatKor.gf b/src/korean/CatKor.gf index 05a56da1b..af4b862c2 100644 --- a/src/korean/CatKor.gf +++ b/src/korean/CatKor.gf @@ -16,7 +16,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in { Cl = ResKor.ClSlash ; ClSlash = ResKor.ClSlash ; SSlash = ResKor.Sentence ; -- sentence missing NP; e.g. "she has looked at" - Imp = {s : Number => Polarity => Str} ; -- imperative e.g. "look at this" + Imp = {s : Polarity => Str} ; -- imperative e.g. "look at this" --2 Questions and interrogatives diff --git a/src/korean/MissingKor.gf b/src/korean/MissingKor.gf index cd6f68227..5b700d48c 100644 --- a/src/korean/MissingKor.gf +++ b/src/korean/MissingKor.gf @@ -53,7 +53,6 @@ oper IdetIP : IDet -> IP = notYet "IdetIP" ; oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ; oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ; oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ; -oper ImpVP : VP -> Imp = notYet "ImpVP" ; oper ImpersCl : VP -> Cl = notYet "ImpersCl" ; oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ; oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ; @@ -101,9 +100,6 @@ oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ; oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ; oper UttIP : IP -> Utt = notYet "UttIP" ; -oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ; -oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; -oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ; oper UttInterj : Interj -> Utt = notYet "UttInterj" ; oper UttQS : QS -> Utt = notYet "UttQS" ; oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ; diff --git a/src/korean/PhraseKor.gf b/src/korean/PhraseKor.gf index 6026a9eda..0c17deb3d 100644 --- a/src/korean/PhraseKor.gf +++ b/src/korean/PhraseKor.gf @@ -8,11 +8,11 @@ concrete PhraseKor of Phrase = CatKor ** open Prelude, ResKor in { UttIAdv iadv = iadv ; UttAdv adv = adv ; UttInterj i = i ; -{- - UttImpSg pol imp = - UttImpPl pol imp = + + UttImpSg pol imp = {s = imp.s ! pol.p} ; + UttImpPl, UttImpPol = UttImpSg ; - -} + UttIP ip = {s = ip.s ! Bare} ; UttNP np = {s = np.s ! Bare} ; diff --git a/src/korean/SentenceKor.gf b/src/korean/SentenceKor.gf index 869b93ff0..3afe8a3a8 100644 --- a/src/korean/SentenceKor.gf +++ b/src/korean/SentenceKor.gf @@ -29,13 +29,13 @@ lin -- : Temp -> Pol -> ClSlash -> SSlash ; -- (that) she had not seen UseSlash t p cls = { } ; - +-} --2 Imperatives -- : VP -> Imp ; - ImpVP vp = {s = \\num,pol => linVP (VImp num pol) Statement vp} ; + ImpVP vp = {s = \\pol => linVP (VF Polite pol) vp} ; --2 Embedded sentences --} + -- : S -> SC ; EmbedS s = {s = s.s ! Subord ++ "것이"} ; -- TODO check subject case From 7cae261a976cce78c0cb4c46bbcd1248daa24da9 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 29 May 2023 17:07:08 +0200 Subject: [PATCH 07/17] (Kor) add unit tests for imperatives --- src/korean/unittest/imperative.gftest | 86 +++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 src/korean/unittest/imperative.gftest diff --git a/src/korean/unittest/imperative.gftest b/src/korean/unittest/imperative.gftest new file mode 100644 index 000000000..7d681978f --- /dev/null +++ b/src/korean/unittest/imperative.gftest @@ -0,0 +1,86 @@ +-- Imperative forms, positive and negative + +-- Intransitive verbs, positive +Lang: UttImpSg PPos (ImpVP (UseV come_V)) +LangEng: come +LangKor: 와요 + +Lang: UttImpSg PPos (ImpVP (UseV go_V)) +LangEng: go +LangKor: 가요 + +Lang: UttImpSg PPos (ImpVP (UseV laugh_V)) +LangEng: laugh +LangKor: 웃어요 + +Lang: UttImpSg PPos (ImpVP (UseV sing_V)) +LangEng: sing +LangKor: 노래해요 + +-- Intransitive verbs, negative +Lang: UttImpSg PNeg (ImpVP (UseV come_V)) +LangEng: don't come +LangKor: 오지 않아요 + +Lang: UttImpSg PNeg (ImpVP (UseV go_V)) +LangEng: don't go +LangKor: 가지 않아요 + +Lang: UttImpSg PNeg (ImpVP (UseV laugh_V)) +LangEng: don't laugh +LangKor: 웃지 않아요 + +Lang: UttImpSg PNeg (ImpVP (UseV sing_V)) +LangEng: don't sing +LangKor: 노래하지 않아요 + + +-- Transitive verbs, positive +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a do_V2) something_NP)) +LangEng: do something +LangKor: 무엇을 해요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a drink_V2) something_NP)) +LangEng: drink something +LangKor: 무엇을 마셔요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a eat_V2) something_NP)) +LangEng: eat something +LangKor: 무엇을 먹어요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a have_V2) something_NP)) +LangEng: have something +LangKor: 무엇이 있어요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a like_V2) something_NP)) +LangEng: like something +LangKor: 무엇을 좋아해요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a see_V2) something_NP)) +LangEng: see something +LangKor: 무엇을 봐요 + +-- Transitive verbs, negative +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a do_V2) something_NP)) +LangEng: don't do something +LangKor: 무엇을 하지 않아요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a drink_V2) something_NP)) +LangEng: don't drink something +LangKor: 무엇을 마시지 않아요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a eat_V2) something_NP)) +LangEng: don't eat something +LangKor: 무엇을 먹지 않아요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a have_V2) something_NP)) +LangEng: don't have something +LangKor: 무엇이 없어요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a like_V2) something_NP)) +LangEng: don't like something +LangKor: 무엇을 좋아하지 않아요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a see_V2) something_NP)) +LangEng: don't see something +LangKor: 무엇을 보지 않아요 From fcfb60b6e5b9a613595fb9cf00e5d4d69f0b1556 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 29 May 2023 19:27:10 +0200 Subject: [PATCH 08/17] (Kor) Add separate form for neg. imperative --- src/korean/ParamKor.gf | 6 ++++-- src/korean/ResKor.gf | 16 ++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index a6f2c7b83..52dd00f2c 100644 --- a/src/korean/ParamKor.gf +++ b/src/korean/ParamKor.gf @@ -115,7 +115,8 @@ param VForm = VStem Polarity -- for adding conjunctions | VAttr Polarity -- for subordinate clauses - | VF Style Polarity ; + | VF Style Polarity + | VImpNeg ; oper -- Default style used in the whole grammar. Change here for another style. @@ -141,7 +142,8 @@ oper VF Polite Pos => "s (VF Polite Pos)" ; VF Polite Neg => "s (VF Polite Neg)" ; VF Plain Pos => "s (VF Plain Pos)" ; - VF Plain Neg => "s (VF Plain Neg)" } ; + VF Plain Neg => "s (VF Plain Neg)" ; + VImpNeg => "s VImpNeg" } ; -------------------------------------------------------------------------------- -- Clauses diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 8fbf00071..fbf4c2272 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -206,10 +206,11 @@ oper planeg = neg ++ negForms ! Plain ; polneg = neg ++ negForms ! Polite ; formneg = neg ++ negForms ! Formal ; - in mkVerbFull stem attrpos attrneg plain polite formal planeg polneg formneg ; + impneg = neg ++ "마새요" ; + in mkVerbFull stem attrpos attrneg plain polite formal planeg polneg formneg impneg ; - mkVerbFull : (x1,_,_,_,_,_,_,_,x9 : Str) -> Verb = - \stem,attrpos,attrneg,plain,polite,formal,planeg,polneg,formneg -> { + mkVerbFull : (x1,_,_,_,_,_,_,_,_,x10 : Str) -> Verb = + \stem,attrpos,attrneg,plain,polite,formal,planeg,polneg,formneg,impneg -> { s = table { VStem Pos => stem ; VStem Neg => init planeg ; @@ -220,7 +221,8 @@ oper VF Polite Pos => polite ; VF Polite Neg => polneg ; VF Formal Pos => formal ; - VF Formal Neg => formneg + VF Formal Neg => formneg ; + VImpNeg => impneg } ; sc = Subject ; p = if_then_else Phono (vowFinal stem) Vowel Consonant ; @@ -236,7 +238,8 @@ oper "입니다" "아니다" "아니에요" - "아닙니다" ; + "아닙니다" + "있지마세요" ; copulaAfterVowel : Verb = copula ** { s = \\vf => case vf of { @@ -255,7 +258,8 @@ oper "있습니다" "없다" "없어요" - "없습니다" ; + "없습니다" + "없지 마새요" ; -- For building an adjective. Different attr from do_V. do_A : Verb = mkVerbReg From 70cbbe689dbbb0e6fae98324ecb4a03e865478a8 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 29 May 2023 19:30:40 +0200 Subject: [PATCH 09/17] (Kor) Use obj in imp, overriding V2's subject case --- src/korean/ParamKor.gf | 3 +++ src/korean/RelativeKor.gf | 2 +- src/korean/ResKor.gf | 22 +++++++++++++--------- src/korean/SentenceKor.gf | 2 +- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 52dd00f2c..647fbffc6 100644 --- a/src/korean/ParamKor.gf +++ b/src/korean/ParamKor.gf @@ -108,6 +108,9 @@ param | Imperative | Propositive ; + ObjectForm = -- sometimes need to override V2's object case for Imp + DeclObj + | ImpObj ; -- TODO: include Aspect and SentenceType. -- These are all Generic and Declarative. diff --git a/src/korean/RelativeKor.gf b/src/korean/RelativeKor.gf index 92e37fcba..a16b997d9 100644 --- a/src/korean/RelativeKor.gf +++ b/src/korean/RelativeKor.gf @@ -8,7 +8,7 @@ lin -- : RP -> VP -> RCl ; RelVP rp vp = vp ** { -- TODO no tenses yet in the grammar s = \\t,a,p,cltyp => - rp.s ++ vp.adv ++ vp.nObj ++ + rp.s ++ vp.adv ++ vp.nObj ! DeclObj ++ case cltyp of { WithConj => vp.s ! VStem p ; _ => vp.s ! VAttr p } ; diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index fbf4c2272..bb062c068 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -320,17 +320,14 @@ oper BaseVP : Type = { adv, - nObj, - vComp : Str - -- {subjunc : Str ; -- inflected verb complement - -- inf : Str ; -- infinitive verb complement - -- subcl : Str} -- clause complement + vComp : Str ; + nObj : ObjectForm => Str ; -- may need diff form for imperative vs. declarative sentences } ; baseVP : BaseVP = { adv, - nObj, vComp = [] ; + nObj = \\_ => [] } ; VerbPhrase : Type = BaseVerb ** Complement ** BaseVP ; @@ -342,7 +339,9 @@ oper useVc : Verb2 -> VPSlash = \v2 -> baseVP ** v2 ; insertComp : VPSlash -> NounPhrase -> VerbPhrase = \v2,np -> useV v2 ** { - nObj = np.s ! v2.c2 ++ v2.p2.s ! np.p + nObj = table { + DeclObj => np.s ! v2.c2 ++ v2.p2.s ! np.p ; + ImpObj => np.s ! Object ++ v2.p2.s ! np.p } -- use 을/를 always for imperative } ; insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s ++ vp.adv} ; @@ -378,7 +377,7 @@ oper WithConj => VStem p ; Statement st => VF st p } -- TODO: more tenses in np - ++ vp.nObj -- an object, not copula complement + ++ vp.nObj ! DeclObj -- an object, not copula complement ++ vp.adv ++ vp.s ! vf } ; @@ -387,6 +386,11 @@ oper -- linrefs linVerb : Verb -> Str = \v -> v.s ! linVF ; -linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ++ vp.adv ++ vp.s ! vf ; +linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ! DeclObj ++ vp.adv ++ vp.s ! vf ; +linImp : Polarity -> VerbPhrase -> Str = \pol,vp -> + let vf : VForm = case pol of { + Pos => VF Polite Pos ; + Neg => VImpNeg } + in vp.nObj ! ImpObj ++ vp.adv ++ vp.s ! vf ; linAP : AdjPhrase -> Str = \ap -> ap.compar ++ ap.s ! linVF ; } diff --git a/src/korean/SentenceKor.gf b/src/korean/SentenceKor.gf index 3afe8a3a8..daa6c0589 100644 --- a/src/korean/SentenceKor.gf +++ b/src/korean/SentenceKor.gf @@ -32,7 +32,7 @@ lin -} --2 Imperatives -- : VP -> Imp ; - ImpVP vp = {s = \\pol => linVP (VF Polite pol) vp} ; + ImpVP vp = {s = \\pol => linImp pol vp} ; --2 Embedded sentences From e7559884e0c3d39b80df7b43b1b34d4fc3c2105c Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 29 May 2023 19:32:09 +0200 Subject: [PATCH 10/17] (Kor) change V*'s linref, for morpho test cases --- src/korean/ResKor.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index bb062c068..6d01f3ee3 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -385,7 +385,7 @@ oper -------------------------------------------------------------------------------- -- linrefs -linVerb : Verb -> Str = \v -> v.s ! linVF ; +linVerb : Verb -> Str = \v -> v.s ! VF Polite Pos ; linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ! DeclObj ++ vp.adv ++ vp.s ! vf ; linImp : Polarity -> VerbPhrase -> Str = \pol,vp -> let vf : VForm = case pol of { From 7c9b6d0d02ff6ec0e75e1d60b454d9adf38b3771 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 29 May 2023 19:32:31 +0200 Subject: [PATCH 11/17] (Kor) Update test cases after changes in grammar --- src/korean/unittest/adjective.gftest | 4 +- src/korean/unittest/adverb.gftest | 4 +- src/korean/unittest/imperative.gftest | 172 +++++++++++++------------- src/korean/unittest/inflection.gftest | 4 +- src/korean/unittest/relative.gftest | 4 +- src/korean/unittest/subjcases.gftest | 8 +- 6 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/korean/unittest/adjective.gftest b/src/korean/unittest/adjective.gftest index d91c6e846..43c41db0a 100644 --- a/src/korean/unittest/adjective.gftest +++ b/src/korean/unittest/adjective.gftest @@ -2,8 +2,8 @@ -- LangEng: I am smaller than a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompAP (ComparA small_A (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))))) NoVoc -LangKor: 제가 고양이 &+ 보다 더 작아요 +LangKor: 제가 고양이 &+ 보다 더 작습니다 -- LangEng: I am a woman smaller than a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (UseComp (CompCN (AdjCN (ComparA small_A (DetCN (DetQuant IndefArt NumSg) (UseN cat_N))) (UseN woman_N))))))) NoVoc -LangKor: 제가 고양이 &+ 보다 더 작은 여자 &+ 예요 +LangKor: 제가 고양이 &+ 보다 더 작은 여자 &+ 입니다 diff --git a/src/korean/unittest/adverb.gftest b/src/korean/unittest/adverb.gftest index 0f49f19d2..6ffe6638e 100644 --- a/src/korean/unittest/adverb.gftest +++ b/src/korean/unittest/adverb.gftest @@ -1,7 +1,7 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc LangEng: the cat is in the house -LangKor: 고양이가 집 &+ 에서 있어요 +LangKor: 고양이가 집 &+ 에서 있습니다 Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP behind_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc LangEng: the cat is behind the house -LangKor: 고양이가 집 뒤에 있어요 +LangKor: 고양이가 집 뒤에 있습니다 diff --git a/src/korean/unittest/imperative.gftest b/src/korean/unittest/imperative.gftest index 7d681978f..395978614 100644 --- a/src/korean/unittest/imperative.gftest +++ b/src/korean/unittest/imperative.gftest @@ -1,86 +1,86 @@ --- Imperative forms, positive and negative - --- Intransitive verbs, positive -Lang: UttImpSg PPos (ImpVP (UseV come_V)) -LangEng: come -LangKor: 와요 - -Lang: UttImpSg PPos (ImpVP (UseV go_V)) -LangEng: go -LangKor: 가요 - -Lang: UttImpSg PPos (ImpVP (UseV laugh_V)) -LangEng: laugh -LangKor: 웃어요 - -Lang: UttImpSg PPos (ImpVP (UseV sing_V)) -LangEng: sing -LangKor: 노래해요 - --- Intransitive verbs, negative -Lang: UttImpSg PNeg (ImpVP (UseV come_V)) -LangEng: don't come -LangKor: 오지 않아요 - -Lang: UttImpSg PNeg (ImpVP (UseV go_V)) -LangEng: don't go -LangKor: 가지 않아요 - -Lang: UttImpSg PNeg (ImpVP (UseV laugh_V)) -LangEng: don't laugh -LangKor: 웃지 않아요 - -Lang: UttImpSg PNeg (ImpVP (UseV sing_V)) -LangEng: don't sing -LangKor: 노래하지 않아요 - - --- Transitive verbs, positive -Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a do_V2) something_NP)) -LangEng: do something -LangKor: 무엇을 해요 - -Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a drink_V2) something_NP)) -LangEng: drink something -LangKor: 무엇을 마셔요 - -Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a eat_V2) something_NP)) -LangEng: eat something -LangKor: 무엇을 먹어요 - -Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a have_V2) something_NP)) -LangEng: have something -LangKor: 무엇이 있어요 - -Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a like_V2) something_NP)) -LangEng: like something -LangKor: 무엇을 좋아해요 - -Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a see_V2) something_NP)) -LangEng: see something -LangKor: 무엇을 봐요 - --- Transitive verbs, negative -Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a do_V2) something_NP)) -LangEng: don't do something -LangKor: 무엇을 하지 않아요 - -Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a drink_V2) something_NP)) -LangEng: don't drink something -LangKor: 무엇을 마시지 않아요 - -Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a eat_V2) something_NP)) -LangEng: don't eat something -LangKor: 무엇을 먹지 않아요 - -Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a have_V2) something_NP)) -LangEng: don't have something -LangKor: 무엇이 없어요 - -Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a like_V2) something_NP)) -LangEng: don't like something -LangKor: 무엇을 좋아하지 않아요 - -Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a see_V2) something_NP)) -LangEng: don't see something -LangKor: 무엇을 보지 않아요 +-- Imperative forms, positive and negative + +-- Intransitive verbs, positive +Lang: UttImpSg PPos (ImpVP (UseV come_V)) +LangEng: come +LangKor: 와요 + +Lang: UttImpSg PPos (ImpVP (UseV go_V)) +LangEng: go +LangKor: 가요 + +Lang: UttImpSg PPos (ImpVP (UseV laugh_V)) +LangEng: laugh +LangKor: 웃어요 + +Lang: UttImpSg PPos (ImpVP (UseV sing_V)) +LangEng: sing +LangKor: 노래해요 + +-- Intransitive verbs, negative +Lang: UttImpSg PNeg (ImpVP (UseV come_V)) +LangEng: don't come +LangKor: 오지 마새요 + +Lang: UttImpSg PNeg (ImpVP (UseV go_V)) +LangEng: don't go +LangKor: 가지 마새요 + +Lang: UttImpSg PNeg (ImpVP (UseV laugh_V)) +LangEng: don't laugh +LangKor: 웃지 마새요 + +Lang: UttImpSg PNeg (ImpVP (UseV sing_V)) +LangEng: don't sing +LangKor: 노래하지 마새요 + + +-- Transitive verbs, positive +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a do_V2) something_NP)) +LangEng: do something +LangKor: 무엇을 해요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a drink_V2) something_NP)) +LangEng: drink something +LangKor: 무엇을 마셔요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a eat_V2) something_NP)) +LangEng: eat something +LangKor: 무엇을 먹어요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a have_V2) something_NP)) +LangEng: have something +LangKor: 무엇을 있어요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a like_V2) something_NP)) +LangEng: like something +LangKor: 무엇을 좋아해요 + +Lang: UttImpSg PPos (ImpVP (ComplSlash (SlashV2a see_V2) something_NP)) +LangEng: see something +LangKor: 무엇을 봐요 + +-- Transitive verbs, negative +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a do_V2) something_NP)) +LangEng: don't do something +LangKor: 무엇을 하지 마새요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a drink_V2) something_NP)) +LangEng: don't drink something +LangKor: 무엇을 마시지 마새요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a eat_V2) something_NP)) +LangEng: don't eat something +LangKor: 무엇을 먹지 마새요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a have_V2) something_NP)) +LangEng: don't have something +LangKor: 무엇을 없지 마새요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a like_V2) something_NP)) +LangEng: don't like something +LangKor: 무엇을 좋아하지 마새요 + +Lang: UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a see_V2) something_NP)) +LangEng: don't see something +LangKor: 무엇을 보지 마새요 \ No newline at end of file diff --git a/src/korean/unittest/inflection.gftest b/src/korean/unittest/inflection.gftest index 6716c9ebb..d6053b8eb 100644 --- a/src/korean/unittest/inflection.gftest +++ b/src/korean/unittest/inflection.gftest @@ -8,7 +8,7 @@ Lang: eat_V2 LangKor: 먹어요 -Lang: UseComp (CompAP (PositA good_A)) +Lang: ImpVP (UseComp (CompAP (PositA good_A))) LangKor: 좋아요 -- Final ㅏ or ㅓ does not repeat itself @@ -16,7 +16,7 @@ Lang: go_V LangKor: 가요 -- Monosyllabic 으-final is dropped -Lang: UseComp (CompAP (PositA big_A)) +Lang: ImpVP (UseComp (CompAP (PositA big_A))) LangKor: 커요 -- Final ㅗ + -아요 becomes ㅘ요 diff --git a/src/korean/unittest/relative.gftest b/src/korean/unittest/relative.gftest index 6f85a8322..27a5f8e3e 100644 --- a/src/korean/unittest/relative.gftest +++ b/src/korean/unittest/relative.gftest @@ -9,8 +9,8 @@ LangKor: 지금 우유를 마시는 고양이 Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant IndefArt NumPl) (RelCN (UseN cat_N) (ConjRS and_Conj (BaseRS (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV laugh_V))) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))))))))) NoVoc LangEng: I like cats that laugh and that drink milk -LangKor: 저는 웃 &+ 고 우유를 마시는 고양이를 좋아해요 +LangKor: 저는 웃 &+ 고 우유를 마시는 고양이 &+ 들을 좋아합니다 Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant IndefArt NumPl) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a like_V2) (UsePron i_Pron)))))))))) NoVoc LangEng: I like cats that like me -LangKor: 저는 저를 좋아하는 고양이가 좋아요 +LangKor: 저는 저를 좋아하는 고양이 &+ 들을 좋아합니다 diff --git a/src/korean/unittest/subjcases.gftest b/src/korean/unittest/subjcases.gftest index f4996cd73..0e95bfb89 100644 --- a/src/korean/unittest/subjcases.gftest +++ b/src/korean/unittest/subjcases.gftest @@ -2,21 +2,21 @@ -- LangEng: I see a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a see_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))) NoVoc -LangKor: 제가 고양이를 봐요 +LangKor: 제가 고양이를 봅니다 -- Double subject case -- LangEng: the cat is short Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAP (PositA short_A)))))) NoVoc -LangKor: 고양이가 키가 작아요 +LangKor: 고양이가 키가 작습니다 -- Topic as subject case -- LangEng: I have a cat Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a have_V2) (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)))))) NoVoc -LangKor: 저는 고양이가 있어요 +LangKor: 저는 고양이가 있습니다 -- Topic + object -- LangEng: I like cats Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a like_V2) (DetCN (DetQuant IndefArt NumPl) (UseN cat_N)))))) NoVoc -LangKor: 저는 고양이를 좋아해요 +LangKor: 저는 고양이 &+ 들을 좋아합니다 From 8a1236264989789934be8da65cf50608995303c5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 11 Mar 2023 22:37:16 +0800 Subject: [PATCH 12/17] (Som) Rename internal opers, update adp.comb. list source: Morgan Nilsson's list, add ?? for those that aren't there --- src/somali/CatSom.gf | 4 +- src/somali/LexiconSom.gf | 2 +- src/somali/ParadigmsSom.gf | 21 +++-- src/somali/ParamSom.gf | 75 +++++++-------- src/somali/QuestionSom.gf | 2 +- src/somali/ResSom.gf | 180 ++++++++++++++++++++---------------- src/somali/StructuralSom.gf | 2 +- src/somali/VerbSom.gf | 4 +- 8 files changed, 154 insertions(+), 136 deletions(-) diff --git a/src/somali/CatSom.gf b/src/somali/CatSom.gf index adc4d2a46..404a9369c 100644 --- a/src/somali/CatSom.gf +++ b/src/somali/CatSom.gf @@ -120,11 +120,11 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in { N3 = ResSom.Noun3 ; GN, SN, PN = ResSom.PNoun ; - Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb. + Adv = ResSom.Adverb ; -- Adposition of an adverbial can merge with obligatory complements of the verb. linref -- Cl = linCl ; VP = infVP ; CN = linCN ; - Prep = \prep -> prep.s ! P3_Prep ++ prep.sii ++ prep.dhex ++ prep.hoostiisa ! Sg3 Masc ; + Prep = \prep -> prep.s ! ZeroObj ++ prep.sii ++ prep.dhex ++ prep.hoostiisa ! Sg3 Masc ; } diff --git a/src/somali/LexiconSom.gf b/src/somali/LexiconSom.gf index d36ebd0d1..10eadd9df 100644 --- a/src/somali/LexiconSom.gf +++ b/src/somali/LexiconSom.gf @@ -4,7 +4,7 @@ concrete LexiconSom of Lexicon = CatSom ** ---- -- A -lin add_V3 = mkV3 "dar" ku NoPrep ; +lin add_V3 = mkV3 "dar" ku noPrep ; -- lin airplane_N = mkN "" ; -- lin alas_Interj = mkInterj "" ; -- lin already_Adv = mkA "" ; diff --git a/src/somali/ParadigmsSom.gf b/src/somali/ParadigmsSom.gf index 76bfe1c37..5e14508b6 100644 --- a/src/somali/ParadigmsSom.gf +++ b/src/somali/ParadigmsSom.gf @@ -25,6 +25,7 @@ oper masc : Gender ; fem : Gender ; +-- Export the adposition type with the more usual/mainstream name Preposition Preposition : Type ; ka : Preposition ; ku : Preposition ; @@ -141,7 +142,7 @@ oper mkAdv : Str -> Adv = \s -> lin Adv { berri = s ; c2 = noPrep ; - np = {s = [] ; a = P3_Prep} ; + np = {s = [] ; a = ZeroObj} ; sii,dhex,miscAdv = [] } ; @@ -172,12 +173,12 @@ oper masc = Masc ; fem = Fem ; - Preposition = ResSom.Preposition ; + Preposition = ResSom.Adposition ; ka = ResSom.Ka ; ku = ResSom.Ku ; la = ResSom.La ; u = ResSom.U ; - noPrep = ResSom.NoPrep ; + noPrep = ResSom.NoAdp ; VVForm = ResSom.VVForm ; infinitive = Infinitive ; @@ -229,14 +230,14 @@ oper mkV2 = overload { mkV2 : Str -> V2 = \s -> lin V2 (regV s ** {c2 = noPrep}) ; - mkV2 : Str -> Preposition -> V2 = \s,p -> lin V2 (regV s ** {c2 = p}) ; - mkV2 : V -> Preposition -> V2 = \v,p -> lin V2 (v ** {c2 = p}) ; + mkV2 : Str -> Adposition -> V2 = \s,p -> lin V2 (regV s ** {c2 = p}) ; + mkV2 : V -> Adposition -> V2 = \v,p -> lin V2 (v ** {c2 = p}) ; } ; mkV3 = overload { mkV3 : (sug : Str) -> V3 = \s -> lin V3 (regV s ** {c2,c3 = noPrep}) ; - mkV3 : (sug : Str) -> (_,_ : Preposition) -> V3 = \s,p,q -> lin V3 (regV s ** {c2 = p ; c3 = q}) ; - mkV3 : V -> (_,_ : Preposition) -> V2 = \v,p,q -> lin V3 (v ** {c2 = p ; c3 = q}) ; + mkV3 : (sug : Str) -> (_,_ : Adposition) -> V3 = \s,p,q -> lin V3 (regV s ** {c2 = p ; c3 = q}) ; + mkV3 : V -> (_,_ : Adposition) -> V2 = \v,p,q -> lin V3 (v ** {c2 = p ; c3 = q}) ; } ; mkVV = overload { @@ -252,11 +253,11 @@ oper } ; mkV2S = overload { - mkV2S : Str -> V2S -- Predictable verb, no preposition. + mkV2S : Str -> V2S -- Predictable verb, no Adposition. = \s -> lin V2S (regV s ** {c2 = noPrep}) ; - mkV2S : Str -> Preposition -> V2S -- Predictable verb, preposition given as second argument. + mkV2S : Str -> Adposition -> V2S -- Predictable verb, Adposition given as second argument. = \s,pr -> lin V2S (regV s ** {c2 = pr}) ; - mkV2S : V -> Preposition -> V2S -- Unpredictable verb, preposition. + mkV2S : V -> Adposition -> V2S -- Unpredictable verb, Adposition. = \v,pr -> lin V2S (v ** {c2 = pr}) } ; diff --git a/src/somali/ParamSom.gf b/src/somali/ParamSom.gf index c64d5838b..f02d25292 100644 --- a/src/somali/ParamSom.gf +++ b/src/somali/ParamSom.gf @@ -136,15 +136,15 @@ param | Pl1 Inclusion | Pl2 | Pl3 - | Impers ; -- Verb agrees with Sg3, but needed for preposition contraction + | Impers ; -- Verb agrees with Sg3, but needed for contractions - PrepAgr = - Sg1_Prep - | Sg2_Prep - | Pl1_Prep Inclusion - | Pl2_Prep - | Reflexive_Prep - | P3_Prep ; + AdpObjAgr = + Sg1Obj + | Sg2Obj + | Pl1Obj Inclusion + | Pl2Obj + | ReflexiveObj + | ZeroObj ; State = Definite | Indefinite ; @@ -164,27 +164,27 @@ oper Sg3 _ => Pl3 ; agr => agr } ; - agr2pagr : Agreement -> PrepAgr = \a -> case a of { - Sg1 => Sg1_Prep ; - Sg2 => Sg2_Prep ; - Pl1 i => Pl1_Prep i ; - Pl2 => Pl2_Prep ; - _ => P3_Prep + agr2objAgr : Agreement -> AdpObjAgr = \a -> case a of { + Sg1 => Sg1Obj ; + Sg2 => Sg2Obj ; + Pl1 i => Pl1Obj i ; + Pl2 => Pl2Obj ; + _ => ZeroObj } ; - pagr2agr : PrepAgr -> Agreement = \a -> case a of { - Sg1_Prep => Sg1 ; - Sg2_Prep => Sg2 ; - Pl1_Prep i => Pl1 i ; - Pl2_Prep => Pl2 ; + objAgr2agr : AdpObjAgr -> Agreement = \a -> case a of { + Sg1Obj => Sg1 ; + Sg2Obj => Sg2 ; + Pl1Obj i => Pl1 i ; + Pl2Obj => Pl2 ; _ => Sg3 Masc } ; isP3 = overload { isP3 : Agreement -> Bool = \agr -> case agr of {Sg3 _ | Pl3 => True ; _ => False} ; - isP3 : PrepAgr -> Bool = \agr -> - case agr of {P3_Prep => True ; _ => False} ; + isP3 : AdpObjAgr -> Bool = \agr -> + case agr of {ZeroObj => True ; _ => False} ; } ; @@ -234,18 +234,20 @@ oper } ; -------------------------------------------------------------------------------- --- Prepositions +-- Adpositions param - Preposition = U | Ku | Ka | La | NoPrep ; + Adposition = U | Ku | Ka | La | NoAdp ; - PrepCombination = Ugu | Uga | Ula | Kaga | Kula | Kala - | Passive | Loo | Lagu | Laga | Lala -- TODO all combinations with impersonal la: Loogu, Looga, Loola, Lagaga, Lagula, Lagala - | Single Preposition ; + AdpCombination = + Single Adposition -- 0-1 adpositions (0 = NoAdp) + | ImpersSubj Adposition -- impersonal subject + 0-1 adpositions + | Ugu | Uga | Ula + | Kaga | Kula | Kala ; oper - combine : Preposition -> Preposition -> PrepCombination = \p1,p2 -> - let oneWay : Preposition => Preposition => PrepCombination = \\x,y => + combine : Adposition -> Adposition -> AdpCombination = \p1,p2 -> + let oneWay : Adposition => Adposition => AdpCombination = \\x,y => case of { => Ugu ; => Uga ; @@ -254,25 +256,16 @@ oper Ku|Ka> => Kaga ; => Kula ; => Kala ; - => Single p ; - => Single x ; + => Single p ; + => Single x ; => Single x } -- for trying both ways in case oneWay ! p2 ! p1 of { Single _ => oneWay ! p1 ! p2 ; z => z } ; - combinePassive : Preposition -> PrepCombination = \p -> - case p of { - U => Loo ; - Ku => Lagu ; - Ka => Laga ; - La => Lala ; - _ => Passive - } ; - - isPassive : {c2 : PrepCombination} -> Bool = \vp -> + isPassive : {c2 : AdpCombination} -> Bool = \vp -> case vp.c2 of { - Passive | Lagu | Laga | Loo | Lala => True ; + ImpersSubj _ => True ; _ => False } ; diff --git a/src/somali/QuestionSom.gf b/src/somali/QuestionSom.gf index 86e0f151f..5ec95fffa 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -81,7 +81,7 @@ concrete QuestionSom of Question = CatSom ** open -- They can be modified with other adverbs. -- : IAdv -> Adv -> IAdv ; -- where in Paris - -- AdvIAdv iadv adv = iadv ** {s = iadv.s ++ adv.berri} ; -- TODO do we need PrepCombination in IAdv? + -- AdvIAdv iadv adv = iadv ** {s = iadv.s ++ adv.berri} ; -- TODO do we need AdpCombination in IAdv? -- Interrogative complements to copulas can be both adverbs and -- pronouns. diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 97b1f05c4..9f2d549aa 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -145,14 +145,14 @@ oper NounPhrase : Type = BaseNP ** {s : Case => Str} ; - NPLite : Type = {s : Str ; a : PrepAgr} ; -- Used in Adv and as an object in VP + NPLite : Type = {s : Str ; a : AdpObjAgr} ; -- Used in Adv and as an object in VP nplite : NounPhrase -> NPLite = \np -> - let pagr : PrepAgr = agr2pagr np.a in + let objAgr : AdpObjAgr = agr2objAgr np.a in case of { - => {s = np.s ! Abs ; a = pagr} ; - -- => {s = objpron np ! Abs ; a = pagr} ; -- uncomment if you want to add long object pronoun for 3rd person object - _ => {s = np.empty ; a = pagr} } ; -- no long object for other pronouns + => {s = np.s ! Abs ; a = objAgr} ; + -- => {s = objpron np ! Abs ; a = objAgr} ; -- uncomment if you want to add long object pronoun for 3rd person object + _ => {s = np.empty ; a = objAgr} } ; -- no long object for other pronouns objpron : NounPhrase -> Case => Str = \np -> case np.isPron of { True => \\c => np.empty ++ (pronTable ! np.a).sp ! c ; @@ -250,19 +250,19 @@ oper poss = {s, short = quantTable "ood" ; sp = gnTable "ood" "ood" "uwood"} } ; Impers => { - s = \\_ => [] ; -- the string `la' comes from Passive (: PrepCombination) + s = \\_ => [] ; -- the string `la' comes from the AdpCombination value `ImpersSubj Adposition` a = Impers ; isPron = True ; sp = \\_ => "" ; empty = [] ; st = Definite ; poss = {s, short = quantTable "iis" ; sp = gnTable "iis" "iis" "uwiis"} } } ; - secondObject : PrepAgr => Str = table { - Sg1_Prep => "kay" ; - Sg2_Prep => "kaa" ; - Pl1_Prep Excl => "kayo" ; - Pl1_Prep Incl => "keen" ; - Pl2_Prep => "kiin" ; + secondObject : AdpObjAgr => Str = table { + Sg1Obj => "kay" ; + Sg2Obj => "kaa" ; + Pl1Obj Excl => "kayo" ; + Pl1Obj Incl => "keen" ; + Pl2Obj => "kiin" ; _ => [] } ; @@ -350,30 +350,30 @@ oper } ; -------------------------------------------------------------------------------- --- Prepositions +-- Adpositions Prep : Type = { - s : PrepAgr => Str ; - c2 : Preposition ; + s : AdpObjAgr => Str ; + c2 : Adposition ; isPoss : Bool ; berri, sii, dhex : Str ; hoostiisa : Agreement => Str } ; - mkPrep : (x1,_,_,_,_,x6 : Str) -> {s : PrepAgr => Str} = \ku,ii,kuu,noo,idiin,isku -> { + mkPrep : (x1,_,_,_,_,x6 : Str) -> {s : AdpObjAgr => Str} = \ku,ii,kuu,noo,idiin,isku -> { s = table { - P3_Prep => ku ; - Sg1_Prep => ii ; - Sg2_Prep => kuu ; - Pl2_Prep => idiin ; - Pl1_Prep Excl => noo ; - Pl1_Prep Incl => "i" + noo ; - Reflexive_Prep => isku + ZeroObj => ku ; + Sg1Obj => ii ; + Sg2Obj => kuu ; + Pl2Obj => idiin ; + Pl1Obj Excl => noo ; + Pl1Obj Incl => "i" + noo ; + ReflexiveObj => isku } } ; - prep : Preposition -> {s : PrepAgr => Str ; c2 : Preposition} = \p -> + prep : Adposition -> {s : AdpObjAgr => Str ; c2 : Adposition} = \p -> prepTable ! p ** {c2 = p} ; - prepTable : Preposition => {s : PrepAgr => Str} = table { + prepTable : Adposition => {s : AdpObjAgr => Str} = table { Ku => mkPrep "ku" "igu" "kugu" "nagu" "idinku" "isku" ; Ka => mkPrep "ka" "iga" "kaa" "naga" "idinka" "iska" ; La => mkPrep "la" "ila" "kula" "nala" "idinla" "isla" ; @@ -381,45 +381,68 @@ oper _ => mkPrep [] "i" "ku" "na" "idin" "is" } ; - prepCombTable : PrepAgr => PrepCombination => Str = table { - Sg1_Prep => table { + allContractions : AdpObjAgr => AdpCombination => Str = table { + Sg1Obj => table { Ugu => "iigu" ; Uga => "iiga" ; Ula => "iila" ; Kaga => "igaga" ; Kula => "igula" ; Kala => "igala" ; - Passive => "la i" ; Loo => "la ii" ; Lala => "la ila" ; - Lagu => "laygu" ; Laga => "layga" ; - Single p => (prepTable ! p).s ! Sg1_Prep } ; - Sg2_Prep => table { Ugu => "kuugu" ; Uga => "kaaga" ; Ula => "kuula" ; + ImpersSubj NoAdp => "lay" ; + ImpersSubj U => "la ii" ; + ImpersSubj La => "??la ila" ; ---- not in morgan's table + ImpersSubj Ku => "laygu" ; + ImpersSubj Ka => "layga" ; + Single p => (prepTable ! p).s ! Sg1Obj } ; + Sg2Obj => table { + Ugu => "kuugu" ; Uga => "kaaga" ; Ula => "kuula" ; Kaga => "kaaga" ; Kula => "kugula" ; Kala => "kaala" ; - Passive => "lagu" ; Loo => "laguu" ; Lala => "lagula" ; - Lagu => "lagugu" ; Laga => "lagaa" ; - Single p => (prepTable ! p).s ! Sg2_Prep } ; - Pl1_Prep Excl => + ImpersSubj NoAdp => "lagu" ; -- Lagu 1: ku = Sg2Obj + ImpersSubj U => "??laguu" ; ---- not in morgan's table + ImpersSubj La => "lagula" ; + ImpersSubj Ku => "??lagugu" ; ---- not in morgan's table + ImpersSubj Ka => "??lagaa" ; ---- not in morgan's table + Single p => (prepTable ! p).s ! Sg2Obj } ; + Pl1Obj Excl => table { Ugu => "noogu" ; Uga => "nooga" ; Ula => "noola" ; Kaga => "nagaga" ; Kula => "nagula" ; Kala => "nagala" ; - Passive => "nala" ; Loo => "???" ; Lala => "???" ; - Lagu => "nalagu" ; Laga => "nalaga" ; - Single p => (prepTable ! p).s ! Pl1_Prep Excl } ; - Pl1_Prep Incl => + ImpersSubj NoAdp => "nala" ; + ImpersSubj U => "??la noo" ; ---- not in morgan's table + ImpersSubj La => "??la nala" ; ---- not in morgan's table + ImpersSubj Ku => "??la nagu" ; ---- not in morgan's table + ImpersSubj Ka => "??la naga" ; ---- not in morgan's table + Single p => (prepTable ! p).s ! Pl1Obj Excl } ; + Pl1Obj Incl => table { Ugu => "inoogu" ; Uga => "inooga" ; Ula => "inoola" ; Kaga => "inagaga" ; Kula => "inagula" ; Kala => "inagala" ; - Passive => "inala" ; Loo => "???" ; Lala => "???" ; - Lagu => "inalagu" ; Laga => "inalaga" ; - Single p => (prepTable ! p).s ! Pl1_Prep Incl } ; - Pl2_Prep => table { Ugu => "idiinku" ; Uga => "idiinka" ; Ula => "idiinla" ; + ImpersSubj NoAdp => "??inala" ; ---- none of following in morgan's table + ImpersSubj U => "??la inoo" ; + ImpersSubj La => "??la inala" ; + ImpersSubj Ku => "??la inagu" ; + ImpersSubj Ka => "??la inaga" ; + Single p => (prepTable ! p).s ! Pl1Obj Incl } ; + Pl2Obj => + table { Ugu => "idiinku" ; Uga => "idiinka" ; Ula => "idiinla" ; Kaga => "idinkaga" ; Kula => "idinkula" ; Kala => "idinkala" ; - Passive => "laydin" ; Loo => "laydiin" ; Lala => "laydinla" ; - Lagu => "laydinku" ; Laga => "laydinka" ; - Single p => (prepTable ! p).s ! Pl2_Prep } ; - Reflexive_Prep => -- TODO check every form - table { Ugu => "isugu" ; Uga => "isuga" ; Ula => "isula" ; - Kaga => "iskaga" ; Kula => "iskula" ; Kala => "iskala" ; - Passive => "lays" ; Loo => "???" ; Lala => "???" ; - Lagu => "laysku" ; Laga => "layska" ; - Single p => (prepTable ! p).s ! Reflexive_Prep } ; + ImpersSubj NoAdp => "laydin" ; ---- none of following in morgan's table + ImpersSubj U => "??laydiin" ; + ImpersSubj La => "??laydinla" ; + ImpersSubj Ku => "??laydinku" ; + ImpersSubj Ka => "??laydinka" ; + Single p => (prepTable ! p).s ! Pl2Obj } ; + ReflexiveObj => + table { Ugu => "isugu" ; Uga => "isaga" ; + Ula => "??isula" ; Kaga => "??iskaga" ; Kula => "??iskula" ; Kala => "??iskala" ; ---- not in morgan's table + ImpersSubj NoAdp => "lays" ; + ImpersSubj U => "laysu" ; + ImpersSubj La => "laysla" ; + ImpersSubj Ku => "laysku" ; + ImpersSubj Ka => "layska" ; + Single p => (prepTable ! p).s ! ReflexiveObj } ; a => table { Ugu => "ugu" ; Uga => "uga" ; Ula => "ula" ; Kaga => "kaga" ; Kula => "kula" ; Kala => "kala" ; - Passive => "la" ; Loo => "loo" ; Lala => "lala" ; - Lagu => "lagu" ; Laga => "laga" ; + ImpersSubj NoAdp => "la" ; + ImpersSubj U => "loo" ; + ImpersSubj La => "lala" ; + ImpersSubj Ku => "lagu" ; -- Lagu 2: ku = Adp + ImpersSubj Ka => "laga" ; Single p => (prepTable ! p).s ! a } } ; @@ -429,7 +452,7 @@ oper -- Sequences of adjectives follow the rules for restrictive relatives clauses, i.e. are linked by oo 'and' on an indefinite head NounPhrase and by ee 'and' on a definite NounPhrase (8.1). Adjective : Type = {s : AForm => Str} ; - Adjective2 : Type = Adjective ** {c2 : Preposition} ; + Adjective2 : Type = Adjective ** {c2 : Adposition} ; duplA : Str -> Adjective = \yar -> let yaryar = duplicate yar @@ -474,8 +497,8 @@ oper dhex : Str ; -- closed class of adverbials: hoos, kor, dul, dhex, … isCopula : Bool ; } ; - Verb2 : Type = Verb ** {c2 : Preposition} ; - Verb3 : Type = Verb2 ** {c3 : Preposition} ; + Verb2 : Type = Verb ** {c2 : Adposition} ; + Verb3 : Type = Verb2 ** {c3 : Adposition} ; VV : Type = Verb ** {vvtype : VVForm} ; @@ -704,7 +727,7 @@ oper } ; Adverb : Type = BaseAdv ** { - c2 : Preposition ; -- adverbs can contribute to preposition contraction. + c2 : Adposition ; -- adverbs can contribute to Adposition contraction. np : NPLite ; -- NP from PrepNP can be promoted into a core argument. } ; @@ -733,8 +756,8 @@ oper } ; VerbPhrase : Type = BaseVerb ** Complement ** BaseAdv ** { - c2 : PrepCombination ; -- Prepositions can combine together and with object pronoun. - obj : NPLite ; -- {s : Str ; a : PrepAgr} + c2 : AdpCombination ; -- Adpositions can combine together and with object pronoun. + obj : NPLite ; -- {s : Str ; a : AdpObjAgr} obj2 : Str ; -- if two overt pronoun objects vComp : {subjunc : Str ; -- "waa in" or subjunctive construction: "in" is placed here inf : Str ; -- auxiliary VV with infinitive argument @@ -754,8 +777,8 @@ oper vComp = {subjunc, inf = [] ; subcl = \\_ => []} ; berri,miscAdv = [] ; - c2 = Single NoPrep ; - obj = {s = [] ; a = P3_Prep} ; + c2 = Single NoAdp ; + obj = {s = [] ; a = ZeroObj} ; obj2 = [] } ; @@ -771,12 +794,12 @@ oper passVP : VerbPhrase -> VerbPhrase = \vp -> vp ** { c2 = case vp.c2 of { - Single p => combinePassive p ; - _ => vp.c2 } + Single p => ImpersSubj p ; + _ => vp.c2 } -- TODO: do combinations of La + 2 adpositions exist? } ; insertRefl : VPSlash -> VPSlash = \vps -> vps ** { - obj = vps.obj ** {a = Reflexive_Prep} ; + obj = vps.obj ** {a = ReflexiveObj} ; -- If old obj was something else than P3, it is now shown in obj2 obj2 = vps.obj2 ++ secondObject ! vps.obj.a ; @@ -796,7 +819,7 @@ oper -- To generalise insertAdv and insertComp VPLite : Type = { - c2 : PrepCombination ; + c2 : AdpCombination ; obj : NPLite ; sii,dhex,berri,miscAdv,obj2 : Str} ; @@ -804,7 +827,7 @@ oper case vp.obj.a of { -- If the old object is 3rd person (or nonexistent), we replace its agreement. -- We keep both old and new string (=noun, if there was one) in obj.s. - P3_Prep => + ZeroObj => vp ** {obj = nplite ** { s = nplite.s ++ vp.obj.s} } ; -- no obj2, because there's ≤1 non-3rd-person pronoun. @@ -820,12 +843,13 @@ oper insertAdvLite : VPLite -> Adverb -> VPLite = \vp,adv -> case adv.c2 of { - NoPrep => vp ** adv'' ; -- the adverb is not formed with PrepNP, e.g. "tomorrow" + NoAdp => vp ** adv'' ; -- the adverb is not formed with PrepNP, e.g. "tomorrow" _ => case vp.c2 of { -- if free complement slots, introduce adv.np with insertComp - Single NoPrep => insertCompLite (vp ** {c2 = Single adv.c2}) adv.np ** adv' ; + Single NoAdp => insertCompLite (vp ** {c2 = Single adv.c2}) adv.np ** adv' ; Single p => insertCompLite (vp ** {c2 = combine p adv.c2}) adv.np ** adv' ; - Passive => insertCompLite (vp ** {c2 = combinePassive adv.c2}) adv.np ** adv' ; + ImpersSubj NoAdp => insertCompLite (vp ** {c2 = ImpersSubj adv.c2}) adv.np ** adv' ; + -- ImpersSubj p => insertCompLite (vp ** {c2 = ??? }) adv.np ** adv' ; -- TODO: is this allowed? -- if complement slots are full, just insert strings. _ => vp ** adv'' @@ -852,7 +876,7 @@ oper subj : {noun, pron : Str ; isP3 : Bool} ; -- noun and subject pronoun if applicable obj : NPLite ; obj2 : Str ; - c2 : PrepCombination ; -- NB. QuestIAdv can add more prepositions + c2 : AdpCombination ; -- NB. QuestIAdv can add more Adpositions aComp : Str ; nComp : Str ; vComp : {inf,subcl,subjunc : Str} ; @@ -930,12 +954,12 @@ oper s = \\t,a,p => let -- Put all arguments in their right place --cl : ClSlash = complCl incomplCl ; - prepComb = prepCombTable ! cl.obj.a ! cl.c2 ; + prepComb = allContractions ! cl.obj.a ! cl.c2 ; -- Contractions bind : Str = case of { - => [] ; -- nothing to attach to the STM - _ => BIND } ; -- something to attach, use BIND + => [] ; -- nothing to attach to the STM + _ => BIND } ; -- something to attach, use BIND prepCombNeg : Str = case of { => prepComb ++ bind ; _ => [] @@ -975,7 +999,7 @@ oper ++ cl.subj.noun -- subject if it's a noun ++ statementNounObj -- noun object if it's a statement - ++ prepCombNeg -- prepositions and pron. objects in negative statement + ++ prepCombNeg -- Adpositions and pron. objects in negative statement ++ stm ++ cl.vComp.subjunc -- "waa in" construction / @@ -985,7 +1009,7 @@ oper ++ cl.aComp -- AP complement, regardless of cltype ++ statementNounComp -- NP complement if it's direct statement - ++ prepCombPos -- prepositions + pron. objects in positive sentence + ++ prepCombPos -- Adpositions + pron. objects in positive sentence ++ cl.sii -- restricted set of particles ++ cl.dhex -- restricted set of nouns/adverbials @@ -1095,7 +1119,7 @@ oper linVP : VForm -> ClType -> VerbPhrase -> Str = \vf,cltyp,vp -> let pred = vp.s ! vf ; - pr = prepCombTable ! vp.obj.a ! vp.c2 ; + pr = allContractions ! vp.obj.a ! vp.c2 ; neg = case of { => "aan" ; _ => [] @@ -1114,7 +1138,7 @@ oper ++ case cltyp of { Subord => vp.obj.s ; -- noun object if it's subordinate clause _ => [] } - ++ vp.aComp ! pagr2agr vp.obj.a -- AP complement agreeing with object + ++ vp.aComp ! objAgr2agr vp.obj.a -- AP complement agreeing with object ++ pr -- object if it's a pronoun ++ vp.sii -- restricted set of particles ++ vp.dhex -- restricted set of nouns/adverbials diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index 50ddf22d7..83b26c7ad 100644 --- a/src/somali/StructuralSom.gf +++ b/src/somali/StructuralSom.gf @@ -189,7 +189,7 @@ lin want_VV = mkVV (mkV "rabid" "rab" "rab") subjunctive ; lin please_Voc = ss "" ; -} oper - mkIAdv : Preposition -> Str -> Bool -> ResSom.IAdv = \pr -> + mkIAdv : Adposition -> Str -> Bool -> ResSom.IAdv = \pr -> let pr' : Prep = ParadigmsSom.mkPrep pr ; in prepIP pr' ; diff --git a/src/somali/VerbSom.gf b/src/somali/VerbSom.gf index 4df5e0ca7..88f0d5982 100644 --- a/src/somali/VerbSom.gf +++ b/src/somali/VerbSom.gf @@ -46,7 +46,7 @@ lin ComplVS vs s = let vps = useV vs ; subord = SubjS {s="in"} s ; - in vps ** {obj = {s = subord.berri ; a = P3_Prep}} ; + in vps ** {obj = {s = subord.berri ; a = ZeroObj}} ; {- -- : VQ -> QS -> VP ; @@ -71,7 +71,7 @@ lin SlashV2S v2s s = let vps = useVc v2s ; subord = SubjS {s="in"} s ; - in vps ** {obj = {s = subord.berri ; a = P3_Prep}} ; + in vps ** {obj = {s = subord.berri ; a = ZeroObj}} ; {- -- : V2V -> VP -> VPSlash ; -- beg (her) to go From ea4249752e17f93eefcf09f3945839321b116e00 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sat, 11 Mar 2023 22:39:01 +0800 Subject: [PATCH 13/17] (Som) add explicit module source to avoid warnings --- src/somali/QuestionSom.gf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/somali/QuestionSom.gf b/src/somali/QuestionSom.gf index 5ec95fffa..4fc495eff 100644 --- a/src/somali/QuestionSom.gf +++ b/src/somali/QuestionSom.gf @@ -10,9 +10,9 @@ concrete QuestionSom of Question = CatSom ** open -- : IP -> VP -> QCl ; QuestVP ip vp = -- TODO: if we want to contract baa + subj. pronoun, change ResSom.predVP - let cls : ClSlash = predVP ip vp ; + let cls : ResSom.ClSlash = predVP ip vp ; baan : Str = case ip.contractSTM of {True => "aan" ; _ => "baa aan"} ; - cl : ClSlash = cls ** { + cl : ResSom.ClSlash = cls ** { stm = modSTM "baa" baan cls.stm } ; in cl2qcl PolarQuestion (notB ip.contractSTM) cl ; @@ -33,9 +33,9 @@ concrete QuestionSom of Question = CatSom ** open -- : IAdv -> Cl -> QCl ; -- why does John walk QuestIAdv iadv cls = - let clRaw : ClSlash = insertIAdv iadv cls ; + let clRaw : ResSom.ClSlash = insertIAdv iadv cls ; sbj = clRaw.subj ; - cl : ClSlash = clRaw ** { + cl : ResSom.ClSlash = clRaw ** { stm = \\clt,p => case of { -- IAdv is focused with baa, and subject comes after <_,Pos> => case iadv.contractSTM of { @@ -117,13 +117,13 @@ oper } ; -- Question clauses: subject pronoun not included, STM is - cl2qcl : ClType -> Bool -> ClSlash -> Clause = \cltyp -> + cl2qcl : ClType -> Bool -> ResSom.ClSlash -> Clause = \cltyp -> let hasSubjPron : Bool = False ; isRel : Bool = False ; in mkClause cltyp isRel hasSubjPron ; -- Question clause with wh-word as object: subject pronoun is included - cl2qclslash : Bool -> ClSlash -> Clause = + cl2qclslash : Bool -> ResSom.ClSlash -> Clause = let hasSubjPron : Bool = True ; isRel : Bool = False ; in mkClause PolarQuestion isRel hasSubjPron ; From 7c334847a5f35ccdf79fc185e14443aa554d840a Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 1 Jun 2023 22:28:59 +0200 Subject: [PATCH 14/17] (Som) test past Sg1 + plural imperative --- src/somali/unittest/inflection.gftest | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/somali/unittest/inflection.gftest b/src/somali/unittest/inflection.gftest index 9f544c856..c27976c59 100644 --- a/src/somali/unittest/inflection.gftest +++ b/src/somali/unittest/inflection.gftest @@ -9,6 +9,10 @@ Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc LangSom: waa sugaa +-- LangEng: I/he waited (for him/her/it) +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc +LangSom: waa sugay + -- Interrogative -- LangEng: does he/she/it wait (for him/her/it) Lang: PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres ASimul) PPos (QuestCl (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))))) NoVoc @@ -30,6 +34,21 @@ LangSom: waa sugi lahaa -- Optative and potential not implemented (yet?) +-- Imperative and Masc3_Sg1 past tense from + +-- Imperative +-- LangEng: buy it (sg) +Lang: PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron)))) NoVoc +LangSom: iibso + +Lang: PhrUtt NoPConj (UttImpPl PPos (ImpVP (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron)))) NoVoc +LangSom: iibsada + + +-- LangEng: I/he bought it +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron))))) NoVoc +LangSom: waa iibsaday + -------------- -- Negative -- -------------- From 722c077eb625aea7fe52d5a35dbc4ef1a6f98f86 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 9 Jun 2023 22:25:40 +0200 Subject: [PATCH 15/17] (Som) more unit tests for imperative --- src/somali/unittest/inflection.gftest | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/somali/unittest/inflection.gftest b/src/somali/unittest/inflection.gftest index c27976c59..268cccbdd 100644 --- a/src/somali/unittest/inflection.gftest +++ b/src/somali/unittest/inflection.gftest @@ -34,9 +34,7 @@ LangSom: waa sugi lahaa -- Optative and potential not implemented (yet?) --- Imperative and Masc3_Sg1 past tense from - --- Imperative +-- Imperatives -- LangEng: buy it (sg) Lang: PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron)))) NoVoc LangSom: iibso @@ -45,6 +43,13 @@ Lang: PhrUtt NoPConj (UttImpPl PPos (ImpVP (ComplSlash (SlashV2a buy_V2) (UsePro LangSom: iibsada +-- LangEng: see it (sg) +Lang: PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplSlash (SlashV2a see_V2) (UsePron it_Pron)))) NoVoc +LangSom: arag + +Lang: PhrUtt NoPConj (UttImpPl PPos (ImpVP (ComplSlash (SlashV2a see_V2) (UsePron it_Pron)))) NoVoc +LangSom: arka + -- LangEng: I/he bought it Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPast ASimul) PPos (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron))))) NoVoc LangSom: waa iibsaday @@ -75,6 +80,18 @@ LangSom: ha sugin Lang: PhrUtt NoPConj (UttImpPl PNeg (ImpVP (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron)))) NoVoc LangSom: ha sugina +Lang: PhrUtt NoPConj (UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron)))) NoVoc +LangSom: ha iibsan + +Lang: PhrUtt NoPConj (UttImpPl PNeg (ImpVP (ComplSlash (SlashV2a buy_V2) (UsePron it_Pron)))) NoVoc +LangSom: ha iibsanina + +Lang: PhrUtt NoPConj (UttImpSg PNeg (ImpVP (ComplSlash (SlashV2a see_V2) (UsePron it_Pron)))) NoVoc +LangSom: ha arkin + +Lang: PhrUtt NoPConj (UttImpPl PNeg (ImpVP (ComplSlash (SlashV2a see_V2) (UsePron it_Pron)))) NoVoc +LangSom: ha arkina + -- Conditional -- LangEng: he/she/it wouldn't wait (for him/her/it) Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TCond ASimul) PNeg (PredVP (UsePron it_Pron) (ComplSlash (SlashV2a wait_V2) (UsePron it_Pron))))) NoVoc From 8b8564e8288622d6fcc89a7d0419151922d0b7b7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 9 Jun 2023 22:26:15 +0200 Subject: [PATCH 16/17] (Som) Fixes in verb constructors, still WIP --- src/somali/LexiconSom.gf | 580 ++++++++++++++++++------------------ src/somali/ParadigmsSom.gf | 18 +- src/somali/ResSom.gf | 207 +++++++------ src/somali/StructuralSom.gf | 2 +- 4 files changed, 427 insertions(+), 380 deletions(-) diff --git a/src/somali/LexiconSom.gf b/src/somali/LexiconSom.gf index 10eadd9df..03f7b765a 100644 --- a/src/somali/LexiconSom.gf +++ b/src/somali/LexiconSom.gf @@ -5,414 +5,414 @@ concrete LexiconSom of Lexicon = CatSom ** -- A lin add_V3 = mkV3 "dar" ku noPrep ; --- lin airplane_N = mkN "" ; --- lin alas_Interj = mkInterj "" ; --- lin already_Adv = mkA "" ; +-- lin airplane_N = mkN [] ; +-- lin alas_Interj = mkInterj [] ; +-- lin already_Adv = mkA [] ; lin animal_N = mkN "xayawaan" ; lin answer_V2S = mkV2S "jawaab" ku ; --- lin apartment_N = mkN "" ; --- lin apple_N = mkN "" ; --- lin art_N = mkN "" ; --- lin ashes_N = mkN "" ; --- lin ask_V2Q = mkV2 "" ; +-- lin apartment_N = mkN [] ; +-- lin apple_N = mkN [] ; +-- lin art_N = mkN [] ; +-- lin ashes_N = mkN [] ; +-- lin ask_V2Q = mkV2 [] ; ---- -- B --- lin baby_N = mkN "" ; --- lin back_N = mkN "" ; --- lin bad_A = mkA "" ; --- lin bank_N = mkN "" ; --- lin bark_N = mkN "" ; --- lin beautiful_A = mkA "" ; --- lin become_VA = mkVA "" ; --- lin beer_N = mkN "" ; --- lin beg_V2V = mkV2 "" ; --- lin belly_N = mkN "" ; +-- lin baby_N = mkN [] ; +-- lin back_N = mkN [] ; +-- lin bad_A = mkA [] ; +-- lin bank_N = mkN [] ; +-- lin bark_N = mkN [] ; +-- lin beautiful_A = mkA [] ; +-- lin become_VA = mkVA [] ; +-- lin beer_N = mkN [] ; +-- lin beg_V2V = mkV2 [] ; +-- lin belly_N = mkN [] ; lin big_A = mkA "weyn" ; --- lin bike_N = mkN "" ; +-- lin bike_N = mkN [] ; lin bird_N = mkN "shimbir" fem ; --- lin bite_V2 = mkV2 "" ; +-- lin bite_V2 = mkV2 [] ; lin black_A = mkA "madow" ; --- lin blood_N = mkN "" ; --- lin blow_V = mkV "" ; --- lin blue_A = mkA "" ; --- lin boat_N = mkN "" ; --- lin bone_N = mkN "" ; --- lin boot_N = mkN "" ; --- lin boss_N = mkN "" ; +-- lin blood_N = mkN [] ; +-- lin blow_V = mkV [] ; +-- lin blue_A = mkA [] ; +-- lin boat_N = mkN [] ; +-- lin bone_N = mkN [] ; +-- lin boot_N = mkN [] ; +-- lin boss_N = mkN [] ; lin book_N = (mk2N "buug" "buugaag") ** {gda = MF GA TA} ; lin boy_N = mk2N "wiil" "wiilal" ; lin bread_N = mkN "rooti" ; --masc/fem --- lin break_V2 = mkV2 "" ; --- lin breast_N = mkN "" ; --- lin breathe_V = mkV "" ; --- lin broad_A = mkA "" ; --- lin brother_N2 = mkN "" ; --- lin brown_A = mkA "" ; --- lin burn_V = mkV "" ; --- lin butter_N = mkN "" ; +-- lin break_V2 = mkV2 [] ; +-- lin breast_N = mkN [] ; +-- lin breathe_V = mkV [] ; +-- lin broad_A = mkA [] ; +-- lin brother_N2 = mkN [] ; +-- lin brown_A = mkA [] ; +-- lin burn_V = mkV [] ; +-- lin butter_N = mkN [] ; lin buy_V2 = mkV2 "iibso" ; ---- -- C --- lin camera_N = mkN "" ; --- lin cap_N = mkN "" ; +-- lin camera_N = mkN [] ; +-- lin cap_N = mkN [] ; lin car_N = mkN "baabuur" masc ; --- lin carpet_N = mkN "" ; +-- lin carpet_N = mkN [] ; lin cat_N = mkN "bisad" ; --- lin ceiling_N = mkN "" ; +-- lin ceiling_N = mkN [] ; lin chair_N = mkN "kursi" ; --- lin cheese_N = mkN "" ; --- lin child_N = mkN "" ; --- lin church_N = mkN "" ; +-- lin cheese_N = mkN [] ; +-- lin child_N = mkN [] ; +-- lin church_N = mkN [] ; lin city_N = mkN "magaalo" ; --- lin clean_A = mkA "" ; --- lin clever_A = mkA "" ; --- lin close_V2 = mkV2 "" ; --- lin cloud_N = mkN "" ; --- lin coat_N = mkN "" ; --- lin cold_A = mkA "" ; +-- lin clean_A = mkA [] ; +-- lin clever_A = mkA [] ; +-- lin close_V2 = mkV2 [] ; +-- lin cloud_N = mkN [] ; +-- lin coat_N = mkN [] ; +-- lin cold_A = mkA [] ; lin come_V = mkV "iman" ; --- lin computer_N = mkN "" ; --- lin correct_A = mkA "" ; --- lin count_V2 = mkV2 "" ; --- lin country_N = mkN "" ; --- lin cousin_N = mkN "" ; --- lin cow_N = mkN "" ; --- lin cut_V2 = mkV2 "" ; +-- lin computer_N = mkN [] ; +-- lin correct_A = mkA [] ; +-- lin count_V2 = mkV2 [] ; +-- lin country_N = mkN [] ; +-- lin cousin_N = mkN [] ; +-- lin cow_N = mkN [] ; +-- lin cut_V2 = mkV2 [] ; -- -- ---- -- -- D -- --- lin day_N = mkN "" ; --- lin die_V = mkV "" ; --- lin dig_V = mkV "" ; --- lin dirty_A = mkA "" ; --- lin distance_N3 = mkN "" ; +-- lin day_N = mkN [] ; +-- lin die_V = mkV [] ; +-- lin dig_V = mkV [] ; +-- lin dirty_A = mkA [] ; +-- lin distance_N3 = mkN [] ; -- lin do_V2 = lin V2 egin_V ; --- lin doctor_N = mkN "" ; --- lin dog_N = mkN "" ; --- lin door_N = mkN "" ; +-- lin doctor_N = mkN [] ; +-- lin dog_N = mkN [] ; +-- lin door_N = mkN [] ; lin drink_V2 = mkV2 "cab" ; --- lin dry_A = mkA "" ; --- lin dull_A = mkA "" ; --- lin dust_N = mkN "" ; +-- lin dry_A = mkA [] ; +-- lin dull_A = mkA [] ; +-- lin dust_N = mkN [] ; ---- -- E --- lin ear_N = mkN "" ; --- lin earth_N = mkN "" ; +-- lin ear_N = mkN [] ; +-- lin earth_N = mkN [] ; lin eat_V2 = mkV2 "cun" ; --- lin egg_N = mkN "" ; --- lin empty_A = mkA "" ; --- lin enemy_N = mkN "" ; --- lin eye_N = mkN "" ; +-- lin egg_N = mkN [] ; +-- lin empty_A = mkA [] ; +-- lin enemy_N = mkN [] ; +-- lin eye_N = mkN [] ; ---- -- F --- lin factory_N = mkN "" ; --- lin fall_V = mkV "" ; --- lin far_Adv = mkA "" ; --- lin fat_N = mkN "" ; +-- lin factory_N = mkN [] ; +-- lin fall_V = mkV [] ; +-- lin far_Adv = mkA [] ; +-- lin fat_N = mkN [] ; lin father_N2 = mkN2 (shortPossN (mkN "aabbe")) ; --- lin fear_V2 = mkV2 "" ; --- lin fear_VS = mkVS "" ; --- lin feather_N = mkN "" ; --- lin fight_V2 = mkV2 "" ; --- lin find_V2 = mkV2 "" ; --- lin fingernail_N = mkN "" ; --- lin fire_N = mkN "" ; --- lin fish_N = mkN "" ; --- lin float_V = mkV "" ; --- lin floor_N = mkN "" ; --- lin flow_V = mkV "" ; --- lin flower_N = mkN "" ; --- lin fly_V = mkV "" ; --- lin fog_N = mkN "" ; --- lin foot_N = mkN "" ; --- lin forest_N = mkN "" ; --- lin forget_V2 = mkV2 "" ; --- lin freeze_V = mkV "" ; --- lin fridge_N = mkN "" ; --- lin friend_N = mkN "" ; --- lin fruit_N = mkN "" ; --- lin full_A = mkA "" ; +-- lin fear_V2 = mkV2 [] ; +-- lin fear_VS = mkVS [] ; +-- lin feather_N = mkN [] ; +-- lin fight_V2 = mkV2 [] ; +-- lin find_V2 = mkV2 [] ; +-- lin fingernail_N = mkN [] ; +-- lin fire_N = mkN [] ; +-- lin fish_N = mkN [] ; +-- lin float_V = mkV [] ; +-- lin floor_N = mkN [] ; +-- lin flow_V = mkV [] ; +-- lin flower_N = mkN [] ; +-- lin fly_V = mkV [] ; +-- lin fog_N = mkN [] ; +-- lin foot_N = mkN [] ; +-- lin forest_N = mkN [] ; +-- lin forget_V2 = mkV2 [] ; +-- lin freeze_V = mkV [] ; +-- lin fridge_N = mkN [] ; +-- lin friend_N = mkN [] ; +-- lin fruit_N = mkN [] ; +-- lin full_A = mkA [] ; -- --lin fun_AV ---- -- G --- lin garden_N = mkN "" ; +-- lin garden_N = mkN [] ; lin girl_N = mkN "gabadh" "gabdho" fem ; lin give_V3 = mkV3 "sii" ; --- lin glove_N = mkN "" ; +-- lin glove_N = mkN [] ; lin go_V = mkV "tag" ; --- lin gold_N = mkN "" ; --- lin good_A = mkA "" ; --- lin grammar_N = mkN "" ; --- lin grass_N = mkN "" ; --- lin green_A = mkA "" ; +-- lin gold_N = mkN [] ; +-- lin good_A = mkA [] ; +-- lin grammar_N = mkN [] ; +-- lin grass_N = mkN [] ; +-- lin green_A = mkA [] ; ---- -- H --- lin hair_N = mkN "" ; --- lin hand_N = mkN "" ; --- lin harbour_N = mkN "" ; --- lin hat_N = mkN "" ; --- lin hate_V2 = mkV2 "" ; --- lin head_N = mkN "" ; --- lin hear_V2 = mkV2 "" ; --- lin heart_N = mkN "" ; --- lin heavy_A = mkA "" ; --- lin hill_N = mkN "" ; --- lin hit_V2 = mkV2 "" ; --- lin hold_V2 = mkV2 "" ; --- lin hope_VS = mkV "" ; --- lin horn_N = mkN "" ; --- lin horse_N = mkN "" ; --- lin hot_A = mkA "" ; +-- lin hair_N = mkN [] ; +-- lin hand_N = mkN [] ; +-- lin harbour_N = mkN [] ; +-- lin hat_N = mkN [] ; +-- lin hate_V2 = mkV2 [] ; +-- lin head_N = mkN [] ; +-- lin hear_V2 = mkV2 [] ; +-- lin heart_N = mkN [] ; +-- lin heavy_A = mkA [] ; +-- lin hill_N = mkN [] ; +-- lin hit_V2 = mkV2 [] ; +-- lin hold_V2 = mkV2 [] ; +-- lin hope_VS = mkV [] ; +-- lin horn_N = mkN [] ; +-- lin horse_N = mkN [] ; +-- lin hot_A = mkA [] ; lin house_N = mkN "guri" ; --- lin hunt_V2 = mkV2 "" ; --- lin husband_N = mkN "" ; +-- lin hunt_V2 = mkV2 [] ; +-- lin husband_N = mkN [] ; -------- -- I - K --- lin ice_N = mkN "" ; --- lin industry_N = mkN "" ; --- lin iron_N = mkN "" ; +-- lin ice_N = mkN [] ; +-- lin industry_N = mkN [] ; +-- lin iron_N = mkN [] ; -- lin john_PN = mkPN "Jon" ; lin jump_V = mkV "bood" ; --- lin kill_V2 = mkV2 "" ; --- lin king_N = mkN "" ; --- lin knee_N = mkN "" ; --- lin know_V2 = mkV2 "" ; --- lin know_VQ = mkVQ "" ; +-- lin kill_V2 = mkV2 [] ; +-- lin king_N = mkN [] ; +-- lin knee_N = mkN [] ; +-- lin know_V2 = mkV2 [] ; +-- lin know_VQ = mkVQ [] ; lin know_VS = mkV "ogaan" ; -- copula ** {sii = "og"} ; ---- -- L --- lin lake_N = mkN "" ; --- lin lamp_N = mkN "" ; +-- lin lake_N = mkN [] ; +-- lin lamp_N = mkN [] ; lin language_N = mkN "af" ; --- lin laugh_V = mkV "" ; --- lin leaf_N = mkN "" ; --- lin learn_V2 = mkV2 "" ; --- lin leather_N = mkN "" ; --- lin leave_V2 = mkV2 "" ; --- lin leg_N = mkN "" ; --- lin lie_V = mkV "" ; --- lin like_V2 = mkV2 "" ; --- lin listen_V2 = mkV2 "" ; +-- lin laugh_V = mkV [] ; +-- lin leaf_N = mkN [] ; +-- lin learn_V2 = mkV2 [] ; +-- lin leather_N = mkN [] ; +-- lin leave_V2 = mkV2 [] ; +-- lin leg_N = mkN [] ; +-- lin lie_V = mkV [] ; +-- lin like_V2 = mkV2 [] ; +-- lin listen_V2 = mkV2 [] ; lin live_V = copula ** {sii = "nool"} ; --- lin liver_N = mkN "" ; --- lin long_A = mkA "" ; --- lin lose_V2 = mkV2 "" ; --- lin louse_N = mkN "" ; --- lin love_N = mkN "" ; --- lin love_V2 = mkV2 "" ; +-- lin liver_N = mkN [] ; +-- lin long_A = mkA [] ; +-- lin lose_V2 = mkV2 [] ; +-- lin louse_N = mkN [] ; +-- lin love_N = mkN [] ; +-- lin love_V2 = mkV2 [] ; ---- -- M lin man_N = (mk2N "nin" "niman") ** {gda = MM KA KA} ; --- lin married_A2 = mkA "" ; +-- lin married_A2 = mkA [] ; lin meat_N = mkN "hilib" "hilbo" masc ; --- lin milk_N = mkN "" ; --- lin moon_N = mkN "" ; +-- lin milk_N = mkN [] ; +-- lin moon_N = mkN [] ; lin mother_N2 = mkN2 (shortPossN (mkN "hooyo")) ; --- lin mountain_N = mkN "" ; --- lin mouth_N = mkN "" ; --- lin music_N = mkN "" ; +-- lin mountain_N = mkN [] ; +-- lin mouth_N = mkN [] ; +-- lin music_N = mkN [] ; ---- -- N lin name_N = mkN "magac" ; --- lin narrow_A = mkA "" ; --- lin near_A = mkA "" ; --- lin neck_N = mkN "" ; --- lin new_A = mkA "" ; --- lin newspaper_N = mkN "" ; --- lin night_N = mkN "" ; --- lin nose_N = mkN "" ; --- lin now_Adv = mkA "" ; --- lin number_N = mkN "" ; +-- lin narrow_A = mkA [] ; +-- lin near_A = mkA [] ; +-- lin neck_N = mkN [] ; +-- lin new_A = mkA [] ; +-- lin newspaper_N = mkN [] ; +-- lin night_N = mkN [] ; +-- lin nose_N = mkN [] ; +-- lin now_Adv = mkA [] ; +-- lin number_N = mkN [] ; -- -- -------- -- -- O - P -- -- --- lin oil_N = mkN "" ; --- lin old_A = mkA "" ; +-- lin oil_N = mkN [] ; +-- lin old_A = mkA [] ; lin open_V2 = mkV2 "fur" ; lin paint_V2A = mkV2A "rinjiyee" ; --- lin paper_N = mkN "" ; +-- lin paper_N = mkN [] ; -- lin paris_PN = mkPN "Paris" ; --- lin peace_N = mkN "" ; --- lin pen_N = mkN "" ; +-- lin peace_N = mkN [] ; +-- lin pen_N = mkN [] ; lin person_N = mkNoun "dad" "dadka" "dad" "dadka" Masc ; --- lin planet_N = mkN "" ; --- lin plastic_N = mkN "" ; --- lin play_V = mkV "" ; --- lin policeman_N = mkN "" ; --- lin priest_N = mkN "" ; --- lin pull_V2 = mkV2 "" ; --- lin push_V2 = mkV2 "" ; --- lin put_V2 = mkV2 "" ; +-- lin planet_N = mkN [] ; +-- lin plastic_N = mkN [] ; +-- lin play_V = mkV [] ; +-- lin policeman_N = mkN [] ; +-- lin priest_N = mkN [] ; +-- lin pull_V2 = mkV2 [] ; +-- lin push_V2 = mkV2 [] ; +-- lin put_V2 = mkV2 [] ; -- -- -------- -- -- Q - R -- --- lin queen_N = mkN "" ; --- lin question_N = mkN "" ; --- lin radio_N = mkN "" ; --- lin rain_N = mkN "" ; --- lin rain_V0 = mkV "" ; +-- lin queen_N = mkN [] ; +-- lin question_N = mkN [] ; +-- lin radio_N = mkN [] ; +-- lin rain_N = mkN [] ; +-- lin rain_V0 = mkV [] ; lin read_V2 = mkV2 "akhri" ; --- lin ready_A = mkA "" ; --- lin reason_N = mkN "" ; --- lin red_A = mkA "" ; --- lin religion_N = mkN "" ; --- lin restaurant_N = mkN "" ; --- lin river_N = mkN "" ; --- lin road_N = mkN "" ; --- lin rock_N = mkN "" ; --- lin roof_N = mkN "" ; --- lin root_N = mkN "" ; --- lin rope_N = mkN "" ; --- lin rotten_A = mkA "" ; --- lin round_A = mkA "" ; --- lin rub_V2 = mkV2 "" ; --- lin rubber_N = mkN "" ; --- lin rule_N = mkN "" ; --- lin run_V = mkV "" ; +-- lin ready_A = mkA [] ; +-- lin reason_N = mkN [] ; +-- lin red_A = mkA [] ; +-- lin religion_N = mkN [] ; +-- lin restaurant_N = mkN [] ; +-- lin river_N = mkN [] ; +-- lin road_N = mkN [] ; +-- lin rock_N = mkN [] ; +-- lin roof_N = mkN [] ; +-- lin root_N = mkN [] ; +-- lin rope_N = mkN [] ; +-- lin rotten_A = mkA [] ; +-- lin round_A = mkA [] ; +-- lin rub_V2 = mkV2 [] ; +-- lin rubber_N = mkN [] ; +-- lin rule_N = mkN [] ; +-- lin run_V = mkV [] ; ---- -- S lin salt_N = mkN "cusbo" ; --- lin sand_N = mkN "" ; --- lin say_VS = mkVS "" ; --- lin school_N = mkN "" ; --- lin science_N = mkN "" ; --- lin scratch_V2 = mkV2 "" ; +-- lin sand_N = mkN [] ; +-- lin say_VS = mkVS [] ; +-- lin school_N = mkN [] ; +-- lin science_N = mkN [] ; +-- lin scratch_V2 = mkV2 [] ; lin sea_N = mkN "bad" fem ; -lin see_V2 = mkV2 "ark" ; --- lin seed_N = mkN "" ; --- lin seek_V2 = mkV2 "" ; --- lin sell_V3 = mkV3 "" ; --- lin send_V3 = mkV3 "" ; --- lin sew_V = mkV "" ; --- lin sharp_A = mkA "" ; +lin see_V2 = mkV2 (mkV "arag" "arkaa") noPrep ; +-- lin seed_N = mkN [] ; +-- lin seek_V2 = mkV2 [] ; +-- lin sell_V3 = mkV3 [] ; +-- lin send_V3 = mkV3 [] ; +-- lin sew_V = mkV [] ; +-- lin sharp_A = mkA [] ; lin sheep_N = mkN "lax" fem ; --- lin ship_N = mkN "" ; --- lin shirt_N = mkN "" ; --- lin shoe_N = mkN "" ; --- lin shop_N = mkN "" ; --- lin short_A = mkA "" ; --- lin silver_N = mkN "" ; --- lin sing_V = mkV "" ; --- lin sister_N = mkN "" ; --- lin sit_V = mkV "" ; --- lin skin_N = mkN "" ; --- lin sky_N = mkN "" ; --- lin sleep_V = mkV "" ; +-- lin ship_N = mkN [] ; +-- lin shirt_N = mkN [] ; +-- lin shoe_N = mkN [] ; +-- lin shop_N = mkN [] ; +-- lin short_A = mkA [] ; +-- lin silver_N = mkN [] ; +-- lin sing_V = mkV [] ; +-- lin sister_N = mkN [] ; +-- lin sit_V = mkV [] ; +-- lin skin_N = mkN [] ; +-- lin sky_N = mkN [] ; +-- lin sleep_V = mkV [] ; lin small_A = mkA "yar" ; --- lin smell_V = mkV "" ; --- lin smoke_N = mkN "" ; --- lin smooth_A = mkA "" ; --- lin snake_N = mkN "" ; --- lin snow_N = mkN "" ; --- lin sock_N = mkN "" ; --- lin song_N = mkN "" ; +-- lin smell_V = mkV [] ; +-- lin smoke_N = mkN [] ; +-- lin smooth_A = mkA [] ; +-- lin snake_N = mkN [] ; +-- lin snow_N = mkN [] ; +-- lin sock_N = mkN [] ; +-- lin song_N = mkN [] ; lin speak_V2 = mkV2 "hadlo" ; --- lin spit_V = mkV "" ; --- lin split_V2 = mkV2 "" ; --- lin squeeze_V2 = mkV2 "" ; --- lin stab_V2 = mkV2 "" ; --- lin stand_V = mkV "" ; --- lin star_N = mkN "" ; --- lin steel_N = mkN "" ; --- lin stick_N = mkN "" ; --- lin stone_N = mkN "" ; --- lin stop_V = mkV "" ; --- lin stove_N = mkN "" ; --- lin straight_A = mkA "" ; --- lin student_N = mkN "" ; --- lin stupid_A = mkA "" ; --- lin suck_V2 = mkV2 "" ; --- lin sun_N = mkN "" ; --- lin swell_V = mkV "" ; --- lin swim_V = mkV "" ; +-- lin spit_V = mkV [] ; +-- lin split_V2 = mkV2 [] ; +-- lin squeeze_V2 = mkV2 [] ; +-- lin stab_V2 = mkV2 [] ; +-- lin stand_V = mkV [] ; +-- lin star_N = mkN [] ; +-- lin steel_N = mkN [] ; +-- lin stick_N = mkN [] ; +-- lin stone_N = mkN [] ; +-- lin stop_V = mkV [] ; +-- lin stove_N = mkN [] ; +-- lin straight_A = mkA [] ; +-- lin student_N = mkN [] ; +-- lin stupid_A = mkA [] ; +-- lin suck_V2 = mkV2 [] ; +-- lin sun_N = mkN [] ; +-- lin swell_V = mkV [] ; +-- lin swim_V = mkV [] ; ---- -- T --- lin table_N = mkN "" ; --- lin tail_N = mkN "" ; --- lin talk_V3 = mkV3 "" ; +-- lin table_N = mkN [] ; +-- lin tail_N = mkN [] ; +-- lin talk_V3 = mkV3 [] ; lin teach_V2 = mkV2 "bar" ku ; lin teacher_N = mkN "macallin" ; --- lin television_N = mkN "" ; --- lin thick_A = mkA "" ; --- lin thin_A = mkA "" ; --- lin think_V = mkV "" ; --- lin throw_V2 = mkV2 "" ; --- lin tie_V2 = mkV2 "" ; --- lin today_Adv = mkA "" ; --- lin tongue_N = mkN "" ; --- lin tooth_N = mkN "" ; --- lin train_N = mkN "" ; --- lin travel_V = mkV "" ; --- lin tree_N = mkN "" ; --- lin turn_V = mkV "" ; +-- lin television_N = mkN [] ; +-- lin thick_A = mkA [] ; +-- lin thin_A = mkA [] ; +-- lin think_V = mkV [] ; +-- lin throw_V2 = mkV2 [] ; +-- lin tie_V2 = mkV2 [] ; +-- lin today_Adv = mkA [] ; +-- lin tongue_N = mkN [] ; +-- lin tooth_N = mkN [] ; +-- lin train_N = mkN [] ; +-- lin travel_V = mkV [] ; +-- lin tree_N = mkN [] ; +-- lin turn_V = mkV [] ; -------- -- U - V --- lin ugly_A = mkA "" ; --- lin uncertain_A = mkA "" ; --- lin understand_V2 = mkV2 "" ; --- lin university_N = mkN "" ; --- lin village_N = mkN "" ; --- lin vomit_V = mkV2 "" ; +-- lin ugly_A = mkA [] ; +-- lin uncertain_A = mkA [] ; +-- lin understand_V2 = mkV2 [] ; +-- lin university_N = mkN [] ; +-- lin village_N = mkN [] ; +-- lin vomit_V = mkV2 [] ; -------- -- W - Y lin wait_V2 = mkV2 "sug" ; --- lin walk_V = mkV "" ; --- lin war_N = mkN "" ; --- lin warm_A = mkA "" ; --- lin wash_V2 = mkV2 "" ; --- lin watch_V2 = mkV2 "" ; +lin walk_V = mkV "soco" "socday" ; +-- lin war_N = mkN [] ; +-- lin warm_A = mkA [] ; +-- lin wash_V2 = mkV2 [] ; +-- lin watch_V2 = mkV2 [] ; lin water_N = mkNoun "biyo" "biyaha" "biyo" "biyaha" Masc ; -- ?? gender --- lin wet_A = mkA "" ; +-- lin wet_A = mkA [] ; lin white_A = mkA "cad" ; --- lin wide_A = mkA "" ; --- lin wife_N = mkN "" ; --- lin win_V2 = mkV2 "" ; --- lin wind_N = mkN "" ; --- lin window_N = mkN "" ; --- lin wine_N = mkN "" ; --- lin wing_N = mkN "" ; --- lin wipe_V2 = mkV2 "" ; +-- lin wide_A = mkA [] ; +-- lin wife_N = mkN [] ; +-- lin win_V2 = mkV2 [] ; +-- lin wind_N = mkN [] ; +-- lin window_N = mkN [] ; +-- lin wine_N = mkN [] ; +-- lin wing_N = mkN [] ; +-- lin wipe_V2 = mkV2 [] ; lin woman_N = mkN "naag" fem ; --- lin wonder_VQ = mkVQ "" ; --- lin wood_N = mkN "" ; --- lin worm_N = mkN "" ; --- lin write_V2 = mkV2 "" ; --- lin year_N = mkN "" ; --- lin yellow_A = mkA "" ; --- lin young_A = mkA "" ; +-- lin wonder_VQ = mkVQ [] ; +-- lin wood_N = mkN [] ; +-- lin worm_N = mkN [] ; +-- lin write_V2 = mkV2 [] ; +-- lin year_N = mkN [] ; +-- lin yellow_A = mkA [] ; +-- lin young_A = mkA [] ; } diff --git a/src/somali/ParadigmsSom.gf b/src/somali/ParadigmsSom.gf index 5e14508b6..490e582b6 100644 --- a/src/somali/ParadigmsSom.gf +++ b/src/somali/ParadigmsSom.gf @@ -214,20 +214,26 @@ oper mkV = overload { mkV : (imp : Str) -> V = \v -> lin V (regV v) ; - mkV : (imp,pl2,sg1 : Str) -> V = \i,p,s -> lin V (mkVerb i p s) ; + mkV : (imp, sg1 : Str) -> V = \i,s1 -> lin V (reg2V i s1) ; + mkV : (imp,sg1,sg2,pl2 : Str) -> V = \i,s1,_,_ -> lin V (reg2V i s1) ; -- TODO: 4-place constructor mkV : Str -> V -> V = \s,v -> lin V (prefixV s v) } ; copula = ResSom.copula ; regV : Str -> Verb = \s -> case s of { - _ + #c + #c + "o" => cJoogso s ; - _ + "o" => cQaado s ; ---- - _ + "i" => cKari s ; - _ + "ee" => cYaree s ; - _ => cSug s + _ + #c + #c + "o" => mkVerb (cJoogso s) ; + _ + "o" => mkVerb (cQaado s) ; ---- + _ + "i" => mkVerb (cKari s) ; + _ + "ee" => mkVerb (cYaree s) ; + _ => mkVerb (cSug s) } ; + reg2V : Str -> Str -> Verb = \arag,arkaa -> case arag of { + _ + #c => mkVerb (cArag arag arkaa) ; + _ => regV arag + } ; + mkV2 = overload { mkV2 : Str -> V2 = \s -> lin V2 (regV s ** {c2 = noPrep}) ; mkV2 : Str -> Adposition -> V2 = \s,p -> lin V2 (regV s ** {c2 = p}) ; diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 9f2d549aa..919618fb6 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -505,99 +505,72 @@ oper -- Saeed page 79: -- "… the reference form is the imperative singular form -- since it corresponds to the form of the basic root." - mkVerb : (imperative,sg1,pl2 : Str) -> Verb = \qaado,qaat,ark -> - let stems : {p1 : Str ; p2 : Str} = case ark of { - a + r@#c + k@#c -- two consonants need a vowel in between - => ; - _ + #c -- if the pl2 root ends in consonant, infinitive needs a vowel - => ; - yar + "ee" -- double e turns into ey - => ; - _ => -- no changes, just add n for infinitive - } ; - arki = stems.p1 ; - arag = stems.p2 ; - arkin = case last arki of { -- The negative past tense ends in n: - "n" => arki ; -- if infinitive ends in n, no change; - _ => arki + "n" } ; -- otherwise add n. + VerbRoots8 : Type = {imper,sg1stem,sg2stem,pl1stem,progr,inf,negpast,impernegpl : Str} ; - progr : Str = case qaat of { -- Progressive - _ + "eey" => stems.p2 + "nay" ; -- bireey -> bireynay - _ + ("y"|"n") => init qaat + "nay" ; -- akhriy -> akhrinay ; gashad -> gashanay - _ + #v + "t" => qaat + "ay" ; - _ + #c + "t" => init qaat + "anay" ; - _ => qaat + "ay" } ; - - -- Some predictable sound changes - t : Str = case arag of { -- kari+seen, bixi noq+deen, (sug|joogsa|qaada)+teen, - _ + ("i"|"y") => "s" ; -- t changes into s in front of i/y - _ + ("x"|"q"|"c") => "d" ; -- t changes into d in front of x/q/c - _ => "t" } ; - ay : Str = case ark of { - _ + ("i"|"e") => "ey" ; - _ => "ay" } ; - n : Str = case arag of { - _ + #v => "nn" ; -- n duplicates after vowel - _ + "r" => "r" ; -- Saeed p. 35: agreement marker n (1PL) - _ + "l" => "l" ; -- assimilates to stem final r or. - _ => "n" } ; - an : Str = case qaado of { - _ + "o" => "an" ; -- Allomorph for imperatives - _ => "in" } ; - - in { s = table { + mkVerb : VerbRoots8 -> Verb = \vr -> + let arag : Str = vr.imper ; + qaat : Str = vr.sg1stem ; -- +aa -- hayst, boogd, joogsad, bilaab, ark, akhriy, + hadash : Str = vr.sg2stem ; -- +aa -- haysat, booqat, joogsat, bilowd, aragt, akhris, + qaadann : Str = vr.pl1stem ; -- +aa -- + arki : Str = vr.inf ; + arkin : Str = vr.negpast ; + qaada : Str = init vr.negpast ; -- TODO: is this correct? is 2sg neg imperative same as negative past root? + ay : Str = case arag of { + _ + ("i"|"e") => "ey" ; + _ => "ay" } ; + in { + s = table { VPres Simple Sg1_Sg3Masc pol => qaat + if_then_Pol pol "aa" "o" ; VPres Simple Sg2_Sg3Fem pol - => arag + t + if_then_Pol pol "aa" "o" ; - VPres Simple Pl1_ pol => arag + n + if_then_Pol pol "aa" "o" ; - VPres Simple Pl2_ pol => arag + t + "aan" ; - VPres Simple Pl3_ pol => qaat + "aan" ; + => hadash + if_then_Pol pol "aa" "o" ; + VPres Simple Pl1_ pol => qaadann + if_then_Pol pol "aa" "o" ; + VPres Simple Pl2_ pol => hadash + "aan" ; + VPres Simple Pl3_ pol => qaat + "aan" ; VPres Progressive Sg1_Sg3Masc pol - => progr + if_then_Pol pol "aa" "o" ; + => vr.progr + if_then_Pol pol "aa" "o" ; VPres Progressive Sg2_Sg3Fem pol - => progr + if_then_Pol pol "saa" "so" ; + => vr.progr + if_then_Pol pol "saa" "so" ; VPres Progressive Pl1_ pol - => progr + if_then_Pol pol "naa" "no" ; - VPres Progressive Pl2_ pol => progr + "saan" ; - VPres Progressive Pl3_ pol => progr + "aan" ; + => vr.progr + if_then_Pol pol "naa" "no" ; + VPres Progressive Pl2_ pol => vr.progr + "saan" ; + VPres Progressive Pl3_ pol => vr.progr + "aan" ; VPast Simple Sg1_Sg3Masc - => qaat + ay ; - VPast Simple Sg2_Sg3Fem => arag + t + ay ; -- t, d or s - VPast Simple Pl1_ => arag + n + ay ; - VPast Simple Pl2_ => arag + t + "een" ; -- t, d or s - VPast Simple Pl3_ => qaat + "een" ; + => qaat + ay ; + VPast Simple Sg2_Sg3Fem => hadash + ay ; + VPast Simple Pl1_ => qaadann + ay ; + VPast Simple Pl2_ => hadash + "een" ; + VPast Simple Pl3_ => qaat + "een" ; - VPast Progressive Sg1_Sg3Masc - => progr + "ey" ; - VPast Progressive Sg2_Sg3Fem => progr + "sey" ; - VPast Progressive Pl1_ => progr + "ney" ; - VPast Progressive Pl2_ => progr + "seen" ; - VPast Progressive Pl3_ => progr + "een" ; + VPast Progressive Sg1_Sg3Masc => vr.progr + "ey" ; + VPast Progressive Sg2_Sg3Fem => vr.progr + "sey" ; + VPast Progressive Pl1_ => vr.progr + "ney" ; + VPast Progressive Pl2_ => vr.progr + "seen" ; + VPast Progressive Pl3_ => vr.progr + "een" ; VNegPast Simple => arkin ; - VNegPast Progressive => progr + "n" ; + VNegPast Progressive => vr.progr + "n" ; -- TODO check conjugations 2 and 3 - VNegCond PlInv => arag + n + "een" ; - VNegCond SgMasc => qaat + "een" ; -- for most verbs same as VPast Simple Pl3_ - VNegCond SgFem => arag + t + "een" ; -- for most verbs same as VPast Simple Pl2_ + VNegCond SgMasc => qaat + "een" ; -- for most verbs same as VPast Simple Pl3_ + VNegCond SgFem => hadash + "een" ; -- for most verbs same as VPast Simple Pl2_ + VNegCond PlInv => qaadann + "een" ; -- VImp Sg Pos => arag ; VImp Pl Pos => qaat + "a" ; - VImp Sg Neg => arag + an ; - VImp Pl Neg => qaat + "ina" ; + VImp Sg Neg => qaada + "n" ; + VImp Pl Neg => vr.impernegpl ; VInf => arki ; VRel SgMasc => qaat + "a" ; - VRel SgFem => arag + t + "a" ; - VRel PlInv => arag + "na" ; + VRel SgFem => hadash + "a" ; + VRel PlInv => qaadann + "a" ; VRelNeg => qaat + "o" -- TODO check - } ; + } ; sii, dhex = [] ; isCopula = False ; } ; @@ -605,33 +578,101 @@ oper ------------------------- -- Regular verb paradigms - cSug, cKari, cYaree, cJoogso, cQaado : Str -> Verb ; + cSug, cBilaab, cKari, cYaree, cHayso, cJoogso, cQaado : Str -> VerbRoots8 ; + cArag : (arag,arkaa : Str) -> VerbRoots8 ; -- 1: Root verbs with no lexical affixes, e.g. sug TR 'wait for', kar INTR 'boil, cook'; + -- NB. imperative unable to distinguish whether stem consonant is K or G: sug~sugaa vs. bug~bukaa cSug sug = let cabb : Str = case sug of { - _ + "b" => sug + "b" ; -- TODO: more duplication patterns - _ => sug } - in mkVerb sug cabb sug ; + ca + "b" => ca + "bb" ; -- TODO: more duplication patterns + _ => sug } ; + in cArag sug (cabb+"aa") ; + + -- Imperative only cannot distinguish whether the vowel is epenthetic, and whether stem consonant is G/K or N/M + cArag arag arkaa = -- analogously: bug~bukaa, tartan~tartamaa + let ark : Str = init (init arkaa) ; + n : Str = case arag of { + _ + #v => "nn" ; -- n duplicates after vowel + _ + "r" => "r" ; -- Saeed p. 35: agreement marker n (1PL) + _ + "l" => "l" ; -- assimilates to stem final r or. + _ => "n" } ; + t : Str = case arag of { -- kari+saa, noq+daa, (sug|joogsa|qaada)+taa, hadh+aa + _ + ("x"|"q"|"c") => "d" ; -- t changes into d after x/q/c + _ + "dh" => [] ; -- duplicates after dh, but not written + _ => "t" } ; + hadash : Str = case arag of { + hada + "l" => hada + "sh" ; + _ => arag + t + } ; + + in { imper = arag ; + sg1stem = ark ; + sg2stem = hadash ; + pl1stem = arag + n ; + inf = ark + "i" ; + progr = ark + "ay" ; + negpast = ark + "in" ; + impernegpl = ark + "ina" } ; + + + + -- Predictable stem alterations: aab->ow + cBilaab bilaab = + let bilow : Str = init (init (init bilaab)) + "ow" ; + in cArag bilaab (bilaab + "aa") ** { + sg2stem = bilow + "d" ; + pl1stem = bilow + "n" } ; + -- 2A: Verbs derived from root verbs by the causative affix -i/-is, e.g. kari TR 'cook' (from conjugation 1 kar INTR 'boil, cook'); -- 2B: Verbs derived from nouns and adjectives by the causative/factitive affix -eel-ayn, e.g. yaree 'make small' (from yar ADJ 'small'); - cKari, cYaree = \kari -> mkVerb kari (kari+"y") kari ; + cKari kari = { imper = kari ; + sg1stem = kari + "y" ; + sg2stem = kari + "s" ; + pl1stem = kari + "nn" ; + inf, negpast = kari + "n" ; + progr = kari + "nay" ; + impernegpl = kari + "nina" } ; + + cYaree yaree = + let yar : Str = init (init yaree) ; + yarey : Str = case yaree of { + yar + "ee" => yar + "ey" ; + _ => yaree + "n" -- ideally shouldn't happen; this constructor should only be applied to imperatives that end in ee + } ; + in { imper = yaree ; + sg1stem = yaree + "y" ; + sg2stem = yarey + "s" ; + pl1stem = yarey + "n" ; + inf, negpast = yarey + "n" ; + progr = yarey + "nay" ; + impernegpl = yar + "aynina" } ; + -- 3A: Verbs derived from verbal stems by the middle voice affix -ol­/at -- e.g. karsó 'cook for oneself (from conjugation 2 kâri TR 'cook'); cJoogso joogso = let joogsa = init joogso + "a" ; - in mkVerb joogso (joogsa + "d") joogsa ; + in { imper = joogso ; + sg1stem = joogsa + "d" ; + sg2stem = joogsa + "t" ; + pl1stem = joogsa + "nn" ; + inf, negpast = joogsa + "n" ; + progr = joogsa + "nay" ; + impernegpl = joogsa + "nina" } ; + + cHayso hayso = -- otherwise like joogso, but sg1 is different + let hays : Str = init hayso ; + in cJoogso hayso ** {sg1stem = hays + "t"} ; + -- 3B: As conjugation 3A but verbs whose syllable structure triggers -- stem contraction and subsequent sandhi rules, e.g. qaadó 'take for oneself -- (from conjugation 1 qàad TR 'take'). cQaado qaado = let qaa = init (init qaado) - in mkVerb qaado -- Imperative sg, with the vowel - (qaa + "t") -- Per1 Sg, Per3 Pl and Per3 Sg Masc - (qaa + "da") ; -- Per2 Pl and others + in cJoogso qaado ** { sg1stem = qaa + "t" } ; -- Constructs verbs like u baahan+ahay prefixV : Str -> Verb -> Verb = \s,v -> v ** { @@ -676,7 +717,7 @@ oper } ; have_V : Verb = - let hold_V = mkVerb "hayso" "haysat" "haysa" in hold_V ** { + let hold_V = mkVerb (cHayso "hayso") in hold_V ** { s = table { VPres _ Sg1_Sg3Masc Pos => "leeyahay" ; VPres _ Sg2_Sg3Fem Pos => "leedahay" ; @@ -700,7 +741,7 @@ oper } ; fail_V : Verb = - let waa_V : Verb = cSug "waay" in waa_V ** { + let waa_V : Verb = mkVerb (cSug "waay") in waa_V ** { s = table { VPres _ Sg2_Sg3Fem _ => "waayday" ; @@ -1037,9 +1078,9 @@ oper => presV vp ; => pastV vp ; => vp.s ! VInf ++ presCopula ! agrPol ; ---- just guessing - => vp.s ! VInf ++ pastV (cSug "jir") ; - => vp.s ! VInf ++ presV (cSug "doon") ; - => vp.s ! VInf ++ pastV (cSug "doon") + => vp.s ! VInf ++ pastV (mkVerb (cSug "jir")) ; + => vp.s ! VInf ++ presV (mkVerb (cSug "doon")) ; + => vp.s ! VInf ++ pastV (mkVerb (cSug "doon")) } where { agrPol : {agr:Agreement ; pol:Polarity} = {agr=agr; pol=p} ; diff --git a/src/somali/StructuralSom.gf b/src/somali/StructuralSom.gf index 83b26c7ad..5ce165290 100644 --- a/src/somali/StructuralSom.gf +++ b/src/somali/StructuralSom.gf @@ -180,7 +180,7 @@ lin have_V2 = mkV2 have_V noPrep ; -- TODO: check if {sii = "l" ++ BIND ; isCopu lin can8know_VV = can_VV ; -- can (capacity) lin can_VV = mkVV "kar" ; -- can (possibility) lin must_VV = mkVV waa_in ; -lin want_VV = mkVV (mkV "rabid" "rab" "rab") subjunctive ; +lin want_VV = mkVV (mkV "rab" "rabaa") subjunctive ; ------ From 4b336c2453e65a7a2992cfad867f4f31f90f7d22 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 9 Jun 2023 22:41:02 +0200 Subject: [PATCH 17/17] (Som) Morgan's corrections to adpos. contractions --- src/somali/ResSom.gf | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/somali/ResSom.gf b/src/somali/ResSom.gf index 919618fb6..b797a68e1 100644 --- a/src/somali/ResSom.gf +++ b/src/somali/ResSom.gf @@ -385,56 +385,56 @@ oper Sg1Obj => table { Ugu => "iigu" ; Uga => "iiga" ; Ula => "iila" ; Kaga => "igaga" ; Kula => "igula" ; Kala => "igala" ; - ImpersSubj NoAdp => "lay" ; + ImpersSubj NoAdp => "lay" ; -- alt. "la i" ImpersSubj U => "la ii" ; - ImpersSubj La => "??la ila" ; ---- not in morgan's table - ImpersSubj Ku => "laygu" ; - ImpersSubj Ka => "layga" ; + ImpersSubj La => "layla" ; -- alt. "la ila" + ImpersSubj Ku => "laygu" ; -- alt. "la igu" + ImpersSubj Ka => "layga" ; -- alt. "la iga" Single p => (prepTable ! p).s ! Sg1Obj } ; Sg2Obj => table { Ugu => "kuugu" ; Uga => "kaaga" ; Ula => "kuula" ; Kaga => "kaaga" ; Kula => "kugula" ; Kala => "kaala" ; ImpersSubj NoAdp => "lagu" ; -- Lagu 1: ku = Sg2Obj - ImpersSubj U => "??laguu" ; ---- not in morgan's table + ImpersSubj U => "laguu" ; ImpersSubj La => "lagula" ; - ImpersSubj Ku => "??lagugu" ; ---- not in morgan's table - ImpersSubj Ka => "??lagaa" ; ---- not in morgan's table + ImpersSubj Ku => "lagugu" ; + ImpersSubj Ka => "lagaa" ; Single p => (prepTable ! p).s ! Sg2Obj } ; Pl1Obj Excl => table { Ugu => "noogu" ; Uga => "nooga" ; Ula => "noola" ; Kaga => "nagaga" ; Kula => "nagula" ; Kala => "nagala" ; ImpersSubj NoAdp => "nala" ; - ImpersSubj U => "??la noo" ; ---- not in morgan's table - ImpersSubj La => "??la nala" ; ---- not in morgan's table - ImpersSubj Ku => "??la nagu" ; ---- not in morgan's table - ImpersSubj Ka => "??la naga" ; ---- not in morgan's table + ImpersSubj U => "naloo" ; -- alt. "lanoo" + ImpersSubj La => "nalala" ; -- alt. "lanala" + ImpersSubj Ku => "nalagu" ; -- alt. "lanagu" + ImpersSubj Ka => "nalaga" ; -- alt. "lanaga" Single p => (prepTable ! p).s ! Pl1Obj Excl } ; Pl1Obj Incl => table { Ugu => "inoogu" ; Uga => "inooga" ; Ula => "inoola" ; Kaga => "inagaga" ; Kula => "inagula" ; Kala => "inagala" ; - ImpersSubj NoAdp => "??inala" ; ---- none of following in morgan's table - ImpersSubj U => "??la inoo" ; - ImpersSubj La => "??la inala" ; - ImpersSubj Ku => "??la inagu" ; - ImpersSubj Ka => "??la inaga" ; + ImpersSubj NoAdp => "inala" ; + ImpersSubj U => "laynoo" ; -- alt. "la inoo" ; + ImpersSubj La => "laynala" ; -- alt. "la inala" ; + ImpersSubj Ku => "laynagu" ; -- alt. "la inagu" ; + ImpersSubj Ka => "laynaga" ; -- alt. "la inaga" ; Single p => (prepTable ! p).s ! Pl1Obj Incl } ; Pl2Obj => table { Ugu => "idiinku" ; Uga => "idiinka" ; Ula => "idiinla" ; Kaga => "idinkaga" ; Kula => "idinkula" ; Kala => "idinkala" ; - ImpersSubj NoAdp => "laydin" ; ---- none of following in morgan's table - ImpersSubj U => "??laydiin" ; - ImpersSubj La => "??laydinla" ; - ImpersSubj Ku => "??laydinku" ; - ImpersSubj Ka => "??laydinka" ; + ImpersSubj NoAdp => "laydin" ; + ImpersSubj U => "laydiin" ; -- alt. "la idiin" + ImpersSubj La => "laydinla" ; -- alt. "la idinla" + ImpersSubj Ku => "laydinku" ; -- alt. "la idinku" + ImpersSubj Ka => "laydinka" ; -- alt. "la idinka" Single p => (prepTable ! p).s ! Pl2Obj } ; ReflexiveObj => table { Ugu => "isugu" ; Uga => "isaga" ; - Ula => "??isula" ; Kaga => "??iskaga" ; Kula => "??iskula" ; Kala => "??iskala" ; ---- not in morgan's table + Ula => "isula" ; Kaga => "iskaga" ; Kula => "iskula" ; Kala => "iskala" ; ImpersSubj NoAdp => "lays" ; - ImpersSubj U => "laysu" ; - ImpersSubj La => "laysla" ; - ImpersSubj Ku => "laysku" ; - ImpersSubj Ka => "layska" ; + ImpersSubj U => "laysu" ; -- alt. "la isu" + ImpersSubj La => "laysla" ; -- alt. "la isla" + ImpersSubj Ku => "laysku" ; -- alt. "la isku" + ImpersSubj Ka => "layska" ; -- alt. "la iska" Single p => (prepTable ! p).s ! ReflexiveObj } ; a => table { Ugu => "ugu" ; Uga => "uga" ; Ula => "ula" ; Kaga => "kaga" ; Kula => "kula" ; Kala => "kala" ;