1
0
forked from GitHub/gf-rgl

a draft for Copula verbs

This commit is contained in:
krangelov
2020-03-29 21:39:17 +02:00
parent 1f316bf5c3
commit a79cb0b655
9 changed files with 257 additions and 114 deletions

View File

@@ -1,32 +1,40 @@
concrete AdjectiveTur of Adjective = concrete AdjectiveTur of Adjective =
CatTur ** open ResTur, ParadigmsTur, Prelude in { CatTur ** open ResTur, HarmonyTur, ParadigmsTur, Prelude in {
lin lin
PositA a = {s = a.s} ; PositA a = {s = a.s; h = a.h} ;
ComparA a np = { ComparA a np = {
s = \\n,c => np.s ! Ablat ++ a.s ! n ! c ; s = \\n,c => np.s ! Ablat ++ a.s ! n ! c ;
h = a.h
} ; } ;
UseComparA a = { 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 = { 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 = { 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 = { 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. -- TODO: Whether this is correct or not requires further examination.
@@ -35,7 +43,8 @@ concrete AdjectiveTur of Adjective =
let let
kendi : N = mkN "kendi" kendi : N = mkN "kendi"
in 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: -- Some examples of using CAdvAP:
@@ -43,14 +52,15 @@ concrete AdjectiveTur of Adjective =
-- > Paris kadar kötü -- > Paris kadar kötü
-- > o kadar kötü -- > o kadar kötü
CAdvAP cadv ap np = { 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 -- 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}`. -- and it should be inflected to `gen Sg {n = Sg; p = P3}`.
SentAP ap sc = { SentAP ap sc = {
s = s = \\n, c => sc.s ++ (ap.s ! n ! c) ;
\\n, c => sc.s ++ (ap.s ! n ! c) h = ap.h
} ; } ;
} }

View File

@@ -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 ; flags optimize=all_subs ;
@@ -10,10 +10,12 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude, Predef in
-- Noun -- Noun
CN = {s : Number => Case => Str; gen : Number => Agr => Str} ; CN = {s : Number => Case => Str; gen : Number => Agr => Str; h : Harmony} ;
NP = {s : Case => Str ; a : Agr} ; NP = {s : Case => Str ; h : Harmony; a : Agr} ;
VP = Verb ; VP = Verb ;
VPSlash = VP ** {c : Prep} ; VPSlash = VP ** {c : Prep} ;
Comp = VP ;
Pron = ResTur.Pron ; Pron = ResTur.Pron ;
Det = {s : Str; n : Number; useGen : UseGen} ; 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} ; Digits = {s : CardOrd => Number => Case => Str ; n : Number; tail : DTail} ;
-- Adjective -- Adjective
AP = {s : Number => Case => Str} ; AP = {s : Number => Case => Str; h : Harmony} ;
-- Structural -- Structural
Conj = {s : Str; sep : Ints 4; n : Number} ; Conj = {s : Str; sep : Ints 4; n : Number} ;

View File

@@ -1,60 +1,77 @@
concrete ConjunctionTur of Conjunction = concrete ConjunctionTur of Conjunction =
CatTur ** open ResTur, Coordination, Prelude, Predef in { CatTur ** open ResTur, HarmonyTur, Coordination, Prelude, Predef in {
lin lin
ConjS _ _ = variants {} ; ConjS _ _ = variants {} ;
ConjNP conj ss = { ConjNP conj ss = {
s = \\c => linCoord []!conj.sep ++ ss.s!c!conj.sep ++ conj.s ++ ss.s!c!4; 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 a = conjAgr {n=conj.n; p=P3} ss.a
} ; } ;
BaseNP x y = BaseNP x y =
{s = \\c=>table {4 => y.s!c; _ => x.s!c}; {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 = ConsNP x xs =
{s = \\c=>table {4 => xs.s!c!4; t => x.s!c++linCoord bindComma!t++xs.s!c!t}; {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 = { 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 = 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 = 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 = { ConjCN 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;
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 = BaseCN 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};
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 = 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}; {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 = { 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 = BaseAdV x y =
{s = table {4 => y.s; _ => x.s}} ; {s = table {4 => y.s; _ => x.s};
h = y.h} ;
ConsAdV x xs = 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 = { 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 = BaseAdv x y =
{s = table {4 => y.s; _ => x.s}} ; {s = table {4 => y.s; _ => x.s};
h = y.h} ;
ConsAdv x xs = 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 {} ; ConjRS _ _ = variants {} ;
@@ -67,9 +84,10 @@ concrete ConjunctionTur of Conjunction =
lincat lincat
[Adv] = {s : Ints 4 => Str} ; [Adv] = {s : Ints 4 => Str} ;
[AdV] = {s : Ints 4 => Str} ; [AdV] = {s : Ints 4 => Str} ;
[NP] = {s : Case => Ints 4 => Str; a : Agr} ; [NP] = {s : Case => Ints 4 => Str; h : Harmony; a : Agr} ;
[AP] = {s : Number => Case => Ints 4 => Str} ; [AP] = {s : Number => Case => Ints 4 => Str; h : Harmony} ;
[CN] = {s : Number => Case => Ints 4 => Str; [CN] = {s : Number => Case => Ints 4 => Str;
gen : Number => Agr => Ints 4 => Str} ; gen : Number => Agr => Ints 4 => Str;
h : Harmony} ;
} }

View File

@@ -12,13 +12,18 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
YesGen a => \\c => det.s ++ cn.gen ! det.n ! a ; YesGen a => \\c => det.s ++ cn.gen ! det.n ! a ;
UseIndef => \\c => det.s ++ cn.s ! det.n ! c UseIndef => \\c => det.s ++ cn.s ! det.n ! c
} ; } ;
h = cn.h ;
a = agrP3 det.n a = agrP3 det.n
} ; } ;
UsePron p = p ; UsePron p = p ;
-- TODO: look further into how correct this is. -- 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} ; PossPron p = {s = []; useGen = YesGen p.a} ;
@@ -54,50 +59,72 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
Use2N3 n = variants {} ; 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 = ComplN2 f x =
let
h : Harmony = {vow = f.harmony.vow; con = f.harmony.con}
in
case f.c.c of { case f.c.c of {
Nom => { Nom => {
s = \\n, c => x.s ! Gen ++ f.s ! n ! Acc; 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 => { Gen => {
s = s =
\\n, c => \\n, c =>
x.s ! Gen ++ f.gen ! n ! {n = Sg; p = P3} x.s ! Gen ++ f.gen ! n ! {n = Sg; p = P3}
++ BIND ++ (caseSuffixes ! c).st ! h.con ! h.vow; ++ BIND ++ (caseSuffixes ! c).st ! f.h.con ! f.h.vow;
gen = \\_, _ => "TODO" gen = \\_, _ => "TODO";
h = f.h
}; };
Dat => { Dat => {
s = \\n, c => s = \\n, c =>
x.s ! Gen ++ f.gen ! n ! {n = Sg; p = P3} x.s ! Gen ++ f.gen ! n ! {n = Sg; p = P3}
++ datSuffixN.st ! h.con ! h.vow; ++ datSuffixN.st ! f.h.con ! f.h.vow;
gen = \\_, _ => "TODO" gen = \\_, _ => "TODO";
h = f.h
}; };
Loc => {s = \\_,_ => "TODO"; gen = \\_, _ => "TODO"}; Loc => {
Ablat => {s = \\_,_ => "TODO"; gen = \\_, _ => "TODO"}; s = \\_,_ => "TODO";
Abess _ => {s = \\_,_ => "TODO"; gen = \\_, _ => "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 = { AdjCN ap cn = {
s = \\n,c => ap.s ! Sg ! Nom ++ cn.s ! n ! c; 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} ; -- lin CN = {s : Number => Case => Str; gen : Number => Agr => Str} ;
AdvCN cn adv = { AdvCN cn adv = {
s = \\n, c => adv.s ++ cn.s ! n ! c; 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 = { AdvNP np adv = {
s = \\c => adv.s ++ np.s ! c; s = \\c => adv.s ++ np.s ! c;
h = np.h ;
a = np.a a = np.a
} ; } ;
@@ -111,21 +138,23 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
-- TODO: further test how correct this is. -- TODO: further test how correct this is.
ApposCN cn np = { ApposCN cn np = {
s = \\n,c => cn.s ! n ! c ++ np.s ! c ; s = \\n,c => cn.s ! n ! c ++ np.s ! c ;
gen = cn.gen gen = cn.gen ;
h = cn.h
} ; } ;
ComplN3 f x = { ComplN3 f x = {
s = \\n, c => x.s ! Ablat ++ f.s ! n ! c ; s = \\n, c => x.s ! Ablat ++ f.s ! n ! c ;
gen = f.gen ; gen = f.gen ;
c = f.c2 ; c = f.c2 ;
harmony = f.harmony ; h = f.h ;
} ; } ;
-- TODO: not entirely sure `CountNP` is sensible in Turkish but it should -- TODO: not entirely sure `CountNP` is sensible in Turkish but it should
-- look something like this. -- look something like this.
CountNP det np = { CountNP det np = {
s = \\c => det.s ++ np.s ! Ablat ; s = \\c => det.s ++ np.s ! Ablat ;
h = np.h ;
a = np.a a = np.a
} ; } ;
@@ -134,12 +163,14 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
-- TODO: further check the correctness of this. -- TODO: further check the correctness of this.
DetNP det = { DetNP det = {
s = \\c => det.s ; 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 = P1}
} ; } ;
ExtAdvNP np adv = { ExtAdvNP np adv = {
s = \\c => np.s ! c ++ "," ++ adv.s ; s = \\c => np.s ! c ++ "," ++ adv.s ;
a = np.a a = np.a ;
h = np.h
} ; } ;
NumDigits n = { NumDigits n = {
@@ -152,6 +183,7 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
PPartNP np v2 = { PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! (VPast np.a); s = \\c => np.s ! c ++ v2.s ! (VPast np.a);
h = np.h ;
a = np.a a = np.a
} ; } ;
@@ -161,35 +193,41 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
-- Further check the correctness. -- Further check the correctness.
PartNP cn np = { PartNP cn np = {
s = \\n,c => np.s ! Gen ++ cn.s ! n ! Gen ; s = \\n,c => np.s ! Gen ++ cn.s ! n ! Gen ;
gen = cn.gen gen = cn.gen ;
h = cn.h
} ; } ;
PossNP cn np = { PossNP cn np = {
s = \\n,c => np.s ! Gen ++ cn.s ! n ! c ; 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 -- TODO: currently I am not able to generate trees for this but should be
-- quite close what is needed. -- quite close what is needed.
PredetNP pred np = { PredetNP pred np = {
s = \\c => pred.s ++ np.s ! c ; s = \\c => pred.s ++ np.s ! c ;
h = np.h ;
a = np.a a = np.a
} ; } ;
SentCN cn sc = { SentCN cn sc = {
s = \\n,c => "(TODO: SentCN)" ; s = \\n,c => "(TODO: SentCN)" ;
gen = cn.gen gen = cn.gen ;
h = cn.h
} ; } ;
-- TODO: currently not able to generate trees. -- TODO: currently not able to generate trees.
RelCN cn rs = { RelCN cn rs = {
s = \\n,c => "(TODO: RelCN)" ; s = \\n,c => "(TODO: RelCN)" ;
gen = cn.gen gen = cn.gen ;
h = cn.h
} ; } ;
RelNP np rs = { RelNP np rs = {
s = \\c => "(TODO: RelNP)" ; s = \\c => "(TODO: RelNP)" ;
gen = np.gen ; gen = np.gen ;
h = np.h ;
a = np.a ; a = np.a ;
c = np.c c = np.c
} ; } ;

View File

@@ -322,31 +322,31 @@ resource ParadigmsTur = open
lin N { lin N {
s = table { s = table {
Sg => table { Sg => table {
Nom => sn ; Nom => sn ;
Acc => sa ; Acc => sa ;
Dat => sd ; Dat => sd ;
Gen => sg ; Gen => sg ;
Loc => sl ; Loc => sl ;
Ablat => sabl ; Ablat => sabl ;
Abess Pos => sgabPos ; Abess Pos => sgabPos ;
Abess Neg => sgabNeg Abess Neg => sgabNeg
} ; } ;
Pl => table { Pl => table {
Abess Pos => addSuffix sgabPos plHar plSuffix; Abess Pos => addSuffix sgabPos plHar plSuffix;
Abess Neg => addSuffix sgabNeg plHar plSuffix; Abess Neg => addSuffix sgabNeg plHar plSuffix;
c => addSuffix pln plHar (caseSuffixes ! c) c => addSuffix pln plHar (caseSuffixes ! c)
} }
} ; } ;
gen = table { gen = table {
Sg => table { Sg => table {
-- Genitive suffix for P3 is always -ları, always selecting plural form of -- Genitive suffix for P3 is always -ları, always selecting plural form of
-- base and harmony is a trick to implement this -- base and harmony is a trick to implement this
{n=Pl; p=P3} => addSuffix pln plHar genPlP3Suffix ; {n=Pl; p=P3} => addSuffix pln plHar genPlP3Suffix ;
s => addSuffix sgs har (genSuffixes ! s) s => addSuffix sgs har (genSuffixes ! s)
} ; } ;
Pl => \\s => addSuffix pln plHar (genSuffixes ! s) Pl => \\s => addSuffix pln plHar (genSuffixes ! s)
} ; } ;
harmony = har h = har
} ; } ;
irregN_h sn sg har = irregN har sn sg ; irregN_h sn sg har = irregN har sn sg ;
@@ -429,33 +429,33 @@ resource ParadigmsTur = open
plHar = getHarmony pn plHar = getHarmony pn
in lin N { in lin N {
s = table { s = table {
Sg => table { Sg => table {
Nom => sn ; --tereyağı Nom => sn ; --tereyağı
Acc => addSuffix sn sgHar accSuffixN ; --tereyağını Acc => addSuffix sn sgHar accSuffixN ; --tereyağını
Dat => addSuffix sn sgHar datSuffixN ; --tereyağına Dat => addSuffix sn sgHar datSuffixN ; --tereyağına
Gen => addSuffix sn sgHar genSuffix ; --tereyağının Gen => addSuffix sn sgHar genSuffix ; --tereyağının
Loc => addSuffix sn sgHar locSuffixN ; --tereyağında Loc => addSuffix sn sgHar locSuffixN ; --tereyağında
Ablat => addSuffix sn sgHar ablatSuffixN ; --tereyağından Ablat => addSuffix sn sgHar ablatSuffixN ; --tereyağından
Abess Pos => sgAbessPos ; --tereyağlı Abess Pos => sgAbessPos ; --tereyağlı
Abess Neg => sgAbessNeg --tereyağsız Abess Neg => sgAbessNeg --tereyağsız
} ; } ;
Pl => table { Pl => table {
Nom => pn ;--tereyağları Nom => pn ;--tereyağları
Acc => addSuffix pn plHar accSuffixN ; --tereyağlarını Acc => addSuffix pn plHar accSuffixN ; --tereyağlarını
Dat => addSuffix pn plHar datSuffixN ; --tereyağlarına Dat => addSuffix pn plHar datSuffixN ; --tereyağlarına
Gen => addSuffix pn plHar genSuffix ; --tereyağlarının Gen => addSuffix pn plHar genSuffix ; --tereyağlarının
Loc => addSuffix pn plHar locSuffixN ; --tereyağlarında Loc => addSuffix pn plHar locSuffixN ; --tereyağlarında
Ablat => addSuffix pn plHar ablatSuffixN ; --tereyağlarından Ablat => addSuffix pn plHar ablatSuffixN ; --tereyağlarından
Abess Pos => addSuffix sgAbessPos plHar abessPosSuffix ; --tereyağlılar Abess Pos => addSuffix sgAbessPos plHar abessPosSuffix ; --tereyağlılar
Abess Neg => addSuffix sgAbessNeg plHar abessNegSuffix --tereyağsızlar Abess Neg => addSuffix sgAbessNeg plHar abessNegSuffix --tereyağsızlar
} }
} ; } ;
gen = case ct of { gen = case ct of {
Con => \\num,agr => n1sn + n2.gen ! num ! agr ; Con => \\num,agr => n1sn + n2.gen ! num ! agr ;
Sep => \\num,agr => n1sn ++ n2.gen ! num ! agr Sep => \\num,agr => n1sn ++ n2.gen ! num ! agr
} ; } ;
harmony = sgHar h = sgHar
} ; } ;
mkN = overload { mkN = overload {
mkN : (araba : Str) -> N = mkN : (araba : Str) -> N =

View File

@@ -16,10 +16,12 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
Agr = {n : Number ; p : Person} ; Agr = {n : Number ; p : Person} ;
Noun = { Noun = {
s : Number => Case => Str ; s : Number => Case => Str ;
gen : Number => Agr => Str ; gen : Number => Agr => Str ;
harmony : Harmony h : Harmony
} ; } ;
Pron = {s : Case => Str; a : Agr} ; Pron = {s : Case => Str ;
h : Harmony;
a : Agr} ;
agrP3 : Number -> Agr ; agrP3 : Number -> Agr ;
agrP3 n = {n = n; p = P3} ; agrP3 n = {n = n; p = P3} ;
@@ -73,6 +75,7 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
Abess Pos => benli ; Abess Pos => benli ;
Abess Neg => bensiz Abess Neg => bensiz
} ; } ;
h = getHarmony ben ;
a = {n=n; p=p} ; 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 : {}} = mkPrep : Str -> Case -> {s : Str; c : Case; lock_Prep : {}} =
\s, c -> lin Prep {s=s; c=c}; \s, c -> lin Prep {s=s; c=c};
mkNP : Noun -> Number -> Person -> {s : Case => Str; a : Agr} = mkNP : Noun -> Number -> Person -> {s : Case => Str; h : Harmony; a : Agr} =
\noun, n, p -> {s = noun.s ! n; a = {n = n; p = p}} ; \noun, n, p -> {
s = noun.s ! n;
h = noun.h;
a = {n = n; p = p}
} ;
mkClause : Str -> Agr -> Verb -> {s : Tense => Str; subord : Str} = mkClause : Str -> Agr -> Verb -> {s : Tense => Str; subord : Str} =
\np, a, v -> { \np, a, v -> {

View File

@@ -95,6 +95,21 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
p1PlVerbalSuffix : Suffix = regSuffix "iz" "k" ; p1PlVerbalSuffix : Suffix = regSuffix "iz" "k" ;
p2PlVerbalSuffix : Suffix = regSuffix21 "siniz" "niz" ; p2PlVerbalSuffix : Suffix = regSuffix21 "siniz" "niz" ;
p3PlVerbalSuffix : Suffix = regSuffix "ler" "ler" ; 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" ; subordSuffixDik : Suffix = regSuffix2 "dik" "dikler" ;
softSubordSuffixDik : Suffix = regSuffix2 "diğ" "dikler" ; softSubordSuffixDik : Suffix = regSuffix2 "diğ" "dikler" ;
@@ -135,6 +150,26 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
{n=Pl; p=P3} => p3PlVerbalSuffix {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. -- 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 -- If only one form of base is given then it is assumed that base does not soften
addSuffix = overload { addSuffix = overload {
@@ -148,6 +183,8 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
addSuffixTable : (Softness => Str) -> Harmony -> Suffix -> Str = addSuffixTable : (Softness => Str) -> Harmony -> Suffix -> Str =
\baseTable,har,suf -> (baseTable ! suf.stemT) + suf.st ! har.con ! har.vow ; \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 = regSuffix larC larV =
{ {

View File

@@ -3,7 +3,7 @@
concrete SymbolTur of Symbol = CatTur ** open Prelude, ResTur, HarmonyTur in { concrete SymbolTur of Symbol = CatTur ** open Prelude, ResTur, HarmonyTur in {
lin 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! {- TODO!
IntPN i = {s = addGenitiveS i.s ; g = Neutr} ; IntPN i = {s = addGenitiveS i.s ; g = Neutr} ;

View File

@@ -1,4 +1,4 @@
concrete VerbTur of Verb = CatTur ** open ResTur in { concrete VerbTur of Verb = CatTur ** open ResTur, SuffixTur in {
lin lin
UseV v = v ; UseV v = v ;
@@ -26,10 +26,41 @@ concrete VerbTur of Verb = CatTur ** open ResTur in {
ComplVV _ _ = variants {} ; ComplVV _ _ = variants {} ;
ComplVQ _ _ = variants {} ; ComplVQ _ _ = variants {} ;
UseComp _ = variants {} ; UseComp comp = comp ;
CompCN _ = variants {} ; 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 {} ; CompAdv _ = variants {} ;
ReflVP = variants {} ; ReflVP = variants {} ;