From 4e69c154d674f9a27745f4e2320f986368da54a6 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Tue, 29 Sep 2026 16:48:37 +0200 Subject: [PATCH] extensions by Codex --- src/turkish/AdverbTur.gf | 8 +- src/turkish/CatTur.gf | 7 ++ src/turkish/ConjunctionTur.gf | 13 ++- src/turkish/ConstructionTur.gf | 71 ++++++++++++++ src/turkish/ExtendTur.gf | 170 ++++++++++++++++++++++++++++++++- src/turkish/IdiomTur.gf | 45 +++++++-- src/turkish/NamesTur.gf | 14 +++ src/turkish/NounTur.gf | 64 +++---------- src/turkish/NumeralTur.gf | 36 +++++++ src/turkish/QuestionTur.gf | 36 ++++--- src/turkish/RelativeTur.gf | 12 ++- src/turkish/SentenceTur.gf | 42 +++++--- src/turkish/StructuralTur.gf | 4 +- src/turkish/VerbTur.gf | 86 ++++++++++++----- 14 files changed, 484 insertions(+), 124 deletions(-) create mode 100644 src/turkish/ConstructionTur.gf diff --git a/src/turkish/AdverbTur.gf b/src/turkish/AdverbTur.gf index 2cf55f50..62e2bd2c 100644 --- a/src/turkish/AdverbTur.gf +++ b/src/turkish/AdverbTur.gf @@ -12,11 +12,11 @@ concrete AdverbTur of Adverb = CatTur ** open ResTur, Prelude in { } ; -- TODO: inflect the subject to genitive. - ComparAdvAdjS cadv a s = variants {} ; {- { - s = s.subord ++ cadv.s ++ a.s ! Sg ! Nom - } ; -} + ComparAdvAdjS cadv a s = { + s = s.s ++ cadv.s ++ a.s ! Sg ! Nom + } ; - SubjS s1 s2 = variants {} ; -- {s = s1.s ++ s2.subord} ; + SubjS subj s = {s = subj.s ++ s.s} ; PositAdvAdj a = {s = a.adv} ; PositAdAAdj a = {s = a.adv} ; diff --git a/src/turkish/CatTur.gf b/src/turkish/CatTur.gf index b57615b4..333e22d7 100644 --- a/src/turkish/CatTur.gf +++ b/src/turkish/CatTur.gf @@ -6,10 +6,14 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud -- Tensed/Untensed S = {s : Str} ; + QS = {s : Str} ; RS = {s : Agr => Str} ; -- Sentence Cl = {s : Tense => Anteriority => Polarity => Str} ; + QCl = {s : Tense => Anteriority => Polarity => Str} ; + ClSlash = {s : Tense => Anteriority => Polarity => Str; c : Prep} ; + SSlash = {s : Str; c : Prep} ; Imp = {s : Polarity => Number => Str} ; -- Noun @@ -33,6 +37,9 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud Quant = {s : Str; useGen : UseGen} ; PrepNP = {s : Str} ; DAP = {s : Number => Case => Str} ; + IP = {s : Str} ; + IComp = {s : Str} ; + IQuant = {s : Str} ; CAdv = {s : Str; p : Str; c : Case} ; AdN = {s : Str; c : Case} ; diff --git a/src/turkish/ConjunctionTur.gf b/src/turkish/ConjunctionTur.gf index 1a448aad..fb5788d1 100644 --- a/src/turkish/ConjunctionTur.gf +++ b/src/turkish/ConjunctionTur.gf @@ -81,9 +81,15 @@ concrete ConjunctionTur of Conjunction = h = xs.h} ; - ConjRS _ _ = variants {} ; - ConsRS _ _ = variants {} ; - BaseRS _ _ = variants {} ; + ConjRS conj ss = { + s = \\a => linCoord [] ! conj.sep ++ ss.s ! a ! conj.sep ++ conj.s ++ ss.s ! a ! 4 + } ; + ConsRS x xs = { + s = \\a => table {4 => xs.s ! a ! 4; i => x.s ! a ++ linCoord bindComma ! i ++ xs.s ! a ! i} + } ; + BaseRS x y = { + s = \\a => table {4 => y.s ! a; _ => x.s ! a} + } ; lincat [S] = {s : Ints 4 => Str} ; @@ -94,5 +100,6 @@ concrete ConjunctionTur of Conjunction = [CN] = {s : Number => Case => Ints 4 => Str; gen : Number => Agr => Ints 4 => Str; h : Harmony} ; + [RS] = {s : Agr => Ints 4 => Str} ; } diff --git a/src/turkish/ConstructionTur.gf b/src/turkish/ConstructionTur.gf new file mode 100644 index 00000000..85cba904 --- /dev/null +++ b/src/turkish/ConstructionTur.gf @@ -0,0 +1,71 @@ +--# -path=.:../abstract:../common:../../prelude + +concrete ConstructionTur of Construction = CatTur ** + open GrammarTur, ParadigmsTur, ResTur, HarmonyTur, Prelude in { + + lincat + Weekday = N ; + Month = N ; + Monthday = {s : Str} ; + Year = {s : Str} ; + + lin + ready_VP = UseComp (CompAP (PositA (mkA "hazır"))) ; + + has_age_VP card = { + s = \\asp,vf => card.s ! Sg ! Nom ++ "yaşında" ++ + mkVerbForms olmak_V ! asp ! vf; + compl = [] + } ; + + n_units_AP card unit adj = { + s = \\n,c => card.s ! Sg ! Nom ++ unit.s ! Pl ! Nom ++ adj.s ! n ! c; + h = adj.h + } ; + + n_units_of_NP card unit np = { + s = \\c => np.s ! Gen ++ card.s ! Sg ! Nom ++ unit.s ! Pl ! c; + h = unit.h; + a = agrP3 Pl + } ; + + cup_of_CN np = { + s = \\n,c => np.s ! Gen ++ (mkN "fincan").s ! n ! c; + gen = \\n,a => np.s ! Gen ++ (mkN "fincan").gen ! n ! a; + h = (mkN "fincan").h + } ; + + weekdayPunctualAdv day = {s = day.s ! Sg ! Loc} ; + weekdayHabitualAdv day = {s = day.s ! Pl ! Loc} ; + weekdayNextAdv day = {s = "gelecek" ++ day.s ! Sg ! Nom} ; + weekdayLastAdv day = {s = "geçen" ++ day.s ! Sg ! Nom} ; + monthAdv month = {s = month.s ! Sg ! Loc} ; + yearAdv year = {s = year.s ++ "yılında"} ; + + intYear i = {s = i.s} ; + intMonthday i = {s = i.s} ; + + weekdayN day = day ; + monthN month = month ; + + monday_Weekday = mkN "Pazartesi" ; + tuesday_Weekday = mkN "Salı" ; + wednesday_Weekday = mkN "Çarşamba" ; + thursday_Weekday = mkN "Perşembe" ; + friday_Weekday = mkN "Cuma" ; + saturday_Weekday = mkN "Cumartesi" ; + sunday_Weekday = mkN "Pazar" ; + + january_Month = mkN "Ocak" ; + february_Month = mkN "Şubat" ; + march_Month = mkN "Mart" ; + april_Month = mkN "Nisan" ; + may_Month = mkN "Mayıs" ; + june_Month = mkN "Haziran" ; + july_Month = mkN "Temmuz" ; + august_Month = mkN "Ağustos" ; + september_Month = mkN "Eylül" ; + october_Month = mkN "Ekim" ; + november_Month = mkN "Kasım" ; + december_Month = mkN "Aralık" ; +} diff --git a/src/turkish/ExtendTur.gf b/src/turkish/ExtendTur.gf index a2e30569..80460481 100644 --- a/src/turkish/ExtendTur.gf +++ b/src/turkish/ExtendTur.gf @@ -1,4 +1,14 @@ -concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in { +concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParadigmsTur, Prelude, Predef in { + + lincat + VPS = {s : Agr => Str} ; + [VPS] = {s : Agr => Ints 4 => Str} ; + VPI = {s : Str} ; + [VPI] = {s : Ints 4 => Str} ; + [Comp] = {s : Aspect => VForm => Ints 4 => Str} ; + [Imp] = {s : Polarity => Number => Ints 4 => Str} ; + RNP = {s : Agr => Case => Str} ; + RNPList = {s : Agr => Case => Ints 4 => Str} ; lin GenRP n cn = { @@ -6,11 +16,155 @@ concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in { } ; GenModNP num np cn = { - s = \\c => np.s ! Nom ++ num.s ! num.n ! c ++ cn.gen ! num.n ! np.a ; + s = \\c => np.s ! Gen ++ num.s ! num.n ! c ++ cn.gen ! num.n ! np.a ; h = cn.h ; a = {n=num.n; p=P3} ; } ; + CompoundN n1 n2 = { + s = \\n,c => n1.s ! Sg ! Nom ++ n2.s ! n ! c; + gen = \\n,a => n1.s ! Sg ! Nom ++ n2.gen ! n ! a; + h = n2.h + } ; + + CompoundAP n a = { + s = \\num,c => n.s ! Sg ! Nom ++ a.s ! num ! c ; + h = a.h + } ; + + PresPartAP vp = { + s = \\_,_ => vp.compl ++ vp.s ! Perf ! VImperfPart Pos ; + h = mkHar I_Har (SCon Soft) + } ; + + PastPartAP vp = { + s = \\_,_ => vp.compl ++ mkVerbForms (passiveVerb vp) ! Perf ! VPerfPart Pos ; + h = vp.h + } ; + + PastPartAgentAP vp np = { + s = \\_,_ => np.s ! Nom ++ "tarafından" ++ vp.compl ++ + mkVerbForms (passiveVerb vp) ! Perf ! VPerfPart Pos ; + h = vp.h + } ; + + GerundCN vp = { + s = \\_,_ => vp.compl ++ vp.s ! Perf ! VInf Pos ; + gen = \\_,_ => vp.compl ++ vp.s ! Perf ! VInf Pos ; + h = mkHar I_Har (SCon Soft) + } ; + + GerundNP vp = { + s = \\_ => vp.compl ++ vp.s ! Perf ! VInf Pos ; + h = mkHar I_Har (SCon Soft) ; + a = agrP3 Sg + } ; + + GerundAdv vp = {s = vp.compl ++ vp.s ! Perf ! VInf Pos ++ "suretiyle"} ; + WithoutVP vp = {s = vp.compl ++ vp.s ! Perf ! VInf Neg ++ "suretiyle"} ; + ByVP vp = {s = vp.compl ++ vp.s ! Perf ! VInf Pos ++ "suretiyle"} ; + InOrderToVP vp = {s = vp.compl ++ vp.s ! Perf ! VInf Pos ++ "için"} ; + + MkVPS temp pol vp = { + s = \\agr => vp.compl ++ vp.s ! Perf ! VFin temp.t temp.a pol.p agr + } ; + + BaseVPS x y = {s = \\a => table {4 => y.s ! a; _ => x.s ! a}} ; + ConsVPS x xs = { + s = \\a => table {4 => xs.s ! a ! 4; i => x.s ! a ++ "," ++ xs.s ! a ! i} + } ; + ConjVPS conj xs = {s = \\a => xs.s ! a ! conj.sep ++ conj.s ++ xs.s ! a ! 4} ; + PredVPS np vps = {s = np.s ! Nom ++ vps.s ! np.a} ; + + MkVPI vp = {s = vp.compl ++ vp.s ! Perf ! VInf Pos} ; + BaseVPI x y = {s = table {4 => y.s; _ => x.s}} ; + ConsVPI x xs = {s = table {4 => xs.s ! 4; i => x.s ++ "," ++ xs.s ! i}} ; + ConjVPI conj xs = {s = xs.s ! conj.sep ++ conj.s ++ xs.s ! 4} ; + ComplVPIVV vv vpi = {s = mkVerbForms vv; compl = vpi.s} ; + + BaseComp x y = { + s = \\asp,vf => table {4 => y.s ! asp ! vf; _ => x.s ! asp ! vf} + } ; + ConsComp x xs = { + s = \\asp,vf => table { + 4 => xs.s ! asp ! vf ! 4; + i => x.s ! asp ! vf ++ "," ++ xs.s ! asp ! vf ! i + } + } ; + ConjComp conj xs = { + s = \\asp,vf => xs.s ! asp ! vf ! conj.sep ++ conj.s ++ xs.s ! asp ! vf ! 4 ; + compl = [] + } ; + + BaseImp x y = { + s = \\p,n => table {4 => y.s ! p ! n; _ => x.s ! p ! n} + } ; + ConsImp x xs = { + s = \\p,n => table {4 => xs.s ! p ! n ! 4; i => x.s ! p ! n ++ "," ++ xs.s ! p ! n ! i} + } ; + ConjImp conj xs = { + s = \\p,n => xs.s ! p ! n ! conj.sep ++ conj.s ++ xs.s ! p ! n ! 4 + } ; + + ReflPron = {s = \\_,_ => "kendi"} ; + ReflPoss num cn = {s = \\agr,_ => cn.gen ! num.n ! agr} ; + PredetRNP pred rnp = {s = \\a,c => pred.s ++ rnp.s ! a ! c} ; + AdvRNP np prep rnp = { + s = \\a,c => np.s ! c ++ prep.s ++ rnp.s ! a ! c + } ; + ReflRNP vp rnp = { + s = mkVerbForms vp ; + compl = vp.compl ++ rnp.s ! (agrP3 Sg) ! vp.c.c ++ vp.c.s + } ; + AdvRVP vp prep rnp = vp ** { + compl = vp.compl ++ rnp.s ! (agrP3 Sg) ! prep.c ++ prep.s + } ; + AdvRAP ap prep rnp = ap ** { + s = \\n,c => rnp.s ! (agrP3 n) ! prep.c ++ prep.s ++ ap.s ! n ! c + } ; + ReflA2RNP ap rnp = ap ** { + s = \\n,c => rnp.s ! (agrP3 n) ! ap.c.c ++ ap.c.s ++ ap.s ! n ! c + } ; + PossPronRNP pron num cn rnp = { + s = \\c => pron.s ! Gen ++ cn.gen ! num.n ! pron.a ++ rnp.s ! pron.a ! c ; + h = cn.h ; + a = agrP3 num.n + } ; + + Base_rr_RNP x y = {s = \\a,c => table {4 => y.s ! a ! c; _ => x.s ! a ! c}} ; + Base_nr_RNP x y = {s = \\a,c => table {4 => y.s ! a ! c; _ => x.s ! c}} ; + Base_rn_RNP x y = {s = \\a,c => table {4 => y.s ! c; _ => x.s ! a ! c}} ; + Cons_rr_RNP x xs = { + s = \\a,c => table {4 => xs.s ! a ! c ! 4; i => x.s ! a ! c ++ "," ++ xs.s ! a ! c ! i} + } ; + Cons_nr_RNP x xs = { + s = \\a,c => table {4 => xs.s ! a ! c ! 4; i => x.s ! c ++ "," ++ xs.s ! a ! c ! i} + } ; + ConjRNP conj xs = {s = \\a,c => xs.s ! a ! c ! conj.sep ++ conj.s ++ xs.s ! a ! c ! 4} ; + + UseDAP dap = { + s = \\c => dap.s ! Sg ! c; + h = mkHar I_Har (SCon Soft); + a = agrP3 Sg + } ; + UseDAPMasc = UseDAP ; + UseDAPFem = UseDAP ; + + ProgrVPSlash vp = vp ; + + ApposNP np app = np ** {s = \\c => np.s ! c ++ "," ++ app.s ! Nom} ; + + ComplSlashPartLast vp np = { + s = mkVerbForms vp ; + compl = vp.compl ++ np.s ! vp.c.c ++ vp.c.s + } ; + + ComplBareVS vs sent = {s = mkVerbForms vs; compl = sent.s} ; + + EmptyRelSlash cl = { + s = \\t,a,p,agr => cl.s ! t ! a ! p ++ "olan" + } ; + UttVPShort vp = {s = vp.s ! Perf ! VInf Pos} ; UttAdV adv = {s = adv.s} ; @@ -26,7 +180,7 @@ concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in { aoristType = vps.aoristType ; h = vps.h ; } ; - compl = [] + compl = vps.compl } ; PassAgentVPSlash vps np = { @@ -36,7 +190,15 @@ concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in { aoristType = vps.aoristType ; h = vps.h ; } ; - compl = np.s ! Acc ++ "tarafından" + compl = np.s ! Nom ++ "tarafından" ++ vps.compl + } ; + + oper + passiveVerb : Verb -> Verb = \v -> { + s = v.stems ! VPass ++ BIND ++ suffixStr v.h infinitiveSuffix; + stems = \\_ => v.stems ! VPass; + aoristType = v.aoristType; + h = v.h } ; } diff --git a/src/turkish/IdiomTur.gf b/src/turkish/IdiomTur.gf index cc444905..8697e883 100644 --- a/src/turkish/IdiomTur.gf +++ b/src/turkish/IdiomTur.gf @@ -1,17 +1,46 @@ concrete IdiomTur of Idiom = CatTur ** open Prelude, ResTur, SuffixTur in { lin - ImpersCl _ = variants {} ; - GenericCl _ = variants {} ; - ExistNP _ = variants {} ; - ExistIP _ = variants {} ; - CleftNP _ _ = variants {} ; - CleftAdv _ _ = variants {} ; - ImpPl1 _ = variants {} ; + ImpersCl vp = { + s = \\t,a,p => vp.compl ++ vp.s ! Perf ! VFin t a p (agrP3 Sg) + } ; + GenericCl vp = { + s = \\t,a,p => "insan" ++ vp.compl ++ vp.s ! Perf ! VFin t a p (agrP3 Sg) + } ; + ExistNP np = { + s = \\t,a,p => np.s ! Nom ++ case of { + => "var" ; + => "yok" ; + <_,Pos> => "var" ++ mkVerbForms olmak_V ! Perf ! VFin t a Pos (agrP3 Sg) ; + <_,Neg> => "yok" ++ mkVerbForms olmak_V ! Perf ! VFin t a Pos (agrP3 Sg) + } + } ; + ExistIP ip = { + s = \\t,a,p => ip.s ++ case p of {Pos => "var"; Neg => "yok"} + } ; + ExistNPAdv np adv = { + s = \\t,a,p => adv.s ++ (ExistNP np).s ! t ! a ! p + } ; + ExistIPAdv ip adv = { + s = \\t,a,p => adv.s ++ (ExistIP ip).s ! t ! a ! p + } ; + CleftNP np rs = { + s = \\t,a,p => rs.s ! np.a ++ np.s ! Nom + } ; + CleftAdv adv s = { + s = \\t,a,p => adv.s ++ s.s + } ; + ImpPl1 vp = {s = "hadi" ++ vp.compl ++ vp.s ! Perf ! VImp Pos Pl} ; + ImpP3 np vp = {s = np.s ! Nom ++ vp.compl ++ vp.s ! Perf ! VImp Pos Sg} ; ProgrVP vp = vp ** { s = \\asp,vform => vp.s ! Imperf ! vform } ; -} + SelfAdvVP vp = vp ** {compl = vp.compl ++ "kendi"} ; + SelfAdVVP vp = vp ** { + s = \\asp,vf => "kendi" ++ vp.s ! asp ! vf + } ; + SelfNP np = np ** {s = \\c => np.s ! c ++ "kendi"} ; +} diff --git a/src/turkish/NamesTur.gf b/src/turkish/NamesTur.gf index a03a12d4..33a32966 100644 --- a/src/turkish/NamesTur.gf +++ b/src/turkish/NamesTur.gf @@ -22,4 +22,18 @@ lin UsePN pn = { a = {n = pn.n; p = P3} } ; +lin UseLN ln = { + s = ln.s; + h = ln.h; + a = {n = ln.n; p = P3} + } ; + +lin PlainLN = UseLN ; + +lin InLN ln = {s = ln.s ! Loc} ; + +lin AdjLN ap ln = ln ** { + s = \\c => ap.s ! Sg ! Nom ++ ln.s ! c + } ; + } diff --git a/src/turkish/NounTur.gf b/src/turkish/NounTur.gf index 47aab179..0e3a9d1c 100644 --- a/src/turkish/NounTur.gf +++ b/src/turkish/NounTur.gf @@ -65,56 +65,14 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX, MassNP cn = { s = cn.s ! Sg; h = cn.h; - a = { n = Sg; p = P1 } + a = { n = Sg; p = P3 } } ; - ComplN2 f x = - case f.c.c of { - Nom => { - s = \\n, c => x.s ! Gen ++ f.s ! n ! Acc; - gen = \\_, _ => "TODO"; - h = f.h - }; - Acc => { - s = \\_,_ => "TODO"; - gen = \\_, _ => "TODO"; - h = f.h}; - Gen => { - s = - \\n, c => - x.s ! Gen ++ f.gen ! n ! {n = Sg; p = P3} - ++ BIND ++ (caseSuffixes ! c).st ! f.h.con ! f.h.vow; - gen = \\_, _ => "TODO"; - h = f.h - }; - Dat => { - s = \\n, c => - x.s ! Gen ++ f.gen ! n ! {n = Sg; p = P3} - ++ datSuffixN.st ! f.h.con ! f.h.vow; - gen = \\_, _ => "TODO"; - h = f.h - }; - Loc => { - s = \\_,_ => "TODO"; - gen = \\_, _ => "TODO"; - h = f.h - }; - Ablat => { - s = \\_,_ => "TODO"; - gen = \\_, _ => "TODO"; - h = f.h - }; - Abess _ => { - s = \\_,_ => "TODO"; - gen = \\_, _ => "TODO"; - h = f.h - }; - Instr => { - s = \\_,_ => "TODO"; - gen = \\_, _ => "TODO"; - h = f.h - } - }; + ComplN2 f x = { + s = \\n,c => x.s ! f.c.c ++ f.c.s ++ f.s ! n ! c ; + gen = \\n,a => x.s ! f.c.c ++ f.c.s ++ f.gen ! n ! a ; + h = f.h + } ; AdjCN ap cn = { @@ -172,7 +130,7 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX, DetNP det = { s = \\c => det.s ; h = {vow=I_Har; con=SCon Soft} ; -- to be fixed - a = {n = det.n ; p = P1} + a = {n = det.n ; p = P3} } ; ExtAdvNP np adv = { @@ -212,8 +170,8 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX, } ; PossNP cn np = { - s = \\n,c => np.s ! Gen ++ cn.s ! n ! c ; - gen = cn.gen ; + s = \\n,c => np.s ! Gen ++ cn.gen ! n ! np.a ; + gen = \\n,a => np.s ! Gen ++ cn.gen ! n ! a ; h = cn.h } ; @@ -226,8 +184,8 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX, } ; SentCN cn sc = { - s = \\n,c => "(TODO: SentCN)" ; - gen = cn.gen ; + s = \\n,c => sc.s ++ cn.s ! n ! c ; + gen = \\n,a => sc.s ++ cn.gen ! n ! a ; h = cn.h } ; diff --git a/src/turkish/NumeralTur.gf b/src/turkish/NumeralTur.gf index b16bef6d..67d8b1dc 100644 --- a/src/turkish/NumeralTur.gf +++ b/src/turkish/NumeralTur.gf @@ -52,7 +52,43 @@ lin pot3plus n m = {s = \\t,num,c => case n.n of { } ++ "bin" ++ m.s ! t ! num ! c; n = Pl} ; lin pot3as4 n = n ; +lin pot41 = { + s = \\t,num,c => "bir" ++ (mkNum "milyon" "milyon").s ! unit ! t ! num ! c; + n = Pl +} ; +lin pot4 n = { + s = \\t,num,c => n.s ! NCard ! Sg ! Nom ++ + (mkNum "milyon" "milyon").s ! unit ! t ! num ! c; + n = Pl +} ; +lin pot4plus n m = { + s = \\t,num,c => n.s ! NCard ! Sg ! Nom ++ "milyon" ++ m.s ! t ! num ! c; + n = Pl +} ; lin pot4as5 n = n ; +lin pot4decimal d = { + s = \\t,num,c => d.s ! NCard ! Sg ! Nom ++ + (mkNum "milyon" "milyon").s ! unit ! t ! num ! c; + n = Pl +} ; +lin pot51 = { + s = \\t,num,c => "bir" ++ (mkNum "milyar" "milyar").s ! unit ! t ! num ! c; + n = Pl +} ; +lin pot5 n = { + s = \\t,num,c => n.s ! NCard ! Sg ! Nom ++ + (mkNum "milyar" "milyar").s ! unit ! t ! num ! c; + n = Pl +} ; +lin pot5plus n m = { + s = \\t,num,c => n.s ! NCard ! Sg ! Nom ++ "milyar" ++ m.s ! t ! num ! c; + n = Pl +} ; +lin pot5decimal d = { + s = \\t,num,c => d.s ! NCard ! Sg ! Nom ++ + (mkNum "milyar" "milyar").s ! unit ! t ! num ! c; + n = Pl +} ; lincat diff --git a/src/turkish/QuestionTur.gf b/src/turkish/QuestionTur.gf index d6c3788e..d746d910 100644 --- a/src/turkish/QuestionTur.gf +++ b/src/turkish/QuestionTur.gf @@ -1,19 +1,29 @@ concrete QuestionTur of Question = CatTur ** open ResTur, Prelude in { lin - AdvIAdv _ _ = variants {} ; - AdvIP _ _ = variants {} ; - PrepIP _ _ = variants {} ; - CompIP _ = variants {} ; - CompIAdv _ = variants {} ; - IdetQuant _ _ = variants {} ; - IdetCN _ _ = variants {} ; - IdetIP _ = variants {} ; + AdvIAdv iadv adv = {s = adv.s ++ iadv.s} ; + AdvIP ip adv = {s = adv.s ++ ip.s} ; + PrepIP prep ip = {s = ip.s ++ prep.s} ; + CompIP ip = {s = ip.s} ; + CompIAdv adv = {s = adv.s} ; + IdetQuant iq num = {s = iq.s ++ num.s ! Sg ! Nom} ; + IdetCN idet cn = {s = idet.s ++ cn.s ! Sg ! Nom} ; + IdetIP idet = {s = idet.s} ; - QuestIComp _ _ = variants {} ; - QuestIAdv _ _ = variants {} ; - QuestSlash _ _ = variants {} ; - QuestVP _ _ = variants {} ; - QuestCl _ = variants {} ; + QuestIComp ic np = { + s = \\t,a,p => np.s ! Nom ++ ic.s ++ "mi" + } ; + QuestIAdv iadv cl = { + s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p + } ; + QuestSlash ip cl = { + s = \\t,a,p => ip.s ++ cl.s ! t ! a ! p + } ; + QuestVP ip vp = { + s = \\t,a,p => ip.s ++ vp.compl ++ vp.s ! Perf ! VFin t a p (agrP3 Sg) + } ; + QuestCl cl = { + s = \\t,a,p => cl.s ! t ! a ! p ++ "mi" + } ; } diff --git a/src/turkish/RelativeTur.gf b/src/turkish/RelativeTur.gf index fd852bea..575770cf 100644 --- a/src/turkish/RelativeTur.gf +++ b/src/turkish/RelativeTur.gf @@ -1,7 +1,9 @@ concrete RelativeTur of Relative = CatTur ** open ResTur in { lin - RelCl = variants {} ; + RelCl cl = { + s = \\t,a,p,agr => cl.s ! t ! a ! p ++ "olan" + } ; RelVP rp vp = { s = \\t,a,p,agr => @@ -15,9 +17,13 @@ lin } ; } ; - RelSlash = variants {} ; + RelSlash rp cl = { + s = \\t,a,p,agr => rp.s ! agr ++ cl.s ! t ! a ! p ++ "olan" + } ; - FunRP = variants {} ; + FunRP prep np rp = { + s = \\agr => np.s ! prep.c ++ prep.s ++ rp.s ! agr + } ; IdRP = {s = \\_ => []} ; diff --git a/src/turkish/SentenceTur.gf b/src/turkish/SentenceTur.gf index 4f7c73bf..da0f0557 100644 --- a/src/turkish/SentenceTur.gf +++ b/src/turkish/SentenceTur.gf @@ -3,24 +3,33 @@ concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in { lin PredVP np vp = {s = \\t,a,p => np.s ! Nom ++ vp.compl ++ vp.s ! Perf ! VFin t a p np.a} ; - PredSCVP sc vp = variants {} ; + PredSCVP sc vp = { + s = \\t,a,p => sc.s ++ vp.compl ++ vp.s ! Perf ! VFin t a p (agrP3 Sg) + } ; - -- TODO: Check how correct this is. - EmbedVP vp = variants {} ; -- {s = (vp.s ! Gerund Sg Acc)} ; + EmbedVP vp = {s = vp.compl ++ vp.s ! Perf ! VInf Pos} ; UseCl temp pol cl = {s = temp.s ++ pol.s ++ cl.s ! temp.t ! temp.a ! pol.p} ; - UseQCl _ _ = variants {} ; + UseQCl temp pol cl = {s = temp.s ++ pol.s ++ cl.s ! temp.t ! temp.a ! pol.p} ; UseRCl temp pol cl = {s = \\agr => temp.s ++ pol.s ++ cl.s ! temp.t ! temp.a ! pol.p ! agr} ; - SlashVP _ _ = variants {} ; - AdvSlash _ _ = variants {} ; - SlashPrep _ _ = variants {} ; - SlashVS v = variants {} ; + SlashVP np vp = { + s = \\t,a,p => np.s ! Nom ++ vp.compl ++ mkVerbForms vp ! Perf ! VFin t a p np.a ; + c = vp.c + } ; + AdvSlash cl adv = cl ** { + s = \\t,a,p => cl.s ! t ! a ! p ++ adv.s + } ; + SlashPrep cl prep = cl ** {c = prep} ; + SlashVS np v ss = { + s = \\t,a,p => np.s ! Nom ++ ss.s ++ mkVerbForms v ! Perf ! VFin t a p np.a ; + c = ss.c + } ; - EmbedQS _ = variants {} ; - EmbedS _ = variants {} ; + EmbedQS q = {s = q.s} ; + EmbedS s = {s = s.s} ; ImpVP vp = {s = \\p,n => vp.compl ++ vp.s ! Perf ! VImp p n } ; @@ -29,6 +38,17 @@ concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in { s = adv.s ++ s.s } ; - UseSlash _ = variants {} ; + ExtAdvS adv s = {s = adv.s ++ "," ++ s.s} ; + + SSubjS s1 subj s2 = {s = s1.s ++ "," ++ subj.s ++ s2.s} ; + + AdvImp adv imp = { + s = \\p,n => adv.s ++ imp.s ! p ! n + } ; + + UseSlash temp pol cl = { + s = temp.s ++ pol.s ++ cl.s ! temp.t ! temp.a ! pol.p ; + c = cl.c + } ; } diff --git a/src/turkish/StructuralTur.gf b/src/turkish/StructuralTur.gf index f6d89801..2d447c93 100644 --- a/src/turkish/StructuralTur.gf +++ b/src/turkish/StructuralTur.gf @@ -125,7 +125,7 @@ concrete StructuralTur of Structural = CatTur ** -- TODO: this does not straightforwardly translate to Turkish which does -- not have a "when" as a subordinating conjunction. - when_Subj = {s = "[TODO]"} ; + when_Subj = {s = "ne zaman"} ; because_Subj = {s = "çünkü"} ; @@ -235,7 +235,7 @@ concrete StructuralTur of Structural = CatTur ** -- TODO: this depends on the linearization for `ComplVV` and is really a -- morphological construct so it might be a bit tricky to implement. - want_VV = variants {} ; + want_VV = mkVV (mkV "istemek") ; whatPl_IP = { s = "neler" } ; diff --git a/src/turkish/VerbTur.gf b/src/turkish/VerbTur.gf index 9c43f97d..db3e81cb 100644 --- a/src/turkish/VerbTur.gf +++ b/src/turkish/VerbTur.gf @@ -4,31 +4,56 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur UseV v = {s = mkVerbForms v; compl = []} ; SlashV2a v = v ** {compl = []} ; - Slash2V3 v = variants {} ; - Slash3V3 v = variants {} ; - SlashV2A v = variants {} ; - SlashV2V v = variants {} ; - SlashV2S v = variants {} ; - SlashV2Q v = variants {} ; - SlashVV v = variants {} ; - SlashV2VNP = variants {} ; + Slash2V3 v np = v ** { + compl = np.s ! v.c1.c ++ v.c1.s ; + c = v.c2 + } ; + Slash3V3 v np = v ** { + compl = np.s ! v.c2.c ++ v.c2.s ; + c = v.c1 + } ; + SlashV2A v ap = v ** { + compl = ap.s ! Sg ! Nom ; + c = v.c + } ; + SlashV2V v vp = v ** { + compl = vp.compl ++ vp.s ! Perf ! VInf Pos ; + c = v.c + } ; + SlashV2S v s = v ** {compl = s.s ; c = v.c} ; + SlashV2Q v q = v ** {compl = q.s ; c = v.c} ; + SlashVV v vp = v ** { + compl = vp.compl ++ mkVerbForms vp ! Perf ! VInf Pos ; + c = vp.c + } ; + SlashV2VNP v np vp = v ** { + compl = np.s ! v.c.c ++ v.c.s ++ vp.compl ; + c = vp.c + } ; ComplSlash vps np = { s = mkVerbForms vps ; - compl = vps.compl ++ vps.c.s ++ np.s ! vps.c.c ; + compl = vps.compl ++ np.s ! vps.c.c ++ vps.c.s ; } ; - -- TODO: test this and fix. - ComplVS vs s = variants {} ; {- vs ** { - compl = s.subord - } ; -} + ComplVS vs s = {s = mkVerbForms vs ; compl = s.s} ; - ComplVA _ _ = variants {} ; - ComplVV _ _ = variants {} ; - ComplVQ _ _ = variants {} ; + ComplVA va ap = { + s = mkVerbForms va ; + compl = ap.s ! Sg ! Nom + } ; + ComplVV vv vp = { + s = mkVerbForms vv ; + compl = vp.compl ++ vp.s ! Perf ! VInf Pos + } ; + ComplVQ vq q = {s = mkVerbForms vq ; compl = q.s} ; UseComp comp = comp ** {compl = []} ; - CompCN _ = variants {} ; + CompCN cn = CompNP { + s = cn.s ! Sg; + h = cn.h; + a = agrP3 Sg + } ; CompNP np = { s = \\asp,vform => @@ -62,10 +87,10 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur CompAP ap = { s = \\asp,vform => case of { - <_,VImp p n> => ap.s ! n ! Nom ++ + <_,VImp p n> => ap.s ! Sg ! Nom ++ mkVerbForms olmak_V ! asp ! (VImp p n) ; => - ap.s ! agr.n ! Nom ++ + ap.s ! Sg ! Nom ++ case of { <{n=Sg; p=P3},Pos> => [] ; <{n=Sg; p=P3},Neg> => BIND ++ suffixStr ap.h negativeSuffix ; @@ -80,14 +105,14 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur in suffixStr negHar (verbSuffixes ! agr)) } ; => - ap.s ! agr.n ! Nom ++ BIND ++ + ap.s ! Sg ! Nom ++ BIND ++ case p of { Pos => [] ; Neg => suffixStr ap.h negativeSuffix } + suffixStr ap.h (alethicCopulaSuffixes ! agr) ; <_,VFin t a p agr> => - ap.s ! agr.n ! Nom ++ + ap.s ! Sg ! Nom ++ mkVerbForms olmak_V ! asp ! vform ; _ => ap.s ! Sg ! Nom ++ mkVerbForms olmak_V ! asp ! vform @@ -95,9 +120,15 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur compl = [] } ; - CompAdv _ = variants {} ; + CompAdv adv = { + s = \\asp,vform => adv.s ++ mkVerbForms olmak_V ! asp ! vform ; + compl = [] + } ; - ReflVP = variants {} ; + ReflVP vps = { + s = mkVerbForms vps ; + compl = vps.compl ++ "kendini" ++ vps.c.s + } ; AdvVP vp adv = vp ** { compl = vp.compl ++ adv.s ; @@ -119,6 +150,15 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur compl = vp.compl ++ adv.s ; } ; + VPSlashPrep vp prep = { + s = olmak_V.s; + stems = olmak_V.stems; + aoristType = olmak_V.aoristType; + h = olmak_V.h; + compl = vp.compl ++ vp.s ! Perf ! VInf Pos; + c = prep + } ; + PassV2 v = { s = mkVerbForms { s = v.stems ! VPass ++ BIND ++ suffixStr v.h infinitiveSuffix ;