Skip to content

Commit

Permalink
implement ProgrVP
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Jul 24, 2024
1 parent 4bb96aa commit d3ecaad
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 86 deletions.
6 changes: 3 additions & 3 deletions src/turkish/CatTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud
CN = {s : Number => Case => Str; gen : Number => Agr => Str; h : Harmony} ;
NP = {s : Case => Str ; h : Harmony; a : Agr} ;

VP = {s : VForm => Str; compl : Str} ;
VP = {s : Aspect => VForm => Str; compl : Str} ;
VPSlash = Verb ** {compl : Str; c : Prep} ;
Comp = {s : VForm => Str; compl : Str} ;
Comp = {s : Aspect => VForm => Str; compl : Str} ;

Pron = ResTur.Pron ;
Det = {s : Str; n : Number; useGen : UseGen} ;
Expand Down Expand Up @@ -59,6 +59,6 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud

linref
V2 = \v -> v.s ++ v.c.s ;
VP = \vp -> vp.compl ++ vp.s ! VInf Pos ;
VP = \vp -> vp.compl ++ vp.s ! Perf ! VInf Pos ;

}
30 changes: 16 additions & 14 deletions src/turkish/DocumentationTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -97,37 +97,39 @@ lin
oper
inflVerb : Verb -> Str = \v ->
(heading2 ("Şimdiki zaman") ++
finite Pres ++
finite Perf Pres ++
finite Imperf Pres ++
heading2 ("Geçmiş zaman") ++ --# notpresent
finite Past ++ --# notpresent
finite Perf Past ++ --# notpresent
finite Imperf Past ++ --# notpresent
heading2 ("Gelecek zaman") ++ --# notpresent
finite Fut ++ --# notpresent
finite Perf Fut ++ --# notpresent
heading2 ("Emir kipi") ++
frameTable (
tr (th "tekil" ++
th "çoğul") ++
tr (td (tbl ! VImp Pos Sg) ++
td (tbl ! VImp Pos Pl))
tr (td (tbl ! Perf ! VImp Pos Sg) ++
td (tbl ! Perf ! VImp Pos Pl))
) ++
heading2 ("Eylemlik") ++
paragraph (tbl ! VInf Pos))
paragraph (tbl ! Perf ! VInf Pos))
where {
tbl : VForm => Str = mkVerbForms v ;
tbl : Aspect => VForm => Str = mkVerbForms v ;

finite : Tense -> Str = \t ->
finite : Aspect -> Tense -> Str = \asp,t ->
frameTable (
tr (th "" ++
th "tekil" ++
th "çoğul") ++
tr (th "1." ++
td (tbl ! VFin t Pos {n=Sg; p=P1}) ++
td (tbl ! VFin t Pos {n=Pl; p=P1})) ++
td (tbl ! asp ! VFin t Pos {n=Sg; p=P1}) ++
td (tbl ! asp ! VFin t Pos {n=Pl; p=P1})) ++
tr (th "2." ++
td (tbl ! VFin t Pos {n=Sg; p=P2}) ++
td (tbl ! VFin t Pos {n=Pl; p=P2})) ++
td (tbl ! asp ! VFin t Pos {n=Sg; p=P2}) ++
td (tbl ! asp ! VFin t Pos {n=Pl; p=P2})) ++
tr (th "3." ++
td (tbl ! VFin t Pos {n=Sg; p=P3}) ++
td (tbl ! VFin t Pos {n=Pl; p=P3}))
td (tbl ! asp ! VFin t Pos {n=Sg; p=P3}) ++
td (tbl ! asp ! VFin t Pos {n=Pl; p=P3}))
) ;
} ;
}
2 changes: 1 addition & 1 deletion src/turkish/ExtendTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concrete ExtendTur of Extend = CatTur ** open ResTur, SuffixTur, Predef in {
a = {n=num.n; p=P3} ;
} ;

UttVPShort vp = {s = vp.s ! VInf Pos} ;
UttVPShort vp = {s = vp.s ! Perf ! VInf Pos} ;

TPastSimple = {s = []} ** {t = Past} ; --# notpresent

