1
0
forked from GitHub/gf-rgl

verbal morphology is not syntactic. added negation

This commit is contained in:
Krasimir Angelov
2024-07-24 08:04:35 +02:00
parent 65a05d223b
commit 05c65ccbd8
12 changed files with 334 additions and 292 deletions

View File

@@ -12,11 +12,11 @@ concrete AdverbTur of Adverb = CatTur ** open ResTur, Prelude in {
} ;
-- TODO: inflect the subject to genitive.
ComparAdvAdjS cadv a s = {
ComparAdvAdjS cadv a s = variants {} ; {- {
s = s.subord ++ cadv.s ++ a.s ! Sg ! Nom
} ;
} ; -}
SubjS s1 s2 = {s = s1.s ++ s2.subord} ;
SubjS s1 s2 = variants {} ; -- {s = s1.s ++ s2.subord} ;
PositAdvAdj a = {s = a.adv} ;

View File

@@ -4,18 +4,18 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud
lincat
S = {s, subord : Str} ;
S = {s : Str} ;
Cl = {s : Tense => Str; subord : Str} ;
Imp = {s : Number => Str} ;
Cl = {s : Tense => Polarity => Str} ;
Imp = {s : Polarity => Number => Str} ;
-- Noun
CN = {s : Number => Case => Str; gen : Number => Agr => Str; h : Harmony} ;
NP = {s : Case => Str ; h : Harmony; a : Agr} ;
VP = Verb ** {compl : Str} ;
VPSlash = Verb ** {compl : Str; c : Prep} ;
Comp = Verb ;
VP = {s : VForm => Str; compl : Str} ;
VPSlash = {s : VForm => Str; compl : Str; c : Prep} ;
Comp = {s : VForm => Str; compl : Str} ;
Pron = ResTur.Pron ;
Det = {s : Str; n : Number; useGen : UseGen} ;
@@ -58,8 +58,7 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud
linref
V = \v -> v.s ! VInfinitive ;
V2 = \v -> v.s ! VInfinitive ++ v.c.s ;
VP = \vp -> vp.compl ++ vp.s ! VInfinitive ;
V2 = \v -> v.s ++ v.c.s ;
VP = \vp -> vp.compl ++ vp.s ! VInf Pos ;
}

View File

