1
0
forked from GitHub/gf-rgl

the names API in more languages

This commit is contained in:
Krasimir Angelov
2023-08-16 19:39:22 +02:00
parent d25d648134
commit 6bc965f6c2
69 changed files with 1584 additions and 270 deletions

View File

@@ -83,6 +83,9 @@ concrete CatAfr of Cat =
N = Noun ; N = Noun ;
N2 = {s : NForm => Str ; g : Gender} ** {c2 : Preposition} ; N2 = {s : NForm => Str ; g : Gender} ** {c2 : Preposition} ;
N3 = {s : NForm => Str ; g : Gender} ** {c2,c3 : Preposition} ; N3 = {s : NForm => Str ; g : Gender} ** {c2,c3 : Preposition} ;
GN, SN, LN, PN = {s : NPCase => Str} ; PN = {s : NPCase => Str} ;
GN = {s : NPCase => Str; g : Sex} ;
SN = {s : Sex => NPCase => Str; pl : NPCase => Str} ;
LN = {s : Adjf => NPCase => Str ; hasArt : Bool ; n : Number} ;
} }

View File

@@ -29,9 +29,9 @@ lin
} ; } ;
InflectionLN = \ln -> { InflectionLN = \ln -> {
t = "ln" ; t = "pn" ;
s1 = heading1 "Naam" ; s1 = heading1 "Naam" ;
s2 = paragraph (ln.s ! NPNom) s2 = paragraph (ln.s ! Strong ! NPNom)
} ; } ;
InflectionGN = \pn -> { InflectionGN = \pn -> {
@@ -43,7 +43,7 @@ lin
InflectionSN = \pn -> { InflectionSN = \pn -> {
t = "van" ; t = "van" ;
s1 = heading1 "Van" ; s1 = heading1 "Van" ;
s2 = paragraph (pn.s ! NPNom) s2 = paragraph (pn.s ! Male ! NPNom)
} ; } ;
InflectionA, InflectionA2 = \adj -> InflectionA, InflectionA2 = \adj ->

View File

@@ -1,9 +1,40 @@
concrete NamesAfr of Names = CatAfr ** open ResAfr, Prelude in { concrete NamesAfr of Names = CatAfr ** open ResAfr, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> {s = n.s ; a = agrP3 Sg ; isPron = False} ; lin GivenName = \n -> {s = n.s ; a = agrP3 Sg ; isPron = False} ;
lin FullName gn sn = lin MaleSurname = \n -> {s = n.s ! Male ; a = agrP3 Sg ; isPron = False} ;
{s = \\c => gn.s ! NPNom ++ sn.s ! c ; a = agrP3 Sg ; isPron = False} ; lin FemaleSurname = \n -> {s = n.s ! Female; a = agrP3 Sg ; isPron = False} ;
lin PlSurname = \n -> {s = n.pl ; a = agrP3 Sg ; isPron = False} ;
lin UseLN pn = {s = pn.s ; a = agrP3 Sg ; isPron = False} ; lin FullName gn sn =
{s = \\c => gn.s ! NPNom ++ sn.s ! gn.g ! c ; a = agrP3 Sg ; isPron = False} ;
lin UseLN ln = {
s = \\c => case ln.hasArt of {
True => "die" ++ ln.s ! Weak ! c ;
False => ln.s ! Strong ! c
} ;
a = agrP3 ln.n ;
isPron = False
} ;
PlainLN ln = {
s = \\c => ln.s ! Strong ! c ;
a = agrP3 ln.n ;
isPron = False
} ;
InLN ln = {
s = appPrep "in" (\\c => case ln.hasArt of {
True => "die" ++ ln.s ! Weak ! c ;
False => ln.s ! Strong ! c
})
} ;
AdjLN ap ln = ln ** {
s = \\a,c =>
preOrPost ap.isPre
(ap.s ! agrAdj Neutr a (NF ln.n Nom))
(ln.s ! a ! c) ;
} ;
} }

View File

@@ -73,6 +73,25 @@ oper
mkPN : Str -> PN ; -- proper name mkPN : Str -> PN ; -- proper name
} ; } ;
mkGN = overload { -- given name
mkGN : Str -> GN = \s -> lin GN {s = \\_ => s; g = Male} ;
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s = \\_ => s; g = g} ;
} ;
mkSN = overload { -- given name
mkSN : Str -> SN = \s -> lin SN {s = \\_,_ => s; pl = \\_=>s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Male=>\\_=>male; Female=>\\_=>female}; pl=\\_=>pl} ;
} ;
mkLN = overload {
mkLN : Str -> LN -- location name
= \s -> lin LN {s = \\_,_ => s; hasArt = False; n = Sg} ;
mkLN : Str -> Number -> LN -- location name
= \s,n -> lin LN {s = \\_,_ => s; hasArt = False; n = n} ;
} ;
defLN : LN -> LN = \n -> n ** {hasArt = True} ;
--2 Adjectives --2 Adjectives
@@ -205,6 +224,8 @@ oper
feminine = Neutr ; feminine = Neutr ;
het,neuter = Neutr ; het,neuter = Neutr ;
de,utrum = Neutr ; de,utrum = Neutr ;
male = Male ;
female = Female ;
mkA = overload { mkA = overload {
mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ; mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ;

View File

@@ -88,7 +88,7 @@ concrete CatBul of Cat = CommonX - [IAdv,AdV] ** open ResBul, Prelude, Predef, (
N3 = {s : NForm => Str; rel : AForm => Str; relType : NRelType; g : AGender} ** {c2,c3 : Preposition} ; N3 = {s : NForm => Str; rel : AForm => Str; relType : NRelType; g : AGender} ** {c2,c3 : Preposition} ;
GN = {s : Str; g : Sex} ; GN = {s : Str; g : Sex} ;
SN = {s : Sex => Str; pl : Str} ; SN = {s : Sex => Str; pl : Str} ;
LN = {s : Species => Str; c : Preposition; gn : GenNum} ; LN = {s : Species => Str; onPrep : Bool; gn : GenNum} ;
PN = {s : Str; gn : GenNum} ; PN = {s : Str; gn : GenNum} ;
lindef lindef

View File

@@ -103,7 +103,11 @@ lin
}) ; }) ;
s2 = paragraph (n.s ! Indef) ++ s2 = paragraph (n.s ! Indef) ++
heading1 ("Наречие") ++ heading1 ("Наречие") ++
paragraph (n.c.s ++ linCase n.c.c Pos ++ n.s ! Def) ; paragraph (case n.onPrep of {
True => linCase Dat Pos ;
False => vyv_Str
} ++
n.s ! Def) ;
s3 = "" s3 = ""
} ; } ;
@@ -160,7 +164,7 @@ lin
} ; } ;
InflectionPrep = \prep -> { InflectionPrep = \prep -> {
t = "пр" ; t = "пред" ;
s1= heading1 ("Предлог") ; s1= heading1 ("Предлог") ;
s2= paragraph (prep.s) ; s2= paragraph (prep.s) ;
s3= "" s3= ""

View File

@@ -292,16 +292,16 @@ oper
} ; } ;
mkLN = overload { mkLN = overload {
mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = GSg Masc} ; mkLN : Str -> LN = \s -> lin LN {s = \\_ => s; onPrep = False; gn = GSg Masc} ;
mkLN : Str -> Gender -> LN = mkLN : Str -> Gender -> LN =
\s,g -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = GSg g} ; \s,g -> lin LN {s = \\_ => s; onPrep = False; gn = GSg g} ;
mkLN : Str -> GenNum -> LN = mkLN : Str -> GenNum -> LN =
\s,gn -> lin LN {s = \\_ => s; c = {s = vyv_Str; c = CPrep}; gn = gn} ; \s,gn -> lin LN {s = \\_ => s; onPrep = False; gn = gn} ;
mkLN : Str -> Str -> GenNum -> LN = mkLN : Str -> Str -> GenNum -> LN =
\s1,s2,gn -> lin LN {s = table Species [s2; s1]; c = {s = vyv_Str; c = CPrep}; gn = gn} ; \s1,s2,gn -> lin LN {s = table Species [s2; s1]; onPrep = False; gn = gn} ;
} ; } ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {c = p} ; onLN : LN -> LN = \n -> n ** {onPrep = True} ;
--2 IAdv --2 IAdv
-- --

View File

@@ -1,4 +1,4 @@
concrete NamesBul of Names = CatBul ** open ResBul in { concrete NamesBul of Names = CatBul ** open ResBul, Prelude in {
lin GivenName = \n -> { lin GivenName = \n -> {
s = table { RObj c => linCase c Pos ++ n.s; s = table { RObj c => linCase c Pos ++ n.s;
@@ -44,7 +44,13 @@ lin UseLN, PlainLN = \n -> {
p = NounP3 Pos p = NounP3 Pos
} ; } ;
InLN n = {s = n.c.s ++ linCase n.c.c Pos ++ n.s ! Def} ; InLN n = {
s = case n.onPrep of {
True => linCase Dat Pos ;
False => vyv_Str
} ++
n.s ! Def
} ;
AdjLN ap n = n ** { AdjLN ap n = n ** {
s = \\sp => case ap.isPre of { s = \\sp => case ap.isPre of {

View File

@@ -47,7 +47,6 @@ resource ResBul = ParamX ** open Prelude, Predef in {
param param
Gender = Masc | Fem | Neut ; Gender = Masc | Fem | Neut ;
Sex = Male | Female ;
Species = Indef | Def ; Species = Indef | Def ;

View File

@@ -40,6 +40,42 @@ lin
) )
} ; } ;
InflectionGN = \gn -> {
t = "pn" ;
s1 = heading1 ("Prenom" ++
case gn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = gn.s
} ;
InflectionSN = \gn -> {
t = "pn" ;
s1 = heading1 "Família" ;
s2 = gn.s ! Masc
} ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Nom Propi" ++
case pn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = pn.s
} ;
InflectionLN = \ln -> {
t = "nl" ;
s1 = heading1 ("Nom de la Ubicació" ++
case ln.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = paragraph ln.s
} ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "a" ;
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;

View File

@@ -1,9 +1,41 @@
concrete NamesCat of Names = CatCat ** open ResCat in { concrete NamesCat of Names = CatCat ** open ResCat, CommonRomance, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> pn2np n ; lin GivenName = \n -> pn2np n ;
lin MaleSurname = \n -> pn2np {s = n.s ! Masc; g = Masc} ;
lin FemaleSurname = \n -> pn2np {s = n.s ! Fem; g = Fem} ;
lin PlSurname = \n -> heavyNPpol False {
s = \\c => prepCase c ++ n.pl ;
a = agrP3 Masc Pl
} ;
lin FullName gn sn = pn2np { lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ; s = gn.s ++ sn.s ! gn.g ;
g = gn.g g = gn.g
} ; } ;
lin PlainLN n = heavyNP {
s = \\c => n.s;
a = {g = n.g ; n = n.num ; p = P3}
} ;
lin UseLN n = heavyNP {
s = \\c => case n.art of {
UseArt => artDef True n.g n.num c ++ n.s ;
_ => n.s
} ;
a = {g = n.g ; n = n.num ; p = P3}
} ;
lin InLN n = {
s = "en" ++ case n.art of {
UseArt => artDef True n.g n.num Acc ++ n.s;
_ => prepCase Acc ++ n.s
} ;
} ;
lin AdjLN ap n = n ** {
s = preOrPost ap.isPre (ap.s ! AF n.g n.num) n.s ;
} ;
} }

View File

@@ -139,12 +139,39 @@ oper
mkPN : N -> PN ; mkPN : N -> PN ;
} ; } ;
mkLN : Str -> LN = \s -> mkGN = overload {
lin LN {s = s ; mkGN : (Anna : Str) -> GN = \s -> lin GN (regPN s) ; -- feminine for "-a", otherwise masculine
p = {s=""; c=CPrep P_a; isDir=True} ; mkGN : (Pilar : Str) -> Gender -> GN = \s,g -> lin GN (mk2PN s g) ; -- force gender
art = NoArt ; } ;
g = Masc ;
num = Sg} ; mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_ => s; pl = s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Masc=>male; Fem=>female}; pl = pl} ;
} ;
mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = s ;
onPrep=False ;
art = NoArt ;
g = Masc ;
num = Sg} ;
mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ;
onPrep=False ;
art = NoArt ;
g = g ;
num = Sg} ;
mkLN : Str -> Gender -> Number -> LN = \s,g,n ->
lin LN {s = s ;
onPrep=False ;
art = NoArt ;
g = g ;
num = n}
} ;
defLN : LN -> LN = \n -> n ** {art = UseArt} ;
--2 Adjectives --2 Adjectives
@@ -308,6 +335,8 @@ oper
CopulaType = DiffCat.CopulaType ; CopulaType = DiffCat.CopulaType ;
masculine = Masc ; masculine = Masc ;
feminine = Fem ; feminine = Fem ;
male = Masc ;
female = Fem ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
serCopula = DiffCat.serCopula ; serCopula = DiffCat.serCopula ;

