mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
started Czech with a mini-like coverage
This commit is contained in:
19
src/czech/AdjectiveCze.gf
Normal file
19
src/czech/AdjectiveCze.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
concrete AdjectiveCze of Adjective = CatCze ** open ResCze, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
PositA a = adjFormsAdjective a ** {isPost = False} ;
|
||||
|
||||
AdAP ada ap = ap ** {s = \\g,n,c => ada.s ++ ap.s ! g ! n ! c} ;
|
||||
|
||||
ComplA2 a np =
|
||||
let ap = adjFormsAdjective a
|
||||
in
|
||||
ap ** {
|
||||
s = \\g,n,c => ap.s ! g ! n ! c ++ a.c.s ++ np.s ! a.c.c ;
|
||||
isPost = True ;
|
||||
} ;
|
||||
|
||||
UseA2 a = adjFormsAdjective a ** {isPost = False} ;
|
||||
|
||||
}
|
||||
9
src/czech/AdverbCze.gf
Normal file
9
src/czech/AdverbCze.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
concrete AdverbCze of Adverb = CatCze **
|
||||
open ResCze, Prelude in {
|
||||
|
||||
lin
|
||||
PrepNP prep np = {
|
||||
s = prep.s ++ np.prep ! prep.c
|
||||
} ;
|
||||
|
||||
}
|
||||
6
src/czech/AllCze.gf
Normal file
6
src/czech/AllCze.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract:../common:../api
|
||||
|
||||
concrete AllCze of AllCzeAbs =
|
||||
LangCze
|
||||
;
|
||||
|
||||
6
src/czech/AllCzeAbs.gf
Normal file
6
src/czech/AllCzeAbs.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract AllCzeAbs =
|
||||
Lang
|
||||
;
|
||||
|
||||
65
src/czech/CatCze.gf
Normal file
65
src/czech/CatCze.gf
Normal file
@@ -0,0 +1,65 @@
|
||||
concrete CatCze of Cat =
|
||||
--- CommonX **
|
||||
|
||||
open ResCze, Prelude in {
|
||||
|
||||
lincat
|
||||
Text = {s : Str} ;
|
||||
Phr = {s : Str} ;
|
||||
Utt = {s : Str} ;
|
||||
|
||||
S = {s : Str} ;
|
||||
Cl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ;
|
||||
Comp = {s : Agr => Str} ;
|
||||
|
||||
QS = {s : Str} ; ----
|
||||
QCl = {subj,clit,compl : Str ; verb : VerbForms ; a : Agr} ; ----
|
||||
IAdv = {s : Str} ;
|
||||
|
||||
RS = {s : Agr => Str} ;
|
||||
RCl = {subj,clit,compl : Agr => Str ; verb : VerbForms} ; ---- RAgr
|
||||
RP = AdjForms ;
|
||||
|
||||
VP = {verb : VerbForms ; clit,compl : Agr => Str} ; ----
|
||||
VPSlash = {verb : VerbForms ; clit,compl : Agr => Str ; c : ComplementCase} ; ----
|
||||
V = ResCze.VerbForms ;
|
||||
V2 = ResCze.VerbForms ** {c : ComplementCase} ;
|
||||
|
||||
A = ResCze.AdjForms ;
|
||||
AP = ResCze.Adjective ** {isPost : Bool} ; -- {s : Gender => Number => Case => Str}
|
||||
A2 = ResCze.AdjForms ** {c : ComplementCase} ;
|
||||
|
||||
AdA = {s : Str} ;
|
||||
|
||||
N = ResCze.NounForms ;
|
||||
CN = ResCze.Noun ; -- {s : Number => Case => Str ; g : Gender}
|
||||
NP = {s,clit,prep : Case => Str ; a : Agr ; hasClit : Bool} ; ----
|
||||
PN = {s : Case => Str ; g : Gender} ; ----
|
||||
Det = {s : Gender => Case => Str ; n : NumSize} ;
|
||||
Quant = {s : Gender => Number => Case => Str} ; -- same as AP
|
||||
Num = {s : Gender => Case => Str ; n : NumSize} ;
|
||||
Card = {s : Gender => Case => Str ; n : NumSize} ;
|
||||
Pron = PronForms ;
|
||||
|
||||
Adv = {s : Str} ;
|
||||
Prep = ResCze.ComplementCase ; -- {s : Str ; c : Case ; hasPrep : Bool} ;
|
||||
Conj = {s1,s2 : Str} ; ----
|
||||
|
||||
Pol = {s : Str ; p : Bool} ;
|
||||
Temp = {s : Str ; t : CTense} ; ----
|
||||
Tense = {s : Str ; t : CTense} ; ----
|
||||
Ant = {s : Str ; t : CTense} ; ----
|
||||
|
||||
PConj = {s : Str} ;
|
||||
Voc = {s : Str} ;
|
||||
|
||||
linref
|
||||
N = \s -> s.snom ;
|
||||
A = \s -> s.msnom ;
|
||||
|
||||
|
||||
lincat Numeral = {s : NumeralForms ; size : NumSize} ;
|
||||
lincat Digits = {s:Str ; n : NumSize} ;
|
||||
|
||||
|
||||
}
|
||||
56
src/czech/ConjunctionCze.gf
Normal file
56
src/czech/ConjunctionCze.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
concrete ConjunctionCze of Conjunction = CatCze **
|
||||
open ResCze, Coordination, Prelude in {
|
||||
|
||||
lincat
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[AP] = {s1,s2 : Gender => Number => Case => Str ; isPost : Bool} ;
|
||||
[NP] = {s1,s2,prep1,prep2 : Case => Str ; a : Agr} ;
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[RS] = {s1,s2 : Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
|
||||
BaseAP x y = twoTable3 Gender Number Case x y
|
||||
** {isPost = orB x.isPost y.isPost} ; ---- should be so in Pol too
|
||||
ConsAP x xs = consrTable3 Gender Number Case comma x xs
|
||||
** {isPost = orB x.isPost xs.isPost} ;
|
||||
|
||||
BaseNP x y = {
|
||||
s1 = x.s ;
|
||||
s2 = y.s ;
|
||||
prep1 = x.prep ;
|
||||
prep2 = y.prep ;
|
||||
a = y.a
|
||||
} ; -- clitics disappear ---- Agr TODO
|
||||
ConsNP x xs = {
|
||||
s1 = \\c => x.s ! c ++ comma ++ xs.s1 ! c ;
|
||||
s2 = xs.s2 ;
|
||||
prep1 = \\c => x.prep ! c ++ comma ++ xs.prep1 ! c ;
|
||||
prep2 = xs.prep2 ;
|
||||
a = xs.a ----
|
||||
} ;
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
|
||||
BaseRS = twoTable Agr ;
|
||||
ConsRS = consrTable Agr comma ;
|
||||
|
||||
ConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjAP conj xs = conjunctDistrTable3 Gender Number Case conj xs
|
||||
** {isPost = xs.isPost} ;
|
||||
|
||||
ConjNP conj xs = {
|
||||
s,clit = \\c => conj.s1 ++ xs.s1 ! c ++ conj.s2 ++ xs.s2 ! c ;
|
||||
prep = \\c => conj.s1 ++ xs.prep1 ! c ++ conj.s2 ++ xs.prep2 ! c ;
|
||||
a = xs.a ; ---- dep. on conj as well
|
||||
hasClit = False ;
|
||||
} ;
|
||||
|
||||
ConjS = conjunctDistrSS ;
|
||||
ConjRS = conjunctDistrTable Agr ;
|
||||
|
||||
}
|
||||
19
src/czech/GrammarCze.gf
Normal file
19
src/czech/GrammarCze.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarCze of Grammar =
|
||||
NounCze,
|
||||
VerbCze,
|
||||
AdjectiveCze,
|
||||
AdverbCze,
|
||||
NumeralCze,
|
||||
SentenceCze,
|
||||
QuestionCze,
|
||||
RelativeCze,
|
||||
ConjunctionCze,
|
||||
PhraseCze,
|
||||
TextCze,
|
||||
StructuralCze,
|
||||
IdiomCze,
|
||||
TenseCze
|
||||
** {
|
||||
}
|
||||
5
src/czech/IdiomCze.gf
Normal file
5
src/czech/IdiomCze.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
concrete IdiomCze of Idiom = CatCze ** open Prelude, ResCze in {
|
||||
|
||||
|
||||
|
||||
}
|
||||
10
src/czech/LangCze.gf
Normal file
10
src/czech/LangCze.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:../abstract:../common:../api
|
||||
|
||||
concrete LangCze of Lang =
|
||||
GrammarCze,
|
||||
LexiconCze
|
||||
-- ,ConstructionCze
|
||||
-- ,DocumentationCze --# notpresent
|
||||
** {
|
||||
|
||||
}
|
||||
59
src/czech/LexiconCze.gf
Normal file
59
src/czech/LexiconCze.gf
Normal file
@@ -0,0 +1,59 @@
|
||||
concrete LexiconCze of Lexicon =
|
||||
CatCze
|
||||
**
|
||||
open
|
||||
ResCze, ParadigmsCze
|
||||
in {
|
||||
|
||||
lin
|
||||
boy_N = declPAN "kluk" ;
|
||||
man_N = declMUZ "muž" ;
|
||||
teacher_N = declMUZ "učitel" ;
|
||||
horse_N = declMUZ "kůň" ;
|
||||
father_N = declMUZ "otec" ;
|
||||
husband_N = declPAN "manžel" ;
|
||||
|
||||
castle_N = declHRAD "hrad" ;
|
||||
forest_N = declHRAD "les" ;
|
||||
machine_N = declSTROJ "stroj" ;
|
||||
|
||||
woman_N = declZENA "žena" ;
|
||||
school_N = declZENA "škola" ; ----
|
||||
skirt_N = declRUZE "sukně";
|
||||
street_N = declRUZE "ulice" ;
|
||||
rose_N = declRUZE "růže" ;
|
||||
song_N = declPISEN "píseň" ;
|
||||
bed_N = declPISEN "postel" ;
|
||||
door_N = declRUZE "dveře" ;
|
||||
bone_N = declKOST "kost" ;
|
||||
village_N = declKOST "ves" ; ----
|
||||
|
||||
city_N = declMESTO "město" ;
|
||||
apple_N = declMESTO "jablko" ; ----
|
||||
sea_N = declMORE "moře" ;
|
||||
airport_N = declMORE "letiště" ;
|
||||
chicken_N = declKURE "kuře" ;
|
||||
house_N = declSTAVENI "stavení" ; --- building, house
|
||||
station_N = declSTAVENI "nádraží" ;
|
||||
|
||||
young_A = mkA "mladý" ;
|
||||
old_A = mkA "starý" ;
|
||||
good_A = mkA "dobrý" ;
|
||||
bad_A = mkA "špatný" ;
|
||||
beautiful_A = mkA "krásný" ;
|
||||
clean_A = mkA "čistý" ;
|
||||
dirty_A = mkA "špinavý" ;
|
||||
|
||||
white_A = mkA "bílý" ;
|
||||
black_A = mkA "černý" ;
|
||||
red_A = mkA "červený" ;
|
||||
brown_A = mkA "hnědý" ;
|
||||
blue_A = mkA "modrý" ;
|
||||
green_A = mkA "zelený" ;
|
||||
yellow_A = mkA "žlutý" ;
|
||||
|
||||
buy_V2 = mkV2 (iii_kupovatVerbForms "kupovat") ;
|
||||
love_V2 = mkV2 (iii_kupovatVerbForms "milovat") ;
|
||||
|
||||
}
|
||||
|
||||
100
src/czech/NounCze.gf
Normal file
100
src/czech/NounCze.gf
Normal file
@@ -0,0 +1,100 @@
|
||||
concrete NounCze of Noun =
|
||||
CatCze
|
||||
**
|
||||
|
||||
open ResCze, Prelude in {
|
||||
|
||||
lin
|
||||
DetCN det cn = {
|
||||
s,prep,clit = \\c => det.s ! cn.g ! c ++ numSizeForm cn.s det.n c ;
|
||||
a = numSizeAgr cn.g det.n P3 ;
|
||||
hasClit = False ;
|
||||
} ;
|
||||
|
||||
MassNP cn = {
|
||||
s,prep,clit = \\c => cn.s ! Sg ! c ;
|
||||
a = Ag cn.g Sg P3 ;
|
||||
hasClit = False ;
|
||||
} ;
|
||||
|
||||
DetQuant quant num = {
|
||||
s = \\g,c => num.s ! g ! c ++ quant.s ! g ! numSizeNumber num.n ! c ;
|
||||
n = num.n
|
||||
} ;
|
||||
|
||||
DefArt = {s = \\_,_,_ => []} ;
|
||||
IndefArt = {s = \\_,_,_ => []} ;
|
||||
NumPl = {s = \\_,_ => [] ; n = Num2_4} ;
|
||||
NumSg = {s = \\_,_ => [] ; n = Num1} ;
|
||||
|
||||
UsePron pron = {
|
||||
s = table {
|
||||
Nom | Voc => pron.nom ;
|
||||
Gen => pron.gen ;
|
||||
Dat => pron.dat ;
|
||||
Acc => pron.acc ;
|
||||
Loc => pron.loc ;
|
||||
Ins => pron.ins
|
||||
} ;
|
||||
clit = table {
|
||||
Nom => pron.cnom ;
|
||||
Voc => pron.nom ;
|
||||
Gen => pron.cgen ;
|
||||
Dat => pron.cdat ;
|
||||
Acc => pron.cacc ;
|
||||
Loc => pron.loc ;
|
||||
Ins => pron.ins
|
||||
} ;
|
||||
prep = table {
|
||||
Nom | Voc => pron.nom ;
|
||||
Gen => pron.pgen ;
|
||||
Dat => pron.pdat ;
|
||||
Acc => pron.pacc ;
|
||||
Loc => pron.loc ;
|
||||
Ins => pron.pins
|
||||
} ;
|
||||
a = pron.a ;
|
||||
hasClit = True ;
|
||||
} ;
|
||||
|
||||
UsePN pn = {
|
||||
s,clit,prep = \\c => pn.s ! c ;
|
||||
a = Ag pn.g Sg P3 ;
|
||||
hasClit = False ;
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\n,c => ap.s ! cn.g ! n ! c ++ cn.s ! n ! c ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
RelCN cn rs = {
|
||||
s = \\n,c => cn.s ! n ! c ++ rs.s ! Ag cn.g n P3 ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
AdvCN cn adv = {
|
||||
s = \\n,c => cn.s ! n ! c ++ adv.s ;
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
AdvNP np adv = {
|
||||
s,clit = \\c => np.s ! c ++ adv.s ;
|
||||
prep = \\c => np.prep ! c ++ adv.s ;
|
||||
a = np.a ;
|
||||
hasClit = False ;
|
||||
} ;
|
||||
|
||||
UseN n = nounFormsNoun n ;
|
||||
|
||||
ApposCN cn np = {
|
||||
s = \\n,c => cn.s ! n ! c ++ np.s ! c ; ----
|
||||
g = cn.g
|
||||
} ;
|
||||
|
||||
NumCard c = c ;
|
||||
NumDigits ds = ds ** {s = \\_,_ => ds.s} ;
|
||||
NumNumeral nu = {s = numeralFormsDeterminer nu.s ; n = nu.size} ; ---- TODO: inflection of numerals
|
||||
|
||||
|
||||
}
|
||||
118
src/czech/NumeralCze.gf
Normal file
118
src/czech/NumeralCze.gf
Normal file
@@ -0,0 +1,118 @@
|
||||
concrete NumeralCze of Numeral =
|
||||
|
||||
CatCze **
|
||||
|
||||
open
|
||||
ResCze,
|
||||
Prelude
|
||||
in {
|
||||
|
||||
-- from gf-contrib/numerals/czech.gf, added inflections
|
||||
-- AR 2020-03-20
|
||||
|
||||
|
||||
oper LinNumeral = {s : NumeralForms ; size : NumSize} ;
|
||||
oper LinDigit = {unit : NumeralForms ; teen, ten, hundred : Str ; size : NumSize} ;
|
||||
|
||||
lincat Digit = LinDigit ;
|
||||
lincat Sub10 = LinDigit ;
|
||||
|
||||
lincat Sub100 = LinNumeral ;
|
||||
lincat Sub1000 = LinNumeral ;
|
||||
lincat Sub1000000 = LinNumeral ;
|
||||
|
||||
oper mkNum : NumeralForms -> Str -> Str -> Str -> NumSize -> LinDigit =
|
||||
\dva, dvanast, dvadsat, dveste, sz -> {
|
||||
unit = dva ;
|
||||
teen = dvanast + "náct" ;
|
||||
ten = dvadsat ;
|
||||
hundred = dveste ;
|
||||
size = sz
|
||||
} ;
|
||||
|
||||
oper mk2Num : NumeralForms -> Str -> Str -> Str -> LinDigit =
|
||||
\unit, teenbase, tenbase, hundred ->
|
||||
mkNum unit teenbase (tenbase + "cet") hundred Num2_4 ;
|
||||
|
||||
oper mk5Num : Str -> Str -> Str -> Str -> LinDigit =
|
||||
\unit,uniti, teenbase, tenbase ->
|
||||
mkNum (regNumeralForms unit uniti) teenbase (tenbase + "desát") (unit ++ "set") Num5 ;
|
||||
|
||||
oper bigNumeral : Str -> LinNumeral = \s -> {s = invarNumeralForms s ; size = Num5} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 = mk2Num twoNumeralForms "dva" "dva" ("dvě" ++ "stě") ;
|
||||
lin n3 = mk2Num threeNumeralForms "tři" "tři" ("tři" ++ "sta") ;
|
||||
lin n4 = mk2Num fourNumeralForms "čtr" "čtyři" ("čtyři" ++ "sta") ;
|
||||
lin n5 = mk5Num "pět" "pěti" "pat" "pa" ;
|
||||
lin n6 = mk5Num "šest" "šesti" "šest" "še" ;
|
||||
lin n7 = mk5Num "sedm" "sedmi" "sedm" "sedm";
|
||||
lin n8 = mk5Num "osm" "osmi" "osm" "osm";
|
||||
lin n9 = mk5Num "devět" "devíti" "devate" "deva" ;
|
||||
|
||||
lin pot01 = {
|
||||
unit = oneNumeralForms ; hundred = "sto" ; ten = "deset" ; teen = "jedenáct" ;
|
||||
size = Num1
|
||||
} ;
|
||||
lin pot0 d = d ;
|
||||
|
||||
lin pot110 = bigNumeral "deset" ;
|
||||
lin pot111 = bigNumeral "jedenáct" ;
|
||||
lin pot1to19 d = bigNumeral d.teen ;
|
||||
|
||||
lin pot0as1 n = {s = n.unit ; size = n.size} ;
|
||||
lin pot1 d = bigNumeral d.ten ;
|
||||
lin pot1plus d e = {
|
||||
s = invarNumeralForms (d.ten ++ e.unit.msnom) ; ---- TODO inflection?
|
||||
size = tfSize e.size
|
||||
} ;
|
||||
---- variants { d.s ! ten ++ e.s ! unit ; glue (glue (e.s ! unit) "a") (d.s ! ten)} ; size = tfSize e.size} ;
|
||||
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = bigNumeral d.hundred ;
|
||||
lin pot2plus d e = {
|
||||
s = invarNumeralForms (d.hundred ++ e.s.msnom) ; ---- TODO inflection?
|
||||
size = tfSize e.size
|
||||
} ;
|
||||
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = bigNumeral (mkTh n.s.msnom n.size) ;
|
||||
|
||||
lin pot3plus n m = {
|
||||
s = invarNumeralForms (mkTh n.s.msnom n.size ++ m.s.msnom) ; ---- TODO inflection?
|
||||
size = tfSize m.size
|
||||
} ;
|
||||
|
||||
oper tfSize : NumSize -> NumSize = \sz ->
|
||||
table {Num1 => Num5 ; other => other} ! sz ;
|
||||
|
||||
oper mkTh : Str -> NumSize -> Str = \attr,size ->
|
||||
case size of {
|
||||
Num1 => "tisíc" ;
|
||||
Num2_4 => attr ++ "tisíce" ;
|
||||
Num5 => attr ++ "tisíc"
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
-- -- Numerals as sequences of digits have a separate, simpler grammar
|
||||
lincat Dig = {s:Str ; n : NumSize} ;
|
||||
|
||||
lin
|
||||
IDig d = d;
|
||||
|
||||
IIDig d dd = {s = d.s ++ Predef.BIND ++ dd.s ; n = Num5} ; ---- leading zeros ??
|
||||
|
||||
D_0 = { s = "0" ; n = Num1} ; ---- ??
|
||||
D_1 = { s = "1" ; n = Num1} ;
|
||||
D_2 = { s = "2" ; n = Num2_4} ;
|
||||
D_3 = { s = "3" ; n = Num2_4} ;
|
||||
D_4 = { s = "4" ; n = Num2_4} ;
|
||||
D_5 = { s = "5" ; n = Num5} ;
|
||||
D_6 = { s = "6" ; n = Num5} ;
|
||||
D_7 = { s = "7" ; n = Num5} ;
|
||||
D_8 = { s = "8" ; n = Num5} ;
|
||||
D_9 = { s = "9" ; n = Num5} ;
|
||||
|
||||
}
|
||||
29
src/czech/ParadigmsCze.gf
Normal file
29
src/czech/ParadigmsCze.gf
Normal file
@@ -0,0 +1,29 @@
|
||||
resource ParadigmsCze = open CatCze, ResCze, Prelude in {
|
||||
|
||||
oper
|
||||
mkPrep : Str -> Case -> Prep
|
||||
= \s,c -> lin Prep {s = s ; c = c ; hasPrep = True} ; ---- True if s /= ""
|
||||
|
||||
mkConj : Str -> Conj
|
||||
= \s -> lin Conj {s1 = [] ; s2 = s} ;
|
||||
|
||||
mkA : Str -> A
|
||||
= \s -> lin A (case s of {
|
||||
_ + "ý" => mladyAdjForms s ;
|
||||
_ + "í" => jarniAdjForms s ;
|
||||
_ + "ův" => otcuvAdjForms s ;
|
||||
_ + "in" => matcinAdjForms s ;
|
||||
_ => Predef.error ("no mkA for" ++ s)
|
||||
}) ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : VerbForms -> VerbForms ** {c : ComplementCase}
|
||||
= \vf -> vf ** {c = {s = [] ; c = Acc ; hasPrep = False}} ;
|
||||
mkV2 : VerbForms -> Case -> VerbForms ** {c : ComplementCase}
|
||||
= \vf,c -> vf ** {c = {s = [] ; c = c ; hasPrep = False}} ;
|
||||
mkV2 : VerbForms -> ComplementCase -> VerbForms ** {c : ComplementCase}
|
||||
= \vf,c -> vf ** {c = c} ;
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
19
src/czech/PhraseCze.gf
Normal file
19
src/czech/PhraseCze.gf
Normal file
@@ -0,0 +1,19 @@
|
||||
concrete PhraseCze of Phrase = CatCze ** open Prelude, ResCze in {
|
||||
|
||||
lin
|
||||
UttS s = s ;
|
||||
UttAdv adv = adv ;
|
||||
UttCN cn = {s = cn.s ! Sg ! Nom} ;
|
||||
UttAP ap = {s = ap.s ! Masc Anim ! Sg ! Nom} ;
|
||||
UttNP np = {s = np.s ! Nom} ;
|
||||
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = {s = conj.s2} ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = np.s ! Voc} ;
|
||||
|
||||
}
|
||||
7
src/czech/QuestionCze.gf
Normal file
7
src/czech/QuestionCze.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
concrete QuestionCze of Question = CatCze **
|
||||
open ResCze, Prelude in {
|
||||
|
||||
lin
|
||||
QuestCl cl = cl ; ----
|
||||
|
||||
}
|
||||
18
src/czech/RelativeCze.gf
Normal file
18
src/czech/RelativeCze.gf
Normal file
@@ -0,0 +1,18 @@
|
||||
concrete RelativeCze of Relative = CatCze ** open
|
||||
ParadigmsCze,
|
||||
ResCze,
|
||||
Prelude in {
|
||||
|
||||
lin
|
||||
RelVP rp vp = vp ** {
|
||||
subj =
|
||||
let rel = (adjFormsAdjective rp).s
|
||||
in \\a => case a of {
|
||||
Ag g n _ => rel ! g ! n ! Nom
|
||||
}
|
||||
} ;
|
||||
|
||||
IdRP = mkA "který" ;
|
||||
|
||||
|
||||
}
|
||||
806
src/czech/ResCze.gf
Normal file
806
src/czech/ResCze.gf
Normal file
@@ -0,0 +1,806 @@
|
||||
resource ResCze = open Prelude in {
|
||||
|
||||
|
||||
-- parameters
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
|
||||
Animacy = Anim | Inanim ;
|
||||
Gender = Masc Animacy | Fem | Neutr ;
|
||||
|
||||
Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order
|
||||
|
||||
Person = P1 | P2 | P3 ;
|
||||
|
||||
Agr = Ag Gender Number Person ;
|
||||
|
||||
CTense = CTPres | CTPast ; -----
|
||||
|
||||
-- phonology
|
||||
|
||||
oper
|
||||
hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ;
|
||||
softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ;
|
||||
neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ;
|
||||
|
||||
consonant : pattern Str =
|
||||
#(
|
||||
"d" | "t" | "g" | "h" | "k" | "n" | "r" |
|
||||
"ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" |
|
||||
"b" | "f" | "l" | "m" | "p" | "s" | "v"
|
||||
) ;
|
||||
|
||||
|
||||
|
||||
dropFleetingE : Str -> Str = \s -> case s of {
|
||||
x + "e" + c@("k"|"c") => x + c ;
|
||||
x + "e" + "ň" => x + "n" ;
|
||||
_ => s
|
||||
} ;
|
||||
|
||||
shortenVowel : Str -> Str = \s -> case s of {
|
||||
x + "á" + y => x + "a" + y ;
|
||||
x + "é" + y => x + "e" + y ;
|
||||
x + "í" + y => x + "i" + y ;
|
||||
x + "ý" + y => x + "y" + y ;
|
||||
x + "ó" + y => x + "o" + y ;
|
||||
x + "ú" + y => x + "u" + y ;
|
||||
x + "ů" + y => x + "o" + y ;
|
||||
_ => s
|
||||
} ;
|
||||
|
||||
addI : Str -> Str = \s -> case s of {
|
||||
klu + "k" => klu + "ci" ;
|
||||
vra + "h" => vra + "zi" ;
|
||||
ce + "ch" => ce + "ši" ;
|
||||
dokto + "r" => dokto + "ři" ;
|
||||
pan => pan + "i"
|
||||
} ;
|
||||
|
||||
addAdjI : Str -> Str = \s -> case s of {
|
||||
angli + "ck" => angli + "čtí" ;
|
||||
ce + "sk" => ce + "ští" ;
|
||||
_ => init (addI s) + "í"
|
||||
} ;
|
||||
|
||||
-- 3.4.10, in particular when also final 'a' is dropped
|
||||
addE : Str -> Str = \s -> case s of {
|
||||
re + "k" => re + "ce" ;
|
||||
pra + ("g"|"h") => pra + "ze" ;
|
||||
stre + "ch" => stre + "še" ;
|
||||
sest + "r" => sest + "ře" ;
|
||||
pan => pan + "ě"
|
||||
} ;
|
||||
|
||||
addEch : Str -> Str = \s -> case s of {
|
||||
klu + "k" => klu + "cich" ;
|
||||
vra + ("h"|"g") => vra + "zich" ;
|
||||
ce + "ch" => ce + "šich" ;
|
||||
pan => pan + "ech"
|
||||
} ;
|
||||
|
||||
shortFemPlGen : Str -> Str = \s -> case s of {
|
||||
ul + "ice" => ul + "ic" ;
|
||||
koleg + "yně" => koleg + "yň" ;
|
||||
ruz + "e" => ruz + "i" ;
|
||||
_ => Predef.error ("shortFemPlGen does not apply to" ++ s)
|
||||
} ;
|
||||
|
||||
---------------
|
||||
-- Nouns
|
||||
|
||||
Noun : Type = {s : Number => Case => Str ; g : Gender} ;
|
||||
NounForms : Type = {snom,sgen,sdat,sacc,svoc,sloc,sins, pnom,pgen,pdat,pacc,ploc,pins : Str ; g : Gender} ;
|
||||
|
||||
nounFormsNoun : NounForms -> Noun
|
||||
= \forms -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Nom => forms.snom ;
|
||||
Gen => forms.sgen ;
|
||||
Dat => forms.sdat ;
|
||||
Acc => forms.sacc ;
|
||||
Voc => forms.svoc ;
|
||||
Loc => forms.sloc ;
|
||||
Ins => forms.sins
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom | Voc => forms.pnom ;
|
||||
Gen => forms.pgen ;
|
||||
Dat => forms.pdat ;
|
||||
Acc => forms.pacc ;
|
||||
Loc => forms.ploc ;
|
||||
Ins => forms.pins
|
||||
}
|
||||
} ;
|
||||
g = forms.g
|
||||
} ;
|
||||
|
||||
|
||||
DeclensionType : Type = Str -> NounForms ;
|
||||
|
||||
declensionType : (nom,gen : Str) -> Gender -> DeclensionType
|
||||
= \nom,gen,g -> case <g, nom, gen> of {
|
||||
<Masc Anim, _ + #hardConsonant, _ + "a"> => declPAN ;
|
||||
<Masc Anim, _ + "a" , _ + "a"> => declPREDSEDA ;
|
||||
<Masc Inanim, _ + #hardConsonant, _ + "u"> => declHRAD ;
|
||||
<Fem, _ + "a" , _ + "y"> => declZENA ;
|
||||
<Neutr, _ + "o" , _ + "a"> => declMESTO ;
|
||||
<Masc Anim, _ + #softConsonant, _ + "e"> => declMUZ ;
|
||||
<Masc Anim, _ + "tel" , _ + "e"> => declMUZ ;
|
||||
<Masc Anim, _ + "ce" , _ + "e"> => declSOUDCE ;
|
||||
<Masc Inanim, _ + #softConsonant, _ + "e"> => declSTROJ ;
|
||||
<Fem, _ + ("e"|"ě") , _ + ("e"|"ě")> => declRUZE ;
|
||||
<Fem, _ + #softConsonant, _ + "e"> => declPISEN ;
|
||||
<Fem, _ + "ost" , _ + "i"> => declKOST ; --- also many other "st" 3.6.3
|
||||
<Neutr, _ + "e" , _+"ete"> => declKURE ;
|
||||
<Neutr, _ + "e" , _ + "e"> => declMORE ;
|
||||
<Neutr, _ + "í" , _ + "í"> => declSTAVENI ;
|
||||
_ => Predef.error ("cannot infer declension type for" ++ nom ++ gen)
|
||||
} ;
|
||||
|
||||
-- source: https://en.wikipedia.org/wiki/Czech_declension
|
||||
|
||||
declPAN : DeclensionType = \pan -> --- plural nom ové|i|é should be given as extra arg 3.5.1
|
||||
{
|
||||
snom = pan ;
|
||||
sgen,sacc = pan + "a" ;
|
||||
sdat,sloc = pan + "ovi" ; --- pánu
|
||||
svoc = shortenVowel pan + "e" ; --- "irregular shortening" 3.5.1
|
||||
sins = pan + "em" ;
|
||||
|
||||
pnom = addI pan ; -- pani, kluk-kluci --- panové, host-hosté
|
||||
pgen = pan + "ů" ;
|
||||
pdat = pan + "ům" ;
|
||||
pacc,pins = pan + "y" ;
|
||||
ploc = addEch pan ;
|
||||
g = Masc Anim
|
||||
} ;
|
||||
|
||||
declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i
|
||||
let predsed = init predseda
|
||||
in
|
||||
{
|
||||
snom = predseda ;
|
||||
sgen = predsed + "y" ; -- pacc,pins --- i
|
||||
sdat,sloc = predsed + "ovi" ;
|
||||
sacc = predsed + "u" ;
|
||||
svoc = predsed + "o" ;
|
||||
sins = predsed + "ou" ;
|
||||
|
||||
pnom = case predseda of {
|
||||
tur + "ista" => tur + "isté" ;
|
||||
_ => predsed + "ové"
|
||||
} ;
|
||||
pgen = predsed + "ů" ;
|
||||
pdat = predsed + "ům" ;
|
||||
pacc,pins = predsed + "y" ;
|
||||
ploc = addEch predsed ;
|
||||
g = Masc Anim
|
||||
} ;
|
||||
|
||||
declHRAD : DeclensionType = \hrad -> --- 3.5.2: sloc u/ě/e extra arg, sport-u, hrad-ě ; sgen u/a
|
||||
let hrd = dropFleetingE hrad
|
||||
in
|
||||
{
|
||||
snom,sacc = hrad ;
|
||||
sgen,sdat = hrd + "u" ; --- Berlín-a
|
||||
sloc = hrd + "u" ; --- addE hrad ; -- stůl-stole
|
||||
svoc = hrd + "e" ;
|
||||
sins = hrd + "em" ;
|
||||
|
||||
pnom,pacc,pins = hrd + "y" ;
|
||||
pgen = hrd + "ů" ;
|
||||
pdat = hrd + "ům" ;
|
||||
ploc = addEch hrd ;
|
||||
g = Masc Inanim
|
||||
} ;
|
||||
|
||||
declZENA : DeclensionType = \zena -> --- 3.6.1 sge y/i ; pgen sometimes shortening
|
||||
let zen = init zena
|
||||
in
|
||||
{
|
||||
snom = zena ;
|
||||
sgen = zen + "y" ; --- i after soft cons sometimes
|
||||
sdat,sloc = zen + "ě" ; --- i after soft cons sometimes ; skol+e
|
||||
sacc = zen + "u" ;
|
||||
svoc = shortenVowel zen + "o" ; ---- shorten ?
|
||||
sins = zen + "ou" ;
|
||||
|
||||
pnom,pacc = zen + "y" ; --- also sgen
|
||||
pgen = zen ; --- sometimes with vowel shortening
|
||||
pdat = zen + "ám" ;
|
||||
ploc = zen + "ách" ;
|
||||
pins = zen + "ami" ;
|
||||
g = Fem
|
||||
} ;
|
||||
|
||||
declMESTO : DeclensionType = \mesto -> --- 3.7.1 sloc u/e ; pgen vowel shortening sometimes ; ploc variations
|
||||
let mest = init mesto
|
||||
in
|
||||
{
|
||||
snom,sacc,svoc = mesto ;
|
||||
sgen = mest + "a" ;
|
||||
sdat = mest + "u" ;
|
||||
sloc = mest + "u" ; --- "ě"
|
||||
sins = mest + "em" ;
|
||||
|
||||
pnom,pacc = mest + "a" ;
|
||||
pgen = mest ; --- léta - let
|
||||
pdat = mest + "ům" ;
|
||||
ploc = mest + "ech" ; --- with variations
|
||||
pins = mest + "y" ;
|
||||
g = Neutr
|
||||
} ;
|
||||
|
||||
declMUZ : DeclensionType = \muz_ -> --- 3.5.3 : sdat,sloc ; pnom
|
||||
let muz = dropFleetingE muz_
|
||||
in
|
||||
{
|
||||
snom = muz_ ;
|
||||
sgen,sacc = muz + "e" ; --- pacc
|
||||
sdat,sloc = muz + "i" ; --- muzovi
|
||||
svoc = case muz_ of {
|
||||
chlap + "ec" => chlap + "če" ;
|
||||
_ => muz + "i"
|
||||
} ;
|
||||
sins = muz + "em" ;
|
||||
|
||||
pnom = case muz_ of {
|
||||
uci + "tel" => uci + "tele" ;
|
||||
_ => muz + "i" --- muzové
|
||||
} ;
|
||||
pgen = muz + "ů" ;
|
||||
pacc = muz + "e" ;
|
||||
pdat = muz + "ům" ;
|
||||
ploc = muz + "ích" ;
|
||||
pins = muz + "i" ;
|
||||
g = Masc Anim
|
||||
} ;
|
||||
|
||||
declSOUDCE : DeclensionType = \soudce -> --- 3.5.3: sdat/sloc i,ovi ; pnom i/ové
|
||||
let soudc = init soudce
|
||||
in
|
||||
{
|
||||
snom,sgen,sacc,svoc = soudce ; ---- pacc
|
||||
sdat,sloc = soudc + "i" ; --- soudcovi
|
||||
sins = soudc + "em" ;
|
||||
|
||||
pnom = soudc + "i" ; --- soudcové
|
||||
pgen = soudc + "ů" ;
|
||||
pdat = soudc + "ům" ;
|
||||
pacc = soudce ;
|
||||
ploc = soudc + "ích" ;
|
||||
pins = soudc + "i" ;
|
||||
g = Masc Anim
|
||||
} ;
|
||||
|
||||
declSTROJ : DeclensionType = \stroj ->
|
||||
{
|
||||
snom,sacc = stroj ;
|
||||
sgen = stroj + "e" ; --- pnom,pacc
|
||||
sdat,svoc,sloc = stroj + "i" ; --- pins ---- svoc shorten?
|
||||
sins = stroj + "em" ;
|
||||
|
||||
pnom,pacc = stroj + "e" ;
|
||||
pgen = stroj + "ů" ;
|
||||
pdat = stroj + "ům" ;
|
||||
ploc = stroj + "ích" ;
|
||||
pins = stroj + "i" ;
|
||||
g = Masc Inanim
|
||||
} ;
|
||||
|
||||
declRUZE : DeclensionType = \ruze -> --- 3.6.2: pgen ulice-ulic, chvile-cvil
|
||||
let ruz = init ruze
|
||||
in
|
||||
{
|
||||
snom,sgen,svoc = ruze ; --- pnom,pacc
|
||||
sdat,sacc,sloc,sins = ruz + "i" ;
|
||||
|
||||
pnom,pacc = ruze ;
|
||||
pgen = shortFemPlGen ruze ;
|
||||
pdat = ruz + "ím" ;
|
||||
ploc = ruz + "ích" ;
|
||||
pins = ruz + "emi" ;
|
||||
g = Fem
|
||||
} ;
|
||||
|
||||
declPISEN : DeclensionType = \pisen ->
|
||||
let pisn = dropFleetingE pisen
|
||||
in
|
||||
{
|
||||
snom,sacc = pisen ;
|
||||
sgen = pisn + "ě" ;
|
||||
sdat,svoc,sloc = pisn + "i" ; -- not shortened
|
||||
sins = pisn + "í" ;
|
||||
|
||||
pnom,pacc = pisn + "ě" ;
|
||||
pgen = pisn + "í" ;
|
||||
pdat = pisn + "ím" ;
|
||||
ploc = pisn + "ích" ;
|
||||
pins = pisn + "ěmi" ;
|
||||
g = Fem
|
||||
} ;
|
||||
|
||||
declKOST : DeclensionType = \kost ->
|
||||
{
|
||||
snom,sacc = kost ;
|
||||
sgen,sdat,svoc,sloc = kost + "i" ; --- pnom,pacc
|
||||
sins = kost + "í" ; --- pgen
|
||||
|
||||
pnom,pacc = kost + "i" ;
|
||||
pgen = kost + "í" ;
|
||||
pdat = kost + "em" ;
|
||||
ploc = kost + "ech" ;
|
||||
pins = kost + "mi" ;
|
||||
g = Fem
|
||||
} ;
|
||||
|
||||
declKURE : DeclensionType = \kure ->
|
||||
let kur = init kure
|
||||
in
|
||||
{
|
||||
snom,sacc,svoc = kure ;
|
||||
sgen = kur + "ete" ;
|
||||
sdat,sloc = kur + "eti" ;
|
||||
sins = kur + "etem" ;
|
||||
|
||||
pnom,pacc = kur + "ata" ;
|
||||
pgen = kur + "at" ;
|
||||
pdat = kur + "atům" ;
|
||||
ploc = kur + "atech" ;
|
||||
pins = kur + "aty" ;
|
||||
g = Neutr
|
||||
} ;
|
||||
|
||||
declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes
|
||||
let mor = init more
|
||||
in
|
||||
{
|
||||
snom,sgen,sacc,svoc = more ; --- pnom
|
||||
sdat,sloc = mor + "i" ; --- pins
|
||||
sins = mor + "em" ;
|
||||
|
||||
pnom,pacc = more ;
|
||||
pgen = mor + "í" ; ---
|
||||
pdat = mor + "ím" ;
|
||||
ploc = mor + "ích" ;
|
||||
pins = mor + "i" ;
|
||||
g = Neutr
|
||||
} ;
|
||||
|
||||
declSTAVENI : DeclensionType = \staveni ->
|
||||
{
|
||||
snom,sgen,sdat,sacc,svoc,sloc = staveni ;
|
||||
sins = staveni + "m" ;
|
||||
|
||||
pnom,pgen,pacc = staveni ;
|
||||
pdat = staveni + "m" ;
|
||||
ploc = staveni + "ch" ;
|
||||
pins = staveni + "mi" ;
|
||||
g = Neutr
|
||||
} ;
|
||||
|
||||
---------------------------
|
||||
-- Adjectives
|
||||
|
||||
-- to be used for AP: 56 forms for each degree
|
||||
Adjective : Type = {s : Gender => Number => Case => Str} ;
|
||||
|
||||
-- to be used for A, in three degrees: 15 forms in each
|
||||
|
||||
AdjForms : Type = {
|
||||
msnom, fsnom, nsnom : Str ; -- svoc = snom
|
||||
msgen, fsgen : Str ; -- nsgen = msgen, pacc = fsgen
|
||||
msdat, fsdat : Str ; -- nsdat = msdat
|
||||
fsacc : Str ; -- amsacc = msgen, imsacc = msnom, nsacc = nsnom
|
||||
msloc : Str ; -- fsloc = fsdat, nsloc = msloc
|
||||
msins, fsins : Str ; -- nsins = msins, pdat = msins
|
||||
|
||||
mpnom,fpnom : Str ; -- pvoc = pnom, impnom = fpnom, npnom = fsnom
|
||||
pgen : Str ; -- ploc = pgen
|
||||
pins : Str ;
|
||||
} ;
|
||||
|
||||
adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
||||
s = \\g,n,c => case <n,c,g> of {
|
||||
|
||||
<Sg, Nom|Voc, Masc _>
|
||||
| <Sg, Acc, Masc Inanim> => afs.msnom ;
|
||||
<Sg, Nom|Voc, Fem>
|
||||
| <Pl, Nom|Acc|Voc, Neutr> => afs.fsnom ;
|
||||
<Sg, Nom|Acc|Voc, Neutr> => afs.nsnom ;
|
||||
|
||||
<Sg, Gen, Masc _ | Neutr>
|
||||
| <Sg,Acc,Masc Anim> => afs.msgen ;
|
||||
<Sg, Gen, Fem>
|
||||
| <Pl,Acc,Masc _|Fem> => afs.fsgen ;
|
||||
|
||||
<Sg, Dat, Masc _|Neutr> => afs.msdat ;
|
||||
<Sg, Dat|Loc, Fem> => afs.fsdat ;
|
||||
|
||||
<Sg, Acc, Fem> => afs.fsacc ;
|
||||
|
||||
<Sg, Loc, Masc _|Neutr> => afs.msloc ;
|
||||
|
||||
<Sg, Ins, Masc _|Neutr>
|
||||
| <Pl,Dat,_> => afs.msins ;
|
||||
<Sg, Ins, Fem> => afs.fsins ;
|
||||
|
||||
<Pl, Nom|Voc, Masc Anim> => afs.mpnom ;
|
||||
<Pl, Nom|Voc, Masc Inanim|Fem> => afs.fpnom ;
|
||||
|
||||
<Pl, Gen|Loc,_> => afs.pgen ;
|
||||
<Pl, Ins,_> => afs.pins
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
-- hard declension
|
||||
|
||||
mladyAdjForms : Str -> AdjForms = \mlady ->
|
||||
let mlad = init mlady
|
||||
in {
|
||||
msnom = mlad + "ý" ;
|
||||
fsnom = mlad + "á" ;
|
||||
nsnom,fsgen,fsdat,fpnom = mlad + "é" ;
|
||||
msgen = mlad + "ého" ;
|
||||
msdat = mlad + "ému" ;
|
||||
fsacc,fsins = mlad + "ou" ;
|
||||
msloc = mlad + "ém" ;
|
||||
msins,pdat = mlad + "ým" ;
|
||||
mpnom = addAdjI mlad ;
|
||||
pgen = mlad + "ých" ;
|
||||
pins = mlad + "ými" ;
|
||||
} ;
|
||||
|
||||
-- soft declension
|
||||
|
||||
jarniAdjForms : Str -> AdjForms = \jarni ->
|
||||
{
|
||||
msnom,fsnom,nsnom,
|
||||
fsgen,fsdat,fsacc,fsins,
|
||||
mpnom,fpnom = jarni ;
|
||||
msgen = jarni + "ho" ;
|
||||
msdat = jarni + "mu" ;
|
||||
msloc,msins = jarni + "m" ;
|
||||
pgen = jarni + "ch" ;
|
||||
pins = jarni + "mi" ;
|
||||
} ;
|
||||
|
||||
-- masculine possession: the same endings as in feminine
|
||||
|
||||
otcuvAdjForms : Str -> AdjForms = \otcuv ->
|
||||
let otcov = Predef.tk 2 otcuv + "ov"
|
||||
in
|
||||
matcinAdjForms otcov ** {msnom = otcuv} ;
|
||||
|
||||
-- feminine possession
|
||||
|
||||
matcinAdjForms : Str -> AdjForms = \matcin ->
|
||||
{
|
||||
msnom = matcin ;
|
||||
fsnom,msgen = matcin + "a" ;
|
||||
nsnom = matcin + "o" ;
|
||||
fsgen,fpnom = matcin + "y" ;
|
||||
msdat,fsacc = matcin + "u" ;
|
||||
fsdat,msloc = matcin + "ě" ;
|
||||
msins = matcin + "ým" ;
|
||||
fsins = matcin + "ou" ;
|
||||
mpnom = matcin + "i" ;
|
||||
pgen = matcin + "ých" ;
|
||||
pins = matcin + "ými" ;
|
||||
} ;
|
||||
|
||||
---------------------
|
||||
-- Verbs
|
||||
|
||||
VerbForms : Type = { ---- TODO more forms to add
|
||||
inf,
|
||||
pressg1, pressg2, pressg3,
|
||||
prespl1, prespl2, prespl3,
|
||||
pastpartsg, pastpartpl,
|
||||
---- passpart,
|
||||
negpressg3 : Str -- matters only for copula
|
||||
} ;
|
||||
|
||||
ComplementCase : Type = {s : Str ; c : Case ; hasPrep : Bool} ;
|
||||
|
||||
verbAgr : VerbForms -> Agr -> Bool -> Str ---- TODO tenses
|
||||
= \vf,a,b -> case a of {
|
||||
Ag _ Sg P1 => vf.pressg1 ;
|
||||
Ag _ Sg P2 => vf.pressg2 ;
|
||||
Ag _ Sg P3 => case b of {
|
||||
True => vf.pressg3 ;
|
||||
False => vf.negpressg3 -- matters only for copula
|
||||
} ;
|
||||
Ag _ Pl P1 => vf.prespl1 ;
|
||||
Ag _ Pl P2 => vf.prespl2 ;
|
||||
Ag _ Pl P3 => vf.prespl3
|
||||
} ;
|
||||
|
||||
copulaVerbForms : VerbForms = {
|
||||
inf = "být" ;
|
||||
pressg1 = "jsem" ;
|
||||
pressg2 = "jsi" ;
|
||||
pressg3 = "je" ;
|
||||
prespl1 = "jsme" ;
|
||||
prespl2 = "jste" ;
|
||||
prespl3 = "jsou" ;
|
||||
pastpartsg = "byl" ;
|
||||
pastpartpl = "byli" ;
|
||||
negpressg3 = "ní" ; -- ne is added to this
|
||||
} ;
|
||||
|
||||
haveVerbForms : VerbForms = {
|
||||
inf = "mít" ;
|
||||
pressg1 = "mám" ;
|
||||
pressg2 = "máš" ;
|
||||
pressg3, negpressg3 = "má" ;
|
||||
prespl1 = "máme" ;
|
||||
prespl2 = "máte" ;
|
||||
prespl3 = "mají" ;
|
||||
pastpartsg = "měl" ;
|
||||
pastpartpl = "měli" ;
|
||||
} ;
|
||||
|
||||
iii_kupovatVerbForms : Str -> VerbForms = \kupovat ->
|
||||
let
|
||||
kupo = Predef.tk 3 kupovat ;
|
||||
kupu = Predef.tk 1 kupo + "u"
|
||||
in
|
||||
{
|
||||
inf = kupovat ;
|
||||
pressg1 = kupu + "ji" ; --- kupuju
|
||||
pressg2 = kupu + "ješ" ;
|
||||
pressg3, negpressg3 = kupu + "je" ;
|
||||
prespl1 = kupu + "jeme" ;
|
||||
prespl2 = kupu + "jete" ;
|
||||
prespl3 = kupu + "jí" ; --- kupujou
|
||||
pastpartsg = kupo + "val" ;
|
||||
pastpartpl = kupo + "vali" ;
|
||||
} ;
|
||||
|
||||
|
||||
---------------------------
|
||||
-- Pronouns
|
||||
|
||||
PronForms : Type = {
|
||||
nom, cnom, -- cnom is the pro-drop subject
|
||||
gen, cgen,pgen, -- bare, clitic, prepositional
|
||||
acc, cacc,pacc,
|
||||
dat, cdat,pdat,
|
||||
loc,
|
||||
ins,pins : Str ;
|
||||
a : Agr
|
||||
} ;
|
||||
|
||||
personalPron : Agr -> PronForms = \a ->
|
||||
{a = a ; cnom = []} **
|
||||
case a of {
|
||||
Ag _ Sg P1 => {
|
||||
nom = "já" ;
|
||||
gen,acc,pgen,pacc = "mne" ;
|
||||
cgen,cacc = "mě" ;
|
||||
dat,pdat,loc = "mně" ;
|
||||
cdat = "mi" ;
|
||||
ins,pins = "mnou"
|
||||
} ;
|
||||
Ag _ Sg P2 => {
|
||||
nom = "ty" ;
|
||||
gen,acc,pgen,pacc = "tebe" ;
|
||||
cgen,cacc = "tě" ;
|
||||
dat,pdat,loc = "tobě" ;
|
||||
cdat = "ti" ;
|
||||
ins,pins = "tebou"
|
||||
} ;
|
||||
Ag (Masc _) Sg P3 => {
|
||||
nom = "on" ;
|
||||
gen,acc = "jeho" ;
|
||||
cgen,cacc = "ho" ;
|
||||
pgen,pacc = "něho" ;
|
||||
dat = "jemu" ;
|
||||
cdat = "mu" ;
|
||||
pdat = "němu" ;
|
||||
loc = "něm" ;
|
||||
ins = "jím" ;
|
||||
pins = "ním" ;
|
||||
} ;
|
||||
Ag Fem Sg P3 => {
|
||||
nom = "ona" ;
|
||||
gen = "její" ;
|
||||
dat,acc,cgen,cacc,cdat,ins = "ji" ;
|
||||
pgen,pdat,pacc,loc,pins = "ní" ;
|
||||
} ;
|
||||
Ag Neutr Sg P3 => {
|
||||
nom = "ono" ;
|
||||
gen = "jeho" ;
|
||||
cgen,cacc = "ho" ;
|
||||
pgen = "něho" ;
|
||||
dat = "jemu" ;
|
||||
acc = "je" ;
|
||||
pacc = "ně" ;
|
||||
cdat = "mu" ;
|
||||
pdat = "němu" ;
|
||||
loc = "něm" ;
|
||||
ins = "jím" ;
|
||||
pins = "ním" ;
|
||||
} ;
|
||||
Ag _ Pl P1 => {
|
||||
nom = "my" ;
|
||||
gen,acc,
|
||||
cgen,cacc,
|
||||
pgen,pacc,
|
||||
loc = "nás" ;
|
||||
dat,cdat,pdat = "nám" ;
|
||||
ins,pins = "námi" ;
|
||||
} ;
|
||||
Ag _ Pl P2 => {
|
||||
nom = "vy" ;
|
||||
gen,acc,
|
||||
cgen,cacc,
|
||||
pgen,pacc,
|
||||
loc = "vás" ;
|
||||
dat,cdat,pdat = "vám" ;
|
||||
ins,pins = "vámi" ;
|
||||
} ;
|
||||
Ag g Pl P3 => {
|
||||
nom = case g of {
|
||||
Masc _ => "oni" ;
|
||||
Fem => "ony" ;
|
||||
Neutr => "ona"
|
||||
} ;
|
||||
gen,cgen = "jich" ;
|
||||
pgen = "nich" ;
|
||||
dat,cdat = "jim" ;
|
||||
pdat = "nim" ;
|
||||
acc,cacc = "je" ;
|
||||
pacc = "ně" ;
|
||||
loc = "nich" ;
|
||||
ins = "jimi" ;
|
||||
pins = "nimi" ;
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
--------------------------------
|
||||
-- demonstrative pronouns
|
||||
|
||||
oper
|
||||
DemPronForms : Type = {
|
||||
msnom, fsnom, nsnom,
|
||||
msgen, fsgen,
|
||||
msdat, -- fsdat = fsgen unlike AdjForms
|
||||
fsacc,
|
||||
msloc,
|
||||
msins, fsins,
|
||||
mpnom, fpnom, -- mpacc = fpacc = fpnom
|
||||
pgen,
|
||||
pdat, -- NOT msins like AdjForms
|
||||
pins : Str
|
||||
} ;
|
||||
|
||||
demPronFormsAdjective : DemPronForms -> Str -> Adjective =
|
||||
\dem,s ->
|
||||
let
|
||||
demAdj = dem ** {fsdat = dem.fsgen} ;
|
||||
adjAdj = adjFormsAdjective demAdj
|
||||
in {
|
||||
s = \\g,n,c => case <g,n,c> of {
|
||||
<_,Pl,Dat> => dem.pdat ;
|
||||
<Masc _ | Fem, Pl, Acc> => dem.fpnom ;
|
||||
_ => adjAdj.s ! g ! n ! c
|
||||
} + s
|
||||
} ;
|
||||
|
||||
mkDemPronForms : Str -> DemPronForms = \t -> {
|
||||
msnom = t + "en" ;
|
||||
fsnom = t + "a" ;
|
||||
nsnom = t + "o" ;
|
||||
msgen = t + "oho" ;
|
||||
fsgen = t + "é" ;
|
||||
msdat = t + "omu" ;
|
||||
fsacc = t + "u" ;
|
||||
msloc = t + "om" ;
|
||||
msins = t + "ím" ;
|
||||
fsins = t + "ou" ;
|
||||
mpnom = t + "i" ;
|
||||
fpnom = t + "y" ;
|
||||
pgen = t + "ěch" ;
|
||||
pdat = t + "ěm" ;
|
||||
pins = t + "ěmi" ;
|
||||
} ;
|
||||
|
||||
invarDemPronForms : Str -> DemPronForms = \s -> {
|
||||
msnom, fsnom, nsnom, msgen, fsgen,
|
||||
msdat, fsacc, msloc, msins, fsins,
|
||||
mpnom, fpnom, pgen, pdat, pins = s ;
|
||||
} ;
|
||||
|
||||
-- Numerals
|
||||
|
||||
-- singular forms of demonstratives
|
||||
NumeralForms : Type = {
|
||||
msnom, fsnom, nsnom,
|
||||
msgen, fsgen,
|
||||
msdat,
|
||||
fsacc,
|
||||
msloc,
|
||||
msins, fsins : Str
|
||||
} ;
|
||||
|
||||
numeralFormsDeterminer : NumeralForms -> (Gender => Case => Str) =
|
||||
\nume ->
|
||||
let
|
||||
dem = nume **
|
||||
{mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used
|
||||
demAdj = dem ** {fsdat = dem.fsgen} ;
|
||||
adjAdj = adjFormsAdjective demAdj
|
||||
in
|
||||
\\g,c => adjAdj.s ! g ! Sg ! c ;
|
||||
|
||||
|
||||
-- example: number 1
|
||||
oneNumeralForms : NumeralForms = mkDemPronForms "jed" ;
|
||||
|
||||
-- numbers 2,3,4 ---- to check if everything comes out right with this type
|
||||
twoNumeralForms : NumeralForms = {
|
||||
msnom = "dva" ; fsnom, nsnom, fsacc = "dvě" ;
|
||||
msgen, fsgen, msloc = "dvou" ;
|
||||
msdat, msins, fsins = "dvěma"
|
||||
} ;
|
||||
|
||||
threeNumeralForms : NumeralForms = {
|
||||
msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ;
|
||||
msdat = "třem" ;
|
||||
msloc = "třech" ;
|
||||
msins,fsins = "třemi" ;
|
||||
} ;
|
||||
|
||||
fourNumeralForms : NumeralForms = {
|
||||
msnom, fsnom, nsnom, fsacc = "čtyři" ;
|
||||
msgen, fsgen = "čtyř" ;
|
||||
msdat = "čtyřem" ;
|
||||
msloc = "čtyřech" ;
|
||||
msins,fsins = "čtyřmi" ;
|
||||
} ;
|
||||
|
||||
-- for the numbers 5 upwards
|
||||
regNumeralForms : Str -> Str -> NumeralForms = \pet,peti -> {
|
||||
msnom,fsnom,nsnom = pet ;
|
||||
msgen, fsgen, msdat, fsacc, msloc, msins, fsins = peti
|
||||
} ;
|
||||
|
||||
invarNumeralForms : Str -> NumeralForms = \sto ->
|
||||
regNumeralForms sto sto ;
|
||||
|
||||
--------------------------------
|
||||
-- combining nouns with numerals
|
||||
|
||||
param
|
||||
NumSize = Num1 | Num2_4 | Num5 ; -- essential grammar 6.1
|
||||
|
||||
oper
|
||||
numSizeForm : (Number => Case => Str) -> NumSize -> Case -> Str
|
||||
= \cns,n,c -> case n of {
|
||||
Num1 => cns ! Sg ! c ;
|
||||
Num2_4 => cns ! Pl ! c ;
|
||||
Num5 => case c of {
|
||||
Nom | Acc => cns ! Pl ! Gen ;
|
||||
_ => cns ! Pl ! c
|
||||
}
|
||||
} ;
|
||||
|
||||
numSizeAgr : Gender -> NumSize -> Person -> Agr
|
||||
= \g,ns,p -> case ns of {
|
||||
Num5 => Ag Neutr Sg p ; -- essential grammar 6.1.4
|
||||
Num2_4 => Ag g Pl p ;
|
||||
Num1 => Ag g Sg p
|
||||
} ;
|
||||
|
||||
numSizeNumber : NumSize -> Number = \ns -> case ns of {
|
||||
Num1 => Sg ;
|
||||
_ => Pl ---- TO CHECK
|
||||
} ;
|
||||
}
|
||||
31
src/czech/SentenceCze.gf
Normal file
31
src/czech/SentenceCze.gf
Normal file
@@ -0,0 +1,31 @@
|
||||
concrete SentenceCze of Sentence = CatCze **
|
||||
open Prelude, ResCze in {
|
||||
|
||||
lin
|
||||
PredVP np vp = {
|
||||
subj = case np.hasClit of {
|
||||
True => np.clit ! Nom ; -- pro-drop
|
||||
False => np.s ! Nom
|
||||
} ;
|
||||
verb = vp.verb ;
|
||||
clit = vp.clit ! np.a ;
|
||||
compl = vp.compl ! np.a ;
|
||||
a = np.a ;
|
||||
} ;
|
||||
|
||||
UseCl temp pol cl = {
|
||||
s = temp.s ++ cl.subj ++ cl.clit ++ pol.s ++ verbAgr cl.verb cl.a pol.p ++ cl.compl ;
|
||||
} ;
|
||||
|
||||
UseQCl temp pol cl = {
|
||||
s = temp.s ++ cl.clit ++ pol.s ++ verbAgr cl.verb cl.a pol.p ++ cl.subj ++ cl.compl ; ---- inversion optional
|
||||
} ;
|
||||
|
||||
UseRCl temp pol rcl = {
|
||||
s = \\a => temp.s ++
|
||||
rcl.subj ! a ++ rcl.clit ! a ++
|
||||
pol.s ++ verbAgr rcl.verb a pol.p ++
|
||||
rcl.compl ! a ;
|
||||
} ;
|
||||
|
||||
}
|
||||
25
src/czech/StructuralCze.gf
Normal file
25
src/czech/StructuralCze.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
concrete StructuralCze of Structural = CatCze **
|
||||
open ParadigmsCze, ResCze, Prelude in {
|
||||
|
||||
lin
|
||||
and_Conj = mkConj "i" ;
|
||||
---- by8agent_Prep : Prep
|
||||
---- few_Det : Det
|
||||
from_Prep = mkPrep (pre {"s"|"z" => "ze" ; _ => "z"}) Gen ; ---- consonant clusters
|
||||
have_V2 = mkV2 haveVerbForms ;
|
||||
in_Prep = mkPrep (pre {"v"|"m" => "ve" ; _ => "v"}) Loc ; ----
|
||||
---- many_Det : Det
|
||||
or_Conj = mkConj "nebo" ;
|
||||
---- somePl_Det : Det
|
||||
---- something_NP : NP
|
||||
that_Quant = demPronFormsAdjective (mkDemPronForms "tamt") "" ;
|
||||
this_Quant = demPronFormsAdjective (mkDemPronForms "t") "to" ;
|
||||
to_Prep = mkPrep "do" Gen ;
|
||||
with_Prep = mkPrep (pre {"s"|"z" => "se" ; _ => "s"}) Ins ; ----
|
||||
|
||||
i_Pron = personalPron (Ag (Masc Anim) Sg P1) ;
|
||||
youSg_Pron = personalPron (Ag (Masc Anim) Sg P2) ;
|
||||
he_Pron = personalPron (Ag (Masc Anim) Sg P3) ;
|
||||
she_Pron = personalPron (Ag Fem Sg P3) ;
|
||||
|
||||
}
|
||||
9
src/czech/SymbolCze.gf
Normal file
9
src/czech/SymbolCze.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
--# -path=.:../abstract:../common:../prelude
|
||||
|
||||
concrete SymbolCze of Symbol = CatCze ** open Prelude, ResCze in {
|
||||
|
||||
lin
|
||||
MkSymb s = s ;
|
||||
SymbPN s = lin PN {s = \\_ => s.s ; g = Neutr} ;
|
||||
|
||||
}
|
||||
20
src/czech/TenseCze.gf
Normal file
20
src/czech/TenseCze.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
concrete TenseCze of Tense =
|
||||
CatCze **
|
||||
open
|
||||
ResCze,
|
||||
Prelude
|
||||
in {
|
||||
lin
|
||||
PNeg = {
|
||||
s = "ne" ++ Predef.BIND ;
|
||||
p = False
|
||||
} ;
|
||||
PPos = {
|
||||
s = [] ;
|
||||
p = True
|
||||
} ;
|
||||
ASimul = {s = [] ; t = CTPres} ;
|
||||
TPres = {s = [] ; t = CTPres} ;
|
||||
TTAnt t a = {s = t.s ++ a.s ; t = t.t} ; ----
|
||||
|
||||
}
|
||||
8
src/czech/TextCze.gf
Normal file
8
src/czech/TextCze.gf
Normal file
@@ -0,0 +1,8 @@
|
||||
concrete TextCze of Text = CatCze ** open ResCze in {
|
||||
|
||||
lin
|
||||
TEmpty = {s = []} ;
|
||||
TFullStop x xs = {s = x.s ++ "." ++ xs.s} ;
|
||||
TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ;
|
||||
TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ;
|
||||
}
|
||||
48
src/czech/VerbCze.gf
Normal file
48
src/czech/VerbCze.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
concrete VerbCze of Verb = CatCze ** open ResCze, Prelude in {
|
||||
|
||||
lin
|
||||
UseV v = {
|
||||
verb = v ;
|
||||
clit,compl = \\_ => []
|
||||
} ;
|
||||
|
||||
ComplSlash vps np = case <np.hasClit, vps.c.hasPrep> of {
|
||||
<True,False> => vps ** {
|
||||
clit = \\a => vps.clit ! a ++ np.clit ! vps.c.c
|
||||
} ;
|
||||
_ => vps ** {
|
||||
compl = \\a => vps.compl ! a ++ vps.c.s ++ np.s ! vps.c.c
|
||||
}
|
||||
} ;
|
||||
|
||||
SlashV2a v = {
|
||||
verb = v ;
|
||||
clit,compl = \\_ => [] ;
|
||||
c = v.c
|
||||
} ;
|
||||
|
||||
UseComp comp = {
|
||||
verb = copulaVerbForms ;
|
||||
clit = \\_ => [] ;
|
||||
compl = comp.s
|
||||
} ;
|
||||
|
||||
CompAP ap = {
|
||||
s = \\a => case a of {
|
||||
Ag g n p_ => ap.s ! g ! n ! Nom
|
||||
}
|
||||
} ;
|
||||
|
||||
CompNP np = {
|
||||
s = \\a_ => np.s ! Nom ; ---- InstrC in Pol
|
||||
} ;
|
||||
|
||||
CompAdv adv = {
|
||||
s = \\a_ => adv.s
|
||||
} ;
|
||||
|
||||
AdvVP vp adv = vp ** {
|
||||
compl = \\a => vp.compl ! a ++ adv.s
|
||||
} ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user