first draft of coordination in Turkish

This commit is contained in:
krangelov
2020-03-28 11:14:15 +01:00
parent 98b7599c7b
commit c36725aea7
5 changed files with 76 additions and 57 deletions

View File

@@ -1,4 +1,4 @@
concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude in {
concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude, Predef in {
flags optimize=all_subs ;
@@ -14,7 +14,6 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude in {
NP = {s : Case => Str ; a : Agr} ;
VP = Verb ;
VPSlash = VP ** {c : Prep} ;
Conj = {s : Str ; s1 : Str ; s2 : Str ; ct : ConjType} ;
Pron = ResTur.Pron ;
Det = {s : Str; n : Number; useGen : UseGen} ;
@@ -22,7 +21,6 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude in {
Card = {s : Number => Case => Str} ;
Ord = {s : Number => Case => Str} ;
Quant = {s : Str; useGen : UseGen} ;
Prep = {s : Str; c : Case} ;
PrepNP = {s : Str} ;
DAP = {s : Number => Case => Str} ;
CAdv = {s : Str; p : Str; c : Case} ;
@@ -34,6 +32,10 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude in {
-- Adjective
AP = {s : Number => Case => Str} ;
-- Structural
Conj = {s : Str; sep : Ints 4; n : Number} ;
Prep = {s : Str; c : Case} ;
-- Open lexical classes, e.g. Lexicon
V, VS, VV, VQ, VA = Verb ;
V2, V2S, V2V, V2Q, V2A = Verb ** {c : Prep} ;

View File

@@ -1,38 +1,75 @@
concrete ConjunctionTur of Conjunction =
CatTur ** open ResTur, Coordination, Prelude in {
CatTur ** open ResTur, Coordination, Prelude, Predef in {
lin
ConjNP _ _ = variants {} ;
ConsNP _ _ = variants {} ;
BaseNP _ _ = variants {} ;
ConjS _ _ = variants {} ;
ConsAP _ _ = variants {} ;
ConjNP conj ss = {
s = \\c => linCoord []!conj.sep ++ ss.s!c!conj.sep ++ conj.s ++ ss.s!c!4;
a = conjAgr {n=conj.n; p=P3} ss.a
} ;
-- TODO: ap2.s seems to irrelevant; investigate why.
BaseAP ap1 ap2 = {
s = ap1.s ! Sg ! Nom
} ;
BaseNP x y =
{s = \\c=>table {4 => y.s!c; _ => x.s!c};
a = conjAgr x.a y.a} ;
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} ;
ConjAP _ _ = variants {} ;
ConjAP conj ss = {
s = \\n,c => linCoord []!conj.sep ++ ss.s!n!c!conj.sep ++ conj.s ++ ss.s!n!c!4
} ;
BaseAdV adv1 adv2 = {
s = adv1.s
} ;
BaseAP x y =
{s = \\n,c=>table {4 => y.s!n!c; _ => x.s!n!c}} ;
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}} ;
ConsAdv _ _ = variants {} ;
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
} ;
BaseAdv adv1 adv2 = {
s = adv1.s
} ;
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}} ;
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}} ;
ConjAdV conj ss = {
s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4
} ;
BaseAdV x y =
{s = table {4 => y.s; _ => x.s}} ;
ConsAdV x xs =
{s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ;
ConjAdv conj ss = {
s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4
} ;
BaseAdv x y =
{s = table {4 => y.s; _ => x.s}} ;
ConsAdv x xs =
{s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t}} ;
ConjAdv _ _ = variants {} ;
ConjRS _ _ = variants {} ;
ConsRS _ _ = variants {} ;
BaseRS _ _ = variants {} ;
ConjS _ _ = variants {} ;
ConsS _ _ = variants {} ;
BaseS _ _ = variants {} ;
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} ;
[CN] = {s : Number => Case => Ints 4 => Str;
gen : Number => Agr => Ints 4 => Str} ;
}