View File

@@ -112,26 +112,26 @@ lin
} ; } ;
InflectionPN = \n -> { InflectionPN = \n -> {
t = "v" ; t = "pn" ;
s1 = heading1 "Proper Name" ; s1 = heading1 "Proper Name" ;
s2 = n.s s2 = n.s
} ; } ;
InflectionLN = \n -> { InflectionLN = \n -> {
t = "v" ; t = "pn" ;
s1 = heading1 "Location Name" ; s1 = heading1 "Location Name" ;
s2 = n.s s2 = n.s
} ; } ;
InflectionGN = \n -> { InflectionGN = \n -> {
t = "v" ; t = "pn" ;
s1 = heading1 "Given Name" ; s1 = heading1 "Given Name" ;
s2 = n.s s2 = n.s
} ; } ;
InflectionSN = \n -> { InflectionSN = \n -> {
t = "v" ; t = "pn" ;
s1 = heading1 "Surname Name" ; s1 = heading1 "Family Name" ;
s2 = n.s s2 = n.s
} ; } ;

View File

@@ -1,4 +1,4 @@
concrete NamesChi of Names = CatChi ** { concrete NamesChi of Names = CatChi ** open ResChi, ParadigmsChi, Prelude in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ** {det = []} ; lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ** {det = []} ;
lin FullName gn sn = { lin FullName gn sn = {
@@ -6,6 +6,10 @@ lin FullName gn sn = {
det = [] det = []
} ; } ;
lin UseLN pn = pn ** {det = []} ; lin UseLN ln = ln ** {det = []} ;
lin InLN ln =
let prep : Prep = mkPrep "里" []
in ss (appPrep prep (linNP (ln ** {det = []}))) ** {advType = prep.advType ; hasDe = prep.hasDe} ; --- should depend on np too ?
} }

View File

@@ -18,6 +18,9 @@ resource ParamX = open Prelude in {
| Cond --# notpresent | Cond --# notpresent
; ;
param
Sex = Male | Female ;
param param
Polarity = Pos | Neg ; Polarity = Pos | Neg ;

View File

@@ -81,6 +81,9 @@ concrete CatDut of Cat =
N = Noun ; N = Noun ;
N2 = {s : NForm => Str ; g : Gender} ** {c2 : Preposition} ; N2 = {s : NForm => Str ; g : Gender} ** {c2 : Preposition} ;
N3 = {s : NForm => Str ; g : Gender} ** {c2,c3 : Preposition} ; N3 = {s : NForm => Str ; g : Gender} ** {c2,c3 : Preposition} ;
GN, SN, LN, PN = {s : NPCase => Str} ; PN = {s : NPCase => Str} ;
GN = {s : NPCase => Str; g : Sex} ;
SN = {s : Sex => NPCase => Str; pl : NPCase => Str} ;
LN = {s : Adjf => NPCase => Str ; hasArt : Bool ; n : Number} ;
} }

View File

@@ -36,6 +36,30 @@ lin
) )
} ; } ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 "Naam" ;
s2 = paragraph (pn.s ! NPNom)
} ;
InflectionLN = \ln -> {
t = "pn" ;
s1 = heading1 "Naam" ;
s2 = paragraph (ln.s ! Strong ! NPNom)
} ;
InflectionGN = \pn -> {
t = "vnm" ;
s1 = heading1 "Voornaam" ;
s2 = paragraph (pn.s ! NPNom)
} ;
InflectionSN = \pn -> {
t = "van" ;
s1 = heading1 "Van" ;
s2 = paragraph (pn.s ! Male ! NPNom)
} ;
InflectionA, InflectionA2 = \adj -> InflectionA, InflectionA2 = \adj ->
let let
gforms : AForm -> Str = \a -> gforms : AForm -> Str = \a ->
@@ -61,7 +85,7 @@ lin
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> { InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
t = "adv" ; t = "adv" ;
s1 = heading1 (heading preposition_Category) ; s1 = heading1 "Bijwoord" ;
s2 = paragraph adv.s s2 = paragraph adv.s
} ; } ;

View File

@@ -1,9 +1,43 @@
concrete NamesDut of Names = CatDut ** open Prelude, ResDut in { concrete NamesDut of Names = CatDut ** open Prelude, ResDut in {
lin GivenName, MaleSurname, FemaleSurname = \n -> noMerge ** {s = n.s ; a = agrP3 Sg ; isPron = False} ; lin GivenName = \n -> noMerge ** {s = n.s ; a = agrP3 Sg ; isPron = False} ;
lin MaleSurname = \n -> noMerge ** {s = n.s ! Male ; a = agrP3 Sg ; isPron = False} ;
lin FemaleSurname = \n -> noMerge ** {s = n.s ! Female; a = agrP3 Sg ; isPron = False} ;
lin PlSurname = \n -> noMerge ** {s = n.pl ; a = agrP3 Sg ; isPron = False} ;
lin FullName gn sn = lin FullName gn sn =
noMerge ** {s = \\c => gn.s ! NPNom ++ sn.s ! c ; a = agrP3 Sg ; isPron = False} ; noMerge ** {s = \\c => gn.s ! NPNom ++ sn.s ! gn.g ! c ; a = agrP3 Sg ; isPron = False} ;
lin UseLN pn = noMerge ** {s = pn.s ; a = agrP3 Sg ; isPron = False} ; lin UseLN ln = noMerge ** {
s = \\c => case ln.hasArt of {
True => "de" ++ ln.s ! Weak ! c ;
False => ln.s ! Strong ! c
} ;
a = agrP3 ln.n ;
isPron = False
} ;
lin PlainLN ln = noMerge ** {
s = \\c => ln.s ! Strong ! c ;
a = agrP3 ln.n ;
isPron = False
} ;
lin InLN ln = {
s = "in" ++ case ln.hasArt of {
True => "de" ++ ln.s ! Weak ! NPAcc ;
False => ln.s ! Strong ! NPAcc
}
} ;
lin AdjLN ap ln = ln ** {
s = \\a,c =>
let gan : Gender*Adjf*NForm = case ap.isPre of {
True => <Utr,a,NF ln.n Nom> ;
False => <Neutr,Strong,NF Sg Nom> } ;
af = agrAdj gan.p1 gan.p2 gan.p3 ;
in preOrPost ap.isPre
(ap.s ! agrP3 Sg ! af)
(ln.s ! a ! c) ;
} ;
} }

View File

@@ -76,6 +76,24 @@ oper
mkPN : N -> PN ; -- proper name from noun mkPN : N -> PN ; -- proper name from noun
} ; } ;
mkGN = overload { -- given name
mkGN : Str -> GN = \s -> lin GN {s = \\_ => s; g = Male} ;
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s = \\_ => s; g = g} ;
} ;
mkSN = overload { -- given name
mkSN : Str -> SN = \s -> lin SN {s = \\_,_ => s; pl = \\_=>s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Male=>\\_=>male; Female=>\\_=>female}; pl=\\_=>pl} ;
} ;
mkLN = overload {
mkLN : Str -> LN -- location name
= \s -> lin LN {s = \\_,_ => s; hasArt = False; n = Sg} ;
mkLN : Str -> Number -> LN -- location name
= \s,n -> lin LN {s = \\_,_ => s; hasArt = False; n = n} ;
} ;
defLN : LN -> LN = \n -> n ** {hasArt = True} ;
--2 Adjectives --2 Adjectives
@@ -249,6 +267,10 @@ oper
de,utrum = Utr ; de,utrum = Utr ;
nominative = Nom ; nominative = Nom ;
genitive = Gen ; genitive = Gen ;
male = Male ;
female = Female ;
singular = Sg ;
plural = Pl ;
mkA = overload { mkA = overload {
mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ; mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ;

View File

@@ -106,9 +106,11 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
N = {s : Number => Case => Str ; g : Gender} ; N = {s : Number => Case => Str ; g : Gender} ;
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ; N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ;
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ; N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ;
GN, SN, PN = {s : Case => Str ; g : Gender} ; PN = {s : Case => Str ; g : Gender} ;
GN = {s : Case => Str ; g : Sex} ;
SN = {s : Sex => Case => Str; p : Case => Str} ;
LN = {s : Case => Str; LN = {s : Case => Str;
p : Str; -- preposition "in Scandinavia", "on the Balkans" prep : LNPrep; -- preposition "in Scandinavia", "on the Balkans", "at the South Pole"
art : Bool; -- plain name "United States" vs "the United States" art : Bool; -- plain name "United States" vs "the United States"
n : Number; n : Number;
} ; } ;

View File

@@ -50,36 +50,36 @@ lin
tr (td (n.s ! Nom) ++ td (n.s ! Gen)) tr (td (n.s ! Nom) ++ td (n.s ! Gen))
) ++ ) ++
heading1 ("Adverb") ++ heading1 ("Adverb") ++
paragraph (n.p ++ case n.art of { paragraph (case n.prep of {
True => "the" ++ n.s ! Nom ; InPrep => "in" ;
False => n.s ! Nom}) ; OnPrep => "on" ;
AtPrep => "at"
} ++
case n.art of {
True => "the" ++ n.s ! Nom ;
False => n.s ! Nom
}) ;
} ; } ;
InflectionGN = \pn -> { InflectionGN = \gn -> {
t = "gn" ; t = "gn" ;
s1 = heading1 ("Given Name" ++ s1 = heading1 ("Given Name" ++
case pn.g of { case gn.g of {
Neutr => ""; Male => "(male)";
Masc => "(masc)"; Female => "(female)"
Fem => "(fem)"
}) ; }) ;
s2 = frameTable ( s2 = frameTable (
tr (th "nom" ++ th "gen") ++ tr (th "nom" ++ th "gen") ++
tr (td (pn.s ! Nom) ++ td (pn.s ! Gen)) tr (td (gn.s ! Nom) ++ td (gn.s ! Gen))
) )
} ; } ;
InflectionSN = \pn -> { InflectionSN = \pn -> {
t = "sn" ; t = "sn" ;
s1 = heading1 ("Secondary Name" ++ s1 = heading1 "Secondary Name" ;
case pn.g of {
Neutr => "";
Masc => "(masc)";
Fem => "(fem)"
}) ;
s2 = frameTable ( s2 = frameTable (
tr (th "nom" ++ th "gen") ++ tr (th "nom" ++ th "gen") ++
tr (td (pn.s ! Nom) ++ td (pn.s ! Gen)) tr (td (pn.s ! Male ! Nom) ++ td (pn.s ! Male ! Gen))
) )
} ; } ;

View File

