mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
Turkish: fixed vowel harmony
This commit is contained in:
@@ -12,61 +12,55 @@ oper
|
|||||||
base+"mek" => base
|
base+"mek" => base
|
||||||
}
|
}
|
||||||
in { s = table {
|
in { s = table {
|
||||||
VPres Sg P1 => harmony4 (harmony4 base "iyor") "im" ;
|
VPres Sg P1 => harmony4 (harmony4 base "iyor" "yiyor") "im" "yim" ;
|
||||||
VPres Sg P2 => harmony4 (harmony4 base "iyor") "sin" ;
|
VPres Sg P2 => harmony4 (harmony4 base "iyor" "yiyor") "sin" "sin" ;
|
||||||
VPres Sg P3 => harmony4 base "iyor" ;
|
VPres Sg P3 => harmony4 base "iyor" "yiyor" ;
|
||||||
VPres Pl P1 => harmony4 (harmony4 base "iyor") "iz" ;
|
VPres Pl P1 => harmony4 (harmony4 base "iyor" "yiyor") "iz" "yiz" ;
|
||||||
VPres Pl P2 => harmony4 (harmony4 (harmony4 base "iyor") "sin") "iz" ;
|
VPres Pl P2 => harmony4 (harmony4 (harmony4 base "iyor" "yiyor") "sin" "sin") "iz" "yiz" ;
|
||||||
VPres Pl P3 => harmony4 (harmony4 base "iyor") "ler" ;
|
VPres Pl P3 => harmony2 (harmony4 base "iyor" "yiyor") "ler" "ler" ;
|
||||||
VPast Sg P1 => harmony4 base "dim" ;
|
VPast Sg P1 => harmony4 base "dim" "dim" ;
|
||||||
VPast Sg P2 => harmony4 base "din" ;
|
VPast Sg P2 => harmony4 base "din" "din" ;
|
||||||
VPast Sg P3 => harmony4 base "di" ;
|
VPast Sg P3 => harmony4 base "di" "di" ;
|
||||||
VPast Pl P1 => harmony4 base "dik" ;
|
VPast Pl P1 => harmony4 base "dik" "dik" ;
|
||||||
VPast Pl P2 => harmony4 (harmony4 base "din") "iz" ;
|
VPast Pl P2 => harmony4 (harmony4 base "din" "din") "iz" "yiz" ;
|
||||||
VPast Pl P3 => harmony4 base "diler" ;
|
VPast Pl P3 => harmony4 base "diler" "diler" ;
|
||||||
VFuture Sg P1 => harmony4 (harmony2 base "ecek") "im" ;
|
VFuture Sg P1 => harmony4 (harmony2 base "ecek" "yecek") "im" "yim" ;
|
||||||
VFuture Sg P2 => harmony4 (harmony2 base "ecek") "sin" ;
|
VFuture Sg P2 => harmony4 (harmony2 base "ecek" "yecek") "sin" "sin" ;
|
||||||
VFuture Sg P3 => harmony2 base "ecek" ;
|
VFuture Sg P3 => harmony2 base "ecek" "yecek";
|
||||||
VFuture Pl P1 => harmony4 (harmony2 base "ecek") "iz" ;
|
VFuture Pl P1 => harmony4 (harmony2 base "ecek" "yecek") "iz" "yiz" ;
|
||||||
VFuture Pl P2 => harmony4 (harmony2 base "ecek") "siniz" ;
|
VFuture Pl P2 => harmony4 (harmony2 base "ecek" "yecek") "siniz" "siniz" ;
|
||||||
VFuture Pl P3 => harmony4 (harmony2 base "ecek") "ler" ;
|
VFuture Pl P3 => harmony2 (harmony2 base "ecek" "yecek") "ler" "ler" ;
|
||||||
VAorist Sg P1 => harmony4 base "im" ;
|
VAorist Sg P1 => harmony4 base "im" "yim" ;
|
||||||
VAorist Sg P2 => harmony4 base "sin" ;
|
VAorist Sg P2 => harmony4 base "sin" "sin" ;
|
||||||
VAorist Sg P3 => base ;
|
VAorist Sg P3 => base ;
|
||||||
VAorist Pl P1 => harmony4 base "iz" ;
|
VAorist Pl P1 => harmony4 base "iz" "yiz" ;
|
||||||
VAorist Pl P2 => harmony4 (harmony4 base "sin") "iz" ;
|
VAorist Pl P2 => harmony4 (harmony4 base "sin" "sin") "iz" "yiz" ;
|
||||||
VAorist Pl P3 => harmony4 base "ler" ;
|
VAorist Pl P3 => harmony2 base "ler" "ler" ;
|
||||||
VImperative => base ;
|
VImperative => base ;
|
||||||
VInfinitive => inf
|
VInfinitive => inf
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
add_number : Number -> Str -> Str = \n,base ->
|
|
||||||
case n of {
|
|
||||||
Sg => base ;
|
|
||||||
Pl => harmony2 base "ler"
|
|
||||||
} ;
|
|
||||||
|
|
||||||
regN : Str -> Noun = \base -> {
|
regN : Str -> Noun = \base -> {
|
||||||
s = \\n => table {
|
s = \\n => table {
|
||||||
Nom => add_number n base ;
|
Nom => add_number n base ;
|
||||||
Acc => harmony4 (add_number n base) "i" ;
|
Acc => harmony4 (add_number n base) "i" "yi" ;
|
||||||
Dat => harmony2 (add_number n base) "e" ;
|
Dat => harmony2 (add_number n base) "e" "ye" ;
|
||||||
Gen => harmony4 (add_number n base) "in" ;
|
Gen => harmony4 (add_number n base) "in" "nin" ;
|
||||||
Loc => harmony2 (add_number n base) "de" ;
|
Loc => harmony2 (add_number n base) "de" "de" ;
|
||||||
Ablat => harmony2 (add_number n base) "den" ;
|
Ablat => harmony2 (add_number n base) "den" "den" ;
|
||||||
Abess p => case p of {
|
Abess p => case p of {
|
||||||
Pos => harmony4 (add_number n base) "li" ;
|
Pos => harmony4 (add_number n base) "li" "li" ;
|
||||||
Neg => harmony4 (add_number n base) "siz"
|
Neg => harmony4 (add_number n base) "siz" "siz"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
gen = \\n => table {
|
gen = \\n => table {
|
||||||
{n=Sg; p=P1} => harmony4 (add_number n base) "im" ;
|
{n=Sg; p=P1} => harmony4 (add_number n base) "im" "yim" ;
|
||||||
{n=Sg; p=P2} => harmony4 (add_number n base) "in" ;
|
{n=Sg; p=P2} => harmony4 (add_number n base) "in" "yin" ;
|
||||||
{n=Sg; p=P3} => harmony4 (add_number n base) "i" ;
|
{n=Sg; p=P3} => harmony4 (add_number n base) "i" "yi" ;
|
||||||
{n=Pl; p=P1} => harmony4 (add_number n base) "imiz" ;
|
{n=Pl; p=P1} => harmony4 (add_number n base) "imiz" "yimiz" ;
|
||||||
{n=Pl; p=P2} => harmony4 (add_number n base) "iniz" ;
|
{n=Pl; p=P2} => harmony4 (add_number n base) "iniz" "yiniz" ;
|
||||||
{n=Pl; p=P3} => harmony4 (add_number n base) "i"
|
{n=Pl; p=P3} => harmony4 (add_number n base) "i" "yi"
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
@@ -65,14 +65,9 @@ resource ResTur = ParamX ** open Prelude, Predef in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
harmony4 : Str -> Str -> Str
|
harmony4 : Str -> Str -> Str -> Str
|
||||||
= \base0,suffix0 ->
|
= \base0,suffixC,suffixV ->
|
||||||
let buffer : Str =
|
let h : Str =
|
||||||
case dp 1 base0 + take 1 suffix0 of {
|
|
||||||
("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => "y" ;
|
|
||||||
_ => ""
|
|
||||||
} ;
|
|
||||||
h : Str =
|
|
||||||
case base0 of {
|
case base0 of {
|
||||||
_+c@("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+
|
_+c@("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+
|
||||||
("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")* =>
|
("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")* =>
|
||||||
@@ -82,31 +77,34 @@ resource ResTur = ParamX ** open Prelude, Predef in {
|
|||||||
("u"|"o") => "u" ;
|
("u"|"o") => "u" ;
|
||||||
("ü"|"ö") => "ü"
|
("ü"|"ö") => "ü"
|
||||||
} ;
|
} ;
|
||||||
_ => error ("harmony4")
|
_ => error "harmony4"
|
||||||
} ;
|
} ;
|
||||||
base : Str =
|
base : Str =
|
||||||
case dp 1 base0 + take 1 suffix0 of {
|
case dp 1 base0 + take 1 suffixC of {
|
||||||
("k")+("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => tk 1 base0 + "ğ" ;
|
("k")+("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => tk 1 base0 + "ğ" ;
|
||||||
_ => base0
|
_ => base0
|
||||||
} ;
|
} ;
|
||||||
suffix : Str =
|
suffix : Str =
|
||||||
case suffix0 of {
|
case dp 1 base0 of {
|
||||||
|
("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => case suffixV of {
|
||||||
|
s1@("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")
|
||||||
|
+ ("ı"|"i"|"u"|"ü")
|
||||||
|
+s2 => s1+h+s2 ;
|
||||||
|
_ => error "harmony4"
|
||||||
|
} ;
|
||||||
|
_ => case suffixC of {
|
||||||
s1@(("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")*)
|
s1@(("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")*)
|
||||||
+ ("ı"|"i"|"u"|"ü")
|
+ ("ı"|"i"|"u"|"ü")
|
||||||
+s2 => s1+h+s2 ;
|
+s2 => s1+h+s2 ;
|
||||||
s => s
|
s => error "harmony4"
|
||||||
}
|
}
|
||||||
in base + buffer + suffix ;
|
}
|
||||||
|
in base + suffix ;
|
||||||
|
|
||||||
harmony2 : Str -> Str -> Str
|
harmony2 : Str -> Str -> Str -> Str
|
||||||
= \base,suffix0 ->
|
= \base0,suffixC,suffixV ->
|
||||||
let buffer : Str =
|
let h : Str =
|
||||||
case dp 1 base + take 1 suffix0 of {
|
case base0 of {
|
||||||
("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => "n" ;
|
|
||||||
_ => ""
|
|
||||||
} ;
|
|
||||||
h : Str =
|
|
||||||
case base of {
|
|
||||||
_+c@("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+
|
_+c@("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö")+
|
||||||
("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")* =>
|
("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")* =>
|
||||||
case c of {
|
case c of {
|
||||||
@@ -115,17 +113,38 @@ resource ResTur = ParamX ** open Prelude, Predef in {
|
|||||||
} ;
|
} ;
|
||||||
_ => error "harmony2"
|
_ => error "harmony2"
|
||||||
} ;
|
} ;
|
||||||
suffix1 : Str =
|
base : Str =
|
||||||
case suffix0 of {
|
case dp 1 base0 + take 1 suffixC of {
|
||||||
|
("k")+("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => tk 1 base0 + "ğ" ;
|
||||||
|
_ => base0
|
||||||
|
} ;
|
||||||
|
suffix : Str =
|
||||||
|
case dp 1 base0 of {
|
||||||
|
("ı"|"a"|"i"|"e"|"u"|"o"|"ü"|"ö") => case suffixV of {
|
||||||
|
s1@("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")
|
||||||
|
+ ("a"|"e")
|
||||||
|
+s2 => s1+h+s2 ;
|
||||||
|
_ => error "harmony2"
|
||||||
|
} ;
|
||||||
|
("p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h") => case suffixC of {
|
||||||
|
s1@(("b"|"v"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")*)
|
||||||
|
+ ("a"|"e")
|
||||||
|
+s2 => s1+h+s2 ;
|
||||||
|
("da"|"de")+s => "t"+h+s ;
|
||||||
|
_ => error "harmony2"
|
||||||
|
} ;
|
||||||
|
_ => case suffixC of {
|
||||||
s1@(("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")*)
|
s1@(("b"|"v"|"d"|"z"|"j"|"c"|"g"|"ğ"|"l"|"r"|"m"|"n"|"y"|"p"|"f"|"t"|"s"|"ş"|"ç"|"k"|"h")*)
|
||||||
+ ("a"|"e")
|
+ ("a"|"e")
|
||||||
+s2 => s1+h+s2 ;
|
+s2 => s1+h+s2 ;
|
||||||
s => s
|
_ => error "harmony2"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in base + suffix ;
|
||||||
|
|
||||||
|
add_number : Number -> Str -> Str = \n,base ->
|
||||||
|
case n of {
|
||||||
|
Sg => base ;
|
||||||
|
Pl => harmony2 base "ler" "ler"
|
||||||
} ;
|
} ;
|
||||||
suffix : Str =
|
|
||||||
case dp 1 base + take 1 suffix1 of {
|
|
||||||
("ç"|"p"|"ş"|"k"|"f")+("d") => "t"+drop 1 suffix1 ;
|
|
||||||
_ => suffix1
|
|
||||||
} ;
|
|
||||||
in base + buffer + suffix ;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user