From a79cb0b65584a7c93147f518432153ea3f34b454 Mon Sep 17 00:00:00 2001 From: krangelov Date: Sun, 29 Mar 2020 21:39:17 +0200 Subject: [PATCH] a draft for Copula verbs --- src/turkish/AdjectiveTur.gf | 34 ++++++++----- src/turkish/CatTur.gf | 10 ++-- src/turkish/ConjunctionTur.gf | 54 +++++++++++++------- src/turkish/NounTur.gf | 94 ++++++++++++++++++++++++----------- src/turkish/ParadigmsTur.gf | 84 +++++++++++++++---------------- src/turkish/ResTur.gf | 17 +++++-- src/turkish/SuffixTur.gf | 37 ++++++++++++++ src/turkish/SymbolTur.gf | 2 +- src/turkish/VerbTur.gf | 39 +++++++++++++-- 9 files changed, 257 insertions(+), 114 deletions(-) diff --git a/src/turkish/AdjectiveTur.gf b/src/turkish/AdjectiveTur.gf index a0d23104..5239ddcc 100644 --- a/src/turkish/AdjectiveTur.gf +++ b/src/turkish/AdjectiveTur.gf @@ -1,32 +1,40 @@ concrete AdjectiveTur of Adjective = - CatTur ** open ResTur, ParadigmsTur, Prelude in { + CatTur ** open ResTur, HarmonyTur, ParadigmsTur, Prelude in { lin - PositA a = {s = a.s} ; + PositA a = {s = a.s; h = a.h} ; ComparA a np = { s = \\n,c => np.s ! Ablat ++ a.s ! n ! c ; + h = a.h } ; UseComparA a = { - s = \\n,c => "daha" ++ a.s ! n ! c + s = \\n,c => "daha" ++ a.s ! n ! c ; + h = a.h } ; - AdjOrd v = v ; + AdjOrd v = v ** {h = {vow=I_Har; con=SCon Soft}} ; -- to be fixed AdvAP ap adv = { - s = \\n, c => adv.s ++ ap.s ! n ! c + s = \\n, c => adv.s ++ ap.s ! n ! c ; + h = ap.h } ; AdAP ada ap = { - s = \\n, c => ada.s ++ ap.s ! n ! c + s = \\n, c => ada.s ++ ap.s ! n ! c ; + h = ap.h } ; - UseA2 a = {s = a.s} ; + UseA2 a = { + s = a.s ; + h = a.h + } ; ComplA2 a np = { - s = \\n, c => np.s ! a.c.c ++ a.c.s ++ a.s ! n ! c + s = \\n, c => np.s ! a.c.c ++ a.c.s ++ a.s ! n ! c ; + h = a.h } ; -- TODO: Whether this is correct or not requires further examination. @@ -35,7 +43,8 @@ concrete AdjectiveTur of Adjective = let kendi : N = mkN "kendi" in - \\n, c => kendi.s ! n ! c ++ a.c.s ++ a.s ! n ! Nom + \\n, c => kendi.s ! n ! c ++ a.c.s ++ a.s ! n ! Nom ; + h = a.h } ; -- Some examples of using CAdvAP: @@ -43,14 +52,15 @@ concrete AdjectiveTur of Adjective = -- > Paris kadar kötü -- > o kadar kötü CAdvAP cadv ap np = { - s = \\n, c => np.s ! Nom ++ cadv.s ++ ap.s ! n ! c + s = \\n, c => np.s ! Nom ++ cadv.s ++ ap.s ! n ! c ; + h = ap.h } ; -- TODO: Instead of `++ BIND ++ "si"`, sc.s should be treated as a noun -- and it should be inflected to `gen Sg {n = Sg; p = P3}`. SentAP ap sc = { - s = - \\n, c => sc.s ++ (ap.s ! n ! c) + s = \\n, c => sc.s ++ (ap.s ! n ! c) ; + h = ap.h } ; } diff --git a/src/turkish/CatTur.gf b/src/turkish/CatTur.gf index 9e3d604d..527da0ff 100644 --- a/src/turkish/CatTur.gf +++ b/src/turkish/CatTur.gf @@ -1,4 +1,4 @@ -concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude, Predef in { +concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelude, Predef in { flags optimize=all_subs ; @@ -10,10 +10,12 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude, Predef in -- Noun - CN = {s : Number => Case => Str; gen : Number => Agr => Str} ; - NP = {s : Case => Str ; a : Agr} ; + CN = {s : Number => Case => Str; gen : Number => Agr => Str; h : Harmony} ; + NP = {s : Case => Str ; h : Harmony; a : Agr} ; + VP = Verb ; VPSlash = VP ** {c : Prep} ; + Comp = VP ; Pron = ResTur.Pron ; Det = {s : Str; n : Number; useGen : UseGen} ; @@ -30,7 +32,7 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude, Predef in Digits = {s : CardOrd => Number => Case => Str ; n : Number; tail : DTail} ; -- Adjective - AP = {s : Number => Case => Str} ; + AP = {s : Number => Case => Str; h : Harmony} ; -- Structural Conj = {s : Str; sep : Ints 4; n : Number} ; diff --git a/src/turkish/ConjunctionTur.gf b/src/turkish/ConjunctionTur.gf index 9d0f8deb..8788819f 100644 --- a/src/turkish/ConjunctionTur.gf +++ b/src/turkish/ConjunctionTur.gf @@ -1,60 +1,77 @@ concrete ConjunctionTur of Conjunction = - CatTur ** open ResTur, Coordination, Prelude, Predef in { + CatTur ** open ResTur, HarmonyTur, Coordination, Prelude, Predef in { lin ConjS _ _ = variants {} ; ConjNP conj ss = { s = \\c => linCoord []!conj.sep ++ ss.s!c!conj.sep ++ conj.s ++ ss.s!c!4; + h = ss.h ; a = conjAgr {n=conj.n; p=P3} ss.a } ; BaseNP x y = {s = \\c=>table {4 => y.s!c; _ => x.s!c}; - a = conjAgr x.a y.a} ; + a = conjAgr x.a y.a; + h = y.h} ; ConsNP x xs = {s = \\c=>table {4 => xs.s!c!4; t => x.s!c++linCoord bindComma!t++xs.s!c!t}; - a = conjAgr xs.a x.a} ; + a = conjAgr xs.a x.a; + h = xs.h} ; ConjAP conj ss = { - s = \\n,c => linCoord []!conj.sep ++ ss.s!n!c!conj.sep ++ conj.s ++ ss.s!n!c!4 + s = \\n,c => linCoord []!conj.sep ++ ss.s!n!c!conj.sep ++ conj.s ++ ss.s!n!c!4; + h = ss.h } ; BaseAP x y = - {s = \\n,c=>table {4 => y.s!n!c; _ => x.s!n!c}} ; + {s = \\n,c=>table {4 => y.s!n!c; _ => x.s!n!c}; + h = y.h + } ; ConsAP x xs = - {s = \\n,c=>table {4 => xs.s!n!c!4; t => x.s!n!c++linCoord bindComma!t++xs.s!n!c!t}} ; + {s = \\n,c=>table {4 => xs.s!n!c!4; t => x.s!n!c++linCoord bindComma!t++xs.s!n!c!t}; + h = xs.h; + } ; ConjCN conj ss = { s = \\n,c => linCoord []!conj.sep ++ ss.s!n!c!conj.sep ++ conj.s ++ ss.s!n!c!4; - gen = \\n,a => linCoord []!conj.sep ++ ss.gen!n!a!conj.sep ++ conj.s ++ ss.gen!n!a!4 + gen = \\n,a => linCoord []!conj.sep ++ ss.gen!n!a!conj.sep ++ conj.s ++ ss.gen!n!a!4; + h = ss.h } ; BaseCN x y = {s = \\n,c=>table {4 => y.s!n!c; _ => x.s!n!c}; - gen = \\n,a=>table {4 => y.gen!n!a; _ => x.gen!n!a}} ; + gen = \\n,a=>table {4 => y.gen!n!a; _ => x.gen!n!a}; + h = y.h} ; ConsCN x xs = {s = \\n,c=>table {4 => xs.s!n!c!4; t => x.s!n!c++linCoord bindComma!t++xs.s!n!c!t}; - gen = \\n,a=>table {4 => xs.gen!n!a!4; t => x.gen!n!a++linCoord bindComma!t++xs.gen!n!a!t}} ; + gen = \\n,a=>table {4 => xs.gen!n!a!4; t => x.gen!n!a++linCoord bindComma!t++xs.gen!n!a!t}; + h = xs.h} ; ConjAdV conj ss = { - s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4 + s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4; + h = ss.h } ; BaseAdV x y = - {s = table {4 => y.s; _ => x.s}} ; + {s = table {4 => y.s; _ => x.s}; + h = y.h} ; ConsAdV x xs = - {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ; + {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}; + h = xs.h} ; ConjAdv conj ss = { - s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4 + s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4; + h = ss.h } ; BaseAdv x y = - {s = table {4 => y.s; _ => x.s}} ; + {s = table {4 => y.s; _ => x.s}; + h = y.h} ; ConsAdv x xs = - {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ; + {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}; + h = xs.h} ; ConjRS _ _ = variants {} ; @@ -67,9 +84,10 @@ concrete ConjunctionTur of Conjunction = lincat [Adv] = {s : Ints 4 => Str} ; [AdV] = {s : Ints 4 => Str} ; - [NP] = {s : Case => Ints 4 => Str; a : Agr} ; - [AP] = {s : Number => Case => Ints 4 => Str} ; + [NP] = {s : Case => Ints 4 => Str; h : Harmony; a : Agr} ; + [AP] = {s : Number => Case => Ints 4 => Str; h : Harmony} ; [CN] = {s : Number => Case => Ints 4 => Str; - gen : Number => Agr => Ints 4 => Str} ; + gen : Number => Agr => Ints 4 => Str; + h : Harmony} ; } diff --git a/src/turkish/NounTur.gf b/src/turkish/NounTur.gf index 982d4872..e36eda59 100644 --- a/src/turkish/NounTur.gf +++ b/src/turkish/NounTur.gf @@ -12,13 +12,18 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude YesGen a => \\c => det.s ++ cn.gen ! det.n ! a ; UseIndef => \\c => det.s ++ cn.s ! det.n ! c } ; + h = cn.h ; a = agrP3 det.n } ; UsePron p = p ; -- TODO: look further into how correct this is. - UsePN pn = { s = \\c => pn.s ! Sg ! c; a = {n = Sg; p = P1}} ; + UsePN pn = { + s = \\c => pn.s ! Sg ! c; + h = pn.h; + a = {n = Sg; p = P1} + } ; PossPron p = {s = []; useGen = YesGen p.a} ; @@ -54,50 +59,72 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude Use2N3 n = variants {} ; - MassNP cn = { s = cn.s ! Sg; a = { n = Sg; p = P1 } } ; + MassNP cn = { + s = cn.s ! Sg; + h = cn.h; + a = { n = Sg; p = P1 } + } ; ComplN2 f x = - let - h : Harmony = {vow = f.harmony.vow; con = f.harmony.con} - in case f.c.c of { Nom => { s = \\n, c => x.s ! Gen ++ f.s ! n ! Acc; - gen = \\_, _ => "TODO" + gen = \\_, _ => "TODO"; + h = f.h }; - Acc => {s = \\_,_ => "TODO"; gen = \\_, _ => "TODO"}; + 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 ! h.con ! h.vow; - gen = \\_, _ => "TODO" + ++ 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 ! h.con ! h.vow; - gen = \\_, _ => "TODO" + ++ datSuffixN.st ! f.h.con ! f.h.vow; + gen = \\_, _ => "TODO"; + h = f.h }; - Loc => {s = \\_,_ => "TODO"; gen = \\_, _ => "TODO"}; - Ablat => {s = \\_,_ => "TODO"; gen = \\_, _ => "TODO"}; - Abess _ => {s = \\_,_ => "TODO"; gen = \\_, _ => "TODO"} + Loc => { + s = \\_,_ => "TODO"; + gen = \\_, _ => "TODO"; + h = f.h + }; + Ablat => { + s = \\_,_ => "TODO"; + gen = \\_, _ => "TODO"; + h = f.h + }; + Abess _ => { + s = \\_,_ => "TODO"; + gen = \\_, _ => "TODO"; + h = f.h + } }; AdjCN ap cn = { s = \\n,c => ap.s ! Sg ! Nom ++ cn.s ! n ! c; - gen = \\n, a => ap.s ! Sg ! Nom ++ cn.gen ! n ! a + gen = \\n, a => ap.s ! Sg ! Nom ++ cn.gen ! n ! a; + h = cn.h } ; -- lin CN = {s : Number => Case => Str; gen : Number => Agr => Str} ; AdvCN cn adv = { s = \\n, c => adv.s ++ cn.s ! n ! c; - gen = \\n, a => adv.s ++ cn.gen ! n ! a + gen = \\n, a => adv.s ++ cn.gen ! n ! a; + h = cn.h } ; AdvNP np adv = { s = \\c => adv.s ++ np.s ! c; + h = np.h ; a = np.a } ; @@ -111,21 +138,23 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude -- TODO: further test how correct this is. ApposCN cn np = { - s = \\n,c => cn.s ! n ! c ++ np.s ! c ; - gen = cn.gen + s = \\n,c => cn.s ! n ! c ++ np.s ! c ; + gen = cn.gen ; + h = cn.h } ; ComplN3 f x = { - s = \\n, c => x.s ! Ablat ++ f.s ! n ! c ; - gen = f.gen ; - c = f.c2 ; - harmony = f.harmony ; + s = \\n, c => x.s ! Ablat ++ f.s ! n ! c ; + gen = f.gen ; + c = f.c2 ; + h = f.h ; } ; -- TODO: not entirely sure `CountNP` is sensible in Turkish but it should -- look something like this. CountNP det np = { s = \\c => det.s ++ np.s ! Ablat ; + h = np.h ; a = np.a } ; @@ -134,12 +163,14 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude -- TODO: further check the correctness of this. DetNP det = { s = \\c => det.s ; + h = {vow=I_Har; con=SCon Soft} ; -- to be fixed a = {n = det.n ; p = P1} } ; ExtAdvNP np adv = { s = \\c => np.s ! c ++ "," ++ adv.s ; - a = np.a + a = np.a ; + h = np.h } ; NumDigits n = { @@ -152,6 +183,7 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude PPartNP np v2 = { s = \\c => np.s ! c ++ v2.s ! (VPast np.a); + h = np.h ; a = np.a } ; @@ -161,35 +193,41 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude -- Further check the correctness. PartNP cn np = { s = \\n,c => np.s ! Gen ++ cn.s ! n ! Gen ; - gen = cn.gen + gen = cn.gen ; + h = cn.h } ; PossNP cn np = { s = \\n,c => np.s ! Gen ++ cn.s ! n ! c ; - gen = cn.gen + gen = cn.gen ; + h = cn.h } ; -- TODO: currently I am not able to generate trees for this but should be -- quite close what is needed. PredetNP pred np = { s = \\c => pred.s ++ np.s ! c ; + h = np.h ; a = np.a } ; SentCN cn sc = { - s = \\n,c => "(TODO: SentCN)" ; - gen = cn.gen + s = \\n,c => "(TODO: SentCN)" ; + gen = cn.gen ; + h = cn.h } ; -- TODO: currently not able to generate trees. RelCN cn rs = { s = \\n,c => "(TODO: RelCN)" ; - gen = cn.gen + gen = cn.gen ; + h = cn.h } ; RelNP np rs = { s = \\c => "(TODO: RelNP)" ; gen = np.gen ; + h = np.h ; a = np.a ; c = np.c } ; diff --git a/src/turkish/ParadigmsTur.gf b/src/turkish/ParadigmsTur.gf index 70587d76..07ae97b8 100644 --- a/src/turkish/ParadigmsTur.gf +++ b/src/turkish/ParadigmsTur.gf @@ -322,31 +322,31 @@ resource ParadigmsTur = open lin N { s = table { Sg => table { - Nom => sn ; - Acc => sa ; - Dat => sd ; - Gen => sg ; - Loc => sl ; - Ablat => sabl ; - Abess Pos => sgabPos ; + Nom => sn ; + Acc => sa ; + Dat => sd ; + Gen => sg ; + Loc => sl ; + Ablat => sabl ; + Abess Pos => sgabPos ; Abess Neg => sgabNeg - } ; + } ; Pl => table { - Abess Pos => addSuffix sgabPos plHar plSuffix; - Abess Neg => addSuffix sgabNeg plHar plSuffix; - c => addSuffix pln plHar (caseSuffixes ! c) - } - } ; + Abess Pos => addSuffix sgabPos plHar plSuffix; + Abess Neg => addSuffix sgabNeg plHar plSuffix; + c => addSuffix pln plHar (caseSuffixes ! c) + } + } ; gen = table { Sg => table { - -- Genitive suffix for P3 is always -ları, always selecting plural form of - -- base and harmony is a trick to implement this - {n=Pl; p=P3} => addSuffix pln plHar genPlP3Suffix ; - s => addSuffix sgs har (genSuffixes ! s) - } ; + -- Genitive suffix for P3 is always -ları, always selecting plural form of + -- base and harmony is a trick to implement this + {n=Pl; p=P3} => addSuffix pln plHar genPlP3Suffix ; + s => addSuffix sgs har (genSuffixes ! s) + } ; Pl => \\s => addSuffix pln plHar (genSuffixes ! s) - } ; - harmony = har + } ; + h = har } ; irregN_h sn sg har = irregN har sn sg ; @@ -429,33 +429,33 @@ resource ParadigmsTur = open plHar = getHarmony pn in lin N { s = table { - Sg => table { - Nom => sn ; --tereyağı - Acc => addSuffix sn sgHar accSuffixN ; --tereyağını - Dat => addSuffix sn sgHar datSuffixN ; --tereyağına - Gen => addSuffix sn sgHar genSuffix ; --tereyağının - Loc => addSuffix sn sgHar locSuffixN ; --tereyağında - Ablat => addSuffix sn sgHar ablatSuffixN ; --tereyağından - Abess Pos => sgAbessPos ; --tereyağlı - Abess Neg => sgAbessNeg --tereyağsız - } ; - Pl => table { - Nom => pn ;--tereyağları - Acc => addSuffix pn plHar accSuffixN ; --tereyağlarını - Dat => addSuffix pn plHar datSuffixN ; --tereyağlarına - Gen => addSuffix pn plHar genSuffix ; --tereyağlarının - Loc => addSuffix pn plHar locSuffixN ; --tereyağlarında - Ablat => addSuffix pn plHar ablatSuffixN ; --tereyağlarından - Abess Pos => addSuffix sgAbessPos plHar abessPosSuffix ; --tereyağlılar - Abess Neg => addSuffix sgAbessNeg plHar abessNegSuffix --tereyağsızlar + Sg => table { + Nom => sn ; --tereyağı + Acc => addSuffix sn sgHar accSuffixN ; --tereyağını + Dat => addSuffix sn sgHar datSuffixN ; --tereyağına + Gen => addSuffix sn sgHar genSuffix ; --tereyağının + Loc => addSuffix sn sgHar locSuffixN ; --tereyağında + Ablat => addSuffix sn sgHar ablatSuffixN ; --tereyağından + Abess Pos => sgAbessPos ; --tereyağlı + Abess Neg => sgAbessNeg --tereyağsız + } ; + Pl => table { + Nom => pn ;--tereyağları + Acc => addSuffix pn plHar accSuffixN ; --tereyağlarını + Dat => addSuffix pn plHar datSuffixN ; --tereyağlarına + Gen => addSuffix pn plHar genSuffix ; --tereyağlarının + Loc => addSuffix pn plHar locSuffixN ; --tereyağlarında + Ablat => addSuffix pn plHar ablatSuffixN ; --tereyağlarından + Abess Pos => addSuffix sgAbessPos plHar abessPosSuffix ; --tereyağlılar + Abess Neg => addSuffix sgAbessNeg plHar abessNegSuffix --tereyağsızlar } } ; gen = case ct of { Con => \\num,agr => n1sn + n2.gen ! num ! agr ; Sep => \\num,agr => n1sn ++ n2.gen ! num ! agr - } ; - harmony = sgHar - } ; + } ; + h = sgHar + } ; mkN = overload { mkN : (araba : Str) -> N = diff --git a/src/turkish/ResTur.gf b/src/turkish/ResTur.gf index 7f97319d..8c6f7496 100644 --- a/src/turkish/ResTur.gf +++ b/src/turkish/ResTur.gf @@ -16,10 +16,12 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in { Agr = {n : Number ; p : Person} ; Noun = { s : Number => Case => Str ; - gen : Number => Agr => Str ; - harmony : Harmony + gen : Number => Agr => Str ; + h : Harmony } ; - Pron = {s : Case => Str; a : Agr} ; + Pron = {s : Case => Str ; + h : Harmony; + a : Agr} ; agrP3 : Number -> Agr ; agrP3 n = {n = n; p = P3} ; @@ -73,6 +75,7 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in { Abess Pos => benli ; Abess Neg => bensiz } ; + h = getHarmony ben ; a = {n=n; p=p} ; } ; @@ -82,8 +85,12 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in { mkPrep : Str -> Case -> {s : Str; c : Case; lock_Prep : {}} = \s, c -> lin Prep {s=s; c=c}; - mkNP : Noun -> Number -> Person -> {s : Case => Str; a : Agr} = - \noun, n, p -> {s = noun.s ! n; a = {n = n; p = p}} ; + mkNP : Noun -> Number -> Person -> {s : Case => Str; h : Harmony; a : Agr} = + \noun, n, p -> { + s = noun.s ! n; + h = noun.h; + a = {n = n; p = p} + } ; mkClause : Str -> Agr -> Verb -> {s : Tense => Str; subord : Str} = \np, a, v -> { diff --git a/src/turkish/SuffixTur.gf b/src/turkish/SuffixTur.gf index a1ce3e6a..7bd64934 100644 --- a/src/turkish/SuffixTur.gf +++ b/src/turkish/SuffixTur.gf @@ -95,6 +95,21 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in { p1PlVerbalSuffix : Suffix = regSuffix "iz" "k" ; p2PlVerbalSuffix : Suffix = regSuffix21 "siniz" "niz" ; p3PlVerbalSuffix : Suffix = regSuffix "ler" "ler" ; + + p1SgAlethicCopulaSuffix : Suffix = regSuffix "dim" "ydim" ; + p2SgAlethicCopulaSuffix : Suffix = regSuffix "din" "ydin" ; + p3SgAlethicCopulaSuffix : Suffix = regSuffix "di" "ydi" ; + p1PlAlethicCopulaSuffix : Suffix = regSuffix "dik" "ydik" ; + p2PlAlethicCopulaSuffix : Suffix = regSuffix "diniz" "ydiniz" ; + p3PlAlethicCopulaSuffix : Suffix = regSuffix "diler" "ydiler" ; + + p1SgCondCopulaSuffix : Suffix = regSuffix "sem" "sem" ; + p2SgCondCopulaSuffix : Suffix = regSuffix "sen" "sen" ; + p3SgCondCopulaSuffix : Suffix = regSuffix "se" "se" ; + p1PlCondCopulaSuffix : Suffix = regSuffix "sek" "sek" ; + p2PlCondCopulaSuffix : Suffix = regSuffix21 "seniz" "seniz" ; + p3PlCondCopulaSuffix : Suffix = regSuffix "lerse" "lerse" ; + subordSuffixDik : Suffix = regSuffix2 "dik" "dikler" ; softSubordSuffixDik : Suffix = regSuffix2 "diğ" "dikler" ; @@ -135,6 +150,26 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in { {n=Pl; p=P3} => p3PlVerbalSuffix } ; + alethicCopulaSuffixes : Agr => Suffix = + table { + {n=Sg; p=P1} => p1SgAlethicCopulaSuffix ; + {n=Sg; p=P2} => p2SgAlethicCopulaSuffix ; + {n=Sg; p=P3} => p3SgAlethicCopulaSuffix ; + {n=Pl; p=P1} => p1PlAlethicCopulaSuffix ; + {n=Pl; p=P2} => p2PlAlethicCopulaSuffix ; + {n=Pl; p=P3} => p3PlAlethicCopulaSuffix + } ; + + condCopulaSuffixes : Agr => Suffix = + table { + {n=Sg; p=P1} => p1SgCondCopulaSuffix ; + {n=Sg; p=P2} => p2SgCondCopulaSuffix ; + {n=Sg; p=P3} => p3SgCondCopulaSuffix ; + {n=Pl; p=P1} => p1PlCondCopulaSuffix ; + {n=Pl; p=P2} => p2PlCondCopulaSuffix ; + {n=Pl; p=P3} => p3PlCondCopulaSuffix + } ; + -- Adds a suffix to the base given as Str using Harmony. -- If only one form of base is given then it is assumed that base does not soften addSuffix = overload { @@ -148,6 +183,8 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in { addSuffixTable : (Softness => Str) -> Harmony -> Suffix -> Str = \baseTable,har,suf -> (baseTable ! suf.stemT) + suf.st ! har.con ! har.vow ; + suffixStr : Harmony -> Suffix -> Str = + \har,suf -> BIND ++ suf.st ! har.con ! har.vow ; regSuffix larC larV = { diff --git a/src/turkish/SymbolTur.gf b/src/turkish/SymbolTur.gf index 682a6d17..52085b2a 100644 --- a/src/turkish/SymbolTur.gf +++ b/src/turkish/SymbolTur.gf @@ -3,7 +3,7 @@ concrete SymbolTur of Symbol = CatTur ** open Prelude, ResTur, HarmonyTur in { lin - SymbPN i = {s,gen = \\_,_ => i.s ; harmony = {vow=I_Har; con=SCon Soft}} ; -- just a placeholder, probably wrong + SymbPN i = {s,gen = \\_,_ => i.s ; h = {vow=I_Har; con=SCon Soft}} ; -- just a placeholder, probably wrong {- TODO! IntPN i = {s = addGenitiveS i.s ; g = Neutr} ; diff --git a/src/turkish/VerbTur.gf b/src/turkish/VerbTur.gf index 60318ea2..503c7313 100644 --- a/src/turkish/VerbTur.gf +++ b/src/turkish/VerbTur.gf @@ -1,4 +1,4 @@ -concrete VerbTur of Verb = CatTur ** open ResTur in { +concrete VerbTur of Verb = CatTur ** open ResTur, SuffixTur in { lin UseV v = v ; @@ -26,10 +26,41 @@ concrete VerbTur of Verb = CatTur ** open ResTur in { ComplVV _ _ = variants {} ; ComplVQ _ _ = variants {} ; - UseComp _ = variants {} ; + UseComp comp = comp ; CompCN _ = variants {} ; - CompNP _ = variants {} ; - CompAP _ = variants {} ; + + CompNP ap = lin VP { + s = table { + VPres agr => ap.s ! Nom ++ + case agr of { + {n=Sg; p=P3} => [] ; + _ => suffixStr ap.h (verbSuffixes ! agr) + } ; + VProg agr => ap.s ! Nom ; + VPast agr => ap.s ! Nom ++ + suffixStr ap.h (alethicCopulaSuffixes ! agr); + VFuture agr => ap.s ! Nom ; + VInfinitive => ap.s ! Nom ++ "olmak" ; + _ => "TODO" + } + } ; + + CompAP ap = lin VP { + s = table { + VPres agr => ap.s ! agr.n ! Nom ++ + case agr of { + {n=Sg; p=P3} => [] ; + _ => suffixStr ap.h (verbSuffixes ! agr) + } ; + VProg agr => ap.s ! agr.n ! Nom ; + VPast agr => ap.s ! agr.n ! Nom ++ + suffixStr ap.h (alethicCopulaSuffixes ! agr); + VFuture agr => ap.s ! agr.n ! Nom ; + VInfinitive => ap.s ! Sg ! Nom ++ "olmak" ; + _ => "TODO" + } + } ; + CompAdv _ = variants {} ; ReflVP = variants {} ;