@@ -1,8 +1,22 @@
concrete NamesEng of Names = CatEng ** open Prelude, ResEng in { concrete NamesEng of Names = CatEng ** open Prelude, ResEng in {
lin GivenName gn = {s = \\c => gn.s ! npcase2case c ; a = agrgP3 Sg gn.g} ; lin GivenName gn = {
lin MaleSurname, FemaleSurname = \sn -> {s = \\c => sn.s ! npcase2case c ; a = agrgP3 Sg sn.g} ; s = \\c => gn.s ! npcase2case c ;
lin FullName gn sn = {s = \\c => gn.s ! Nom ++ sn.s ! npcase2case c ; a = agrgP3 Sg gn.g} ; a = case gn.g of {
Male => agrgP3 Sg Masc ;
Female => agrgP3 Sg Fem
}
} ;
lin MaleSurname = \sn -> {s = \\c => sn.s ! Male ! npcase2case c ; a = agrgP3 Sg Masc} ;
lin FemaleSurname = \sn -> {s = \\c => sn.s ! Female ! npcase2case c ; a = agrgP3 Sg Fem} ;
lin PlSurname = \sn -> {s = \\c => sn.p ! npcase2case c ; a = agrgP3 Pl Masc} ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! npcase2case c ;
a = case gn.g of {
Male => agrgP3 Sg Masc ;
Female => agrgP3 Sg Fem
}
} ;
lin UseLN n = { lin UseLN n = {
s = \\c => case n.art of { s = \\c => case n.art of {
@@ -18,10 +32,15 @@ lin PlainLN n = {
} ; } ;
lin InLN n = { lin InLN n = {
s = n.p ++ case n.art of { s = case n.prep of {
True => "the" ++ n.s ! Nom ; InPrep => "in" ;
False => n.s ! Nom OnPrep => "on" ;
} ; AtPrep => "at"
} ++
case n.art of {
True => "the" ++ n.s ! Nom ;
False => n.s ! Nom
} ;
} ; } ;
lin AdjLN ap n = n ** { lin AdjLN ap n = n ** {

View File

@@ -130,23 +130,6 @@ oper
-- Proper names, with a regular genitive, are formed from strings. -- Proper names, with a regular genitive, are formed from strings.
oper oper
mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
p = "in" ;
art = False ;
n = Sg} ;
mkLN : Str -> Number -> LN = \s,n ->
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
p = "in" ;
art = False ;
n = n} ;
} ;
defLN : LN -> LN = \n -> n ** {art = True} ;
prepLN : LN -> Str -> LN = \n,s -> n ** {p = s} ;
mkPN : overload { mkPN : overload {
mkPN : Str -> PN ; mkPN : Str -> PN ;
@@ -157,6 +140,47 @@ oper
mkPN : N -> PN --% mkPN : N -> PN --%
} ; } ;
mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
prep = InPrep ;
art = False ;
n = Sg} ;
mkLN : Str -> Number -> LN = \s,n ->
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
prep = InPrep ;
art = False ;
n = n} ;
} ;
defLN : LN -> LN = \n -> n ** {art = True} ;
onLN : LN -> LN = \n -> n ** {prep = OnPrep} ;
atLN : LN -> LN = \n -> n ** {prep = AtPrep} ;
mkGN = overload {
mkGN : Str -> GN = \s ->
lin GN {s = table {Gen => s + "'s" ; _ => s} ;
g = Male} ;
mkGN : Str -> Sex -> GN = \s,g ->
lin GN {s = table {Gen => s + "'s" ; _ => s} ;
g = g} ;
} ;
mkSN = overload {
mkSN : Str -> SN = \s ->
lin SN {s = \\_ => table {Gen => s + "'s" ; _ => s} ;
p = table {Gen => s + "'s" ; _ => s}} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl ->
lin SN {s = table {
Male => table {Gen => male + "'s" ; _ => male} ;
Female => table {Gen => female + "'s" ; _ => female}
} ;
p = table {Gen => pl + "'s" ; _ => pl}
} ;
} ;
-- To extract the number of a noun phrase -- To extract the number of a noun phrase
ifPluralNP : NP -> Bool ifPluralNP : NP -> Bool
@@ -397,6 +421,8 @@ mkVoc s = lin Voc (ss s) ;
nonhuman = Neutr ; nonhuman = Neutr ;
masculine = Masc ; masculine = Masc ;
feminine = Fem ; feminine = Fem ;
male = Male ;
female = Female ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
nominative = npNom ; nominative = npNom ;

View File

@@ -690,4 +690,7 @@ param
finalComma : Str = pre {"," | "." => []; "" => SOFT_BIND ++ ","; _ => []} ; finalComma : Str = pre {"," | "." => []; "" => SOFT_BIND ++ ","; _ => []} ;
frontComma : Str = SOFT_BIND ++ "," ; frontComma : Str = SOFT_BIND ++ "," ;
param
LNPrep = InPrep | OnPrep | AtPrep ;
} }

View File

@@ -91,7 +91,10 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
c2,c3 : Compl ; c2,c3 : Compl ;
isPre,isPre2 : Bool isPre,isPre2 : Bool
} ; } ;
GN, SN, LN, PN = {s : Case => Str} ; PN = {s : Case => Str} ;
LN = {s : Case => Str; n : Number} ;
GN = {s : Case => Str; g : Sex} ;
SN = {s : Sex => Case => Str; pl : Case => Str} ;
linref linref
VP = \vp -> linV vp.v ; VP = \vp -> linV vp.v ;

View File

@@ -36,6 +36,33 @@ lin
s2 = inflNoun (caseplus2nf noun) s2 = inflNoun (caseplus2nf noun)
} ; } ;
InflectionPN = \pn -> {
t = "s" ;
s1 = heading1 "Õige Nimi" ;
s2 = inflPN pn.s
} ;
InflectionLN = \ln -> {
t = "s" ;
s1 = heading1 "Asukoha Nimi" ;
s2 = inflPN ln.s
} ;
InflectionGN = \gn -> {
t = "s" ;
s1 = heading1 "Eesnimi"++case gn.g of {
Male => "(mees)" ;
Female => "(naine)"
} ;
s2 = inflPN gn.s
} ;
InflectionSN = \sn -> {
t = "s" ;
s1 = heading1 "Perekonnanimi" ;
s2 = inflPN (sn.s ! Male)
} ;
InflectionA, InflectionA2 = \adj -> InflectionA, InflectionA2 = \adj ->
let posit : (AForm => Str) = adj.s ! Posit ; let posit : (AForm => Str) = adj.s ! Posit ;
compar : (AForm => Str) = adj.s ! Compar ; compar : (AForm => Str) = adj.s ! Compar ;
@@ -272,6 +299,20 @@ oper
tr (th (heading instructive_Parameter) ++ td (nouns Sg Terminative) ++ td (nouns Pl Terminative)) tr (th (heading instructive_Parameter) ++ td (nouns Sg Terminative) ++ td (nouns Pl Terminative))
) ; ) ;
inflPN : (ResEst.Case => Str) -> Str = \pn ->
frameTable (
tr (th (heading nominative_Parameter) ++ td (pn ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (pn ! Gen)) ++
tr (th (heading partitive_Parameter) ++ td (pn ! Part)) ++
tr (th (heading translative_Parameter) ++ td (pn ! Transl)) ++
tr (th (heading illative_Parameter) ++ td (pn ! Illat)) ++
tr (th (heading inessive_Parameter) ++ td (pn ! Iness)) ++
tr (th (heading elative_Parameter) ++ td (pn ! Elat)) ++
tr (th (heading allative_Parameter) ++ td (pn ! Allat)) ++
tr (th (heading adessive_Parameter) ++ td (pn ! Adess)) ++
tr (th (heading ablative_Parameter) ++ td (pn ! Ablat))
) ;
lin lin
NoDefinition t = {s=t.s}; NoDefinition t = {s=t.s};
MkDefinition t d = {s="<p><b>Definitsioon:</b>"++t.s++d.s++"</p>"}; MkDefinition t d = {s="<p><b>Definitsioon:</b>"++t.s++d.s++"</p>"};

View File

@@ -1,20 +1,44 @@
concrete NamesEst of Names = CatEst ** open ResEst, Prelude in { concrete NamesEst of Names = CatEst ** open ResEst, ParadigmsEst, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> emptyNP ** { lin GivenName n = emptyNP ** {
s = \\c => n.s ! npform2case Sg c ; s = \\c => n.s ! npform2case Sg c ;
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False isPron = False
} ; } ;
lin MaleSurname n = emptyNP ** {
s = \\c => n.s ! Male ! npform2case Sg c ;
a = agrP3 Sg ;
isPron = False
} ;
lin FemaleSurname n = emptyNP ** {
s = \\c => n.s ! Female ! npform2case Sg c ;
a = agrP3 Sg ;
isPron = False
} ;
lin PlSurname n = emptyNP ** {
s = \\c => n.pl ! npform2case Sg c ;
a = agrP3 Pl ;
isPron = False
} ;
lin FullName gn sn = emptyNP ** { lin FullName gn sn = emptyNP ** {
s = \\c => gn.s ! Nom ++ sn.s ! npform2case Sg c ; s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! npform2case Sg c ;
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False isPron = False
} ; } ;
lin UseLN pn = emptyNP ** { lin UseLN, PlainLN = \ln -> emptyNP ** {
s = \\c => pn.s ! npform2case Sg c ; s = \\c => ln.s ! npform2case Sg c ;
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False isPron = False
} ; } ;
lin InLN pn = {
s = appCompl True Pos (casePrep inessive)
(emptyNP ** {
s = \\c => pn.s ! npform2case Sg c ;
a = agrP3 Sg ;
isPron = False
})
} ;
} }

View File

@@ -42,6 +42,9 @@ resource ParadigmsEst = open
-- defined in $ResEst$. -- defined in $ResEst$.
oper oper
male = Male ;
female = Female ;
Number : Type ; Number : Type ;
singular : Number ; singular : Number ;
@@ -610,6 +613,55 @@ oper
mkPN_1 : Str -> PN = \s -> lin PN {s = \\c => (mk1N s).s ! NCase Sg c} ; mkPN_1 : Str -> PN = \s -> lin PN {s = \\c => (mk1N s).s ! NCase Sg c} ;
mkLN = overload {
mkLN : Str -> LN =
\s -> lin LN {s = \\c => (mk1N s).s ! NCase Sg c ;
n = Sg} ;
mkLN : Str -> Number -> LN =
\s,n -> lin LN {s = \\c => (mk1N s).s ! NCase n c ;
n = n} ;
mkLN : N -> LN =
\noun -> lin LN {s = \\c => noun.s ! NCase Sg c ;
n = Sg} ;
mkLN : N -> Number -> LN =
\noun,n -> lin LN {s = \\c => noun.s ! NCase n c ;
n = n} ;
} ;
mkGN = overload {
mkGN : Str -> GN =
\s -> lin GN {s = \\c => (mk1N s).s ! NCase Sg c ;
g = Male} ;
mkGN : Str -> Sex -> GN =
\s,g -> lin GN {s = \\c => (mk1N s).s ! NCase Sg c ;
g = g} ;
mkGN : N -> GN =
\noun -> lin GN {s = \\c => noun.s ! NCase Sg c ;
g = Male} ;
mkGN : N -> Sex -> GN =
\noun,g -> lin GN {s = \\c => noun.s ! NCase Sg c ;
g = g} ;
} ;
mkSN = overload {
mkSN : Str -> SN =
\s -> lin SN {s = \\_,c => (mk1N s).s ! NCase Sg c ;
pl = \\c => (mk1N s).s ! NCase Sg c} ;
mkSN : Str -> Str -> Str -> SN =
\male,female,pl -> lin SN {s = table {Male =>\\c => (mk1N male).s ! NCase Sg c ;
Female=>\\c => (mk1N female).s ! NCase Sg c} ;
pl = \\c => (mk1N pl).s ! NCase Sg c} ;
mkSN : N -> SN =
\noun -> lin SN {s = \\_,c => noun.s ! NCase Sg c ;
pl = \\c => noun.s ! NCase Sg c} ;
mkSN : N -> N -> N -> SN =
\male,female,pl -> lin SN {s = table {Male =>\\c => male.s ! NCase Sg c ;
Female=>\\c => female.s ! NCase Sg c} ;
pl = \\c => pl.s ! NCase Sg c} ;
} ;
prepLN : LN -> Prep -> LN = \n,s -> n ** {c = s} ;
-- adjectives -- adjectives
mkA = overload { mkA = overload {

View File

@@ -95,7 +95,10 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
N = SNoun ; N = SNoun ;
N2 = SNoun ** {c2 : Compl ; isPre : Bool ; postmod : Number => Str} ; N2 = SNoun ** {c2 : Compl ; isPre : Bool ; postmod : Number => Str} ;
N3 = SNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ; N3 = SNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ;
GN, SN, LN, PN = SPN ; PN = SPN ;
LN = SPN ** {n : Number} ;
GN = SPN ** {g : Sex} ;
SN = {s : Sex => SPN; pl : SPN} ;
linref linref
SSlash = \ss -> ss.s ++ ss.c2.s.p1 ; SSlash = \ss -> ss.s ++ ss.c2.s.p1 ;

View File

@@ -33,26 +33,29 @@ lin
InflectionPN = \pn -> { InflectionPN = \pn -> {
t = "s" ; t = "s" ;
s1 = heading1 (heading noun_Category) ; s1 = heading1 "Oikea Nimi" ;
s2 = inflPN (\c -> pn.s ! c) s2 = inflPN (\c -> pn.s ! c)
} ; } ;
InflectionLN = \pn -> { InflectionLN ln = {
t = "s" ; t = "s" ;
s1 = heading1 (heading noun_Category) ; s1 = heading1 "Paikannimi" ;
s2 = inflPN (\c -> pn.s ! c) s2 = inflPN (\c -> ln.s ! c)
} ; } ;
InflectionGN = \pn -> { InflectionGN gn = {
t = "s" ; t = "s" ;
s1 = heading1 "Etunimi" ; s1 = heading1 "Etunimi"++case gn.g of {
s2 = inflPN (\c -> pn.s ! c) Male => "(mies)" ;
Female => "(nainen)"
} ;
s2 = inflPN (\c -> gn.s ! c)
} ; } ;
InflectionSN = \pn -> { InflectionSN sn = {
t = "s" ; t = "s" ;
s1 = heading1 "Sukunimi" ; s1 = heading1 "Sukunimi" ;
s2 = inflPN (\c -> pn.s ! c) s2 = inflPN (\c -> (sn.s ! Male).s ! c)
} ; } ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {

View File

@@ -1,20 +1,43 @@
concrete NamesFin of Names = CatFin ** open ResFin, StemFin, Prelude in { concrete NamesFin of Names = CatFin ** open ResFin, StemFin, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> { lin GivenName n = {
s = snoun2np Sg n ; s = snoun2np Sg n ;
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False ; isNeg = False isPron = False ; isNeg = False
} ; } ;
lin MaleSurname n = {
s = snoun2np Sg (n.s ! Male) ;
a = agrP3 Sg ;
isPron = False ; isNeg = False
} ;
lin FemaleSurname n = {
s = snoun2np Sg (n.s ! Female) ;
a = agrP3 Sg ;
isPron = False ; isNeg = False
} ;
lin PlSurname n = {
s = snoun2np Pl n.pl ;
a = agrP3 Pl ;
isPron = False ; isNeg = False
} ;
lin FullName gn sn = { lin FullName gn sn = {
s = snoun2np Sg {s = \\c => gn.s ! Nom ++ sn.s ! c} ; s = snoun2np Sg {s = \\c => gn.s ! Nom ++ (sn.s ! gn.g).s ! c} ;
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False ; isNeg = False isPron = False ; isNeg = False
} ; } ;
lin UseLN pn = { lin UseLN, PlainLN = \ln -> {
s = snoun2np Sg pn ; s = snoun2np ln.n ln ;
a = agrP3 Sg ; a = agrP3 ln.n ;
isPron = False ; isNeg = False isPron = False ; isNeg = False
} ; } ;
lin InLP ln = {
s = appCompl True Pos ln.c { s = snoun2np ln.n ln ;
a = agrP3 ln.n ;
isPron = False ;
isNeg = False
}
} ;
} }

View File

@@ -422,6 +422,9 @@ mkVS = overload {
Case = MorphoFin.Case ; Case = MorphoFin.Case ;
Number = MorphoFin.Number ; Number = MorphoFin.Number ;
male = Male ;
female = Female ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
@@ -841,6 +844,36 @@ mkVS = overload {
} }
} ; } ;
mkLN = overload {
mkLN : Str -> LN = \s -> lin LN (snoun2spn (mk1N s) ** {n = Sg}) ;
mkLN : Str -> Number -> LN = \s,n -> lin LN (snoun2spn (mk1N s) ** {n = n}) ;
mkLN : N -> LN = \noun -> lin LN (snoun2spn noun ** {n = Sg}) ;
mkLN : N -> Number -> LN = \noun,n -> lin LN (snoun2spn noun ** {n = n}) ;
} ;
mkGN = overload {
mkGN : Str -> GN = \s -> lin GN (snoun2spn (mk1N s) ** {g = Male}) ;
mkGN : Str -> Sex -> GN = \s,g -> lin GN (snoun2spn (mk1N s) ** {g = g}) ;
mkGN : N -> GN = \noun -> lin GN (snoun2spn noun ** {g = Male}) ;
mkGN : N -> Sex -> GN = \noun,g -> lin GN (snoun2spn noun ** {g = g}) ;
} ;
mkSN = overload {
mkSN : Str -> SN = \s -> let spn = snoun2spn (mk1N s) in lin SN {s = \\_=>spn; pl=spn} ;
mkSN : Str -> Str -> Str -> SN
= \male,female,pl -> lin SN {
s = table {Male =>snoun2spn (mk1N male);
Female=>snoun2spn (mk1N female)};
pl= snoun2spn (mk1N pl)
} ;
mkSN : N -> SN = \noun -> let spn = snoun2spn noun in lin SN {s = \\_=>spn; pl=spn} ;
mkSN : N -> N -> N -> SN
= \male,female,pl -> lin SN {
s = table {Male =>snoun2spn male;
Female=>snoun2spn female};
pl= snoun2spn pl
} ;
} ;
-- adjectives -- adjectives