@@ -4,7 +4,6 @@ concrete ConjunctionTur of Conjunction =
lin
ConjS conj ss = {
s = linCoord []!conj.sep ++ ss.s!conj.sep ++ conj.s ++ ss.s!4;
subord = linCoord []!conj.sep ++ ss.subord!conj.sep ++ conj.s ++ ss.subord!4;
} ;
ConjNP conj ss = {
@@ -14,10 +13,8 @@ concrete ConjunctionTur of Conjunction =
} ;
BaseS x y = {s = table {4 => y.s; _ => x.s};
subord = table {4 => y.subord; _ => x.subord};
} ;
ConsS x xs = {s = table {4 => xs.s!4; t => x.s++linCoord bindComma!t++xs.s!t};
subord = table {4 => xs.subord!4; t => x.subord++linCoord bindComma!t++xs.subord!t} ;
} ;
BaseNP x y =
@@ -89,7 +86,7 @@ concrete ConjunctionTur of Conjunction =
BaseRS _ _ = variants {} ;
lincat
[S] = {s,subord : Ints 4 => Str} ;
[S] = {s : Ints 4 => Str} ;
[Adv] = {s : Ints 4 => Str} ;
[AdV] = {s : Ints 4 => Str} ;
[NP] = {s : Case => Ints 4 => Str; h : Harmony; a : Agr} ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
concrete DocumentationTur of Documentation = CatTur ** open
ResTur,
ResTur, Prelude,
HTML in {
lincat
@@ -97,52 +97,37 @@ lin
oper
inflVerb : Verb -> Str = \v ->
(heading2 ("Şimdiki zaman") ++
finite VPres ++
tag "br" ++
finite VProg ++
finite Pres ++
heading2 ("Geçmiş zaman") ++
finite VPast ++
finite Past ++
heading2 ("Gelecek zaman") ++
finite VFuture ++
finite Fut ++
heading2 ("Emir kipi") ++
frameTable (
tr (th "tekil" ++
th "çoğul") ++
tr (td (v.s ! VImperative Sg) ++
td (v.s ! VImperative Pl))
tr (td (tbl ! VImp Pos Sg) ++
td (tbl ! VImp Pos Pl))
) ++
heading2 ("Eylemlik") ++
paragraph (v.s ! VInfinitive) ++
heading2 ("Ulaç") ++
nounForm Gerund ++
heading2 ("Ad") ++
nounForm VNoun)
paragraph (tbl ! VInf Pos))
where {
finite : (Agr -> VForm) -> Str = \f ->
tbl : VForm => Str = mkVerbForms v ;
finite : Tense -> Str = \t ->
frameTable (
tr (th "" ++
th "tekil" ++
th "çoğul") ++
tr (th "1." ++
td (v.s ! f {n=Sg; p=P1}) ++
td (v.s ! f {n=Pl; p=P1})) ++
td (tbl ! VFin t Pos {n=Sg; p=P1}) ++
td (tbl ! VFin t Pos {n=Pl; p=P1})) ++
tr (th "2." ++
td (v.s ! f {n=Sg; p=P2}) ++
td (v.s ! f {n=Pl; p=P2})) ++
td (tbl ! VFin t Pos {n=Sg; p=P2}) ++
td (tbl ! VFin t Pos {n=Pl; p=P2})) ++
tr (th "3." ++
td (v.s ! f {n=Sg; p=P3}) ++
td (v.s ! f {n=Pl; p=P3}))
) ;
nounForm : (Number -> Case -> VForm) -> Str = \f ->
frameTable (
tr (th "" ++ th "tekil" ++ th "çoğul") ++
tr (th "yalın" ++ td (v.s ! f Sg Nom) ++ td (v.s ! f Pl Nom)) ++
tr (th "belirtme" ++ td (v.s ! f Sg Acc) ++ td (v.s ! f Pl Acc)) ++
tr (th "yönelme" ++ td (v.s ! f Sg Dat) ++ td (v.s ! f Pl Dat)) ++
tr (th "bulunma" ++ td (v.s ! f Sg Loc) ++ td (v.s ! f Pl Loc)) ++
tr (th "ayrılma" ++ td (v.s ! f Sg Ablat) ++ td (v.s ! f Pl Ablat)) ++
tr (th "tamlayan" ++ td (v.s ! f Sg Gen) ++ td (v.s ! f Pl Gen))
td (tbl ! VFin t Pos {n=Sg; p=P3}) ++
td (tbl ! VFin t Pos {n=Pl; p=P3}))
) ;
} ;
}

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common:../../prelude
concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude in {
concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX, Prelude in {
flags optimize=all_subs ;
@@ -194,7 +194,9 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, Prelude
} ;
PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! (VPast np.a);
s = \\c => np.s ! c
++ mkVerbForms v2 ! VFin Past Pos np.a --# notpresent
;
h = np.h ;
a = np.a
} ;

View File