View File

@@ -571,6 +571,9 @@ resource ParadigmsTur = open
n = num
} ;
mkConj : Str -> Number -> Conj =
\s,n -> {s = s; sep = 3; n = n; lock_Conj = <>} ;
-- Helper functions and parameters
-- finds which aorist type will be used with a base, see aorist type parameter for more info
getAoristType : Str -> AoristType =

View File

@@ -24,6 +24,10 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
agrP3 : Number -> Agr ;
agrP3 n = {n = n; p = P3} ;
-- For $Adjective$
conjAgr : Agr -> Agr -> Agr = \a,b ->
{n=conjNumber a.n b.n; p=conjPerson a.p b.p} ;
oper
Adjective = Noun ** { adv : Str } ;
@@ -95,28 +99,6 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
mkDet : Str -> Number -> UseGen -> {s : Str; n : Number; useGen : UseGen} =
\s, n, ug -> {s = s; n = n; useGen = ug} ;
mkConj : overload {
mkConj : Str -> {s : Str ; s1 : Str ; s2 : Str ; ct : ConjType} ;
mkConj : Str -> Str -> {s : Str ; s1 : Str ; s2 : Str ; ct : ConjType} ;
} ;
mkConj = overload {
mkConj : Str -> {s : Str ; s1 : Str ; s2 : Str ; ct : ConjType} =
\s -> {
s = s ;
s1 = s ;
s2 = [] ;
ct = Infix
} ;
mkConj : Str -> Str -> {s : Str ; s1 : Str ; s2 : Str ; ct : ConjType} =
\s1, s2 -> {
s = s1 ++ s2 ;
s1 = s1 ;
s2 = s2 ;
ct = Mixfix
} ;
} ;
attachMe : Verb -> {s : Str} =
\v ->
let
@@ -126,4 +108,8 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
(_ + #vowel + _ )* + (_ + #frontVowel + _) => ss (s ++ "me") ;
(_ + #vowel + _)* + (_ + #backVowel + _) => ss (s ++ "ma")
} ;
linCoord : Str -> Ints 4 => Str ;
linCoord comma = table {0 => "hem"; 1=>"ya"; 2=>"ne"; 3=>comma; 4=>[]} ;
}

View File

@@ -83,9 +83,8 @@ concrete StructuralTur of Structural = CatTur **
between_Prep =
mkPrep "arasındaki" Gen ;
and_Conj = mkConj "ile" ;
or_Conj = mkConj "veya" ;
and_Conj = mkConj "ve" Pl ;
or_Conj = mkConj "veya" Sg ;
yes_Utt = ss "evet" ;
no_Utt = ss "hayır" ;
@@ -136,8 +135,8 @@ concrete StructuralTur of Structural = CatTur **
if_Subj = {s = "eğer"} ;
both7and_DConj = mkConj "hem" "hem de" ;
either7or_DConj = mkConj "ya" "ya da" ;
both7and_DConj = mkConj "hem de" Pl ** {sep=0} ;
either7or_DConj = mkConj "ya da" Sg ** {sep=1} ;
few_Det = mkDet "birkaç" Sg NoGen ;
@@ -182,10 +181,6 @@ concrete StructuralTur of Structural = CatTur **
how_IAdv = {s = "nasıl"} ;
-- Conditionals in Turkish are handled through inflections.
-- I will decide what to do with this later.
if_then_Conj = mkConj "foo" "bar" ;
-- TODO: in8front_Prep
in8front_Prep = mkPrep "önünde" Gen ;
@@ -252,10 +247,6 @@ concrete StructuralTur of Structural = CatTur **
whatSg_IP = { s = "ne" } ;
-- Not sure what this is for given that we have separate functions for the
-- plural "what" case and the singular "what" case.
what_IP = { s = "ne" } ;
when_IAdv = { s = "ne zaman" } ;
which_IQuant = { s = "hangi" } ;