View File

@@ -40,6 +40,52 @@ lin
) )
} ; } ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Nom Propre" ++
case pn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = pn.s
} ;
InflectionGN = \gn -> {
t = "pn" ;
s1 = heading1 ("Prénom" ++
case gn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = gn.s
} ;
InflectionSN = \gn -> {
t = "pn" ;
s1 = heading1 "Nom de Famille" ;
s2 = gn.s ! Masc
} ;
InflectionLN = \ln -> {
t = "nl" ;
s1 = heading1 ("Nom de la Localisation" ++
case ln.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = paragraph ln.s ++
heading2 "Adverbe" ++
paragraph (let p : {s : Str; c:Prepos} =
case ln.onPrep of {
True => {s="en"; c=PNul} ;
False => {s=""; c=P_a}
}
in p.s ++ case ln.art of {
AlwaysArt => artDef True ln.g ln.num (CPrep p.c) ++ ln.s;
_ => prepCase (CPrep p.c) ++ ln.s
})
} ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "a" ;
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;

View File

@@ -1,8 +1,14 @@
concrete NamesFre of Names = CatFre ** open Prelude, ResFre, CommonRomance, PhonoFre in { concrete NamesFre of Names = CatFre ** open Prelude, ResFre, CommonRomance, PhonoFre in {
lin GivenName, MaleSurname, FemaleSurname = \n -> pn2np n ; lin GivenName = \n -> pn2np n ;
lin MaleSurname = \n -> pn2np {s = n.s ! Masc; g = Masc} ;
lin FemaleSurname = \n -> pn2np {s = n.s ! Fem; g = Fem} ;
lin PlSurname = \n -> heavyNPpol False {
s = \\c => prepCase c ++ n.pl ;
a = agrP3 Masc Pl
} ;
lin FullName gn sn = pn2np { lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ; s = gn.s ++ sn.s ! gn.g ;
g = gn.g g = gn.g
} ; } ;
@@ -21,10 +27,15 @@ lin UseLN n = heavyNP {
lin InLN n = { lin InLN n = {
s = n.p.s ++ case n.art of { s = let p : {s : Str; c:Prepos} =
AlwaysArt => artDef True n.g n.num n.p.c ++ n.s; case n.onPrep of {
_ => prepCase n.p.c ++ n.s True => {s="en"; c=PNul} ;
} ; False => {s=""; c=P_a}
}
in p.s ++ case n.art of {
AlwaysArt => artDef True n.g n.num (CPrep p.c) ++ n.s;
_ => prepCase (CPrep p.c) ++ n.s
} ;
} ; } ;

View File

@@ -132,17 +132,38 @@ oper
-- Proper names need a string and a gender. If no gender is given, the -- Proper names need a string and a gender. If no gender is given, the
-- feminine is used for strings ending with "e", the masculine for other strings. -- feminine is used for strings ending with "e", the masculine for other strings.
mkPN : overload {
mkPN : Str -> PN ; -- feminine if ends with "e", otherwise masculine
mkPN : Str -> Gender -> PN ; -- gender deviant from the simple rule
mkPN : N -> PN ; -- gender inherited from noun
} ;
mkGN = overload {
mkGN : (Anna : Str) -> GN = \s -> lin GN (regPN s) ; -- feminine for "-a", otherwise masculine
mkGN : (Pilar : Str) -> Gender -> GN = \s,g -> lin GN (mk2PN s g) ; -- force gender
} ;
mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_ => s; pl = s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Masc=>male; Fem=>female}; pl = pl} ;
} ;
mkLN = overload { mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = s ;
onPrep=False ;
art = NoArt ;
g = Masc ;
num = Sg} ;
mkLN : Str -> Gender -> LN = \s,g -> mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ; lin LN {s = s ;
p = {s=""; c=CPrep P_a; isDir=True} ; onPrep=False ;
art = NoArt ; art = NoArt ;
g = g ; g = g ;
num = Sg} ; num = Sg} ;
mkLN : Str -> Gender -> Number -> LN = \s,g,num -> mkLN : Str -> Gender -> Number -> LN = \s,g,num ->
lin LN {s = s ; lin LN {s = s ;
p = {s=""; c=CPrep P_a; isDir=True} ; onPrep=False ;
art = NoArt ; art = NoArt ;
g = g ; g = g ;
num = num} ; num = num} ;
@@ -151,14 +172,7 @@ oper
defLN : LN -> LN = \n -> n ** {art = AlwaysArt} ; defLN : LN -> LN = \n -> n ** {art = AlwaysArt} ;
useDefLN : LN -> LN = \n -> n ** {art = UseArt} ; useDefLN : LN -> LN = \n -> n ** {art = UseArt} ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {p = p} ; enLN : LN -> LN = \n -> n ** {onPrep = True} ;
mkPN : overload {
mkPN : Str -> PN ; -- feminine if ends with "e", otherwise masculine
mkPN : Str -> Gender -> PN ; -- gender deviant from the simple rule
mkPN : N -> PN ; -- gender inherited from noun
} ;
--2 Adjectives --2 Adjectives
@@ -355,8 +369,10 @@ oper
Gender = MorphoFre.Gender ; Gender = MorphoFre.Gender ;
Number = MorphoFre.Number ; Number = MorphoFre.Number ;
masculine = Masc ; masculine, male = Masc ;
feminine = Fem ; feminine, female = Fem ;
male = Masc ;
female = Fem ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;

View File

@@ -102,7 +102,8 @@ concrete CatGer of Cat =
N3 = ResGer.Noun ** {c2,c3 : Preposition} ; N3 = ResGer.Noun ** {c2,c3 : Preposition} ;
GN = {s : Case => Str; g : Sex} ; GN = {s : Case => Str; g : Sex} ;
SN = {s : Sex => Case => Str} ; SN = {s : Sex => Case => Str} ;
LN, PN = {s : Case => Str; g : Gender; n : Number} ; PN = {s : Case => Str; g : Gender; n : Number} ;
LN = {s : Adjf => Case => Str; hasArt : Bool; g : Gender; n : Number} ;
-- tense with possibility to choose conjunctive forms -- tense with possibility to choose conjunctive forms

View File

