Skip to content

Commit

Permalink
verbal morphology is not syntactic. added negation
Browse files Browse the repository at this point in the history
  • Loading branch information
krangelov committed Jul 24, 2024
1 parent 65a05d2 commit 05c65cc
Show file tree
Hide file tree
Showing 12 changed files with 334 additions and 292 deletions.
6 changes: 3 additions & 3 deletions src/turkish/AdverbTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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} ;

Expand Down
17 changes: 8 additions & 9 deletions src/turkish/CatTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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} ;
Expand Down Expand Up @@ -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 ;

}
5 changes: 1 addition & 4 deletions src/turkish/ConjunctionTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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 =
Expand Down Expand Up @@ -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} ;
Expand Down
47 changes: 16 additions & 31 deletions src/turkish/DocumentationTur.gf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
concrete DocumentationTur of Documentation = CatTur ** open
ResTur,
ResTur, Prelude,
HTML in {

lincat
Expand Down Expand Up @@ -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}))
) ;
} ;
}
6 changes: 4 additions & 2 deletions src/turkish/NounTur.gf
Original file line number Diff line number Diff line change
@@ -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 ;

Expand Down Expand Up @@ -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
} ;
Expand Down
116 changes: 20 additions & 96 deletions src/turkish/ParadigmsTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -234,95 +227,34 @@ 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)) ;

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 =
Expand Down Expand Up @@ -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} ;

Expand Down
8 changes: 4 additions & 4 deletions src/turkish/PhraseTur.gf
Original file line number Diff line number Diff line change
Expand Up @@ -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} ;
Expand All @@ -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} ;
Expand Down
Loading

0 comments on commit 05c65cc

Please sign in to comment.