mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
Merge pull request #313 from michmech/master
improvements to czech, mostly morphological
This commit is contained in:
@@ -16,7 +16,7 @@ param
|
|||||||
Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order
|
Case = Nom | Gen | Dat | Acc | Voc | Loc | Ins ; -- traditional order
|
||||||
|
|
||||||
Person = P1 | P2 | P3 ;
|
Person = P1 | P2 | P3 ;
|
||||||
|
|
||||||
Agr = Ag Gender Number Person ;
|
Agr = Ag Gender Number Person ;
|
||||||
|
|
||||||
CTense = CTPres | CTPast ; ----- TODO complete the tense system to match Czech verb morphology
|
CTense = CTPres | CTPast ; ----- TODO complete the tense system to match Czech verb morphology
|
||||||
@@ -27,16 +27,16 @@ oper
|
|||||||
hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ;
|
hardConsonant : pattern Str = #("d"|"t"|"g"|"h"|"k"|"n"|"r") ;
|
||||||
softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ;
|
softConsonant : pattern Str = #("ť"|"ď"|"j"|"ň"|"ř"|"š"|"c"|"č"|"ž") ;
|
||||||
neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ;
|
neutralConsonant : pattern Str = #("b"|"f"|"l"|"m"|"p"|"s"|"v") ;
|
||||||
|
|
||||||
consonant : pattern Str =
|
consonant : pattern Str =
|
||||||
#(
|
#(
|
||||||
"d" | "t" | "g" | "h" | "k" | "n" | "r" |
|
"d" | "t" | "g" | "h" | "k" | "n" | "r" |
|
||||||
"ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" |
|
"ť" | "ď" | "j" | "ň" | "ř" | "š" | "c" | "č" | "ž" |
|
||||||
"b" | "f" | "l" | "m" | "p" | "s" | "v"
|
"b" | "f" | "l" | "m" | "p" | "s" | "v"
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
dropFleetingE : Str -> Str = \s -> case s of {
|
dropFleetingE : Str -> Str = \s -> case s of {
|
||||||
x + "e" + c@("k"|"c") => x + c ;
|
x + "e" + c@("k"|"c"|"n") => x + c ;
|
||||||
x + "e" + "ň" => x + "n" ;
|
x + "e" + "ň" => x + "n" ;
|
||||||
_ => s
|
_ => s
|
||||||
} ;
|
} ;
|
||||||
@@ -85,10 +85,10 @@ oper
|
|||||||
shortFemPlGen : Str -> Str = \s -> case s of {
|
shortFemPlGen : Str -> Str = \s -> case s of {
|
||||||
ul + "ice" => ul + "ic" ;
|
ul + "ice" => ul + "ic" ;
|
||||||
koleg + "yně" => koleg + "yň" ;
|
koleg + "yně" => koleg + "yň" ;
|
||||||
ruz + "e" => ruz + "i" ;
|
ruz + "e" => ruz + "í" ;
|
||||||
_ => Predef.error ("shortFemPlGen does not apply to" ++ s)
|
_ => Predef.error ("shortFemPlGen does not apply to" ++ s)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
---------------
|
---------------
|
||||||
-- Nouns
|
-- Nouns
|
||||||
---------------
|
---------------
|
||||||
@@ -136,7 +136,7 @@ oper
|
|||||||
|
|
||||||
-- terminology of CEG
|
-- terminology of CEG
|
||||||
DeclensionType : Type = Str -> NounForms ;
|
DeclensionType : Type = Str -> NounForms ;
|
||||||
|
|
||||||
declensionNounForms : (nom,gen : Str) -> Gender -> NounForms
|
declensionNounForms : (nom,gen : Str) -> Gender -> NounForms
|
||||||
= \nom,gen,g ->
|
= \nom,gen,g ->
|
||||||
let decl : DeclensionType = case <g, nom, gen> of {
|
let decl : DeclensionType = case <g, nom, gen> of {
|
||||||
@@ -173,12 +173,12 @@ oper
|
|||||||
_ + "e" => declMORE s ;
|
_ + "e" => declMORE s ;
|
||||||
_ + "í" => declSTAVENI s ;
|
_ + "í" => declSTAVENI s ;
|
||||||
_ => Predef.error ("cannot guess declension type for" ++ s)
|
_ => Predef.error ("cannot guess declension type for" ++ s)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- the traditional declensions, in both CEG and Wiki
|
-- the traditional declensions, in both CEG and Wiki
|
||||||
-- they are also exported in ParadigmsCze with names panN etc
|
-- they are also exported in ParadigmsCze with names panN etc
|
||||||
|
|
||||||
declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1
|
declPAN : DeclensionType = \pan -> --- plural nom ové|i|é can be changed with ** {pnom = ...} CEG 3.5.1
|
||||||
{
|
{
|
||||||
snom = pan ;
|
snom = pan ;
|
||||||
sgen,sacc = pan + "a" ;
|
sgen,sacc = pan + "a" ;
|
||||||
@@ -193,7 +193,7 @@ oper
|
|||||||
ploc = addEch pan ;
|
ploc = addEch pan ;
|
||||||
g = Masc Anim
|
g = Masc Anim
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i
|
declPREDSEDA : DeclensionType = \predseda -> --- 3.5.4: sgen y/i
|
||||||
let predsed = init predseda
|
let predsed = init predseda
|
||||||
in
|
in
|
||||||
@@ -284,7 +284,7 @@ oper
|
|||||||
sins = muz + "em" ;
|
sins = muz + "em" ;
|
||||||
|
|
||||||
pnom = case muz_ of {
|
pnom = case muz_ of {
|
||||||
uci + "tel" => uci + "tele" ;
|
uci + "tel" => uci + "telé" ;
|
||||||
_ => muz + "i" --- muzové
|
_ => muz + "i" --- muzové
|
||||||
} ;
|
} ;
|
||||||
pgen = muz + "ů" ;
|
pgen = muz + "ů" ;
|
||||||
@@ -308,7 +308,7 @@ oper
|
|||||||
pdat = soudc + "ům" ;
|
pdat = soudc + "ům" ;
|
||||||
pacc = soudce ;
|
pacc = soudce ;
|
||||||
ploc = soudc + "ích" ;
|
ploc = soudc + "ích" ;
|
||||||
pins = soudc + "i" ;
|
pins = soudc + "i" ;
|
||||||
g = Masc Anim
|
g = Masc Anim
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -332,7 +332,8 @@ oper
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
snom,sgen,svoc = ruze ; --- pnom,pacc
|
snom,sgen,svoc = ruze ; --- pnom,pacc
|
||||||
sdat,sacc,sloc,sins = ruz + "i" ;
|
sdat,sacc,sloc = ruz + "i" ;
|
||||||
|
sins = ruz + "í" ;
|
||||||
|
|
||||||
pnom,pacc = ruze ;
|
pnom,pacc = ruze ;
|
||||||
pgen = shortFemPlGen ruze ;
|
pgen = shortFemPlGen ruze ;
|
||||||
@@ -343,7 +344,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
declPISEN : DeclensionType = \pisen ->
|
declPISEN : DeclensionType = \pisen ->
|
||||||
let pisn = dropFleetingE pisen
|
let pisn = dropFleetingE pisen
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
snom,sacc = pisen ;
|
snom,sacc = pisen ;
|
||||||
@@ -389,7 +390,7 @@ oper
|
|||||||
pins = kur + "aty" ;
|
pins = kur + "aty" ;
|
||||||
g = Neutr
|
g = Neutr
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes
|
declMORE : DeclensionType = \more -> --- 3.7.2 pgen zero sometimes
|
||||||
let mor = init more
|
let mor = init more
|
||||||
in
|
in
|
||||||
@@ -399,13 +400,13 @@ oper
|
|||||||
sins = mor + "em" ;
|
sins = mor + "em" ;
|
||||||
|
|
||||||
pnom,pacc = more ;
|
pnom,pacc = more ;
|
||||||
pgen = mor + "í" ; ---
|
pgen = mor + "í" ; ---
|
||||||
pdat = mor + "ím" ;
|
pdat = mor + "ím" ;
|
||||||
ploc = mor + "ích" ;
|
ploc = mor + "ích" ;
|
||||||
pins = mor + "i" ;
|
pins = mor + "i" ;
|
||||||
g = Neutr
|
g = Neutr
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
declSTAVENI : DeclensionType = \staveni ->
|
declSTAVENI : DeclensionType = \staveni ->
|
||||||
{
|
{
|
||||||
snom,sgen,sdat,sacc,svoc,sloc = staveni ;
|
snom,sgen,sdat,sacc,svoc,sloc = staveni ;
|
||||||
@@ -422,7 +423,7 @@ oper
|
|||||||
-- Adjectives
|
-- Adjectives
|
||||||
|
|
||||||
-- to be used for AP: 56 forms for each degree
|
-- to be used for AP: 56 forms for each degree
|
||||||
Adjective : Type = {s : Gender => Number => Case => Str} ;
|
Adjective : Type = {s : Gender => Number => Case => Str} ;
|
||||||
|
|
||||||
-- to be used for A, in three degrees: 15 forms in each
|
-- to be used for A, in three degrees: 15 forms in each
|
||||||
---- TODO other degrees than positive
|
---- TODO other degrees than positive
|
||||||
@@ -444,25 +445,25 @@ oper
|
|||||||
|
|
||||||
adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
||||||
s = \\g,n,c => case <n,c,g> of {
|
s = \\g,n,c => case <n,c,g> of {
|
||||||
|
|
||||||
<Sg, Nom|Voc, Masc _>
|
<Sg, Nom|Voc, Masc _>
|
||||||
| <Sg, Acc, Masc Inanim> => afs.msnom ;
|
| <Sg, Acc, Masc Inanim> => afs.msnom ;
|
||||||
<Sg, Nom|Voc, Fem>
|
<Sg, Nom|Voc, Fem>
|
||||||
| <Pl, Nom|Acc|Voc, Neutr> => afs.fsnom ;
|
| <Pl, Nom|Acc|Voc, Neutr> => afs.fsnom ;
|
||||||
<Sg, Nom|Acc|Voc, Neutr> => afs.nsnom ;
|
<Sg, Nom|Acc|Voc, Neutr> => afs.nsnom ;
|
||||||
|
|
||||||
<Sg, Gen, Masc _ | Neutr>
|
<Sg, Gen, Masc _ | Neutr>
|
||||||
| <Sg,Acc,Masc Anim> => afs.msgen ;
|
| <Sg,Acc,Masc Anim> => afs.msgen ;
|
||||||
<Sg, Gen, Fem>
|
<Sg, Gen, Fem>
|
||||||
| <Pl,Acc,Masc _|Fem> => afs.fsgen ;
|
| <Pl,Acc,Masc _|Fem> => afs.fsgen ;
|
||||||
|
|
||||||
<Sg, Dat, Masc _|Neutr> => afs.msdat ;
|
<Sg, Dat, Masc _|Neutr> => afs.msdat ;
|
||||||
<Sg, Dat|Loc, Fem> => afs.fsdat ;
|
<Sg, Dat|Loc, Fem> => afs.fsdat ;
|
||||||
|
|
||||||
<Sg, Acc, Fem> => afs.fsacc ;
|
<Sg, Acc, Fem> => afs.fsacc ;
|
||||||
|
|
||||||
<Sg, Loc, Masc _|Neutr> => afs.msloc ;
|
<Sg, Loc, Masc _|Neutr> => afs.msloc ;
|
||||||
|
|
||||||
<Sg, Ins, Masc _|Neutr>
|
<Sg, Ins, Masc _|Neutr>
|
||||||
| <Pl,Dat,_> => afs.msins ;
|
| <Pl,Dat,_> => afs.msins ;
|
||||||
<Sg, Ins, Fem> => afs.fsins ;
|
<Sg, Ins, Fem> => afs.fsins ;
|
||||||
@@ -473,7 +474,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
<Pl, Gen|Loc,_> => afs.pgen ;
|
<Pl, Gen|Loc,_> => afs.pgen ;
|
||||||
<Pl, Ins,_> => afs.pins
|
<Pl, Ins,_> => afs.pins
|
||||||
}
|
}
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- hard declension
|
-- hard declension
|
||||||
@@ -571,7 +572,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
pastpartpl = "byli" ;
|
pastpartpl = "byli" ;
|
||||||
negpressg3 = "ní" ; -- ne is added to this
|
negpressg3 = "ní" ; -- ne is added to this
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
haveVerbForms : VerbForms = {
|
haveVerbForms : VerbForms = {
|
||||||
inf = "mít" ;
|
inf = "mít" ;
|
||||||
pressg1 = "mám" ;
|
pressg1 = "mám" ;
|
||||||
@@ -590,7 +591,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
iii_kupovatVerbForms : Str -> VerbForms = \kupovat ->
|
iii_kupovatVerbForms : Str -> VerbForms = \kupovat ->
|
||||||
let
|
let
|
||||||
kupo = Predef.tk 3 kupovat ;
|
kupo = Predef.tk 3 kupovat ;
|
||||||
kupu = Predef.tk 1 kupo + "u"
|
kupu = Predef.tk 1 kupo + "u"
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inf = kupovat ;
|
inf = kupovat ;
|
||||||
@@ -604,7 +605,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
pastpartpl = kupo + "vali" ;
|
pastpartpl = kupo + "vali" ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
-- Pronouns
|
-- Pronouns
|
||||||
|
|
||||||
@@ -637,7 +638,7 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
cgen,cacc = "tě" ;
|
cgen,cacc = "tě" ;
|
||||||
dat,pdat,loc = "tobě" ;
|
dat,pdat,loc = "tobě" ;
|
||||||
cdat = "ti" ;
|
cdat = "ti" ;
|
||||||
ins,pins = "tebou"
|
ins,pins = "tebou"
|
||||||
} ;
|
} ;
|
||||||
Ag (Masc _) Sg P3 => {
|
Ag (Masc _) Sg P3 => {
|
||||||
nom = "on" ;
|
nom = "on" ;
|
||||||
@@ -714,10 +715,10 @@ adjFormsAdjective : AdjForms -> Adjective = \afs -> {
|
|||||||
oper
|
oper
|
||||||
DemPronForms : Type = {
|
DemPronForms : Type = {
|
||||||
msnom, fsnom, nsnom,
|
msnom, fsnom, nsnom,
|
||||||
msgen, fsgen,
|
msgen, fsgen,
|
||||||
msdat, -- fsdat = fsgen unlike AdjForms
|
msdat, -- fsdat = fsgen unlike AdjForms
|
||||||
fsacc,
|
fsacc,
|
||||||
msloc,
|
msloc,
|
||||||
msins, fsins,
|
msins, fsins,
|
||||||
mpnom, fpnom, -- mpacc = fpacc = fpnom
|
mpnom, fpnom, -- mpacc = fpacc = fpnom
|
||||||
pgen,
|
pgen,
|
||||||
@@ -748,7 +749,7 @@ oper
|
|||||||
fsnom = t + "a" ;
|
fsnom = t + "a" ;
|
||||||
nsnom = t + "o" ;
|
nsnom = t + "o" ;
|
||||||
msgen = t + "oho" ;
|
msgen = t + "oho" ;
|
||||||
fsgen = t + "é" ;
|
fsgen = t + "é" ;
|
||||||
msdat = t + "omu" ;
|
msdat = t + "omu" ;
|
||||||
fsacc = t + "u" ;
|
fsacc = t + "u" ;
|
||||||
msloc = t + "om" ;
|
msloc = t + "om" ;
|
||||||
@@ -760,9 +761,9 @@ oper
|
|||||||
pdat = t + "ěm" ;
|
pdat = t + "ěm" ;
|
||||||
pins = t + "ěmi" ;
|
pins = t + "ěmi" ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
invarDemPronForms : Str -> DemPronForms = \s -> {
|
invarDemPronForms : Str -> DemPronForms = \s -> {
|
||||||
msnom, fsnom, nsnom, msgen, fsgen,
|
msnom, fsnom, nsnom, msgen, fsgen,
|
||||||
msdat, fsacc, msloc, msins, fsins,
|
msdat, fsacc, msloc, msins, fsins,
|
||||||
mpnom, fpnom, pgen, pdat, pins = s ;
|
mpnom, fpnom, pgen, pdat, pins = s ;
|
||||||
} ;
|
} ;
|
||||||
@@ -776,7 +777,7 @@ oper
|
|||||||
Loc => "kom" ;
|
Loc => "kom" ;
|
||||||
Ins => "kým"
|
Ins => "kým"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
coForms : Case => Str = table {
|
coForms : Case => Str = table {
|
||||||
Nom|Acc|Voc => "co" ;
|
Nom|Acc|Voc => "co" ;
|
||||||
Gen => "čeho" ;
|
Gen => "čeho" ;
|
||||||
@@ -790,10 +791,10 @@ oper
|
|||||||
-- singular forms of demonstratives
|
-- singular forms of demonstratives
|
||||||
NumeralForms : Type = {
|
NumeralForms : Type = {
|
||||||
msnom, fsnom, nsnom,
|
msnom, fsnom, nsnom,
|
||||||
msgen, fsgen,
|
msgen, fsgen,
|
||||||
msdat,
|
msdat,
|
||||||
fsacc,
|
fsacc,
|
||||||
msloc,
|
msloc,
|
||||||
msins, fsins : Str
|
msins, fsins : Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -801,7 +802,7 @@ oper
|
|||||||
\nume,size ->
|
\nume,size ->
|
||||||
let
|
let
|
||||||
dem = nume **
|
dem = nume **
|
||||||
{mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used
|
{mpnom, fpnom, pgen, pdat, pins = nume.msnom} ; --- plural forms not used
|
||||||
demAdj = dem ** {fsdat = dem.fsgen} ;
|
demAdj = dem ** {fsdat = dem.fsgen} ;
|
||||||
adjAdj = adjFormsAdjective demAdj
|
adjAdj = adjFormsAdjective demAdj
|
||||||
in {
|
in {
|
||||||
@@ -810,7 +811,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- example: number 1
|
-- example: number 1
|
||||||
oneNumeral : Determiner = numeralFormsDeterminer (mkDemPronForms "jed") Num1 ;
|
oneNumeral : Determiner = numeralFormsDeterminer ((mkDemPronForms "jedn") ** {msnom = "jeden"}) Num1 ;
|
||||||
|
|
||||||
-- numbers 2,3,4 ---- to check if everything comes out right with the determiner type
|
-- numbers 2,3,4 ---- to check if everything comes out right with the determiner type
|
||||||
twoNumeral : Determiner =
|
twoNumeral : Determiner =
|
||||||
@@ -820,7 +821,7 @@ oper
|
|||||||
msdat, msins, fsins = "dvěma"
|
msdat, msins, fsins = "dvěma"
|
||||||
}
|
}
|
||||||
in numeralFormsDeterminer forms Num2_4 ;
|
in numeralFormsDeterminer forms Num2_4 ;
|
||||||
|
|
||||||
threeNumeral : Determiner =
|
threeNumeral : Determiner =
|
||||||
let forms = {
|
let forms = {
|
||||||
msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ;
|
msnom, fsnom, nsnom, fsacc, msgen, fsgen = "tři" ;
|
||||||
@@ -850,7 +851,7 @@ oper
|
|||||||
|
|
||||||
invarDeterminer : Str -> NumSize -> Determiner = \sto,size ->
|
invarDeterminer : Str -> NumSize -> Determiner = \sto,size ->
|
||||||
regNumeral sto sto ;
|
regNumeral sto sto ;
|
||||||
|
|
||||||
invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ;
|
invarNumeral : Str -> Determiner = \s -> invarDeterminer s Num5 ;
|
||||||
|
|
||||||
--------------------------------
|
--------------------------------
|
||||||
@@ -881,4 +882,4 @@ oper
|
|||||||
Num1 => Sg ;
|
Num1 => Sg ;
|
||||||
_ => Pl ---- TO CHECK
|
_ => Pl ---- TO CHECK
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
concrete StructuralCze of Structural = CatCze **
|
concrete StructuralCze of Structural = CatCze **
|
||||||
open ParadigmsCze, ResCze, Prelude in {
|
open ParadigmsCze, ResCze, Prelude in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
and_Conj = mkConj "i" ;
|
and_Conj = mkConj "a" ;
|
||||||
by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation
|
by8agent_Prep = mkPrep "od" Gen ; ---- TODO this means "from", there might be no good translation
|
||||||
few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála
|
few_Det = invarNumeral "málo" ; -- CEG 6.8 --- TODO genitive mála
|
||||||
for_Prep = mkPrep "pro" accusative ;
|
for_Prep = mkPrep "pro" accusative ;
|
||||||
|
|||||||
Reference in New Issue
Block a user