@@ -40,6 +40,66 @@ lin
) )
} ; } ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Eigenname" ++
"("+case <pn.g,pn.n> of {
<Masc,Sg> => heading masculine_Parameter ;
<Fem,Sg> => heading feminine_Parameter ;
<Neutr,Sg> => heading neuter_Parameter ;
<_,Pl> => heading plural_Parameter
} ++")") ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (pn.s ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (pn.s ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (pn.s ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (pn.s ! Acc))
)
} ;
InflectionGN = \gn -> {
t = "vn" ;
s1 = heading1 ("Vorname" ++
case gn.g of {
Male => "(männlich)" ;
Female => "(weiblich)"
}) ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (gn.s ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (gn.s ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (gn.s ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (gn.s ! Acc))
) ;
} ;
InflectionSN = \sn -> {
t = "fn" ;
s1 = heading1 ("Familienname") ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (sn.s ! Male ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (sn.s ! Male ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (sn.s ! Male ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (sn.s ! Male ! Acc))
) ;
} ;
InflectionLN = \ln -> {
t = "pn" ;
s1 = heading1 ("Standortnamen" ++
"("+case <ln.g,ln.n> of {
<Masc,Sg> => heading masculine_Parameter ;
<Fem,Sg> => heading feminine_Parameter ;
<Neutr,Sg> => heading neuter_Parameter ;
<_,Pl> => heading plural_Parameter
} ++")") ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (ln.s ! Strong ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (ln.s ! Strong ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (ln.s ! Strong ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (ln.s ! Strong ! Acc))
)
} ;
InflectionA, InflectionA2 = \adj -> InflectionA, InflectionA2 = \adj ->
let let
gforms : Degree -> ResGer.Case -> Str = \d,c -> gforms : Degree -> ResGer.Case -> Str = \d,c ->

View File

@@ -1,4 +1,4 @@
concrete NamesGer of Names = CatGer ** open ResGer in { concrete NamesGer of Names = CatGer ** open ResGer, Prelude in {
lin GivenName gn = { lin GivenName gn = {
s = \\c => usePrepC c (\k -> gn.s ! k) ; s = \\c => usePrepC c (\k -> gn.s ! k) ;
@@ -31,15 +31,40 @@ lin PlSurname sn = {
lin FullName gn sn = { lin FullName gn sn = {
s = \\c => usePrepC c (\k -> gn.s ! Nom ++ sn.s ! gn.g ! k) ; s = \\c => usePrepC c (\k -> gn.s ! Nom ++ sn.s ! gn.g ! k) ;
a = agrgP3 (sex2gender gn.g) Sg ; a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ;
rc, ext = []
} ;
lin UseLN ln = {
s = \\c => case ln.hasArt of {
True => artDefContr (gennum ln.g ln.n) c ++ usePrepC c (\k -> ln.s ! Weak ! k) ;
False => usePrepC c (\k -> ln.s ! adjfCase Strong k ! k)
} ;
a = agrgP3 ln.g ln.n ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []
} ; } ;
lin UseLN pn = { lin PlainLN ln = {
s = \\c => usePrepC c (\k -> pn.s ! k) ; s = \\c => usePrepC c (\k -> ln.s ! adjfCase Strong k ! k) ;
a = agrgP3 pn.g pn.n ; a = agrgP3 ln.g ln.n ;
w = WLight ; w = WLight ;
rc, ext = [] rc, ext = []
} ; } ;
lin InLN ln = {
s = let c = NPP CInDat
in case ln.hasArt of {
True => artDefContr (gennum ln.g ln.n) c ++ usePrepC c (\k -> ln.s ! Weak ! k) ;
False => usePrepC c (\k -> ln.s ! adjfCase Strong k ! k)
} ;
} ;
lin AdjLN ap ln = ln ** {
s = \\a,c =>
preOrPost ap.isPre
(ap.c.p1 ++ ap.c.p2 ++ ap.s ! agrAdj ln.g a ln.n c ++ ap.ext)
(ln.s ! a ! c) ;
} ;
} }

View File

@@ -165,6 +165,32 @@ mkN : overload {
mkSN : (nom,acc,dat,gen : Str) -> GN ; -- name with all case forms mkSN : (nom,acc,dat,gen : Str) -> GN ; -- name with all case forms
} ; } ;
mkLN = overload {
mkLN : Str -> LN = \s -> regLN s Masc ; -- regular name with genitive in "s", masculine
mkLN : Str -> Number -> LN = \s,n -> regLN s Masc ** {n=n} ; -- regular name with genitive in "s", masculine
mkLN : Str -> Gender -> LN = regLN ; -- regular name with genitive in "s"
-- If only the genitive differs, two strings are needed.
mkLN : (nom,gen : Str) -> Gender -> LN = mk2LN ; -- name with other genitive
-- In the worst case, all four forms are needed.
mkLN : (nom,acc,dat,gen : Str) -> Gender -> LN = \nom,acc,dat,gen,g ->
lin LN {s = \\a => table {Nom => nom ; Acc => acc ; Dat => dat ; Gen => gen} ;
g = g ; n = Sg ;
hasArt = False}
} ;
defLN : LN -> LN = \n -> n ** {hasArt = True} ;
mk2LN : (karolus, karoli : Str) -> Gender -> LN = \karolus, karoli, g ->
lin LN {s = \\a => table {Gen => karoli ; _ => karolus} ; g = g ; n = Sg ;
hasArt = False} ;
regLN : (horst : Str) -> Gender -> LN = \horst, g ->
mk2LN horst (ifTok Tok (Predef.dp 1 horst) "s" horst (horst + "s")) g ;
-- To extract the number of a noun phrase -- To extract the number of a noun phrase
ifPluralNP : NP -> Bool ifPluralNP : NP -> Bool

View File

@@ -25,7 +25,6 @@ resource ResGer = ParamX ** open Prelude in {
param param
Case = Nom | Acc | Dat | Gen ; Case = Nom | Acc | Dat | Gen ;
Gender = Masc | Fem | Neutr ; Gender = Masc | Fem | Neutr ;
Sex = Male | Female ;
-- Complex $CN$s, like adjectives, have strong and weak forms. -- Complex $CN$s, like adjectives, have strong and weak forms.

View File

@@ -40,6 +40,42 @@ lin
) )
} ; } ;
InflectionGN = \gn -> {
t = "pn" ;
s1 = heading1 ("Prenome" ++
case gn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = gn.s
} ;
InflectionSN = \gn -> {
t = "pn" ;
s1 = heading1 "Cognome" ;
s2 = gn.s ! Masc
} ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Nome Proprio" ++
case pn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = pn.s
} ;
InflectionLN = \ln -> {
t = "nl" ;
s1 = heading1 ("Nom del Luogo" ++
case ln.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = paragraph ln.s
} ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "a" ;
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;

View File

@@ -1,9 +1,58 @@
concrete NamesIta of Names = CatIta ** open ResIta in { concrete NamesIta of Names = CatIta ** open ResIta, CommonRomance, Prelude in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> pn2np n ; lin GivenName = \n -> pn2np n ;
lin MaleSurname = \n -> pn2np {s = n.s ! Masc; g = Masc} ;
lin FemaleSurname = \n -> pn2np {s = n.s ! Fem; g = Fem} ;
lin PlSurname = \n -> heavyNPpol False {
s = \\c => prepCase c ++ n.pl ;
a = agrP3 Masc Pl
} ;
lin FullName gn sn = pn2np { lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ; s = gn.s ++ sn.s ! gn.g ;
g = gn.g g = gn.g
} ; } ;
lin PlainLN n = heavyNP {
s = \\c => n.s;
a = {g = n.g ; n = n.num ; p = P3}
} ;
lin UseLN n = heavyNP {
s = \\c => case n.art of {
UseArt => case n.g of {
Fem => case n.num of {
Sg => "la" ++ n.s;
Pl => "las" ++ n.s} ;
Masc => case n.num of {
Sg => "el" ++ n.s;
Pl => "los" ++ n.s
}
} ;
NoArt => n.s
} ;
a = {g = n.g ; n = n.num ; p = P3}
} ;
lin InLN n = {
s = case n.art of {
UseArt => case n.g of {
Fem => case n.num of {
Sg => "la" ++ n.s;
Pl => "las" ++ n.s} ;
Masc => case n.num of {
Sg => "el" ++ n.s;
Pl => "los" ++ n.s
}
} ;
NoArt => n.s
} ;
} ;
lin AdjLN ap n = n ** {
s = preOrPost ap.isPre (ap.s ! AF n.g n.num) n.s ;
} ;
} }

View File

@@ -145,13 +145,38 @@ oper
mkPN : N -> PN ; -- get gender from noun mkPN : N -> PN ; -- get gender from noun
} ; } ;
mkLN : Str -> LN = \s -> mkGN = overload {
lin LN {s = s ; mkGN : (Anna : Str) -> GN = \s -> lin GN (regPN s) ; -- feminine for "-a", otherwise masculine
p = {s=""; c=CPrep P_a; isDir=True} ; mkGN : (Pilar : Str) -> Gender -> GN = \s,g -> lin GN (mk2PN s g) ; -- force gender
art = NoArt ; } ;
g = Masc ;
num = Sg} ;
mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_ => s; pl = s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Masc=>male; Fem=>female}; pl = pl} ;
} ;
mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = Masc ;
num = Sg} ;
mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = g ;
num = Sg} ;
mkLN : Str -> Gender -> Number -> LN = \s,g,n ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = g ;
num = n}
} ;
defLN : LN -> LN = \n -> n ** {art = UseArt} ;
--2 Adjectives --2 Adjectives
@@ -333,8 +358,8 @@ oper
Gender = MorphoIta.Gender ; Gender = MorphoIta.Gender ;
Number = MorphoIta.Number ; Number = MorphoIta.Number ;
masculine = Masc ; masculine, male = Masc ;
feminine = Fem ; feminine, female = Fem ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;

View File

@@ -10,10 +10,9 @@ instance DiffNor of DiffScand = open CommonScand, Prelude in {
param param
NGenderNor = NUtr Sex | NNeutr ; NGenderNor = NUtr Sex | NNeutr ;
Sex = Masc | Fem ;
oper oper
utrum = NUtr Masc ; utrum = NUtr Male ;
neutrum = NNeutr ; neutrum = NNeutr ;
detDef : Species = Def ; detDef : Species = Def ;

View File

@@ -14,8 +14,8 @@ resource MorphoNor = CommonScand, ResNor ** open Prelude, Predef in {
-- genders -- genders
oper oper
masc = NUtr Masc ; masc = NUtr Male ;
fem = NUtr Fem ; fem = NUtr Female ;
neutr = NNeutr ; neutr = NNeutr ;
-- type synonyms -- type synonyms

View File

@@ -279,8 +279,8 @@ oper
Gender = MorphoNor.NGender ; Gender = MorphoNor.NGender ;
Number = MorphoNor.Number ; Number = MorphoNor.Number ;
Case = MorphoNor.Case ; Case = MorphoNor.Case ;
masculine = NUtr Masc ; masculine = NUtr Male ;
feminine = NUtr Fem ; feminine = NUtr Female ;
neutrum = NNeutr ; neutrum = NNeutr ;
utrum = masculine ; utrum = masculine ;
singular = Sg ; singular = Sg ;

View File

@@ -10,10 +10,9 @@ instance DiffNno of DiffScand = open CommonScand, Prelude in {
param param
NGenderNno = NUtr Sex | NNeutr ; NGenderNno = NUtr Sex | NNeutr ;
Sex = Masc | Fem ;
oper oper
utrum = NUtr Masc ; utrum = NUtr Male ;
neutrum = NNeutr ; neutrum = NNeutr ;
detDef : Species = Def ; detDef : Species = Def ;

View File

@@ -14,8 +14,8 @@ resource MorphoNno = CommonScand, ResNno ** open Prelude, Predef in {
-- genders -- genders
oper oper
masc = NUtr Masc ; masc = NUtr Male ;
fem = NUtr Fem ; fem = NUtr Female ;
neutr = NNeutr ; neutr = NNeutr ;
-- type synonyms -- type synonyms

View File

@@ -276,8 +276,8 @@ oper
Gender = MorphoNno.NGender ; Gender = MorphoNno.NGender ;
Number = MorphoNno.Number ; Number = MorphoNno.Number ;
Case = MorphoNno.Case ; Case = MorphoNno.Case ;
masculine = NUtr Masc ; masculine = NUtr Male ;
feminine = NUtr Fem ; feminine = NUtr Female ;
neutrum = NNeutr ; neutrum = NNeutr ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;

View File

@@ -40,6 +40,42 @@ lin
) )
} ; } ;
InflectionGN = \gn -> {
t = "pn" ;
s1 = heading1 ("Prenome" ++
case gn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = gn.s
} ;
InflectionSN = \gn -> {
t = "pn" ;
s1 = heading1 "Sobrenome" ;
s2 = gn.s ! Masc
} ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Nome Próprio" ++
case pn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = pn.s
} ;
InflectionLN = \ln -> {
t = "nl" ;
s1 = heading1 ("Nom do Local" ++
case ln.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = paragraph ln.s
} ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "a" ;
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;

View File

@@ -1,9 +1,58 @@
concrete NamesPor of Names = CatPor ** open ResPor in { concrete NamesPor of Names = CatPor ** open ResPor, CommonRomance, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> pn2np n ; lin GivenName = \n -> pn2np n ;
lin MaleSurname = \n -> pn2np {s = n.s ! Masc; g = Masc} ;
lin FemaleSurname = \n -> pn2np {s = n.s ! Fem; g = Fem} ;
lin PlSurname = \n -> heavyNPpol False {
s = \\c => prepCase c ++ n.pl ;
a = agrP3 Masc Pl
} ;
lin FullName gn sn = pn2np { lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ; s = gn.s ++ sn.s ! gn.g ;
g = gn.g g = gn.g
} ; } ;
lin PlainLN n = heavyNP {
s = \\c => n.s;
a = {g = n.g ; n = n.num ; p = P3}
} ;
lin UseLN n = heavyNP {
s = \\c => case n.art of {
UseArt => case n.g of {
Fem => case n.num of {
Sg => "la" ++ n.s;
Pl => "las" ++ n.s} ;
Masc => case n.num of {
Sg => "el" ++ n.s;
Pl => "los" ++ n.s
}
} ;
NoArt => n.s
} ;
a = {g = n.g ; n = n.num ; p = P3}
} ;
lin InLN n = {
s = case n.art of {
UseArt => case n.g of {
Fem => case n.num of {
Sg => "la" ++ n.s;
Pl => "las" ++ n.s} ;
Masc => case n.num of {
Sg => "el" ++ n.s;
Pl => "los" ++ n.s
}
} ;
NoArt => n.s
} ;
} ;
lin AdjLN ap n = n ** {
s = preOrPost ap.isPre (ap.s ! AF n.g n.num) n.s ;
} ;
} }

