mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
fixed Slo noun declensions and smart paradigms ; LexiconSlo doesn't compile
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
resource ParadigmsSlo = open CatSlo, ResSlo, Prelude in {
|
resource ParadigmsSlo = open CatSlo, ResSlo, (R=ResSlo), Prelude in {
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
-- Parameters
|
-- Parameters
|
||||||
@@ -35,6 +35,7 @@ oper
|
|||||||
-- Nouns
|
-- Nouns
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
mkN = overload {
|
mkN = overload {
|
||||||
mkN : (nom : Str) -> N
|
mkN : (nom : Str) -> N
|
||||||
= \nom -> lin N (guessNounForms nom) ;
|
= \nom -> lin N (guessNounForms nom) ;
|
||||||
@@ -46,35 +47,36 @@ oper
|
|||||||
-- However, they have some defaults that may have to be overwritten.
|
-- However, they have some defaults that may have to be overwritten.
|
||||||
-- This can be done easily by overriding those formes with record extension (**).
|
-- This can be done easily by overriding those formes with record extension (**).
|
||||||
-- The default extensions are shown in comments; if the default is correct, no extension is needed.
|
-- The default extensions are shown in comments; if the default is correct, no extension is needed.
|
||||||
|
-- Notice that some paradigms take two arguments, some take one.
|
||||||
|
|
||||||
panN : Str -> N -- default ** {pnom = +i}
|
chlapN : Str -> N
|
||||||
= \s -> lin N (declPAN s) ;
|
= \s -> lin N (R.chlapN s) ;
|
||||||
predsedaN : Str -> N -- default ** {sgen = +i}
|
hrdinaN : Str -> N
|
||||||
= \s -> lin N (declPREDSEDA s) ;
|
= \s -> lin N (R.hrdinaN s) ;
|
||||||
hradN : Str -> N -- default ** {sgen,sloc = +u}
|
dubN : Str -> N
|
||||||
= \s -> lin N (declHRAD s) ;
|
= \s -> lin N (R.dubN s) ;
|
||||||
zenaN : Str -> N -- default ** {pgen = zen}
|
|
||||||
= \s -> lin N (declZENA s) ;
|
|
||||||
mestoN : Str -> N -- default ** {sloc = +u ; pgen = mest ; ploc = +ech}
|
|
||||||
= \s -> lin N (declMESTO s) ;
|
|
||||||
muzN : Str -> N
|
|
||||||
= \s -> lin N (declMUZ s) ;
|
|
||||||
soudceN : Str -> N -- default ** {sdat,sloc = +i ; pnom = +i}
|
|
||||||
= \s -> lin N (declSOUDCE s) ;
|
|
||||||
strojN : Str -> N
|
strojN : Str -> N
|
||||||
= \s -> lin N (declSTROJ s) ;
|
= \s -> lin N (R.strojN s) ;
|
||||||
ruzeN : Str -> N
|
ponyN : Str -> N
|
||||||
= \s -> lin N (declRUZE s) ;
|
= \s -> lin N (R.ponyN s) ;
|
||||||
pisenN : Str -> N
|
zenaN : (snom, pgen : Str) -> N
|
||||||
= \s -> lin N (declPISEN s) ;
|
= \s,p -> lin N (R.zenaN s) ** {pgen = p} ;
|
||||||
kostN : Str -> N
|
ulicaN : (snom, pgen : Str) -> N
|
||||||
= \s -> lin N (declKOST s) ;
|
= \s,p -> lin N (R.ulicaN s) ** {pgen = p} ;
|
||||||
kureN : Str -> N
|
dlanN : (snom, pgen : Str) -> N
|
||||||
= \s -> lin N (declKURE s) ;
|
= \s,p -> lin N (R.dlanN s p) ;
|
||||||
moreN : Str -> N -- default ** {pgen = +í}
|
kostN : (snom, pgen : Str) -> N
|
||||||
= \s -> lin N (declMORE s) ;
|
= \s,p -> lin N (R.kostN s p) ;
|
||||||
staveniN : Str -> N
|
mestoN : (snom, pgen : Str) -> N
|
||||||
= \s -> lin N (declSTAVENI s) ;
|
= \s,p -> lin N (R.mestoN s) ** {pgen = p} ;
|
||||||
|
srdceN : (snom, pgen : Str) -> N
|
||||||
|
= \s,p -> lin N (R.srdceN s) ** {pgen = p} ;
|
||||||
|
vysvedcenieN : Str -> N
|
||||||
|
= \s -> lin N (R.vysvedcenieN s) ;
|
||||||
|
dievcaN : Str -> N
|
||||||
|
= \s -> lin N (R.dievcaN s) ;
|
||||||
|
dievceniecN : Str -> N
|
||||||
|
= \s -> lin N (R.dievceniecN s) ;
|
||||||
|
|
||||||
-- The full definition of the noun record is
|
-- The full definition of the noun record is
|
||||||
-- {
|
-- {
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ oper
|
|||||||
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" | "ľ" | "ĺ" | "ŕ" | "dz"
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
dropFleetingE : Str -> Str = \s -> case s of {
|
dropFleetingE : Str -> Str = \s -> case s of {
|
||||||
@@ -140,46 +140,52 @@ oper
|
|||||||
-- terminology of CEG
|
-- terminology of CEG
|
||||||
DeclensionType : Type = Str -> NounForms ;
|
DeclensionType : Type = Str -> NounForms ;
|
||||||
|
|
||||||
{- -----
|
declensionNounForms : (snom,pgen : Str) -> Gender -> NounForms
|
||||||
declensionNounForms : (nom,gen : Str) -> Gender -> NounForms
|
= \snom,pgen,g -> case <g, snom, pgen> of {
|
||||||
= \nom,gen,g ->
|
<Masc Anim, _ + "a" , _ + "ov"> => hrdinaN snom ;
|
||||||
let decl : DeclensionType = case <g, nom, gen> of {
|
<Masc _, _ + ("i"|"y"|"e") , _ + "ov"> => ponyN snom ; ----
|
||||||
<Masc Anim, _ + "a" , _ + "u"> => declHRDINA ;
|
<Masc Anim, _ , _ + "ov"> => hrdinaN snom ;
|
||||||
|
|
||||||
<Masc Anim, _ , _ + "a"> => declCHLAP ;
|
<Masc Inanim, _ + #softConsonant, _ + "ov"> => strojN snom ;
|
||||||
<Masc Inanim, _ + #hardConsonant, _ + "u"> => declHRAD ;
|
<Masc Ianim, _ + #hardConsonant, _ + "ov"> => dubN snom ;
|
||||||
<Fem, _ + "a" , _ + "y"> => declZENA ;
|
<Masc Ianim, _ + #neutralConsonant,_ + "ov"> => dubN snom ;
|
||||||
<Neutr, _ + "o" , _ + "a"> => declMESTO ;
|
|
||||||
<Masc Anim, _ + #softConsonant, _ + "e"> => declMUZ ;
|
<Fem, _ + #hardConsonant + "a", _ + #consonant> => zenaN snom ;
|
||||||
<Masc Anim, _ + "tel" , _ + "e"> => declMUZ ;
|
<Fem, _ + #neutralConsonant + "a", _ + #consonant> => zenaN snom ;
|
||||||
<Masc Anim, _ + "ce" , _ + "e"> => declSOUDCE ;
|
<Fem, _ + #softConsonant + "a", _ + #consonant> => ulicaN snom ;
|
||||||
<Masc Inanim, _ + #softConsonant, _ + "e"> => declSTROJ ;
|
<Fem, _ + ("ia"|"ya"), _> => ulicaN snom ;
|
||||||
<Fem, _ + ("e"|"ě") , _ + ("e"|"ě")> => declRUZE ;
|
<Fem, _ + ("c"|"s"|"p"|"v"|"sť"), _ + "í"> => kostN snom pgen ;
|
||||||
<Fem, _ + #softConsonant, _ + "e"> => declPISEN ;
|
<Fem, _ + #consonant , _ + "í"> => dlanN snom pgen ;
|
||||||
<Fem, _ + "ost" , _ + "i"> => declKOST ; --- also many other "st" 3.6.3
|
|
||||||
<Neutr, _ + "e" , _+"ete"> => declKURE ;
|
<Neutr, _ + "o" , _ > => mestoN snom ;
|
||||||
<Neutr, _ + "e" , _ + "e"> => declMORE ;
|
<Neutr, _ + "ie" , _ + "í"> => vysvedcenieN snom ;
|
||||||
<Neutr, _ + "í" , _ + "í"> => declSTAVENI ;
|
<Neutr, _ + "e" , _ > => srdceN snom ;
|
||||||
_ => Predef.error ("cannot infer declension type for" ++ nom ++ gen)
|
<Neutr, _ + ("a"|"ä") , _ + "iec"> => dievceniecN snom ;
|
||||||
}
|
<Neutr, _ + ("a"|"ä") , _ > => dievcaN snom ;
|
||||||
in decl nom ;
|
|
||||||
|
_ => Predef.error ("cannot infer declension type for" ++ snom ++ pgen)
|
||||||
|
} ** {pgen = pgen ; g = g} ;
|
||||||
|
|
||||||
-- the "smartest" one-argument mkN
|
-- the "smartest" one-argument mkN
|
||||||
|
|
||||||
guessNounForms : Str -> NounForms
|
guessNounForms : Str -> NounForms
|
||||||
= \s -> case s of {
|
= \snom -> case snom of {
|
||||||
_ + "ost" => declKOST s ;
|
_ + ("i"|"y"|"e") => ponyN snom ;
|
||||||
_ + "tel" => declMUZ s ;
|
_ + #softConsonant => strojN snom ;
|
||||||
_ + #hardConsonant => declHRAD s ;
|
_ + #hardConsonant => dubN snom ;
|
||||||
_ + #softConsonant => declSTROJ s ;
|
_ + #neutralConsonant => dubN snom ;
|
||||||
_ + "a" => declZENA s ;
|
_ + #hardConsonant + "a" => zenaN snom ;
|
||||||
_ + "o" => declMESTO s ;
|
_ + #neutralConsonant + "a" => zenaN snom ;
|
||||||
_ + "ce" => declSOUDCE s ;
|
_ + #softConsonant + "a" => ulicaN snom ;
|
||||||
_ + "e" => declMORE s ;
|
_ + ("ia"|"ya") => ulicaN snom ;
|
||||||
_ + "í" => declSTAVENI s ;
|
_ + "o" => mestoN snom ;
|
||||||
_ => Predef.error ("cannot guess declension type for" ++ s)
|
_ + "ie" => vysvedcenieN snom ;
|
||||||
|
_ + "e" => srdceN snom ;
|
||||||
|
_ + "ä" => dievcaN snom ;
|
||||||
|
|
||||||
|
_ => Predef.error ("cannot guess declension type for" ++ snom)
|
||||||
} ;
|
} ;
|
||||||
-}
|
|
||||||
|
|
||||||
-- the traditional declensions, in both CEG and Wiki
|
-- the traditional declensions, in both CEG and Wiki
|
||||||
-- they are also exported in ParadigmsSlo with names chlapN etc
|
-- they are also exported in ParadigmsSlo with names chlapN etc
|
||||||
@@ -327,11 +333,8 @@ oper
|
|||||||
g = Fem
|
g = Fem
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
dlanN : DeclensionType = \dlanj ->
|
dlanN : Str -> DeclensionType = \dlanj,dlani ->
|
||||||
let dlan : Str = case dlanj of {
|
let dlan : Str = init dlani
|
||||||
dla + "ň" => dla + "n" ;
|
|
||||||
_ => dlanj ---- TODO many more cases
|
|
||||||
} ;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
snom = dlanj ;
|
snom = dlanj ;
|
||||||
@@ -342,7 +345,7 @@ oper
|
|||||||
sins = dlanj + "ou" ;
|
sins = dlanj + "ou" ;
|
||||||
|
|
||||||
pnom = dlan + "e" ;
|
pnom = dlan + "e" ;
|
||||||
pgen = dlan + "í" ;
|
pgen = dlani ;
|
||||||
pdat = dlan + "iam" ;
|
pdat = dlan + "iam" ;
|
||||||
pacc = dlan + "e" ;
|
pacc = dlan + "e" ;
|
||||||
ploc = dlan + "iach" ;
|
ploc = dlan + "iach" ;
|
||||||
@@ -351,11 +354,8 @@ oper
|
|||||||
g = Fem
|
g = Fem
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
kostN : DeclensionType = \kost' ->
|
kostN : Str -> DeclensionType = \kost',kosti ->
|
||||||
let kost : Str = case kost' of {
|
let kost = init kosti
|
||||||
kos + "ť" => kos + "t" ;
|
|
||||||
_ => kost' ---- TODO more cases
|
|
||||||
} ;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
snom = kost' ;
|
snom = kost' ;
|
||||||
@@ -366,7 +366,7 @@ oper
|
|||||||
sins = kost' + "ou" ;
|
sins = kost' + "ou" ;
|
||||||
|
|
||||||
pnom = kost + "i" ;
|
pnom = kost + "i" ;
|
||||||
pgen = kost + "í" ;
|
pgen = kosti ;
|
||||||
pdat = kost + "iam" ;
|
pdat = kost + "iam" ;
|
||||||
pacc = kost + "i" ;
|
pacc = kost + "i" ;
|
||||||
ploc = kost + "iach" ;
|
ploc = kost + "iach" ;
|
||||||
@@ -457,7 +457,7 @@ oper
|
|||||||
sloc = dievca + "ti" ;
|
sloc = dievca + "ti" ;
|
||||||
sins = dievca + "ťom" ;
|
sins = dievca + "ťom" ;
|
||||||
|
|
||||||
pnom = dievca + "tá" ; ---- TODO alternatives dievčence etc
|
pnom = dievca + "tá" ;
|
||||||
pgen = dievc + "iat" ;
|
pgen = dievc + "iat" ;
|
||||||
pdat = dievca + "tám" ;
|
pdat = dievca + "tám" ;
|
||||||
pacc = dievca + "tá" ;
|
pacc = dievca + "tá" ;
|
||||||
@@ -467,7 +467,17 @@ oper
|
|||||||
g = Neutr
|
g = Neutr
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- with variant plural forms of the previous
|
||||||
|
dievceniecN : DeclensionType = \dievca ->
|
||||||
|
let dievc = init dievca
|
||||||
|
in dievcaN dievca ** {
|
||||||
|
pnom = dievc + "ence" ;
|
||||||
|
pgen = dievc + "eniec" ;
|
||||||
|
pdat = dievc + "encom" ;
|
||||||
|
pacc = dievc + "ence" ;
|
||||||
|
ploc = dievc + "encoch" ;
|
||||||
|
pins = dievc + "encami" ;
|
||||||
|
} ;
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
-- Adjectives
|
-- Adjectives
|
||||||
|
|||||||
Reference in New Issue
Block a user