mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
Latin noun declension complete
This commit is contained in:
@@ -96,17 +96,107 @@ oper
|
|||||||
noun3c : Str -> Str -> Gender -> Noun = \rex,regis,g ->
|
noun3c : Str -> Str -> Gender -> Noun = \rex,regis,g ->
|
||||||
let
|
let
|
||||||
reg = Predef.tk 2 regis ;
|
reg = Predef.tk 2 regis ;
|
||||||
|
rege : Str = case rex of {
|
||||||
|
_ + "e" => reg + "i" ;
|
||||||
|
_ + ("al" | "ar") => rex + "i" ;
|
||||||
|
_ => reg + "e"
|
||||||
|
} ;
|
||||||
regemes : Str * Str = case g of {
|
regemes : Str * Str = case g of {
|
||||||
Neutr => <rex,reg + "a"> ;
|
Neutr => <rex,reg + "a"> ;
|
||||||
_ => <reg + "em", reg + "es">
|
_ => <reg + "em", reg + "es">
|
||||||
} ;
|
} ;
|
||||||
in
|
in
|
||||||
mkNoun
|
mkNoun
|
||||||
rex regemes.p1 (reg + "is") (reg + "i") (reg + "e") rex
|
rex regemes.p1 (reg + "is") (reg + "i") rege rex
|
||||||
regemes.p2 regemes.p2 (reg + "um") (reg + "ibus")
|
regemes.p2 regemes.p2 (reg + "um") (reg + "ibus")
|
||||||
g ;
|
g ;
|
||||||
|
|
||||||
|
|
||||||
|
noun3 : Str -> Noun = \labor ->
|
||||||
|
case labor of {
|
||||||
|
_ + "r" => noun3c labor (labor + "is") Masc ;
|
||||||
|
fl + "os" => noun3c labor (fl + "oris") Masc ;
|
||||||
|
lim + "es" => noun3c labor (lim + "itis") Masc ;
|
||||||
|
cod + "ex" => noun3c labor (cod + "icis") Masc ;
|
||||||
|
poem + "a" => noun3c labor (poem + "atis") Neutr ;
|
||||||
|
calc + "ar" => noun3c labor (calc + "aris") Neutr ;
|
||||||
|
mar + "e" => noun3c labor (mar + "is") Neutr ;
|
||||||
|
car + "men" => noun3c labor (car + "minis") Neutr ;
|
||||||
|
rob + "ur" => noun3c labor (rob + "oris") Neutr ;
|
||||||
|
temp + "us" => noun3c labor (temp + "oris") Neutr ;
|
||||||
|
vers + "io" => noun3c labor (vers + "ionis") Fem ;
|
||||||
|
imag + "o" => noun3c labor (imag + "inis") Fem ;
|
||||||
|
ae + "tas" => noun3c labor (ae + "tatis") Fem ;
|
||||||
|
vo + "x" => noun3c labor (vo + "cis") Fem ;
|
||||||
|
pa + "rs" => noun3c labor (pa + "rtis") Fem ;
|
||||||
|
cut + "is" => noun3c labor (cut + "is") Fem ;
|
||||||
|
urb + "s" => noun3c labor (urb + "is") Fem ;
|
||||||
|
_ => Predef.error ("noun3 does not apply to" ++ labor)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
noun4us : Str -> Noun = \fructus ->
|
||||||
|
let
|
||||||
|
fructu = init fructus ;
|
||||||
|
fruct = init fructu
|
||||||
|
in
|
||||||
|
mkNoun
|
||||||
|
fructus (fructu + "m") fructus (fructu + "i") fructu fructus
|
||||||
|
fructus fructus (fructu + "um") (fruct + "ibus")
|
||||||
|
Masc ;
|
||||||
|
|
||||||
|
noun4u : Str -> Noun = \cornu ->
|
||||||
|
let
|
||||||
|
corn = init cornu ;
|
||||||
|
cornua = cornu + "a"
|
||||||
|
in
|
||||||
|
mkNoun
|
||||||
|
cornu cornu (cornu + "s") (cornu + "i") cornu cornu
|
||||||
|
cornua cornua (cornu + "um") (corn + "ibus")
|
||||||
|
Neutr ;
|
||||||
|
|
||||||
|
noun5 : Str -> Noun = \res ->
|
||||||
|
let
|
||||||
|
re = init res ;
|
||||||
|
rei = re + "i"
|
||||||
|
in
|
||||||
|
mkNoun
|
||||||
|
res (re+ "m") rei rei re res
|
||||||
|
res res (re + "rum") (re + "bus")
|
||||||
|
Fem ;
|
||||||
|
|
||||||
|
-- to change the default gender
|
||||||
|
|
||||||
|
nounWithGen : Gender -> Noun -> Noun = \g,n ->
|
||||||
|
{s = n.s ; g = g} ;
|
||||||
|
|
||||||
|
-- smart paradigms
|
||||||
|
|
||||||
|
noun_ngg : Str -> Str -> Gender -> Noun = \verbum,verbi,g ->
|
||||||
|
let s : Noun = case <verbum,verbi> of {
|
||||||
|
<_ + "a", _ + "ae"> => noun1 verbum ;
|
||||||
|
<_ + "us", _ + "i"> => noun2us verbum ;
|
||||||
|
<_ + "um", _ + "i"> => noun2um verbum ;
|
||||||
|
<_ + "er", _ + "i"> => noun2er verbum ;
|
||||||
|
<_ + "us", _ + "us"> => noun4us verbum ;
|
||||||
|
<_ + "u", _ + "us"> => noun4u verbum ;
|
||||||
|
<_ + "es", _ + "ei"> => noun5 verbum ;
|
||||||
|
_ => noun3c verbum verbi g
|
||||||
|
}
|
||||||
|
in
|
||||||
|
nounWithGen g s ;
|
||||||
|
|
||||||
|
noun : Str -> Noun = \verbum ->
|
||||||
|
case verbum of {
|
||||||
|
_ + "a" => noun1 verbum ;
|
||||||
|
_ + "us" => noun2us verbum ;
|
||||||
|
_ + "um" => noun2um verbum ;
|
||||||
|
_ + "er" => noun2er verbum ;
|
||||||
|
_ + "u" => noun4u verbum ;
|
||||||
|
_ + "es" => noun5 verbum ;
|
||||||
|
_ => noun3 verbum
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- adjectives
|
-- adjectives
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user