View File

@@ -49,11 +49,11 @@ oper
Gender : Type ; Gender : Type ;
Gender = MorphoPor.Gender ; Gender = MorphoPor.Gender ;
masculine : Gender ; masculine, male : Gender ;
masculine = Masc ; masculine, male = Masc ;
feminine : Gender ; feminine, female : Gender ;
feminine = Fem ; feminine, female = Fem ;
-- To abstract over number names, we define the following. -- To abstract over number names, we define the following.
@@ -206,12 +206,39 @@ oper
= \n -> lin PN {s = n.s ! Sg ; g = n.g} ; = \n -> lin PN {s = n.s ! Sg ; g = n.g} ;
} ; } ;
mkLN : Str -> LN = \s -> mkGN = overload {
lin LN {s = s ; mkGN : (Anna : Str) -> GN = \s -> lin GN (regPN s) ; -- feminine for "-a", otherwise masculine
p = {s=""; c=CPrep P_a; isDir=True} ; mkGN : (Pilar : Str) -> Gender -> GN = \s,g -> lin GN (mk2PN s g) ; -- force gender
art = NoArt ; } ;
g = Masc ;
num = Sg} ; mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_ => s; pl = s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Masc=>male; Fem=>female}; pl = pl} ;
} ;
mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = Masc ;
num = Sg} ;
mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = g ;
num = Sg} ;
mkLN : Str -> Gender -> Number -> LN = \s,g,num ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = g ;
num = num} ;
} ;
defLN : LN -> LN = \n -> n ** {art = UseArt} ;
--2 Adjectives --2 Adjectives
compADeg : Adj -> A ; --% compADeg : Adj -> A ; --%

View File

@@ -110,14 +110,14 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
N = Noun ; N = Noun ;
N2 = Noun ** {c2 : Compl} ; N2 = Noun ** {c2 : Compl} ;
N3 = Noun ** {c2,c3 : Compl} ; N3 = Noun ** {c2,c3 : Compl} ;
GN, SN, PN = {s : Str ; g : Gender} ; GN, PN = {s : Str ; g : Gender} ;
SN = {s : Gender => Str ; pl : Str} ;
lincat LN = {s : Str; LN = {s : Str;
p : Compl; onPrep : Bool;
art : HasArt; art : HasArt;
g : Gender; g : Gender;
num : Number; num : Number;
} ; } ;
-- tense augmented with passé simple -- tense augmented with passé simple
lincat lincat

View File