Expand Down
7 changes: 5 additions & 2 deletions src/turkish/IdiomTur.gf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
concrete IdiomTur of Idiom = CatTur ** open Prelude, ResTur in {
concrete IdiomTur of Idiom = CatTur ** open Prelude, ResTur, SuffixTur in {

lin
ImpersCl _ = variants {} ;
Expand All @@ -8,7 +8,10 @@ lin
CleftNP _ _ = variants {} ;
CleftAdv _ _ = variants {} ;
ImpPl1 _ = variants {} ;
ProgrVP _ = variants {} ;

ProgrVP vp = vp ** {
s = \\asp,vform => vp.s ! Imperf ! vform
} ;

}

2 changes: 1 addition & 1 deletion src/turkish/NounTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ concrete NounTur of Noun = CatTur ** open ResTur, SuffixTur, HarmonyTur, ParamX,

PPartNP np v2 = {
s = \\c => np.s ! c
++ mkVerbForms v2 ! VFin Past Pos np.a --# notpresent
++ mkVerbForms v2 ! Perf ! VFin Past Pos np.a --# notpresent
;
h = np.h ;
a = np.a
Expand Down
8 changes: 4 additions & 4 deletions src/turkish/ParadigmsTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ resource ParadigmsTur = open
VBase Soft => softBase ;
VProg => progBase ;
VFuture => futBase ;
VPass => case last base of {
#vowel => base + "n" ;
"l" => base + suffixStr h passiveInSuffix ;
_ => base + suffixStr h passiveIlSuffix
VPass => case last softBase of {
#vowel => softBase + "n" ;
"l" => softBase + suffixStr h passiveInSuffix ;
_ => softBase + suffixStr h passiveIlSuffix
}
} ;
aoristType = aoristType ;
Expand Down
2 changes: 1 addition & 1 deletion src/turkish/PhraseTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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 ! VInf Pos} ;
UttVP vp = {s = vp.s ! Perf ! VInf Pos} ;
UttAP ap = {s = ap.s ! Sg ! Nom} ;
UttCN n = {s = n.s ! Sg ! Nom} ;
UttS s = {s = s.s} ;
Expand Down
138 changes: 96 additions & 42 deletions src/turkish/ResTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
-- For $Verb$.

param
Aspect =
Perf | Imperf ;

VForm =
VInf Polarity
| VImp Polarity Number
Expand Down Expand Up @@ -107,26 +110,45 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
a = {n = n; p = p}
} ;

