forked from GitHub/gf-rgl
first draft of coordination in Turkish
This commit is contained in:
@@ -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 ;
|
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} ;
|
NP = {s : Case => Str ; a : Agr} ;
|
||||||
VP = Verb ;
|
VP = Verb ;
|
||||||
VPSlash = VP ** {c : Prep} ;
|
VPSlash = VP ** {c : Prep} ;
|
||||||
Conj = {s : Str ; s1 : Str ; s2 : Str ; ct : ConjType} ;
|
|
||||||
|
|
||||||
Pron = ResTur.Pron ;
|
Pron = ResTur.Pron ;
|
||||||
Det = {s : Str; n : Number; useGen : UseGen} ;
|
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} ;
|
Card = {s : Number => Case => Str} ;
|
||||||
Ord = {s : Number => Case => Str} ;
|
Ord = {s : Number => Case => Str} ;
|
||||||
Quant = {s : Str; useGen : UseGen} ;
|
Quant = {s : Str; useGen : UseGen} ;
|
||||||
Prep = {s : Str; c : Case} ;
|
|
||||||
PrepNP = {s : Str} ;
|
PrepNP = {s : Str} ;
|
||||||
DAP = {s : Number => Case => Str} ;
|
DAP = {s : Number => Case => Str} ;
|
||||||
CAdv = {s : Str; p : Str; c : Case} ;
|
CAdv = {s : Str; p : Str; c : Case} ;
|
||||||
@@ -34,6 +32,10 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, Prelude in {
|
|||||||
-- Adjective
|
-- Adjective
|
||||||
AP = {s : Number => Case => Str} ;
|
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
|
-- Open lexical classes, e.g. Lexicon
|
||||||
V, VS, VV, VQ, VA = Verb ;
|
V, VS, VV, VQ, VA = Verb ;
|
||||||
V2, V2S, V2V, V2Q, V2A = Verb ** {c : Prep} ;
|
V2, V2S, V2V, V2Q, V2A = Verb ** {c : Prep} ;
|
||||||
|
|||||||
@@ -1,38 +1,75 @@
|
|||||||
concrete ConjunctionTur of Conjunction =
|
concrete ConjunctionTur of Conjunction =
|
||||||
CatTur ** open ResTur, Coordination, Prelude in {
|
CatTur ** open ResTur, Coordination, Prelude, Predef in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ConjNP _ _ = variants {} ;
|
ConjS _ _ = variants {} ;
|
||||||
ConsNP _ _ = variants {} ;
|
|
||||||
BaseNP _ _ = variants {} ;
|
|
||||||
|
|
||||||
ConsAP _ _ = variants {} ;
|
ConjNP conj ss = {
|
||||||
|
s = \\c => linCoord []!conj.sep ++ ss.s!c!conj.sep ++ conj.s ++ ss.s!c!4;
|
||||||
-- TODO: ap2.s seems to irrelevant; investigate why.
|
a = conjAgr {n=conj.n; p=P3} ss.a
|
||||||
BaseAP ap1 ap2 = {
|
|
||||||
s = ap1.s ! Sg ! Nom
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjAP _ _ = variants {} ;
|
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} ;
|
||||||
|
|
||||||
BaseAdV adv1 adv2 = {
|
ConjAP conj ss = {
|
||||||
s = adv1.s
|
s = \\n,c => linCoord []!conj.sep ++ ss.s!n!c!conj.sep ++ conj.s ++ ss.s!n!c!4
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConsAdv _ _ = variants {} ;
|
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}} ;
|
||||||
|
|
||||||
BaseAdv adv1 adv2 = {
|
ConjCN conj ss = {
|
||||||
s = adv1.s
|
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
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjAdv _ _ = variants {} ;
|
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}} ;
|
||||||
|
|
||||||
|
|
||||||
ConjRS _ _ = variants {} ;
|
ConjRS _ _ = variants {} ;
|
||||||
ConsRS _ _ = variants {} ;
|
ConsRS _ _ = variants {} ;
|
||||||
BaseRS _ _ = variants {} ;
|
BaseRS _ _ = variants {} ;
|
||||||
|
|
||||||
ConjS _ _ = variants {} ;
|
|
||||||
ConsS _ _ = variants {} ;
|
ConsS _ _ = variants {} ;
|
||||||
BaseS _ _ = 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} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -571,6 +571,9 @@ resource ParadigmsTur = open
|
|||||||
n = num
|
n = num
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkConj : Str -> Number -> Conj =
|
||||||
|
\s,n -> {s = s; sep = 3; n = n; lock_Conj = <>} ;
|
||||||
|
|
||||||
-- Helper functions and parameters
|
-- Helper functions and parameters
|
||||||
-- finds which aorist type will be used with a base, see aorist type parameter for more info
|
-- finds which aorist type will be used with a base, see aorist type parameter for more info
|
||||||
getAoristType : Str -> AoristType =
|
getAoristType : Str -> AoristType =
|
||||||
|
|||||||
@@ -24,6 +24,10 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
|
|||||||
agrP3 : Number -> Agr ;
|
agrP3 : Number -> Agr ;
|
||||||
agrP3 n = {n = n; p = P3} ;
|
agrP3 n = {n = n; p = P3} ;
|
||||||
-- For $Adjective$
|
-- For $Adjective$
|
||||||
|
|
||||||
|
conjAgr : Agr -> Agr -> Agr = \a,b ->
|
||||||
|
{n=conjNumber a.n b.n; p=conjPerson a.p b.p} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Adjective = Noun ** { adv : Str } ;
|
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} =
|
mkDet : Str -> Number -> UseGen -> {s : Str; n : Number; useGen : UseGen} =
|
||||||
\s, n, ug -> {s = s; n = n; useGen = ug} ;
|
\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} =
|
attachMe : Verb -> {s : Str} =
|
||||||
\v ->
|
\v ->
|
||||||
let
|
let
|
||||||
@@ -126,4 +108,8 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
|
|||||||
(_ + #vowel + _ )* + (_ + #frontVowel + _) => ss (s ++ "me") ;
|
(_ + #vowel + _ )* + (_ + #frontVowel + _) => ss (s ++ "me") ;
|
||||||
(_ + #vowel + _)* + (_ + #backVowel + _) => ss (s ++ "ma")
|
(_ + #vowel + _)* + (_ + #backVowel + _) => ss (s ++ "ma")
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
linCoord : Str -> Ints 4 => Str ;
|
||||||
|
linCoord comma = table {0 => "hem"; 1=>"ya"; 2=>"ne"; 3=>comma; 4=>[]} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,9 +83,8 @@ concrete StructuralTur of Structural = CatTur **
|
|||||||
between_Prep =
|
between_Prep =
|
||||||
mkPrep "arasındaki" Gen ;
|
mkPrep "arasındaki" Gen ;
|
||||||
|
|
||||||
and_Conj = mkConj "ile" ;
|
and_Conj = mkConj "ve" Pl ;
|
||||||
|
or_Conj = mkConj "veya" Sg ;
|
||||||
or_Conj = mkConj "veya" ;
|
|
||||||
|
|
||||||
yes_Utt = ss "evet" ;
|
yes_Utt = ss "evet" ;
|
||||||
no_Utt = ss "hayır" ;
|
no_Utt = ss "hayır" ;
|
||||||
@@ -136,8 +135,8 @@ concrete StructuralTur of Structural = CatTur **
|
|||||||
|
|
||||||
if_Subj = {s = "eğer"} ;
|
if_Subj = {s = "eğer"} ;
|
||||||
|
|
||||||
both7and_DConj = mkConj "hem" "hem de" ;
|
both7and_DConj = mkConj "hem de" Pl ** {sep=0} ;
|
||||||
either7or_DConj = mkConj "ya" "ya da" ;
|
either7or_DConj = mkConj "ya da" Sg ** {sep=1} ;
|
||||||
|
|
||||||
few_Det = mkDet "birkaç" Sg NoGen ;
|
few_Det = mkDet "birkaç" Sg NoGen ;
|
||||||
|
|
||||||
@@ -182,10 +181,6 @@ concrete StructuralTur of Structural = CatTur **
|
|||||||
|
|
||||||
how_IAdv = {s = "nasıl"} ;
|
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
|
-- TODO: in8front_Prep
|
||||||
in8front_Prep = mkPrep "önünde" Gen ;
|
in8front_Prep = mkPrep "önünde" Gen ;
|
||||||
|
|
||||||
@@ -252,10 +247,6 @@ concrete StructuralTur of Structural = CatTur **
|
|||||||
|
|
||||||
whatSg_IP = { s = "ne" } ;
|
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" } ;
|
when_IAdv = { s = "ne zaman" } ;
|
||||||
|
|
||||||
which_IQuant = { s = "hangi" } ;
|
which_IQuant = { s = "hangi" } ;
|
||||||
|
|||||||
Reference in New Issue
Block a user