@@ -60,13 +60,6 @@ resource ParadigmsTur = open
mkVS : V -> VS = \verb -> verb ;
mkVQ : V -> VQ = \verb -> verb ;
-- worst-case function
-- bases of all forms are required.
makeVerb : (mek,inf,base,presBase,pastBase,aoristBase : Str)
-> (futureBase : Softness => Str )
-> Harmony
-> V ;
-- make a regular verb
-- supply infinitive, softened infinitive, future infinitive forms and
-- aorist type
@@ -234,8 +227,8 @@ resource ParadigmsTur = open
auxillaryVerb prefix verb con =
case con of {
Sep => lin V {s = \\t => prefix ++ verb.s ! t} ;
Con => lin V {s = \\t => prefix + verb.s ! t}
Sep => lin V {s = prefix ++ verb.s; stems : VStem => Str = \\t => prefix ++ verb.stems ! t; h = verb.h; aoristType = verb.aoristType} ;
Con => lin V {s = prefix + verb.s; stems : VStem => Str = \\t => prefix + verb.stems ! t; h = verb.h; aoristType = verb.aoristType}
} ;
regV inf = regVerb inf inf inf (getAoristType (tk 3 inf)) ;
@@ -243,86 +236,25 @@ resource ParadigmsTur = open
irregV_aor inf aorT = regVerb inf inf inf aorT ;
regVerb inf softInf futInf aoristType =
let base = (tk 3 inf) ;
softBase = (tk 3 softInf) ;
futBase = (tk 3 futInf) ;
har = getHarmony base ;
softness = getSoftness base ;
futureBase = addSuffix futBase har futureSuffix ;
softFutureBase = addSuffix futBase har softFutureSuffix ;
pastBase = addSuffix base har pastSuffix ;
futureTable =
table {
Soft => softFutureBase ;
Hard => futureBase
} ;
aoristBase =
case aoristType of {
SgSylConReg => addSuffix softBase har aoristErSuffix ;
_ => addSuffix softBase har aoristIrSuffix
} ;
let base = tk 3 inf ;
softBase = tk 3 softInf ;
futBase = tk 3 futInf ;
progBase =
case (getHarConP base) of {
SVow => addSuffix (tk 1 base) (getHarmony (tk 1 base)) presentSuffix ;
_ => addSuffix softBase har presentSuffix
} ;
in makeVerb (init inf) inf base progBase pastBase aoristBase futureTable har;
makeVerb mek inf base progBase pastBase aoristBase futureTable har =
let
futht = getHarVowP (futureTable ! Hard) ;
pastHar = {vow = har.vow ; con = SVow} ;
futHar = {vow = futht ; con = (SCon Soft)} ;
aorHar = {vow = getHarVowP aoristBase ; con = (SCon Soft)} ;
in
lin V {
s =
table {
VPres agr =>
addSuffix aoristBase aorHar (verbSuffixes ! agr) ;
VProg agr =>
addSuffix progBase progHar (verbSuffixes ! agr) ;
VPast agr =>
addSuffix pastBase pastHar (verbSuffixes ! agr) ;
VFuture agr =>
addSuffix futureTable futHar (verbSuffixes ! agr) ;
VImperative Sg =>
base ;
VImperative Pl =>
addSuffix base har p2PlImperSuffix ;
VInfinitive =>
inf ;
Gerund _ Acc =>
case aorHar.vow of {
Ih_Har => mek + "si" ;
I_Har => mek + "sı" ;
U_Har => "TODO" ;
Uh_Har => "TODO"
} ;
Gerund _ _ => mek ;
VNoun n Gen =>
case aorHar.vow of {
Ih_Har => base + "tiği" ;
I_Har => base + "tığı" ;
U_Har => base + "duğu" ;
Uh_Har => base + "düğü"
} ;
VNoun n Ablat =>
case aorHar.vow of {
Ih_Har => base + "tıktan" ;
I_Har => base + "tıktan" ;
U_Har => base + "duktan" ;
Uh_Har => base + "dükten"
} ;
VNoun n _ =>
case aorHar.vow of {
Ih_Har => base + "(TODO: makeVerb)" ;
I_Har => base + "(TODO: makeVerb)" ;
U_Har => base + "(TODO: makeVerb)" ;
Uh_Har => base + "(TODO: makeVerb)"
}
} ;
} ;
case getHarConP base of {
SVow => tk 1 base ;
_ => softBase
}
in lin V {
s = inf ;
stems = table {
VBase Hard => base ;
VBase Soft => softBase ;
VProg => progBase ;
VFut => futBase
} ;
aoristType = aoristType ;
h = getHarmony base
} ;
-- Implementation of noun paradigms
mkNoun sn sa sd sg sl sabl sgabPos sgabNeg si sgs pln har =
@@ -636,14 +568,6 @@ resource ParadigmsTur = open
mkQuant : Str -> Quant = \s -> lin Quant {s=s; useGen = NoGen} ;
param
AoristType =
PlSyl -- more than one syllable, takes -ir
| SgSylConIrreg -- one syllable ending with consonant, but takes -ir
-- (here is the list: al-, bil-, bul-, dur-, gel-, gör-,
-- kal-, ol-, öl-, var-, ver-, vur-, san- )
| SgSylConReg ; -- one syllable ending with consonant, takes -er
oper
mkMU : Str -> MU = \s -> lin MU {s=s; isPre=False} ;

View File