@@ -1,7 +1,21 @@
concrete CatRus of Cat = CommonX ** open ResRus, Prelude in { concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
flags coding=utf8 ; optimize=all ; flags coding=utf8 ; optimize=all ;
lincat lincat
N, GN, SN, LN, PN = ResRus.NounForms ; N, PN = ResRus.NounForms ;
GN = {
s : Case => Str ;
g : Sex ;
} ;
SN = {
s : Sex => Case => Str ;
p : Case => Str ;
} ;
LN = {
s : Case => Str ;
g : Gender ;
n : Number ;
anim : Animacy
} ;
N2 = ResRus.Noun2Forms ; N2 = ResRus.Noun2Forms ;
N3 = ResRus.Noun3Forms ; N3 = ResRus.Noun3Forms ;
@@ -105,7 +119,7 @@ lincat
linref linref
N = \s -> s.snom ; N = \s -> s.snom ;
PN = \s -> s.snom ; PN = \s -> s.snom ;
LN = \s -> s.snom ; LN = \s -> s.s ! Nom ;
Pron = \s -> s.nom ; Pron = \s -> s.nom ;
N2 = \s -> s.snom ++ s.c2.s ; N2 = \s -> s.snom ++ s.c2.s ;
N3 = \s -> s.snom ++ s.c2.s ++ s.c3.s ; N3 = \s -> s.snom ++ s.c2.s ++ s.c3.s ;

View File

@@ -26,13 +26,79 @@ oper
lin lin
InflectionN, InflectionN2, InflectionN3 = \noun -> { InflectionN, InflectionN2, InflectionN3 = \noun -> {
t = "s" ; t = "сущ." ;
s1 = heading1 (heading noun_Category) ; s1 = heading1 (heading noun_Category) ;
s2 = inflNoun noun s2 = inflNoun noun
} ; } ;
InflectionPN = \pn -> {
t = "сущ.с." ;
s1 = heading1 "Существительное Собственное" ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (pn.snom)) ++
tr (th (heading genitive_Parameter) ++ td (pn.sgen)) ++
tr (th (heading dative_Parameter) ++ td (pn.sdat)) ++
tr (th (heading accusative_Parameter) ++ td (pn.sacc)) ++
tr (th ("творительный") ++ td (pn.sins)) ++
tr (th ("предложный") ++ td (pn.sprep)) ++
tr (th (heading partitive_Parameter) ++ td (pn.sptv)) ++
tr (th ("местный") ++ td (pn.sloc)) ++
tr (th ("звательный") ++ td (pn.svoc))
) ;
} ;
InflectionGN = \gn -> {
t = "сущ.с." ;
s1 = heading1 "Личное Имя" ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (gn.s ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (gn.s ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (gn.s ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (gn.s ! Acc)) ++
tr (th ("творительный") ++ td (gn.s ! Ins)) ++
tr (th ("предложный") ++ td (gn.s ! Pre)) ++
tr (th (heading partitive_Parameter) ++ td (gn.s ! Ptv)) ++
tr (th ("местный") ++ td (gn.s ! Loc)) ++
tr (th ("звательный") ++ td (gn.s ! VocRus))
)
} ;
InflectionSN = \sn -> {
t = "сущ.с." ;
s1 = heading1 "Фамилия" ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (sn.s ! Male ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (sn.s ! Male ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (sn.s ! Male ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (sn.s ! Male ! Acc)) ++
tr (th ("творительный") ++ td (sn.s ! Male ! Ins)) ++
tr (th ("предложный") ++ td (sn.s ! Male ! Pre)) ++
tr (th (heading partitive_Parameter) ++ td (sn.s ! Male ! Ptv)) ++
tr (th ("местный") ++ td (sn.s ! Male ! Loc)) ++
tr (th ("звательный") ++ td (sn.s ! Male ! VocRus))
)
} ;
InflectionLN = \ln -> {
t = "сущ.с." ;
s1 = heading1 "Название Местоположения" ;
s2 = frameTable (
tr (th (heading nominative_Parameter) ++ td (ln.s ! Nom)) ++
tr (th (heading genitive_Parameter) ++ td (ln.s ! Gen)) ++
tr (th (heading dative_Parameter) ++ td (ln.s ! Dat)) ++
tr (th (heading accusative_Parameter) ++ td (ln.s ! Acc)) ++
tr (th ("творительный") ++ td (ln.s ! Ins)) ++
tr (th ("предложный") ++ td (ln.s ! Pre)) ++
tr (th (heading partitive_Parameter) ++ td (ln.s ! Ptv)) ++
tr (th ("местный") ++ td (ln.s ! Loc)) ++
tr (th ("звательный") ++ td (ln.s ! VocRus))
) ++
heading2 (heading adverb_Category) ++
paragraph "adv.s"
} ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "пр" ;
s1 = heading1 (heading adjective_Category) ; s1 = heading1 (heading adjective_Category) ;
s2 = heading2 (heading feminine_Parameter) ++ s2 = heading2 (heading feminine_Parameter) ++
inflNoun (makeNFFromAF adj Fem Inanimate) ++ inflNoun (makeNFFromAF adj Fem Inanimate) ++
@@ -45,89 +111,89 @@ lin
} ; } ;
InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> { InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> {
t = "adv" ; t = "нар" ;
s1 = heading1 (heading adverb_Category) ; s1 = heading1 (heading adverb_Category) ;
s2 = paragraph adv.s s2 = paragraph adv.s
} ; } ;
InflectionPrep p = { InflectionPrep p = {
t = "prep" ; t = "пред" ;
s1 = heading1 (heading preposition_Category) ; s1 = heading1 (heading preposition_Category) ;
s2 = paragraph ((S.mkAdv (lin Prep p) S.it_NP).s ++ ";" ++ (S.mkAdv (lin Prep p) S.we_NP).s) s2 = paragraph ((S.mkAdv (lin Prep p) S.it_NP).s ++ ";" ++ (S.mkAdv (lin Prep p) S.we_NP).s)
} ; } ;
InflectionV v = { InflectionV v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v)) ; paragraph (verbExample (S.mkCl S.she_NP v)) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionV2 v = { InflectionV2 v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ; paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionV3 v = { InflectionV3 v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ; paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionV2V v = { InflectionV2V v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (S.mkVP (L.sleep_V)))) ; paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (S.mkVP (L.sleep_V)))) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionV2S v = { InflectionV2S v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S {s : Mood=>Str = \\m=>"..."}))) ; paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S {s : Mood=>Str = \\m=>"..."}))) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionV2Q v = { InflectionV2Q v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS {s: QForm=>Str = \\m=>"..."}))) ; paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS {s: QForm=>Str = \\m=>"..."}))) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionV2A v = { InflectionV2A v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ; paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionVV vv = { InflectionVV vv = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP vv (S.mkVP (L.sleep_V)))) ; paragraph (verbExample (S.mkCl S.she_NP vv (S.mkVP (L.sleep_V)))) ;
s2 = inflVerb vv.v s2 = inflVerb vv.v
} ; } ;
InflectionVS v = { InflectionVS v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (lin S {s : Mood=>Str = \\m=>"..."}))) ; paragraph (verbExample (S.mkCl S.she_NP v (lin S {s : Mood=>Str = \\m=>"..."}))) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionVQ v = { InflectionVQ v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (lin QS {s : Mood=>Str = \\m=>"..."}))) ; paragraph (verbExample (S.mkCl S.she_NP v (lin QS {s : Mood=>Str = \\m=>"..."}))) ;
s2 = inflVerb v s2 = inflVerb v
} ; } ;
InflectionVA v = { InflectionVA v = {
t = "v" ; t = "гл" ;
s1 = heading1 (heading verb_Category) ++ s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ; paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ;
s2 = inflVerb v s2 = inflVerb v

View File

@@ -1,31 +1,54 @@
concrete NamesRus of Names = CatRus ** open ResRus, Prelude in { concrete NamesRus of Names = CatRus ** open ResRus, MorphoRus, Prelude in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \pn -> lin GivenName gn =
{ s=\\cas => (nounFormsNoun pn).s ! Sg ! cas ; { s=gn.s ;
pron=False; pron=False;
a=Ag (gennum pn.g Sg) P3 a=let g = case gn.g of {
Male => Masc ;
Female => Fem
}
in Ag (gennum g Sg) P3
} ; -- Does NP need animacy?
lin MaleSurname sn =
{ s=\\cas => sn.s ! Male ! cas ;
pron=False;
a=Ag (GSg Masc) P3
} ; -- Does NP need animacy?
lin FemaleSurname sn =
{ s=\\cas => sn.s ! Female ! cas ;
pron=False;
a=Ag (GSg Fem) P3
} ; -- Does NP need animacy?
lin PlSurname sn =
{ s=sn.p ;
pron=False;
a=Ag GPl P3
} ; -- Does NP need animacy? } ; -- Does NP need animacy?
lin FullName gn sn = lin FullName gn sn =
{ s= table { { s=\\cas => gn.s ! Nom ++ sn.s ! gn.g ! cas ;
Nom => gn.snom ++ sn.snom ;
Gen => gn.snom ++ sn.sgen ;
Dat => gn.snom ++ sn.sdat ;
Acc => gn.snom ++ sn.sacc ;
Ins => gn.snom ++ sn.sins ;
Pre => gn.snom ++ sn.sprep ;
Loc => gn.snom ++ sn.sloc ;
Ptv => gn.snom ++ sn.sptv ;
VocRus => gn.snom ++ sn.svoc
} ;
pron=False; pron=False;
a=Ag (gennum gn.g Sg) P3 a=let g = case gn.g of {
Male => Masc ;
Female => Fem
}
in Ag (GSg g) P3
} ; } ;
UseLN pn = { UseLN, PlainLN = \ln -> {
s=\\cas => (nounFormsNoun pn).s ! Sg ! cas ; s=\\cas => ln.s ! cas ;
pron=False; pron=False;
a=Ag (gennum pn.g Sg) P3 a=Ag (gennum ln.g ln.n) P3
} ; -- Does NP need animacy? } ; -- Does NP need animacy?
InLN ln = ss (applyPrep {s=v_prep_mod; c=Loc; hasPrep=True} {
s=ln.s ;
pron=False;
a=Ag (gennum ln.g ln.n) P3
}) ; -- Does NP need animacy?
AdjLN ap ln = ln ** {
s=\\cas => preOrPost (notB ap.isPost) (ap.s ! (gennum ln.g ln.n) ! ln.anim ! cas) (ln.s ! cas)
} ;
} }

View File

@@ -1,6 +1,6 @@
--1 Russian Lexical Paradigms --1 Russian Lexical Paradigms
resource ParadigmsRus = open CatRus, ResRus, (R=ResRus), ParamRus, (Z=InflectionRus), Prelude, Maybe in { resource ParadigmsRus = open CatRus, ResRus, (R=ResRus), ParamRus, (Z=InflectionRus), Prelude, Maybe, MorphoRus in {
--2 Parameters --2 Parameters
-- --
@@ -14,6 +14,11 @@ oper
neuter : Gender neuter : Gender
= Neut ; = Neut ;
male : Sex
= Male ;
female : Sex
= Female ;
-- Abstracting numbers. Number is a parameter for mkPN, mkConj -- Abstracting numbers. Number is a parameter for mkPN, mkConj
singular : Number singular : Number
= Sg ; = Sg ;
@@ -380,6 +385,130 @@ oper
= \word, g, anim, zi -> lin PN (noMinorCases (Z.makeNoun word g anim (Z.parseIndex zi))) ; = \word, g, anim, zi -> lin PN (noMinorCases (Z.makeNoun word g anim (Z.parseIndex zi))) ;
} ; } ;
mkGN = overload {
mkGN : Str -> GN
= \nom -> let nf = guessNounForms nom
in lin GN {
s = (nounFormsNoun nf).s ! Sg ;
g = case nf.g of {
Fem => Female ;
_ => Male
}
} ;
mkGN : Str -> Sex -> GN
= \nom, sex ->
let g = case sex of {
Male => Masc ;
Female => Fem
} ;
nf = guessLessNounForms nom g Animate
in lin GN {
s = (nounFormsNoun nf).s ! Sg ;
g = sex
} ;
mkGN : Str -> Sex -> Z.ZNIndex -> GN
= \nom, sex, z ->
let g = case sex of {
Male => Masc ;
Female => Fem
} ;
nf = noMinorCases (Z.makeNoun nom g Animate z)
in lin GN {
s = (nounFormsNoun nf).s ! Sg ;
g = sex
} ;
mkGN : Str -> Sex -> Str -> GN
= \nom, sex, zi ->
let g = case sex of {
Male => Masc ;
Female => Fem
} ;
nf = noMinorCases (Z.makeNoun nom g Animate (Z.parseIndex zi))
in lin GN {
s = (nounFormsNoun nf).s ! Sg ;
g = sex
} ;
} ;
mkSN = overload {
mkSN : Str -> SN
= \nom -> lin SN {
s = table {
Male => (nounFormsNoun (guessLessNounForms nom Masc Animate)).s ! Sg ;
Female => (nounFormsNoun (guessLessNounForms nom Fem Animate)).s ! Sg
} ;
p = (nounFormsNoun (guessLessNounForms nom Masc Animate)).s ! Pl ;
} ;
mkSN : Str -> Str -> SN
= \male,female -> lin SN {
s = table {
Male => (nounFormsNoun (guessLessNounForms male Masc Animate)).s ! Sg ;
Female => (nounFormsNoun (guessLessNounForms female Fem Animate)).s ! Sg
} ;
p = (nounFormsNoun (guessLessNounForms male Masc Animate)).s ! Pl ;
} ;
mkSN : Str -> Z.ZNIndex -> Str -> Z.ZNIndex -> SN
= \male,zm,female,zf -> lin SN {
s = table {
Male => (nounFormsNoun (noMinorCases (Z.makeNoun male Masc Animate zm))).s ! Sg ;
Female => (nounFormsNoun (noMinorCases (Z.makeNoun female Masc Animate zf))).s ! Sg
} ;
p = (nounFormsNoun (noMinorCases (Z.makeNoun male Masc Animate zm))).s ! Pl ;
} ;
} ;
mkLN = overload {
mkLN : Str -> LN
= \nom -> let nf = guessNounForms nom
in lin LN {
s = (nounFormsNoun nf).s ! Sg ;
anim = nf.anim ;
c = mkPrep v_prep_mod Loc ;
g = nf.g ;
n = Sg
} ;
mkLN : Str -> Gender -> LN
= \nom, g ->
let nf = guessLessNounForms nom g Animate
in lin LN {
s = (nounFormsNoun nf).s ! Sg ;
anim = nf.anim ;
c = mkPrep v_prep_mod Loc ;
g = nf.g ;
n = Sg
} ;
mkLN : Str -> Gender -> Number -> LN
= \nom, g, n ->
let nf = guessLessNounForms nom g Animate
in lin LN {
s = (nounFormsNoun nf).s ! n ;
anim = nf.anim ;
c = mkPrep v_prep_mod Loc ;
g = nf.g ;
n = n
} ;
mkLN : Str -> Gender -> Number -> Z.ZNIndex -> LN
= \nom, g, n, z ->
let nf = noMinorCases (Z.makeNoun nom g Animate z)
in lin LN {
s = (nounFormsNoun nf).s ! n ;
anim = nf.anim ;
c = mkPrep v_prep_mod Loc ;
g = nf.g ;
n = n
} ;
mkLN : Str -> Gender -> Number -> Str -> LN
= \nom, g, n, zi ->
let nf = noMinorCases (Z.makeNoun nom g Animate (Z.parseIndex zi))
in lin LN {
s = (nounFormsNoun nf).s ! n ;
anim = nf.anim ;
c = mkPrep v_prep_mod Loc ;
g = nf.g ;
n = n
} ;
} ;
--------------------- ---------------------
-- Adjectives -- Adjectives

View File

@@ -108,9 +108,10 @@ incomplete concrete CatScand of Cat =
-- {s : Number => Species => Case => Str ; g : Gender} ; -- {s : Number => Species => Case => Str ; g : Gender} ;
N2 = Noun ** {c2 : Complement} ; N2 = Noun ** {c2 : Complement} ;
N3 = Noun ** {c2,c3 : Complement} ; N3 = Noun ** {c2,c3 : Complement} ;
LN = {s : Case => Str ; c : Complement ; g : Gender ; n : Number} ; PN = {s : Case => Str ; g : Gender} ;
GN, SN, PN = {s : Case => Str ; g : Gender} ; LN = {s : Case => Str ; g : Gender ; n : Number} ;
GN = {s : Case => Str ; g : Sex} ;
SN = {s : Sex => Case => Str; pl : Case => Str} ;
lincat lincat

View File

@@ -56,9 +56,10 @@ lincat
N2 = {s : Case => Number => Str; g : AGender; c : Prep} ; N2 = {s : Case => Number => Str; g : AGender; c : Prep} ;
N3 = {s : Case => Number => Str; g : AGender; c : Prep} ; N3 = {s : Case => Number => Str; g : AGender; c : Prep} ;
GN = {s : Case => Str; g : Sex}; PN = {s : Case => Str; g : AGender; n : Number};
SN = {s : Sex => Case => Str}; LN = {s : Case => Str; g : AGender; n : Number};
LN, PN = {s : Case => Str; g : AGender; n : Number}; GN = {s : Case => Str; g : P.Sex};
SN = {s : P.Sex => Case => Str};
linref linref
V, VA, VS, V2, V3, V2A, V2S, V2Q, V2V = \v -> v.s ! VInf ++ v.refl ++ v.p; V, VA, VS, V2, V3, V2A, V2S, V2Q, V2V = \v -> v.s ! VInf ++ v.refl ++ v.p;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common --# -path=.:../abstract:../common
concrete DocumentationSlv of Documentation = CatSlv ** open concrete DocumentationSlv of Documentation = CatSlv ** open
ResSlv, ResSlv, ParamX,
HTML in { HTML in {
flags coding=utf8 ; flags coding=utf8 ;
@@ -31,6 +31,74 @@ lin
) )
} ; } ;
InflectionPN = \n -> {
t = "li" ;
s1= heading1 ("Lastno Ime"++
case n.g of {
AMasc Animate => "(m.s.ž.)" ;
AMasc Inanimate => "(m.s.)" ;
AFem => "(ž.s.)" ;
ANeut => "(s.s.)"
}) ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Nom))++
tr (th "rod." ++ td (n.s!Gen))++
tr (th "daj." ++ td (n.s!Dat))++
tr (th "tož." ++ td (n.s!Acc))++
tr (th "mest." ++ td (n.s!Loc))++
tr (th "orod."++td (n.s!Instr))
)
} ;
InflectionLN = \n -> {
t = "li" ;
s1= heading1 ("Ime Lokacije"++
case n.g of {
AMasc Animate => "(m.s.ž.)" ;
AMasc Inanimate => "(m.s.)" ;
AFem => "(ž.s.)" ;
ANeut => "(s.s.)"
}) ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Nom))++
tr (th "rod." ++ td (n.s!Gen))++
tr (th "daj." ++ td (n.s!Dat))++
tr (th "tož." ++ td (n.s!Acc))++
tr (th "mest." ++ td (n.s!Loc))++
tr (th "orod."++td (n.s!Instr))
)
} ;
InflectionGN = \n -> {
t = "li" ;
s1= heading1 ("Dano Ime"++
case n.g of {
Male => "(moški)" ;
Female => "(ženski)"
}) ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Nom))++
tr (th "rod." ++ td (n.s!Gen))++
tr (th "daj." ++ td (n.s!Dat))++
tr (th "tož." ++ td (n.s!Acc))++
tr (th "mest." ++ td (n.s!Loc))++
tr (th "orod."++td (n.s!Instr))
)
} ;
InflectionSN = \n -> {
t = "li" ;
s1= heading1 "Družinsko Ime" ;
s2= frameTable (
tr (th "imen." ++ td (n.s!Male!Nom))++
tr (th "rod." ++ td (n.s!Male!Gen))++
tr (th "daj." ++ td (n.s!Male!Dat))++
tr (th "tož." ++ td (n.s!Male!Acc))++
tr (th "mest." ++ td (n.s!Male!Loc))++
tr (th "orod."++td (n.s!Male!Instr))
)
} ;
InflectionA, InflectionA2 = \a -> { InflectionA, InflectionA2 = \a -> {
t = "pr" ; t = "pr" ;
s1= heading1 ("Pridevnik") ; s1= heading1 ("Pridevnik") ;

View File

@@ -1,4 +1,4 @@
concrete NamesSlv of Names = CatSlv ** open ResSlv, Prelude in { concrete NamesSlv of Names = CatSlv ** open ResSlv, ParamX, Prelude in {
lin GivenName = \n -> { lin GivenName = \n -> {
s = n.s; s = n.s;
@@ -21,10 +21,14 @@ lin FullName gn sn = {
isPron = False isPron = False
} ; } ;
lin UseLN pn = { lin UseLN, PlainLN = \ln -> {
s = pn.s; s = ln.s;
a = {g=agender2gender pn.g; n=pn.n; p=P3}; a = {g=agender2gender ln.g; n=ln.n; p=P3};
isPron = False isPron = False
} ; } ;
lin InLN ln = {
s = "v" ++ ln.s ! Loc
} ;
} }

View File

@@ -1,4 +1,4 @@
resource ParadigmsSlv = open CatSlv, ResSlv, Prelude, Predef in { resource ParadigmsSlv = open CatSlv, ResSlv, ParamX, Prelude, Predef in {
oper oper
nominative : Case = Nom ; nominative : Case = Nom ;
@@ -34,6 +34,10 @@ oper
mkN : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> AGender -> N = worstN ; mkN : (_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> AGender -> N = worstN ;
} ; } ;
compoundN = overload {
compoundN : N -> Str -> N = \noun,adv -> noun ** {s = \\c,n => noun.s ! c ! n ++ adv} ;
} ;
mkN2 : N -> Prep -> N2 = \n,c -> n ** {c=c} ; mkN2 : N -> Prep -> N2 = \n,c -> n ** {c=c} ;
--All masculine forms (except those with long pluralstem) are formed here. --All masculine forms (except those with long pluralstem) are formed here.
@@ -241,6 +245,44 @@ oper
}; };
} ; } ;
mkLN = overload {
mkLN : N -> LN = \noun -> lin LN {
s = \\c => noun.s ! c ! Sg ;
g = noun.g ;
n = Sg
};
mkLN : N -> Number -> LN = \noun,nr -> lin LN {
s = \\c => noun.s ! c ! nr ;
g = noun.g ;
n = nr
};
mkLN : Str -> LN =
\s -> lin LN {
s = \\_ => s ;
g = AMasc Inanimate ;
n = Sg
};
mkLN : Str -> AGender -> Number -> LN =
\s,g,n -> lin LN {
s = \\_ => s ;
g = g ;
n = n
};
mkLN : (_,_,_,_,_,_ : Str) -> AGender -> Number -> LN =
\nom,gen,dat,acc,loc,instr,g,n -> lin LN {
s = table {
Nom => nom;
Gen => gen;
Dat => dat;
Acc => acc;
Loc => loc;
Instr => instr
};
g = g ;
n = n
};
} ;
mkV = overload { mkV = overload {
mkV : (inf : Str) -> V = \v -> regV v (dp 2 v) ; mkV : (inf : Str) -> V = \v -> regV v (dp 2 v) ;
mkV : (inf,stem : Str) -> V = regV ; mkV : (inf,stem : Str) -> V = regV ;

View File

@@ -4,7 +4,6 @@ param
Case = Nom | Gen | Dat | Acc | Loc | Instr; Case = Nom | Gen | Dat | Acc | Loc | Instr;
Number = Sg | Dl | Pl ; Number = Sg | Dl | Pl ;
Gender = Masc | Fem | Neut ; Gender = Masc | Fem | Neut ;
Sex = Male | Female ;
Person = P1 | P2 | P3 ; Person = P1 | P2 | P3 ;
Species = Indef | Def ; Species = Indef | Def ;
Animacy = Animate | Inanimate ; Animacy = Animate | Inanimate ;

View File

@@ -40,6 +40,42 @@ lin
) )
} ; } ;
InflectionPN = \pn -> {
t = "pn" ;
s1 = heading1 ("Nombre Proprio" ++
case pn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = pn.s
} ;
InflectionGN = \gn -> {
t = "pn" ;
s1 = heading1 ("Nombre de Pila" ++
case gn.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = gn.s
} ;
InflectionSN = \sn -> {
t = "sn" ;
s1 = heading1 "Apellido" ;
s2 = sn.s ! Masc
} ;
InflectionLN = \ln -> {
t = "nl" ;
s1 = heading1 ("Nombre del Lugar" ++
case ln.g of {
Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")"
}) ;
s2 = paragraph ln.s
} ;
InflectionA, InflectionA2 = \adj -> { InflectionA, InflectionA2 = \adj -> {
t = "a" ; t = "a" ;
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;

View File

@@ -1,8 +1,14 @@
concrete NamesSpa of Names = CatSpa ** open Prelude, ResSpa, CommonRomance in { concrete NamesSpa of Names = CatSpa ** open Prelude, ResSpa, CommonRomance in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> pn2np n ; lin GivenName = \n -> pn2np n ;
lin MaleSurname = \n -> pn2np {s = n.s ! Masc; g = Masc} ;
lin FemaleSurname = \n -> pn2np {s = n.s ! Fem; g = Fem} ;
lin PlSurname = \n -> heavyNPpol False {
s = \\c => prepCase c ++ n.pl ;
a = agrP3 Masc Pl
} ;
lin FullName gn sn = pn2np { lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ; s = gn.s ++ sn.s ! gn.g ;
g = gn.g g = gn.g
} ; } ;
@@ -30,18 +36,19 @@ lin UseLN n = heavyNP {
lin InLN n = { lin InLN n = {
s = n.p.s ++ case n.art of { s = "en" ++
UseArt => case n.g of { case n.art of {
Fem => case n.num of { UseArt => case n.g of {
Sg => "la" ++ n.s; Fem => case n.num of {
Pl => "las" ++ n.s} ; Sg => "la" ++ n.s;
Masc => case n.num of { Pl => "las" ++ n.s} ;
Sg => "el" ++ n.s; Masc => case n.num of {
Pl => "los" ++ n.s Sg => "el" ++ n.s;
} Pl => "los" ++ n.s
} ; }
NoArt => n.s } ;
} ; NoArt => n.s
} ;
} ; } ;

View File

@@ -137,17 +137,38 @@ oper
-- Proper names need a string and a gender. -- Proper names need a string and a gender.
-- The default gender is feminine for names ending with "a", otherwise masculine. -- The default gender is feminine for names ending with "a", otherwise masculine.
mkPN : overload {
mkPN : (Anna : Str) -> PN ; -- feminine for "-a"
mkPN : (Pilar : Str) -> Gender -> PN ; -- force gender
mkPN : N -> PN ; -- gender from noun
} ;
mkGN = overload {
mkGN : (Anna : Str) -> GN = \s -> lin GN (regPN s) ; -- feminine for "-a", otherwise masculine
mkGN : (Pilar : Str) -> Gender -> GN = \s,g -> lin GN (mk2PN s g) ; -- force gender
} ;
mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_ => s; pl = s} ;
mkSN : Str -> Str -> Str -> SN = \male,female,pl -> lin SN {s = table {Masc=>male; Fem=>female}; pl = pl} ;
} ;
mkLN = overload { mkLN = overload {
mkLN : Str -> LN = \s ->
lin LN {s = s ;
onPrep = False ;
art = NoArt ;
g = Masc ;
num = Sg} ;
mkLN : Str -> Gender -> LN = \s,g -> mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ; lin LN {s = s ;
p = {s = "en"; c = Nom; isDir = True} ; onPrep = False ;
art = NoArt ; art = NoArt ;
g = g ; g = g ;
num = Sg} ; num = Sg} ;
mkLN : Str -> Gender -> Number -> LN = \s,g,num -> mkLN : Str -> Gender -> Number -> LN = \s,g,num ->
lin LN {s = s ; lin LN {s = s ;
p = {s = "en"; c = Nom; isDir = True} ; onPrep = False ;
art = NoArt ; art = NoArt ;
g = g ; g = g ;
num = num} ; num = num} ;
@@ -155,14 +176,6 @@ oper
defLN : LN -> LN = \n -> n ** {art = UseArt} ; defLN : LN -> LN = \n -> n ** {art = UseArt} ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {p = p} ;
mkPN : overload {
mkPN : (Anna : Str) -> PN ; -- feminine for "-a"
mkPN : (Pilar : Str) -> Gender -> PN ; -- force gender
mkPN : N -> PN ; -- gender from noun
} ;
--2 Adjectives --2 Adjectives
@@ -350,8 +363,8 @@ oper
Gender = MorphoSpa.Gender ; Gender = MorphoSpa.Gender ;
Number = MorphoSpa.Number ; Number = MorphoSpa.Number ;
CopulaType = DiffSpa.CopulaType ; CopulaType = DiffSpa.CopulaType ;
masculine = Masc ; masculine, male = Masc ;
feminine = Fem ; feminine, female = Fem ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
serCopula = DiffSpa.serCopula ; serCopula = DiffSpa.serCopula ;

View File

@@ -41,16 +41,14 @@ lin
s2 = frameTable ( s2 = frameTable (
tr (th "nom" ++ td (n.s ! Nom)) ++ tr (th "nom" ++ td (n.s ! Nom)) ++
tr (th "gen" ++ td (n.s ! Gen)) tr (th "gen" ++ td (n.s ! Gen))
) ++ ) ;
heading1 ("Adverb") ++
paragraph (n.c.s ++ n.s ! caseNP accusative) ;
} ; } ;
InflectionGN = \pn -> { InflectionGN = \pn -> {
t = "fnm" ; t = "fnm" ;
s1 = heading1 ("Förnamn" ++ case pn.g of { s1 = heading1 ("Förnamn" ++ case pn.g of {
Utr => "(utr)" ; Male => "(man)" ;
Neutr => "(neutr)" Female => "(kvinna)"
}) ; }) ;
s2 = frameTable ( s2 = frameTable (
tr (th "nom" ++ td (pn.s ! Nom)) ++ tr (th "nom" ++ td (pn.s ! Nom)) ++
@@ -60,13 +58,10 @@ lin
InflectionSN = \pn -> { InflectionSN = \pn -> {
t = "enm" ; t = "enm" ;
s1 = heading1 ("Efternamn" ++ case pn.g of { s1 = heading1 "Efternamn" ;
Utr => "(utr)" ;
Neutr => "(neutr)"
}) ;
s2 = frameTable ( s2 = frameTable (
tr (th "nom" ++ td (pn.s ! Nom)) ++ tr (th "nom" ++ td (pn.s ! Male ! Nom)) ++
tr (th "gen" ++ td (pn.s ! Gen)) tr (th "gen" ++ td (pn.s ! Male ! Gen))
) )
} ; } ;

View File

@@ -1,13 +1,28 @@
concrete NamesSwe of Names = CatSwe ** open CommonScand, ResSwe, Prelude in { concrete NamesSwe of Names = CatSwe ** open CommonScand, ResSwe, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \pn -> { lin GivenName = \pn -> {
s = \\c => pn.s ! caseNP c ; s = \\c => pn.s ! caseNP c ;
a = agrP3 pn.g Sg ; a = agrP3 Utr Sg ;
isPron = False
} ;
lin MaleSurname = \pn -> {
s = \\c => pn.s ! Male ! caseNP c ;
a = agrP3 Utr Sg ;
isPron = False
} ;
lin FemaleSurname = \pn -> {
s = \\c => pn.s ! Female ! caseNP c ;
a = agrP3 Utr Sg ;
isPron = False
} ;
lin PlSurname = \pn -> {
s = \\c => pn.pl ! caseNP c ;
a = agrP3 Utr Pl ;
isPron = False isPron = False
} ; } ;
lin FullName gn sn = { lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! caseNP c ; s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! caseNP c ;
a = agrP3 gn.g Sg ; a = agrP3 Utr Sg ;
isPron = False isPron = False
} ; } ;
@@ -17,6 +32,6 @@ lin FullName gn sn = {
isPron = False isPron = False
} ; } ;
InLN n = {s = n.c.s ++ n.s ! caseNP accusative} ; InLN n = {s = "i" ++ n.s ! caseNP accusative} ;
} }

View File

@@ -155,12 +155,24 @@ oper
geoPN : Str -> PN ; -- neuter, with identical genitive if ends in a vowel geoPN : Str -> PN ; -- neuter, with identical genitive if ends in a vowel
mkLN = overload { mkLN = overload {
mkLN : Str -> LN = \s -> lin LN (regPN s) ** {c={s="i";hasPrep=True}; n=Sg}; -- default gender utrum mkLN : Str -> LN = \s -> lin LN (regPN s) ** {n=Sg}; -- default gender utrum
mkLN : Str -> Gender -> LN = \s,g -> lin LN (regGenPN s g) ** {c={s="i";hasPrep=True}; n=Sg} ; -- set other gender mkLN : Str -> Gender -> LN = \s,g -> lin LN (regGenPN s g) ** {n=Sg} ; -- set other gender
mkLN : Str -> Gender -> Number -> LN = \s,g,n -> lin LN (regGenPN s g) ** {c={s="i";hasPrep=True}; n=n} ; -- set other gender mkLN : Str -> Gender -> Number -> LN = \s,g,n -> lin LN (regGenPN s g) ** {n=n} ; -- set other gender and number
} ;
mkGN = overload {
mkGN : Str -> GN = \s -> lin GN {s = \\c => mkCase c s ; g = Male}; -- default gender utrum
mkGN : Str -> Sex -> GN = \s,g -> lin GN {s = \\c => mkCase c s ; g = g} ; -- set other gender
} ;
mkSN = overload {
mkSN : Str -> SN = \s -> lin SN {s = \\_,c => mkCase c s; pl = \\c => mkCase c s}; -- default gender utrum
mkSN : Str -> Str -> Str -> SN =
\male,female,pl -> lin SN {s = table {Male => \\c => mkCase c male;
Female => \\c => mkCase c female} ;
pl = \\c => mkCase c pl
} ;
} ; } ;
prepLN : LN -> Prep -> LN = \n,p -> n ** {c = mkComplement p.s} ;
--2 Adjectives --2 Adjectives
@@ -359,6 +371,8 @@ oper
utrum = Utr ; utrum = Utr ;
neutrum = Neutr ; neutrum = Neutr ;
neuter = Neutr ; neuter = Neutr ;
male = Male ;
female = Female ;
singular = Sg ; singular = Sg ;
plural = Pl ; plural = Pl ;
nominative = Nom ; nominative = Nom ;