mkVerbForms : Verb -> VForm => Str =
\v -> table {
VInf Pos => v.s ;
mkVerbForms : Verb -> Aspect => VForm => Str =
\v -> \\asp =>
table {
VInf Pos => case asp of {
Perf => v.s ;
Imperf => v.stems ! VBase Soft ++ BIND ++
suffixStr v.h progrSuffix +
suffixStr progrHar infinitiveSuffix
} ;
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)
case asp of {
Perf => suffixStr v.h infinitiveSuffix ;
Imperf => suffixStr negHar progrSuffix +
suffixStr progrHar infinitiveSuffix
} ;
VImp p n => case asp of {
Perf => 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 +
suffixStr negHar p2PlImperSuffix
} ;
Imperf => v.stems ! VBase Soft ++ BIND ++
case <p,n> of {
<Pos,Sg> => suffixStr v.h progrSuffix ;
<Neg,Sg> => suffixStr v.h negativeSuffix +
suffixStr negHar progrSuffix ;
<Pos,Pl> => suffixStr v.h progrSuffix +
suffixStr progrHar p2PlImperSuffix ;
<Neg,Pl> => suffixStr v.h negativeSuffix +
suffixStr negHar progrSuffix +
suffixStr progrHar p2PlImperSuffix
}
} ;
VFin t p agr =>
let presHar = mkHar (case v.h.con of {
Expand All @@ -137,28 +159,40 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
SVow => v.h.vow
}) (SCon Soft) ;
pastHar = mkHar v.h.vow SVow ;
pastIHar= mkHar U_Har 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) ;
Pres => case asp of {
Perf => v.stems ! VBase Soft ++ BIND ++
suffixStr v.h (case v.aoristType of {
SgSylConReg => aoristErSuffix ;
_ => aoristIrSuffix
}) +
suffixStr presHar (verbSuffixes ! agr) ;
Imperf => v.stems ! VProg ++ BIND ++
suffixStr v.h progrSuffix +
suffixStr progrHar (verbSuffixes ! agr)
} ;
Past => case asp of {
Perf => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h pastSuffix +
suffixStr pastHar (verbSuffixes ! agr) ;
Imperf => v.stems ! VProg ++ BIND ++
suffixStr v.h progrSuffix +
case agr of {
{n=Pl; p=P3} => suffixStr progrHar (verbSuffixes ! agr) +
suffixStr (mkHar Ih_Har (SCon Soft)) pastSuffix ;
_ => suffixStr progrHar pastSuffix +
suffixStr pastIHar (verbSuffixes ! agr)
}
} ;
Fut => v.stems ! VFuture ++ BIND ++
suffixStr v.h (case futSoft of {
Soft => softFutureSuffix ;
Expand All @@ -169,17 +203,30 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
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)
Pres => case asp of {
Perf => 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)
} ;
Imperf => v.stems ! VBase Soft ++ BIND ++
tk 1 (suffixStr v.h negativeSuffix) +
suffixStr v.h progrSuffix +
suffixStr progrHar (verbSuffixes ! agr)
} ;
Past => case asp of {
Perf => v.stems ! VBase Hard ++ BIND ++
suffixStr v.h negativeSuffix +
suffixStr negHar pastSuffix +
suffixStr negHar (verbSuffixes ! agr) ;
Imperf => v.stems ! VBase Soft ++ BIND ++
tk 1 (suffixStr v.h negativeSuffix) +
suffixStr v.h progrSuffix +
suffixStr progrHar pastSuffix +
suffixStr pastIHar (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 {
Expand All @@ -192,7 +239,14 @@ resource ResTur = ParamX ** open Prelude, Predef, HarmonyTur, SuffixTur in {
suffixStr negHar (condCopulaSuffixes ! agr)
}
}
} ;
}
where {
negHar = mkHar (case v.h.vow of {
I_Har | U_Har => I_Har ;
Ih_Har | Uh_Har => Ih_Har
}) SVow ;
progrHar = mkHar U_Har (SCon Soft)
} ;

mkDet : Str -> Number -> UseGen -> {s : Str; n : Number; useGen : UseGen} =
\s, n, ug -> {s = s; n = n; useGen = ug} ;
Expand Down
4 changes: 2 additions & 2 deletions src/turkish/SentenceTur.gf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in {

lin
PredVP np vp = {s = \\t,p => np.s ! Nom ++ vp.compl ++ vp.s ! VFin t p np.a} ;
PredVP np vp = {s = \\t,p => np.s ! Nom ++ vp.compl ++ vp.s ! Perf ! VFin t p np.a} ;

PredSCVP sc vp = variants {} ;

Expand All @@ -22,7 +22,7 @@ concrete SentenceTur of Sentence = CatTur ** open Prelude, ResTur in {
EmbedQS _ = variants {} ;
EmbedS _ = variants {} ;

ImpVP vp = {s = \\p,n => vp.compl ++ vp.s ! VImp p n
ImpVP vp = {s = \\p,n => vp.compl ++ vp.s ! Perf ! VImp p n
} ;

AdvS _ _ = variants {} ;
Expand Down
2 changes: 1 addition & 1 deletion src/turkish/SuffixTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ resource SuffixTur = open Prelude, Predef, HarmonyTur in {
pastSuffix : Suffix = regSuffix "di" "di" ;
inferentSuffix : Suffix = regSuffix "miş" "miş" ;
-- Vowel "o" does not obey harmony rules so assume that "iyor" is a one syllable word (see oper oneSylParser)
presentSuffix : Suffix = regSuffix "iyor" "iyor" ;
progrSuffix : Suffix = regSuffix "iyor" "iyor" ;
aoristIrSuffix : Suffix = regSuffix "ir" "r" ;
aoristErSuffix : Suffix = regSuffix "er" "r" ;
aoristIzSuffix : Suffix = regSuffix "iz" "z" ;
Expand Down
Loading

0 comments on commit d3ecaad

Please sign in to comment.