@@ -5,9 +5,9 @@ concrete PhraseTur of Phrase = CatTur ** open Prelude, ResTur in {
-- The following are utterly untested.
-- Currently, they should be treated as just implementation stubs.
UttQS qs = {s = qs.s} ;
UttImpSg pol imp = {s = imp.s ! Sg} ;
UttImpPl pol imp = {s = imp.s ! Pl} ;
UttImpPol pol imp = {s = imp.s ! Pl} ;
UttImpSg pol imp = {s = imp.s ! pol.p ! Sg} ;
UttImpPl pol imp = {s = imp.s ! pol.p ! Pl} ;
UttImpPol pol imp = {s = imp.s ! pol.p ! Pl} ;
UttIP ip = {s = ip.s} ;
UttIAdv iadv = iadv ;
UttCard n = {s = n.s ! Sg ! Nom} ;
@@ -16,7 +16,7 @@ concrete PhraseTur of Phrase = CatTur ** open Prelude, ResTur in {
-- The following have been somewhat tested and seem to be working fine
-- to some extent.
UttNP np = {s = np.s ! Nom} ;
UttVP vp = {s = vp.s ! VInfinitive} ;
UttVP vp = {s = vp.s ! VInf Pos} ;
UttAP ap = {s = ap.s ! Sg ! Nom} ;
UttCN n = {s = n.s ! Sg ! Nom} ;
UttS s = {s = s.s} ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common:../../prelude
resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
--2 For $Noun$
@@ -37,16 +37,26 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
param
VForm =
VPres Agr
| VProg Agr
| VPast Agr
| VFuture Agr
| VImperative Number
| VInfinitive
| Gerund Number Case
| VNoun Number Case
VInf Polarity
| VImp Polarity Number
| VFin Tense Polarity Agr
;
param
VStem =
VBase Softness
| VProg
| VFuture
;
param
AoristType =
PlSyl -- more than one syllable, takes -ir
| SgSylConIrreg -- one syllable ending with consonant, but takes -ir
-- (here is the list: al-, bil-, bul-, dur-, gel-, gör-,
-- kal-, ol-, öl-, var-, ver-, vur-, san- )
| SgSylConReg ; -- one syllable ending with consonant, takes -er
param
ConjType = Infix | Mixfix ;
@@ -54,7 +64,10 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
oper
Verb : Type = {
s : VForm => Str
s : Str ;
stems : VStem => Str ;
aoristType : AoristType ;
h : Harmony
} ;
--2 For $Numeral$
@@ -93,31 +106,150 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur in {
a = {n = n; p = p}
} ;
mkClause : Str -> Agr -> Str -> Verb -> {s : Tense => Str; subord : Str} =
\np, a, compl, v -> {
s = table {
Pres => np ++ compl ++ v.s ! VPres a ;
Past => np ++ compl ++ v.s ! VPast a ;
Fut => np ++ compl ++ v.s ! VFuture a ;
Cond => "TODO"
} ;
subord = np ++ compl ++ v.s ! VNoun a.n Nom
} ;
mkVerbForms : Verb -> VForm => Str =
\v -> table {
VInf Pos => v.s ;
VInf Neg => v.stems ! VBase Soft ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr v.h infinitiveSuffix ;
VImp p n => v.stems ! VBase Soft ++
case <p,n> of {
<Pos,Sg> => [] ;
<Neg,Sg> => BIND ++
suffixStr v.h negativeSuffix ;
<Pos,Pl> => BIND ++
suffixStr v.h p2PlImperSuffix ;
<Neg,Pl> => BIND ++
suffixStr v.h negativeSuffix +
(let negHar = mkHar (case v.h.vow of {
I_Har | U_Har => I_Har ;
Ih_Har | Uh_Har => Ih_Har
}) SVow
in suffixStr negHar p2PlImperSuffix)
} ;
VFin t p agr =>
let presHar = mkHar (case v.h.con of {
SCon _ => case v.aoristType of {
SgSylConReg => Ih_Har ;
_ => v.h.vow
} ;
SVow => v.h.vow
}) (SCon Soft) ;
pastHar = mkHar v.h.vow SVow ;
futSoft = (verbSuffixes ! agr).stemT ;
futHar = mkHar (case v.h.vow of {
I_Har | U_Har => I_Har ;
Ih_Har | Uh_Har => Ih_Har
}) (SCon futSoft) ;
negHar = mkHar (case v.h.vow of {
I_Har | U_Har => I_Har ;
Ih_Har | Uh_Har => Ih_Har
}) SVow ;
presNegHar =
mkHar negHar.vow (SCon Soft)
in case p of {
Pos => case t of {
Pres => v.stems ! VBase Soft ++ BIND ++
suffixStr v.h (case v.aoristType of {
SgSylConReg => aoristErSuffix ;
_ => aoristIrSuffix
}) +
suffixStr presHar (verbSuffixes ! agr) ;
Past => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h pastSuffix +
suffixStr pastHar (verbSuffixes ! agr) ;
Fut => v.stems ! VFuture ++ BIND ++
suffixStr v.h (case futSoft of {
Soft => softFutureSuffix ;
Hard => futureSuffix
}) +
suffixStr futHar (verbSuffixes ! agr) ;
Cond => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h (condCopulaSuffixes ! agr)
} ;
Neg => case t of {
Pres => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
case agr of {
{n=Sg; p=P1} => suffixStr negHar (verbSuffixes ! agr) ;
{n=Pl; p=P1} => suffixStr negHar p1PlAoristSuffix ;
_ => suffixStr negHar aoristIzSuffix + suffixStr presNegHar (verbSuffixes ! agr)
} ;
Past => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar pastSuffix +
suffixStr negHar (verbSuffixes ! agr) ;
Fut => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar (case (verbSuffixes ! agr).stemT of {
Soft => softFutureSuffix ;
Hard => futureSuffix
}) +
suffixStr futHar (verbSuffixes ! agr) ;
Cond => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar (condCopulaSuffixes ! agr)
}
}
} ;
mkDet : Str -> Number -> UseGen -> {s : Str; n : Number; useGen : UseGen} =
\s, n, ug -> {s = s; n = n; useGen = ug} ;
attachMe : Verb -> {s : Str} =
\v ->
let
s : Str = v.s ! VImperative Sg
in
case s of {
(_ + #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=>[]} ;
caseSuffixes : Case => Suffix =
table {
Nom => empSuffix ;
Acc => accSuffix ;
Dat => datSuffix ;
Gen => genSuffix ;
Loc => locSuffix ;
Ablat => ablatSuffix ;
Abess Pos => abessPosSuffix ;
Abess Neg => abessNegSuffix ;
Instr => instrSuffix
} ;
genSuffixes : Agr => Suffix =
table {
{n=Sg; p=P1} => genSgP1Suffix ;
{n=Sg; p=P2} => genSgP2Suffix ;
{n=Sg; p=P3} => genSgP3Suffix ;
{n=Pl; p=P1} => genPlP1Suffix ;
{n=Pl; p=P2} => genPlP2Suffix ;
{n=Pl; p=P3} => genPlP3Suffix
} ;
verbSuffixes : Agr => Suffix =
table {
{n=Sg; p=P1} => p1SgVerbalSuffix ;
{n=Sg; p=P2} => p2SgVerbalSuffix ;
{n=Sg; p=P3} => empSuffix ;
{n=Pl; p=P1} => p1PlVerbalSuffix ;
{n=Pl; p=P2} => p2PlVerbalSuffix ;
{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
} ;
}

View File

@@ -1,16 +1,14 @@
concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in {
lin
PredVP np vp = mkClause (np.s ! Nom) np.a vp.compl vp ;
PredVP np vp = {s = \\t,p => np.s ! Nom ++ vp.compl ++ vp.s ! VFin t p np.a} ;
PredSCVP sc vp = variants {} ;
-- TODO: Check how correct this is.
EmbedVP vp = {s = (vp.s ! Gerund Sg Acc)} ;
EmbedVP vp = variants {} ; -- {s = (vp.s ! Gerund Sg Acc)} ;
-- TODO: rudimentary implementation; revise this.
UseCl temp pol cl = {s = temp.s ++ cl.s ! temp.t; subord=cl.subord} ;
UseCl temp pol cl = {s = temp.s ++ pol.s ++ cl.s ! temp.t ! pol.p} ;
UseQCl _ _ = variants {} ;
@@ -24,7 +22,8 @@ concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in {
EmbedQS _ = variants {} ;
EmbedS _ = variants {} ;
ImpVP vp = {s = \\n => vp.compl ++ vp.s ! VImperative n} ;
ImpVP vp = {s = \\p,n => vp.compl ++ vp.s ! VImp p n
} ;
AdvS _ _ = variants {} ;

View File

@@ -203,17 +203,11 @@ concrete StructuralTur of Structural = CatTur **
why_IAdv = {s = "neden"} ;
where_IAdv = {s = "nerede"} ;
can8know_VV = {
s = \\_ => "(TODO: can8know_VV)"
} ;
can8know_VV = variants {} ;
can_VV = {
s = \\_ => "(TODO: can_VV)"
} ;
can_VV = variants {} ;
must_VV = {
s = \\_ => "(TODO: must_VV)"
} ;
must_VV = variants {} ;
not_Predet = {
s = "(TODO: not_Predet)"
@@ -241,7 +235,7 @@ concrete StructuralTur of Structural = CatTur **
-- TODO: this depends on the linearization for `ComplVV` and is really a
-- morphological construct so it might be a bit tricky to implement.
want_VV = { s = \\_ => "(TODO: want_VV)" } ;
want_VV = variants {} ;
whatPl_IP = { s = "neler" } ;

View File

@@ -10,7 +10,7 @@
--# -path=.:../abstract:../common:../../prelude
resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
resource SuffixTur = open Prelude, Predef, HarmonyTur in {
flags
coding=utf8 ;
@@ -62,7 +62,7 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
ablatSuffix : Suffix = regSuffix "den" "den" ;
abessPosSuffix : Suffix = regSuffix "li" "li" ;
abessNegSuffix : Suffix = regSuffix "siz" "siz" ;
instrSuffix : Suffix = regSuffix "la" "la" ;
instrSuffix : Suffix = regSuffix "le" "le" ;
-- following 4 suffixes has other forms used after genSgP3Suffix
accSuffixN : Suffix = regSuffix "i" "ni" ;
datSuffixN : Suffix = regSuffix "e" "ne" ;
@@ -79,6 +79,8 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
-- see the comment at makeNoun operation in ParadigmsTur.gf
genPlP3Suffix : Suffix = regSuffix "i" "i" ;
negativeSuffix : Suffix = regSuffix "me" "me" ;
-- Tense Suffixes
pastSuffix : Suffix = regSuffix "di" "di" ;
inferentSuffix : Suffix = regSuffix "miş" "miş" ;
@@ -86,8 +88,10 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
presentSuffix : Suffix = regSuffix "iyor" "iyor" ;
aoristIrSuffix : Suffix = regSuffix "ir" "r" ;
aoristErSuffix : Suffix = regSuffix "er" "r" ;
aoristIzSuffix : Suffix = regSuffix "iz" "z" ;
futureSuffix : Suffix = regSuffix2 "ecek" "yecek" ;
softFutureSuffix : Suffix = regSuffix2 "eceğ" "yeceğ" ;
softFutureSuffix: Suffix = regSuffix2 "eceğ" "yeceğ" ;
-- Person Suffixes for Verbs
p1SgVerbalSuffix : Suffix = regSuffix "im" "m" ;
@@ -97,7 +101,8 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
p2PlVerbalSuffix : Suffix = regSuffix21 "siniz" "niz" ;
p3PlVerbalSuffix : Suffix = regSuffix "ler" "ler" ;
p2PlImperSuffix : Suffix = regSuffix "in" "yin" ;
p1PlAoristSuffix : Suffix = regSuffix "iz" "yiz" ;
p2PlImperSuffix : Suffix = regSuffix "in" "yin" ;
p1SgAlethicCopulaSuffix : Suffix = regSuffix "dim" "ydim" ;
p2SgAlethicCopulaSuffix : Suffix = regSuffix "din" "ydin" ;
@@ -110,69 +115,16 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
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" ;
p2PlCondCopulaSuffix : Suffix = regSuffix2 "seniz" "seniz" ;
p3PlCondCopulaSuffix : Suffix = regSuffix "seler" "seler" ;
subordSuffixDik : Suffix = regSuffix2 "dik" "dikler" ;
softSubordSuffixDik : Suffix = regSuffix2 "diğ" "dikler" ;
infinitiveSuffix : Suffix = regSuffix "mek" "mek" ;
-- Ordinal suffix for numbers
ordNumSuffix : Suffix = regSuffix21 "inci" "nci" ;
-- Suffix for deriving adverb from a adjective
adjAdvSuffix : Suffix = regSuffix "ce" "ce" ;
caseSuffixes : Case => Suffix =
table {
Nom => empSuffix ;
Acc => accSuffix ;
Dat => datSuffix ;
Gen => genSuffix ;
Loc => locSuffix ;
Ablat => ablatSuffix ;
Abess Pos => abessPosSuffix ;
Abess Neg => abessNegSuffix ;
Instr => instrSuffix
} ;
genSuffixes : Agr => Suffix =
table {
{n=Sg; p=P1} => genSgP1Suffix ;
{n=Sg; p=P2} => genSgP2Suffix ;
{n=Sg; p=P3} => genSgP3Suffix ;
{n=Pl; p=P1} => genPlP1Suffix ;
{n=Pl; p=P2} => genPlP2Suffix ;
{n=Pl; p=P3} => genPlP3Suffix
} ;
verbSuffixes : Agr => Suffix =
table {
{n=Sg; p=P1} => p1SgVerbalSuffix ;
{n=Sg; p=P2} => p2SgVerbalSuffix ;
{n=Sg; p=P3} => empSuffix ;
{n=Pl; p=P1} => p1PlVerbalSuffix ;
{n=Pl; p=P2} => p2PlVerbalSuffix ;
{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
@@ -188,7 +140,7 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
\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 ;
\har,suf -> suf.st ! har.con ! har.vow ;
regSuffix larC larV =
{
@@ -257,7 +209,7 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
lirCH = hardenWord wordC ;
lirC = case wordC.p4 of {
"WXQ" => <wordC.p1, wordC.p1, wordC.p1, wordC.p1, lirCH, lirCH, lirCH, lirCH> ;
"i" => <wordC.p1 + "ı" + wordC.p2 + "ı" + wordC.p3,
"ii" => <wordC.p1 + "ı" + wordC.p2 + "ı" + wordC.p3,
wordC.p1 + "i" + wordC.p2 + "i" + wordC.p3,
wordC.p1 + "u" + wordC.p2 + "u" + wordC.p3,
wordC.p1 + "ü" + wordC.p2 + "ü" + wordC.p3,
@@ -265,7 +217,23 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
lirCH + "i" + wordC.p2 + "i" + wordC.p3,
lirCH + "u" + wordC.p2 + "u" + wordC.p3,
lirCH + "ü" + wordC.p2 + "ü" + wordC.p3> ;
_ => <wordC.p1 + "a" + wordC.p2 + "a" + wordC.p3,
"ie" => <wordC.p1 + "ı" + wordC.p2 + "a" + wordC.p3,
wordC.p1 + "i" + wordC.p2 + "e" + wordC.p3,
wordC.p1 + "u" + wordC.p2 + "a" + wordC.p3,
wordC.p1 + "ü" + wordC.p2 + "e" + wordC.p3,
lirCH + "ı" + wordC.p2 + "a" + wordC.p3,
lirCH + "i" + wordC.p2 + "e" + wordC.p3,
lirCH + "u" + wordC.p2 + "a" + wordC.p3,
lirCH + "ü" + wordC.p2 + "e" + wordC.p3> ;
"ei" => <wordC.p1 + "a" + wordC.p2 + "ı" + wordC.p3,
wordC.p1 + "e" + wordC.p2 + "i" + wordC.p3,
wordC.p1 + "a" + wordC.p2 + "ı" + wordC.p3,
wordC.p1 + "e" + wordC.p2 + "i" + wordC.p3,
lirCH + "a" + wordC.p2 + "ı" + wordC.p3,
lirCH + "e" + wordC.p2 + "i" + wordC.p3,
lirCH + "a" + wordC.p2 + "ı" + wordC.p3,
lirCH + "e" + wordC.p2 + "i" + wordC.p3> ;
"ee" => <wordC.p1 + "a" + wordC.p2 + "a" + wordC.p3,
wordC.p1 + "e" + wordC.p2 + "e" + wordC.p3,
wordC.p1 + "a" + wordC.p2 + "a" + wordC.p3,
wordC.p1 + "e" + wordC.p2 + "e" + wordC.p3,
@@ -277,11 +245,19 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
wordV = twoSylParser baseV ;
lirV = case wordV.p4 of {
"WXQ" => <wordV.p1, wordV.p1, wordV.p1, wordV.p1> ;
"i" => <wordV.p1 + "ı" + wordV.p2 + "ı" + wordV.p3,
"ii" => <wordV.p1 + "ı" + wordV.p2 + "ı" + wordV.p3,
wordV.p1 + "i" + wordV.p2 + "i" + wordV.p3,
wordV.p1 + "u" + wordV.p2 + "u" + wordV.p3,
wordV.p1 + "ü" + wordV.p2 + "ü" + wordV.p3> ;
_ => <wordV.p1 + "a" + wordV.p2 + "a" + wordV.p3,
"ie" => <wordV.p1 + "ı" + wordV.p2 + "a" + wordV.p3,
wordV.p1 + "i" + wordV.p2 + "e" + wordV.p3,
wordV.p1 + "u" + wordV.p2 + "a" + wordV.p3,
wordV.p1 + "ü" + wordV.p2 + "e" + wordV.p3> ;
"ei" => <wordV.p1 + "a" + wordV.p2 + "ı" + wordV.p3,
wordV.p1 + "e" + wordV.p2 + "i" + wordV.p3,
wordV.p1 + "a" + wordV.p2 + "u" + wordV.p3,
wordV.p1 + "e" + wordV.p2 + "ü" + wordV.p3> ;
"ee" => <wordV.p1 + "a" + wordV.p2 + "a" + wordV.p3,
wordV.p1 + "e" + wordV.p2 + "e" + wordV.p3,
wordV.p1 + "a" + wordV.p2 + "a" + wordV.p3,
wordV.p1 + "e" + wordV.p2 + "e" + wordV.p3>
@@ -306,7 +282,7 @@ resource SuffixTur = open Prelude, Predef, ResTur, HarmonyTur in {
c@("i"|"e") +
y@(#consonant*) +
d@("i"|"e") +
z@(#consonant*)=> <x, y, z, c> ;
z@(#consonant*)=> <x, y, z, c+d> ;
_ => <base, "WXQ", "WXQ", "WXQ">
} ;

View File

@@ -1,8 +1,8 @@
concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur in {
lin
UseV v = lin VP (v ** {compl = []}) ;
SlashV2a v = v ** {compl = []} ;
UseV v = {s = mkVerbForms v; compl = []} ;
SlashV2a v = {s = mkVerbForms v; compl = []; c = v.c} ;
Slash2V3 v = variants {} ;
Slash3V3 v = variants {} ;
@@ -18,9 +18,9 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur
} ;
-- TODO: test this and fix.
ComplVS vs s = vs ** {
ComplVS vs s = variants {} ; {- vs ** {
compl = s.subord
} ;
} ; -}
ComplVA _ _ = variants {} ;
ComplVV _ _ = variants {} ;
@@ -29,37 +29,62 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur
UseComp comp = comp ** {compl = []} ;
CompCN _ = variants {} ;
CompNP ap = lin VP {
CompNP np = {
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 ++
addSuffix "olacağ" (mkHar I_Har (SCon Hard)) (verbSuffixes ! agr) ;
VInfinitive => ap.s ! Nom ++ "olmak" ;
_ => "TODO"
}
VFin Pres p agr => np.s ! Nom ++
case <agr,p> of {
<{n=Sg; p=P3},Pos> => [] ;
<{n=Sg; p=P3},Neg> => BIND ++ suffixStr np.h negativeSuffix ;
<_, Pos> => BIND ++ suffixStr np.h (verbSuffixes ! agr) ;
<_, Neg> => BIND ++ suffixStr np.h negativeSuffix +
(let negHar = mkHar (case np.h.vow of {
I_Har | U_Har => I_Har ;
Ih_Har | Uh_Har => Ih_Har
}) SVow
in suffixStr negHar (verbSuffixes ! agr))
} ;
VFin Past p agr => np.s ! Nom ++ BIND ++
case p of {
Pos => [] ;
Neg => suffixStr np.h negativeSuffix
} +
suffixStr np.h (alethicCopulaSuffixes ! agr) ;
vform => np.s ! Nom ++
mkVerbForms olmak_V ! vform
} ;
compl = []
} ;
CompAP ap = lin VP {
CompAP ap = {
s = table {
VPres agr => case agr.p of {
P3 => ap.s ! Sg ! Nom ;
_ => ap.s ! agr.n ! Nom ++ 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 ++
addSuffix "olacağ" (mkHar I_Har (SCon Hard)) (verbSuffixes ! agr) ;
VInfinitive => ap.s ! Sg ! Nom ++ "olmak" ;
_ => "TODO"
}
VInf p => ap.s ! Sg ! Nom ++
mkVerbForms olmak_V ! (VInf p) ;
VImp p n => ap.s ! n ! Nom ++
mkVerbForms olmak_V ! (VImp p n) ;
VFin Pres p agr => ap.s ! agr.n ! Nom ++
case <agr,p> of {
<{n=Sg; p=P3},Pos> => [] ;
<{n=Sg; p=P3},Neg> => BIND ++ suffixStr ap.h negativeSuffix ;
<_, Pos> => BIND ++ suffixStr ap.h (verbSuffixes ! agr) ;
<_, Neg> => BIND ++ suffixStr ap.h negativeSuffix +
(let negHar = {vow = case ap.h.vow of {
I_Har | U_Har => I_Har ;
Ih_Har | Uh_Har => Ih_Har
} ;
con = SVow
}
in suffixStr negHar (verbSuffixes ! agr))
} ;
VFin Past p agr => ap.s ! agr.n ! Nom ++ BIND ++
case p of {
Pos => [] ;
Neg => suffixStr ap.h negativeSuffix
} +
suffixStr ap.h (alethicCopulaSuffixes ! agr) ;
VFin t p agr => ap.s ! agr.n ! Nom ++
mkVerbForms olmak_V ! (VFin t p agr)
} ;
compl = []
} ;
CompAdv _ = variants {} ;
@@ -75,4 +100,13 @@ concrete VerbTur of Verb = CatTur ** open Prelude, ResTur, SuffixTur, HarmonyTur
} ;
PassV2 = variants {} ;
oper
olmak_V : V = lin V {
s = "olmak" ;
stems = \\_ => "ol" ;
aoristType = SgSylConIrreg ;
h = mkHar U_Har (SCon Soft)
} ;
}