From 6bc965f6c2b5266bdb3ddf3cd1a6fe5bebd3e69f Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Wed, 16 Aug 2023 19:39:22 +0200 Subject: [PATCH] the names API in more languages --- src/afrikaans/CatAfr.gf | 5 +- src/afrikaans/DocumentationAfr.gf | 6 +- src/afrikaans/NamesAfr.gf | 39 ++++++- src/afrikaans/ParadigmsAfr.gf | 21 ++++ src/bulgarian/CatBul.gf | 2 +- src/bulgarian/DocumentationBul.gf | 8 +- src/bulgarian/MorphoFunsBul.gf | 10 +- src/bulgarian/NamesBul.gf | 10 +- src/bulgarian/ResBul.gf | 1 - src/catalan/DocumentationCatFunctor.gf | 36 ++++++ src/catalan/NamesCat.gf | 38 ++++++- src/catalan/ParadigmsCat.gf | 41 ++++++- src/chinese/DocumentationChi.gf | 10 +- src/chinese/NamesChi.gf | 8 +- src/common/ParamX.gf | 3 + src/dutch/CatDut.gf | 5 +- src/dutch/DocumentationDutFunctor.gf | 26 ++++- src/dutch/NamesDut.gf | 40 ++++++- src/dutch/ParadigmsDut.gf | 22 ++++ src/english/CatEng.gf | 6 +- src/english/DocumentationEng.gf | 32 +++--- src/english/NamesEng.gf | 33 ++++-- src/english/ParadigmsEng.gf | 60 +++++++--- src/english/ResEng.gf | 3 + src/estonian/CatEst.gf | 5 +- src/estonian/DocumentationEstFunctor.gf | 41 +++++++ src/estonian/NamesEst.gf | 34 +++++- src/estonian/ParadigmsEst.gf | 52 +++++++++ src/finnish/CatFin.gf | 5 +- src/finnish/DocumentationFinFunctor.gf | 21 ++-- src/finnish/NamesFin.gf | 33 +++++- src/finnish/ParadigmsFin.gf | 33 ++++++ src/french/DocumentationFreFunctor.gf | 46 ++++++++ src/french/NamesFre.gf | 23 +++- src/french/ParadigmsFre.gf | 42 ++++--- src/german/CatGer.gf | 3 +- src/german/DocumentationGerFunctor.gf | 60 ++++++++++ src/german/NamesGer.gf | 33 +++++- src/german/ParadigmsGer.gf | 26 +++++ src/german/ResGer.gf | 1 - src/italian/DocumentationItaFunctor.gf | 36 ++++++ src/italian/NamesIta.gf | 55 ++++++++- src/italian/ParadigmsIta.gf | 41 +++++-- src/norwegian/DiffNor.gf | 3 +- src/norwegian/MorphoNor.gf | 4 +- src/norwegian/ParadigmsNor.gf | 4 +- src/nynorsk/DiffNno.gf | 3 +- src/nynorsk/MorphoNno.gf | 4 +- src/nynorsk/ParadigmsNno.gf | 4 +- src/portuguese/DocumentationPorFunctor.gf | 36 ++++++ src/portuguese/NamesPor.gf | 55 ++++++++- src/portuguese/ParadigmsPor.gf | 47 ++++++-- src/romance/CatRomance.gf | 16 +-- src/russian/CatRus.gf | 18 ++- src/russian/DocumentationRusFunctor.gf | 96 +++++++++++++--- src/russian/NamesRus.gf | 61 ++++++---- src/russian/ParadigmsRus.gf | 131 +++++++++++++++++++++- src/scandinavian/CatScand.gf | 7 +- src/slovenian/CatSlv.gf | 7 +- src/slovenian/DocumentationSlv.gf | 70 +++++++++++- src/slovenian/NamesSlv.gf | 12 +- src/slovenian/ParadigmsSlv.gf | 44 +++++++- src/slovenian/ResSlv.gf | 1 - src/spanish/DocumentationSpaFunctor.gf | 36 ++++++ src/spanish/NamesSpa.gf | 35 +++--- src/spanish/ParadigmsSpa.gf | 39 ++++--- src/swedish/DocumentationSwe.gf | 17 +-- src/swedish/NamesSwe.gf | 25 ++++- src/swedish/ParadigmsSwe.gf | 24 +++- 69 files changed, 1584 insertions(+), 270 deletions(-) diff --git a/src/afrikaans/CatAfr.gf b/src/afrikaans/CatAfr.gf index e2f230c2..f26f6c55 100644 --- a/src/afrikaans/CatAfr.gf +++ b/src/afrikaans/CatAfr.gf @@ -83,6 +83,9 @@ concrete CatAfr of Cat = N = Noun ; N2 = {s : NForm => Str ; g : Gender} ** {c2 : 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} ; } diff --git a/src/afrikaans/DocumentationAfr.gf b/src/afrikaans/DocumentationAfr.gf index ebaf00e8..c080d206 100644 --- a/src/afrikaans/DocumentationAfr.gf +++ b/src/afrikaans/DocumentationAfr.gf @@ -29,9 +29,9 @@ lin } ; InflectionLN = \ln -> { - t = "ln" ; + t = "pn" ; s1 = heading1 "Naam" ; - s2 = paragraph (ln.s ! NPNom) + s2 = paragraph (ln.s ! Strong ! NPNom) } ; InflectionGN = \pn -> { @@ -43,7 +43,7 @@ lin InflectionSN = \pn -> { t = "van" ; s1 = heading1 "Van" ; - s2 = paragraph (pn.s ! NPNom) + s2 = paragraph (pn.s ! Male ! NPNom) } ; InflectionA, InflectionA2 = \adj -> diff --git a/src/afrikaans/NamesAfr.gf b/src/afrikaans/NamesAfr.gf index 15d12e89..f079b984 100644 --- a/src/afrikaans/NamesAfr.gf +++ b/src/afrikaans/NamesAfr.gf @@ -1,9 +1,40 @@ concrete NamesAfr of Names = CatAfr ** open ResAfr, Prelude in { -lin GivenName, MaleSurname, FemaleSurname = \n -> {s = n.s ; a = agrP3 Sg ; isPron = False} ; -lin FullName gn sn = - {s = \\c => gn.s ! NPNom ++ sn.s ! c ; a = agrP3 Sg ; isPron = False} ; +lin GivenName = \n -> {s = n.s ; a = agrP3 Sg ; isPron = False} ; +lin MaleSurname = \n -> {s = n.s ! Male ; 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) ; + } ; } diff --git a/src/afrikaans/ParadigmsAfr.gf b/src/afrikaans/ParadigmsAfr.gf index c7ae8b33..42dbfd8d 100644 --- a/src/afrikaans/ParadigmsAfr.gf +++ b/src/afrikaans/ParadigmsAfr.gf @@ -73,6 +73,25 @@ oper 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 @@ -205,6 +224,8 @@ oper feminine = Neutr ; het,neuter = Neutr ; de,utrum = Neutr ; + male = Male ; + female = Female ; mkA = overload { mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ; diff --git a/src/bulgarian/CatBul.gf b/src/bulgarian/CatBul.gf index c4bbfe3e..4eec21ca 100644 --- a/src/bulgarian/CatBul.gf +++ b/src/bulgarian/CatBul.gf @@ -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} ; GN = {s : Str; g : Sex} ; 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} ; lindef diff --git a/src/bulgarian/DocumentationBul.gf b/src/bulgarian/DocumentationBul.gf index b047edda..76630cb5 100644 --- a/src/bulgarian/DocumentationBul.gf +++ b/src/bulgarian/DocumentationBul.gf @@ -103,7 +103,11 @@ lin }) ; s2 = paragraph (n.s ! Indef) ++ 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 = "" } ; @@ -160,7 +164,7 @@ lin } ; InflectionPrep = \prep -> { - t = "пр" ; + t = "пред" ; s1= heading1 ("Предлог") ; s2= paragraph (prep.s) ; s3= "" diff --git a/src/bulgarian/MorphoFunsBul.gf b/src/bulgarian/MorphoFunsBul.gf index 6fa19478..5aa59c45 100644 --- a/src/bulgarian/MorphoFunsBul.gf +++ b/src/bulgarian/MorphoFunsBul.gf @@ -292,16 +292,16 @@ oper } ; 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 = - \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 = - \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 = - \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 -- diff --git a/src/bulgarian/NamesBul.gf b/src/bulgarian/NamesBul.gf index 97f0307a..ea5c5901 100644 --- a/src/bulgarian/NamesBul.gf +++ b/src/bulgarian/NamesBul.gf @@ -1,4 +1,4 @@ -concrete NamesBul of Names = CatBul ** open ResBul in { +concrete NamesBul of Names = CatBul ** open ResBul, Prelude in { lin GivenName = \n -> { s = table { RObj c => linCase c Pos ++ n.s; @@ -44,7 +44,13 @@ lin UseLN, PlainLN = \n -> { 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 ** { s = \\sp => case ap.isPre of { diff --git a/src/bulgarian/ResBul.gf b/src/bulgarian/ResBul.gf index cde09a47..e869807c 100644 --- a/src/bulgarian/ResBul.gf +++ b/src/bulgarian/ResBul.gf @@ -47,7 +47,6 @@ resource ResBul = ParamX ** open Prelude, Predef in { param Gender = Masc | Fem | Neut ; - Sex = Male | Female ; Species = Indef | Def ; diff --git a/src/catalan/DocumentationCatFunctor.gf b/src/catalan/DocumentationCatFunctor.gf index 351fddbd..8b30bba5 100644 --- a/src/catalan/DocumentationCatFunctor.gf +++ b/src/catalan/DocumentationCatFunctor.gf @@ -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 -> { t = "a" ; s1 = heading1 (nounHeading adjective_Category).s ; diff --git a/src/catalan/NamesCat.gf b/src/catalan/NamesCat.gf index 52d69dba..e64c20fc 100644 --- a/src/catalan/NamesCat.gf +++ b/src/catalan/NamesCat.gf @@ -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 { - s = gn.s ++ sn.s ; + s = gn.s ++ sn.s ! 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 ; + } ; + } diff --git a/src/catalan/ParadigmsCat.gf b/src/catalan/ParadigmsCat.gf index ada9ec08..edf09edb 100644 --- a/src/catalan/ParadigmsCat.gf +++ b/src/catalan/ParadigmsCat.gf @@ -139,12 +139,39 @@ oper mkPN : N -> PN ; } ; - mkLN : Str -> LN = \s -> - lin LN {s = s ; - p = {s=""; c=CPrep P_a; isDir=True} ; - art = NoArt ; - g = Masc ; - num = Sg} ; + 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 : 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 @@ -308,6 +335,8 @@ oper CopulaType = DiffCat.CopulaType ; masculine = Masc ; feminine = Fem ; + male = Masc ; + female = Fem ; singular = Sg ; plural = Pl ; serCopula = DiffCat.serCopula ; diff --git a/src/chinese/DocumentationChi.gf b/src/chinese/DocumentationChi.gf index 4b3e8678..0e2b84b8 100644 --- a/src/chinese/DocumentationChi.gf +++ b/src/chinese/DocumentationChi.gf @@ -112,26 +112,26 @@ lin } ; InflectionPN = \n -> { - t = "v" ; + t = "pn" ; s1 = heading1 "Proper Name" ; s2 = n.s } ; InflectionLN = \n -> { - t = "v" ; + t = "pn" ; s1 = heading1 "Location Name" ; s2 = n.s } ; InflectionGN = \n -> { - t = "v" ; + t = "pn" ; s1 = heading1 "Given Name" ; s2 = n.s } ; InflectionSN = \n -> { - t = "v" ; - s1 = heading1 "Surname Name" ; + t = "pn" ; + s1 = heading1 "Family Name" ; s2 = n.s } ; diff --git a/src/chinese/NamesChi.gf b/src/chinese/NamesChi.gf index c583a763..6d529154 100644 --- a/src/chinese/NamesChi.gf +++ b/src/chinese/NamesChi.gf @@ -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 FullName gn sn = { @@ -6,6 +6,10 @@ lin FullName gn sn = { 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 ? } diff --git a/src/common/ParamX.gf b/src/common/ParamX.gf index a9940665..20cd9eba 100644 --- a/src/common/ParamX.gf +++ b/src/common/ParamX.gf @@ -18,6 +18,9 @@ resource ParamX = open Prelude in { | Cond --# notpresent ; + param + Sex = Male | Female ; + param Polarity = Pos | Neg ; diff --git a/src/dutch/CatDut.gf b/src/dutch/CatDut.gf index 80763f90..85bdb995 100644 --- a/src/dutch/CatDut.gf +++ b/src/dutch/CatDut.gf @@ -81,6 +81,9 @@ concrete CatDut of Cat = N = Noun ; N2 = {s : NForm => Str ; g : Gender} ** {c2 : 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} ; } diff --git a/src/dutch/DocumentationDutFunctor.gf b/src/dutch/DocumentationDutFunctor.gf index 920a7db3..6b5dadb1 100644 --- a/src/dutch/DocumentationDutFunctor.gf +++ b/src/dutch/DocumentationDutFunctor.gf @@ -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 -> let gforms : AForm -> Str = \a -> @@ -61,7 +85,7 @@ lin InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> { t = "adv" ; - s1 = heading1 (heading preposition_Category) ; + s1 = heading1 "Bijwoord" ; s2 = paragraph adv.s } ; diff --git a/src/dutch/NamesDut.gf b/src/dutch/NamesDut.gf index c79205aa..e62b4729 100644 --- a/src/dutch/NamesDut.gf +++ b/src/dutch/NamesDut.gf @@ -1,9 +1,43 @@ 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 = - 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 => ; + False => } ; + af = agrAdj gan.p1 gan.p2 gan.p3 ; + in preOrPost ap.isPre + (ap.s ! agrP3 Sg ! af) + (ln.s ! a ! c) ; + } ; } diff --git a/src/dutch/ParadigmsDut.gf b/src/dutch/ParadigmsDut.gf index a797b65b..dbbbc972 100644 --- a/src/dutch/ParadigmsDut.gf +++ b/src/dutch/ParadigmsDut.gf @@ -76,6 +76,24 @@ oper 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 @@ -249,6 +267,10 @@ oper de,utrum = Utr ; nominative = Nom ; genitive = Gen ; + male = Male ; + female = Female ; + singular = Sg ; + plural = Pl ; mkA = overload { mkA : (vers : Str) -> A = \a -> lin A (regAdjective a) ; diff --git a/src/english/CatEng.gf b/src/english/CatEng.gf index 8a9482f3..18c30b0c 100644 --- a/src/english/CatEng.gf +++ b/src/english/CatEng.gf @@ -106,9 +106,11 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in { N = {s : Number => Case => Str ; g : Gender} ; N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : 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; - 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" n : Number; } ; diff --git a/src/english/DocumentationEng.gf b/src/english/DocumentationEng.gf index 343e0c24..75066bb5 100644 --- a/src/english/DocumentationEng.gf +++ b/src/english/DocumentationEng.gf @@ -50,36 +50,36 @@ lin tr (td (n.s ! Nom) ++ td (n.s ! Gen)) ) ++ heading1 ("Adverb") ++ - paragraph (n.p ++ case n.art of { - True => "the" ++ n.s ! Nom ; - False => n.s ! Nom}) ; + paragraph (case n.prep of { + InPrep => "in" ; + OnPrep => "on" ; + AtPrep => "at" + } ++ + case n.art of { + True => "the" ++ n.s ! Nom ; + False => n.s ! Nom + }) ; } ; - InflectionGN = \pn -> { + InflectionGN = \gn -> { t = "gn" ; s1 = heading1 ("Given Name" ++ - case pn.g of { - Neutr => ""; - Masc => "(masc)"; - Fem => "(fem)" + case gn.g of { + Male => "(male)"; + Female => "(female)" }) ; s2 = frameTable ( 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 -> { t = "sn" ; - s1 = heading1 ("Secondary Name" ++ - case pn.g of { - Neutr => ""; - Masc => "(masc)"; - Fem => "(fem)" - }) ; + s1 = heading1 "Secondary Name" ; s2 = frameTable ( 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)) ) } ; diff --git a/src/english/NamesEng.gf b/src/english/NamesEng.gf index fa341f9c..b88a75b2 100644 --- a/src/english/NamesEng.gf +++ b/src/english/NamesEng.gf @@ -1,8 +1,22 @@ concrete NamesEng of Names = CatEng ** open Prelude, ResEng in { -lin GivenName gn = {s = \\c => gn.s ! npcase2case c ; a = agrgP3 Sg gn.g} ; -lin MaleSurname, FemaleSurname = \sn -> {s = \\c => sn.s ! npcase2case c ; a = agrgP3 Sg sn.g} ; -lin FullName gn sn = {s = \\c => gn.s ! Nom ++ sn.s ! npcase2case c ; a = agrgP3 Sg gn.g} ; +lin GivenName gn = { + s = \\c => gn.s ! npcase2case c ; + 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 = { s = \\c => case n.art of { @@ -18,10 +32,15 @@ lin PlainLN n = { } ; lin InLN n = { - s = n.p ++ case n.art of { - True => "the" ++ n.s ! Nom ; - False => n.s ! Nom - } ; + s = case n.prep of { + InPrep => "in" ; + OnPrep => "on" ; + AtPrep => "at" + } ++ + case n.art of { + True => "the" ++ n.s ! Nom ; + False => n.s ! Nom + } ; } ; lin AdjLN ap n = n ** { diff --git a/src/english/ParadigmsEng.gf b/src/english/ParadigmsEng.gf index bf9556c0..36a00e5d 100644 --- a/src/english/ParadigmsEng.gf +++ b/src/english/ParadigmsEng.gf @@ -130,23 +130,6 @@ oper -- Proper names, with a regular genitive, are formed from strings. 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 : Str -> PN ; @@ -157,6 +140,47 @@ oper 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 ifPluralNP : NP -> Bool @@ -397,6 +421,8 @@ mkVoc s = lin Voc (ss s) ; nonhuman = Neutr ; masculine = Masc ; feminine = Fem ; + male = Male ; + female = Female ; singular = Sg ; plural = Pl ; nominative = npNom ; diff --git a/src/english/ResEng.gf b/src/english/ResEng.gf index 1257ca98..440f2251 100644 --- a/src/english/ResEng.gf +++ b/src/english/ResEng.gf @@ -690,4 +690,7 @@ param finalComma : Str = pre {"," | "." => []; "" => SOFT_BIND ++ ","; _ => []} ; frontComma : Str = SOFT_BIND ++ "," ; +param + LNPrep = InPrep | OnPrep | AtPrep ; + } diff --git a/src/estonian/CatEst.gf b/src/estonian/CatEst.gf index 2c49380d..c019747e 100644 --- a/src/estonian/CatEst.gf +++ b/src/estonian/CatEst.gf @@ -91,7 +91,10 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in { c2,c3 : Compl ; 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 VP = \vp -> linV vp.v ; diff --git a/src/estonian/DocumentationEstFunctor.gf b/src/estonian/DocumentationEstFunctor.gf index 9441583e..e310ef79 100644 --- a/src/estonian/DocumentationEstFunctor.gf +++ b/src/estonian/DocumentationEstFunctor.gf @@ -36,6 +36,33 @@ lin 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 -> let posit : (AForm => Str) = adj.s ! Posit ; compar : (AForm => Str) = adj.s ! Compar ; @@ -272,6 +299,20 @@ oper 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 NoDefinition t = {s=t.s}; MkDefinition t d = {s="

Definitsioon:"++t.s++d.s++"

"}; diff --git a/src/estonian/NamesEst.gf b/src/estonian/NamesEst.gf index ee2c5371..38eee3e1 100644 --- a/src/estonian/NamesEst.gf +++ b/src/estonian/NamesEst.gf @@ -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 ; a = agrP3 Sg ; 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 ** { - 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 ; isPron = False } ; -lin UseLN pn = emptyNP ** { - s = \\c => pn.s ! npform2case Sg c ; +lin UseLN, PlainLN = \ln -> emptyNP ** { + s = \\c => ln.s ! npform2case Sg c ; a = agrP3 Sg ; isPron = False } ; +lin InLN pn = { + s = appCompl True Pos (casePrep inessive) + (emptyNP ** { + s = \\c => pn.s ! npform2case Sg c ; + a = agrP3 Sg ; + isPron = False + }) + } ; + } diff --git a/src/estonian/ParadigmsEst.gf b/src/estonian/ParadigmsEst.gf index 6d0b7620..0e8723f4 100644 --- a/src/estonian/ParadigmsEst.gf +++ b/src/estonian/ParadigmsEst.gf @@ -42,6 +42,9 @@ resource ParadigmsEst = open -- defined in $ResEst$. oper + male = Male ; + female = Female ; + Number : Type ; singular : Number ; @@ -610,6 +613,55 @@ oper 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 mkA = overload { diff --git a/src/finnish/CatFin.gf b/src/finnish/CatFin.gf index 14778ba6..49f5ca19 100644 --- a/src/finnish/CatFin.gf +++ b/src/finnish/CatFin.gf @@ -95,7 +95,10 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in { N = SNoun ; N2 = SNoun ** {c2 : Compl ; isPre : Bool ; postmod : Number => Str} ; 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 SSlash = \ss -> ss.s ++ ss.c2.s.p1 ; diff --git a/src/finnish/DocumentationFinFunctor.gf b/src/finnish/DocumentationFinFunctor.gf index 65a041fe..05a8f85c 100644 --- a/src/finnish/DocumentationFinFunctor.gf +++ b/src/finnish/DocumentationFinFunctor.gf @@ -33,26 +33,29 @@ lin InflectionPN = \pn -> { t = "s" ; - s1 = heading1 (heading noun_Category) ; + s1 = heading1 "Oikea Nimi" ; s2 = inflPN (\c -> pn.s ! c) } ; - InflectionLN = \pn -> { + InflectionLN ln = { t = "s" ; - s1 = heading1 (heading noun_Category) ; - s2 = inflPN (\c -> pn.s ! c) + s1 = heading1 "Paikannimi" ; + s2 = inflPN (\c -> ln.s ! c) } ; - InflectionGN = \pn -> { + InflectionGN gn = { t = "s" ; - s1 = heading1 "Etunimi" ; - s2 = inflPN (\c -> pn.s ! c) + s1 = heading1 "Etunimi"++case gn.g of { + Male => "(mies)" ; + Female => "(nainen)" + } ; + s2 = inflPN (\c -> gn.s ! c) } ; - InflectionSN = \pn -> { + InflectionSN sn = { t = "s" ; s1 = heading1 "Sukunimi" ; - s2 = inflPN (\c -> pn.s ! c) + s2 = inflPN (\c -> (sn.s ! Male).s ! c) } ; InflectionA, InflectionA2 = \adj -> { diff --git a/src/finnish/NamesFin.gf b/src/finnish/NamesFin.gf index 4039dc02..8ecbf92f 100644 --- a/src/finnish/NamesFin.gf +++ b/src/finnish/NamesFin.gf @@ -1,20 +1,43 @@ concrete NamesFin of Names = CatFin ** open ResFin, StemFin, Prelude in { -lin GivenName, MaleSurname, FemaleSurname = \n -> { +lin GivenName n = { s = snoun2np Sg n ; a = agrP3 Sg ; 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 = { - 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 ; isPron = False ; isNeg = False } ; -lin UseLN pn = { - s = snoun2np Sg pn ; - a = agrP3 Sg ; +lin UseLN, PlainLN = \ln -> { + s = snoun2np ln.n ln ; + a = agrP3 ln.n ; 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 + } + } ; + } diff --git a/src/finnish/ParadigmsFin.gf b/src/finnish/ParadigmsFin.gf index 53e921da..c6eca84e 100644 --- a/src/finnish/ParadigmsFin.gf +++ b/src/finnish/ParadigmsFin.gf @@ -422,6 +422,9 @@ mkVS = overload { Case = MorphoFin.Case ; Number = MorphoFin.Number ; + male = Male ; + female = Female ; + singular = Sg ; 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 diff --git a/src/french/DocumentationFreFunctor.gf b/src/french/DocumentationFreFunctor.gf index 8dd61dcc..5a90f25e 100644 --- a/src/french/DocumentationFreFunctor.gf +++ b/src/french/DocumentationFreFunctor.gf @@ -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 -> { t = "a" ; s1 = heading1 (nounHeading adjective_Category).s ; diff --git a/src/french/NamesFre.gf b/src/french/NamesFre.gf index b7415da8..77637c84 100644 --- a/src/french/NamesFre.gf +++ b/src/french/NamesFre.gf @@ -1,8 +1,14 @@ 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 { - s = gn.s ++ sn.s ; + s = gn.s ++ sn.s ! gn.g ; g = gn.g } ; @@ -21,10 +27,15 @@ lin UseLN n = heavyNP { lin InLN n = { - s = n.p.s ++ case n.art of { - AlwaysArt => artDef True n.g n.num n.p.c ++ n.s; - _ => prepCase n.p.c ++ n.s - } ; + s = let p : {s : Str; c:Prepos} = + case n.onPrep of { + 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 + } ; } ; diff --git a/src/french/ParadigmsFre.gf b/src/french/ParadigmsFre.gf index 83a7fff2..fa11d608 100644 --- a/src/french/ParadigmsFre.gf +++ b/src/french/ParadigmsFre.gf @@ -132,17 +132,38 @@ oper -- 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. + 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 : 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 ; - p = {s=""; c=CPrep P_a; isDir=True} ; + onPrep=False ; art = NoArt ; g = g ; num = Sg} ; - mkLN : Str -> Gender -> Number -> LN = \s,g,num -> lin LN {s = s ; - p = {s=""; c=CPrep P_a; isDir=True} ; + onPrep=False ; art = NoArt ; g = g ; num = num} ; @@ -151,14 +172,7 @@ oper defLN : LN -> LN = \n -> n ** {art = AlwaysArt} ; useDefLN : LN -> LN = \n -> n ** {art = UseArt} ; - prepLN : LN -> Prep -> LN = \n,p -> n ** {p = p} ; - - 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 - } ; - + enLN : LN -> LN = \n -> n ** {onPrep = True} ; --2 Adjectives @@ -355,8 +369,10 @@ oper Gender = MorphoFre.Gender ; Number = MorphoFre.Number ; - masculine = Masc ; - feminine = Fem ; + masculine, male = Masc ; + feminine, female = Fem ; + male = Masc ; + female = Fem ; singular = Sg ; plural = Pl ; diff --git a/src/german/CatGer.gf b/src/german/CatGer.gf index 8130ea6f..9b7d8550 100644 --- a/src/german/CatGer.gf +++ b/src/german/CatGer.gf @@ -102,7 +102,8 @@ concrete CatGer of Cat = N3 = ResGer.Noun ** {c2,c3 : Preposition} ; GN = {s : Case => Str; g : Sex} ; 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 diff --git a/src/german/DocumentationGerFunctor.gf b/src/german/DocumentationGerFunctor.gf index eedea374..bfa43c3f 100644 --- a/src/german/DocumentationGerFunctor.gf +++ b/src/german/DocumentationGerFunctor.gf @@ -40,6 +40,66 @@ lin ) } ; + InflectionPN = \pn -> { + t = "pn" ; + s1 = heading1 ("Eigenname" ++ + "("+case of { + => heading masculine_Parameter ; + => heading feminine_Parameter ; + => 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 of { + => heading masculine_Parameter ; + => heading feminine_Parameter ; + => 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 -> let gforms : Degree -> ResGer.Case -> Str = \d,c -> diff --git a/src/german/NamesGer.gf b/src/german/NamesGer.gf index 978b99ca..7f3c8efa 100644 --- a/src/german/NamesGer.gf +++ b/src/german/NamesGer.gf @@ -1,4 +1,4 @@ -concrete NamesGer of Names = CatGer ** open ResGer in { +concrete NamesGer of Names = CatGer ** open ResGer, Prelude in { lin GivenName gn = { s = \\c => usePrepC c (\k -> gn.s ! k) ; @@ -31,15 +31,40 @@ lin PlSurname sn = { lin FullName gn sn = { s = \\c => usePrepC c (\k -> gn.s ! Nom ++ sn.s ! gn.g ! k) ; 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 ; rc, ext = [] } ; -lin UseLN pn = { - s = \\c => usePrepC c (\k -> pn.s ! k) ; - a = agrgP3 pn.g pn.n ; +lin PlainLN ln = { + s = \\c => usePrepC c (\k -> ln.s ! adjfCase Strong k ! k) ; + a = agrgP3 ln.g ln.n ; w = WLight ; 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) ; + } ; + } diff --git a/src/german/ParadigmsGer.gf b/src/german/ParadigmsGer.gf index 65a87d85..17eaae58 100644 --- a/src/german/ParadigmsGer.gf +++ b/src/german/ParadigmsGer.gf @@ -165,6 +165,32 @@ mkN : overload { 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 ifPluralNP : NP -> Bool diff --git a/src/german/ResGer.gf b/src/german/ResGer.gf index 47eea586..34cb3ccc 100644 --- a/src/german/ResGer.gf +++ b/src/german/ResGer.gf @@ -25,7 +25,6 @@ resource ResGer = ParamX ** open Prelude in { param Case = Nom | Acc | Dat | Gen ; Gender = Masc | Fem | Neutr ; - Sex = Male | Female ; -- Complex $CN$s, like adjectives, have strong and weak forms. diff --git a/src/italian/DocumentationItaFunctor.gf b/src/italian/DocumentationItaFunctor.gf index 89afd907..b8c5ce01 100644 --- a/src/italian/DocumentationItaFunctor.gf +++ b/src/italian/DocumentationItaFunctor.gf @@ -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 -> { t = "a" ; s1 = heading1 (nounHeading adjective_Category).s ; diff --git a/src/italian/NamesIta.gf b/src/italian/NamesIta.gf index 9dde301b..8cb83371 100644 --- a/src/italian/NamesIta.gf +++ b/src/italian/NamesIta.gf @@ -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 { - s = gn.s ++ sn.s ; + s = gn.s ++ sn.s ! 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 ; + } ; + } diff --git a/src/italian/ParadigmsIta.gf b/src/italian/ParadigmsIta.gf index bfd39385..2454bf15 100644 --- a/src/italian/ParadigmsIta.gf +++ b/src/italian/ParadigmsIta.gf @@ -145,13 +145,38 @@ oper mkPN : N -> PN ; -- get gender from noun } ; - mkLN : Str -> LN = \s -> - lin LN {s = s ; - p = {s=""; c=CPrep P_a; isDir=True} ; - art = NoArt ; - g = Masc ; - num = Sg} ; + 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 : 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 @@ -333,8 +358,8 @@ oper Gender = MorphoIta.Gender ; Number = MorphoIta.Number ; - masculine = Masc ; - feminine = Fem ; + masculine, male = Masc ; + feminine, female = Fem ; singular = Sg ; plural = Pl ; diff --git a/src/norwegian/DiffNor.gf b/src/norwegian/DiffNor.gf index e3f7b771..0c807c6a 100644 --- a/src/norwegian/DiffNor.gf +++ b/src/norwegian/DiffNor.gf @@ -10,10 +10,9 @@ instance DiffNor of DiffScand = open CommonScand, Prelude in { param NGenderNor = NUtr Sex | NNeutr ; - Sex = Masc | Fem ; oper - utrum = NUtr Masc ; + utrum = NUtr Male ; neutrum = NNeutr ; detDef : Species = Def ; diff --git a/src/norwegian/MorphoNor.gf b/src/norwegian/MorphoNor.gf index 061ebe47..1a521c4a 100644 --- a/src/norwegian/MorphoNor.gf +++ b/src/norwegian/MorphoNor.gf @@ -14,8 +14,8 @@ resource MorphoNor = CommonScand, ResNor ** open Prelude, Predef in { -- genders oper - masc = NUtr Masc ; - fem = NUtr Fem ; + masc = NUtr Male ; + fem = NUtr Female ; neutr = NNeutr ; -- type synonyms diff --git a/src/norwegian/ParadigmsNor.gf b/src/norwegian/ParadigmsNor.gf index 53244829..a3dc7de9 100644 --- a/src/norwegian/ParadigmsNor.gf +++ b/src/norwegian/ParadigmsNor.gf @@ -279,8 +279,8 @@ oper Gender = MorphoNor.NGender ; Number = MorphoNor.Number ; Case = MorphoNor.Case ; - masculine = NUtr Masc ; - feminine = NUtr Fem ; + masculine = NUtr Male ; + feminine = NUtr Female ; neutrum = NNeutr ; utrum = masculine ; singular = Sg ; diff --git a/src/nynorsk/DiffNno.gf b/src/nynorsk/DiffNno.gf index 868a2bff..f0adcc0b 100644 --- a/src/nynorsk/DiffNno.gf +++ b/src/nynorsk/DiffNno.gf @@ -10,10 +10,9 @@ instance DiffNno of DiffScand = open CommonScand, Prelude in { param NGenderNno = NUtr Sex | NNeutr ; - Sex = Masc | Fem ; oper - utrum = NUtr Masc ; + utrum = NUtr Male ; neutrum = NNeutr ; detDef : Species = Def ; diff --git a/src/nynorsk/MorphoNno.gf b/src/nynorsk/MorphoNno.gf index d38761e7..2b59c14c 100644 --- a/src/nynorsk/MorphoNno.gf +++ b/src/nynorsk/MorphoNno.gf @@ -14,8 +14,8 @@ resource MorphoNno = CommonScand, ResNno ** open Prelude, Predef in { -- genders oper - masc = NUtr Masc ; - fem = NUtr Fem ; + masc = NUtr Male ; + fem = NUtr Female ; neutr = NNeutr ; -- type synonyms diff --git a/src/nynorsk/ParadigmsNno.gf b/src/nynorsk/ParadigmsNno.gf index f94046b4..14507490 100644 --- a/src/nynorsk/ParadigmsNno.gf +++ b/src/nynorsk/ParadigmsNno.gf @@ -276,8 +276,8 @@ oper Gender = MorphoNno.NGender ; Number = MorphoNno.Number ; Case = MorphoNno.Case ; - masculine = NUtr Masc ; - feminine = NUtr Fem ; + masculine = NUtr Male ; + feminine = NUtr Female ; neutrum = NNeutr ; singular = Sg ; plural = Pl ; diff --git a/src/portuguese/DocumentationPorFunctor.gf b/src/portuguese/DocumentationPorFunctor.gf index d4912ef5..23291679 100644 --- a/src/portuguese/DocumentationPorFunctor.gf +++ b/src/portuguese/DocumentationPorFunctor.gf @@ -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 -> { t = "a" ; s1 = heading1 (nounHeading adjective_Category).s ; diff --git a/src/portuguese/NamesPor.gf b/src/portuguese/NamesPor.gf index 1d185325..b3ccdfc3 100644 --- a/src/portuguese/NamesPor.gf +++ b/src/portuguese/NamesPor.gf @@ -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 { - s = gn.s ++ sn.s ; + s = gn.s ++ sn.s ! 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 ; + } ; + } diff --git a/src/portuguese/ParadigmsPor.gf b/src/portuguese/ParadigmsPor.gf index f183220d..f59bc66b 100644 --- a/src/portuguese/ParadigmsPor.gf +++ b/src/portuguese/ParadigmsPor.gf @@ -49,11 +49,11 @@ oper Gender : Type ; Gender = MorphoPor.Gender ; - masculine : Gender ; - masculine = Masc ; + masculine, male : Gender ; + masculine, male = Masc ; - feminine : Gender ; - feminine = Fem ; + feminine, female : Gender ; + feminine, female = Fem ; -- To abstract over number names, we define the following. @@ -206,12 +206,39 @@ oper = \n -> lin PN {s = n.s ! Sg ; g = n.g} ; } ; - mkLN : Str -> LN = \s -> - lin LN {s = s ; - p = {s=""; c=CPrep P_a; isDir=True} ; - art = NoArt ; - g = Masc ; - num = Sg} ; + 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 : 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 compADeg : Adj -> A ; --% diff --git a/src/romance/CatRomance.gf b/src/romance/CatRomance.gf index 06cd7d87..e6932e44 100644 --- a/src/romance/CatRomance.gf +++ b/src/romance/CatRomance.gf @@ -110,14 +110,14 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol] N = Noun ; N2 = Noun ** {c2 : Compl} ; N3 = Noun ** {c2,c3 : Compl} ; - GN, SN, PN = {s : Str ; g : Gender} ; - - lincat LN = {s : Str; - p : Compl; - art : HasArt; - g : Gender; - num : Number; - } ; + GN, PN = {s : Str ; g : Gender} ; + SN = {s : Gender => Str ; pl : Str} ; + LN = {s : Str; + onPrep : Bool; + art : HasArt; + g : Gender; + num : Number; + } ; -- tense augmented with passé simple lincat diff --git a/src/russian/CatRus.gf b/src/russian/CatRus.gf index b96f6cc8..dd028baa 100644 --- a/src/russian/CatRus.gf +++ b/src/russian/CatRus.gf @@ -1,7 +1,21 @@ concrete CatRus of Cat = CommonX ** open ResRus, Prelude in { flags coding=utf8 ; optimize=all ; 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 ; N3 = ResRus.Noun3Forms ; @@ -105,7 +119,7 @@ lincat linref N = \s -> s.snom ; PN = \s -> s.snom ; - LN = \s -> s.snom ; + LN = \s -> s.s ! Nom ; Pron = \s -> s.nom ; N2 = \s -> s.snom ++ s.c2.s ; N3 = \s -> s.snom ++ s.c2.s ++ s.c3.s ; diff --git a/src/russian/DocumentationRusFunctor.gf b/src/russian/DocumentationRusFunctor.gf index 694c69ee..20a4272b 100644 --- a/src/russian/DocumentationRusFunctor.gf +++ b/src/russian/DocumentationRusFunctor.gf @@ -26,13 +26,79 @@ oper lin InflectionN, InflectionN2, InflectionN3 = \noun -> { - t = "s" ; + t = "сущ." ; s1 = heading1 (heading noun_Category) ; 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 -> { - t = "a" ; + t = "пр" ; s1 = heading1 (heading adjective_Category) ; s2 = heading2 (heading feminine_Parameter) ++ inflNoun (makeNFFromAF adj Fem Inanimate) ++ @@ -45,89 +111,89 @@ lin } ; InflectionAdv, InflectionAdV, InflectionAdA, InflectionAdN = \adv -> { - t = "adv" ; + t = "нар" ; s1 = heading1 (heading adverb_Category) ; s2 = paragraph adv.s } ; InflectionPrep p = { - t = "prep" ; + t = "пред" ; 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) } ; InflectionV v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v)) ; s2 = inflVerb v } ; InflectionV2 v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ; s2 = inflVerb v } ; InflectionV3 v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ; s2 = inflVerb v } ; InflectionV2V v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (S.mkVP (L.sleep_V)))) ; s2 = inflVerb v } ; InflectionV2S v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S {s : Mood=>Str = \\m=>"..."}))) ; s2 = inflVerb v } ; InflectionV2Q v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS {s: QForm=>Str = \\m=>"..."}))) ; s2 = inflVerb v } ; InflectionV2A v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ; s2 = inflVerb v } ; InflectionVV vv = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP vv (S.mkVP (L.sleep_V)))) ; s2 = inflVerb vv.v } ; InflectionVS v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v (lin S {s : Mood=>Str = \\m=>"..."}))) ; s2 = inflVerb v } ; InflectionVQ v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v (lin QS {s : Mood=>Str = \\m=>"..."}))) ; s2 = inflVerb v } ; InflectionVA v = { - t = "v" ; + t = "гл" ; s1 = heading1 (heading verb_Category) ++ paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ; s2 = inflVerb v diff --git a/src/russian/NamesRus.gf b/src/russian/NamesRus.gf index e35bbf6d..3a89fae6 100644 --- a/src/russian/NamesRus.gf +++ b/src/russian/NamesRus.gf @@ -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 -> - { s=\\cas => (nounFormsNoun pn).s ! Sg ! cas ; +lin GivenName gn = + { s=gn.s ; 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? lin FullName gn sn = - { s= table { - 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 - } ; + { s=\\cas => gn.s ! Nom ++ sn.s ! gn.g ! cas ; 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 = { - s=\\cas => (nounFormsNoun pn).s ! Sg ! cas ; + UseLN, PlainLN = \ln -> { + s=\\cas => ln.s ! cas ; pron=False; - a=Ag (gennum pn.g Sg) P3 + a=Ag (gennum ln.g ln.n) P3 } ; -- 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) + } ; + } diff --git a/src/russian/ParadigmsRus.gf b/src/russian/ParadigmsRus.gf index 044f8e49..1c014d2c 100644 --- a/src/russian/ParadigmsRus.gf +++ b/src/russian/ParadigmsRus.gf @@ -1,6 +1,6 @@ --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 -- @@ -14,6 +14,11 @@ oper neuter : Gender = Neut ; + male : Sex + = Male ; + female : Sex + = Female ; + -- Abstracting numbers. Number is a parameter for mkPN, mkConj singular : Number = Sg ; @@ -380,6 +385,130 @@ oper = \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 diff --git a/src/scandinavian/CatScand.gf b/src/scandinavian/CatScand.gf index e78a312c..cdf4be02 100644 --- a/src/scandinavian/CatScand.gf +++ b/src/scandinavian/CatScand.gf @@ -108,9 +108,10 @@ incomplete concrete CatScand of Cat = -- {s : Number => Species => Case => Str ; g : Gender} ; N2 = Noun ** {c2 : Complement} ; N3 = Noun ** {c2,c3 : Complement} ; - LN = {s : Case => Str ; c : Complement ; g : Gender ; n : Number} ; - GN, SN, PN = {s : Case => Str ; g : Gender} ; - + 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 diff --git a/src/slovenian/CatSlv.gf b/src/slovenian/CatSlv.gf index 7c069fb7..8fcf21e5 100644 --- a/src/slovenian/CatSlv.gf +++ b/src/slovenian/CatSlv.gf @@ -56,9 +56,10 @@ lincat N2 = {s : Case => Number => Str; g : AGender; c : Prep} ; N3 = {s : Case => Number => Str; g : AGender; c : Prep} ; - GN = {s : Case => Str; g : Sex}; - SN = {s : Sex => Case => Str}; - LN, PN = {s : Case => Str; g : AGender; n : Number}; + PN = {s : Case => Str; g : AGender; n : Number}; + LN = {s : Case => Str; g : AGender; n : Number}; + GN = {s : Case => Str; g : P.Sex}; + SN = {s : P.Sex => Case => Str}; linref V, VA, VS, V2, V3, V2A, V2S, V2Q, V2V = \v -> v.s ! VInf ++ v.refl ++ v.p; diff --git a/src/slovenian/DocumentationSlv.gf b/src/slovenian/DocumentationSlv.gf index 1812ce19..345b480b 100644 --- a/src/slovenian/DocumentationSlv.gf +++ b/src/slovenian/DocumentationSlv.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common concrete DocumentationSlv of Documentation = CatSlv ** open - ResSlv, + ResSlv, ParamX, HTML in { 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 -> { t = "pr" ; s1= heading1 ("Pridevnik") ; diff --git a/src/slovenian/NamesSlv.gf b/src/slovenian/NamesSlv.gf index 016f7715..1b767352 100644 --- a/src/slovenian/NamesSlv.gf +++ b/src/slovenian/NamesSlv.gf @@ -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 -> { s = n.s; @@ -21,10 +21,14 @@ lin FullName gn sn = { isPron = False } ; -lin UseLN pn = { - s = pn.s; - a = {g=agender2gender pn.g; n=pn.n; p=P3}; +lin UseLN, PlainLN = \ln -> { + s = ln.s; + a = {g=agender2gender ln.g; n=ln.n; p=P3}; isPron = False } ; +lin InLN ln = { + s = "v" ++ ln.s ! Loc + } ; + } diff --git a/src/slovenian/ParadigmsSlv.gf b/src/slovenian/ParadigmsSlv.gf index db45033e..54d0ab79 100644 --- a/src/slovenian/ParadigmsSlv.gf +++ b/src/slovenian/ParadigmsSlv.gf @@ -1,4 +1,4 @@ -resource ParadigmsSlv = open CatSlv, ResSlv, Prelude, Predef in { +resource ParadigmsSlv = open CatSlv, ResSlv, ParamX, Prelude, Predef in { oper nominative : Case = Nom ; @@ -34,6 +34,10 @@ oper 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} ; --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 : (inf : Str) -> V = \v -> regV v (dp 2 v) ; mkV : (inf,stem : Str) -> V = regV ; diff --git a/src/slovenian/ResSlv.gf b/src/slovenian/ResSlv.gf index 1b3e2446..7f1c846a 100644 --- a/src/slovenian/ResSlv.gf +++ b/src/slovenian/ResSlv.gf @@ -4,7 +4,6 @@ param Case = Nom | Gen | Dat | Acc | Loc | Instr; Number = Sg | Dl | Pl ; Gender = Masc | Fem | Neut ; - Sex = Male | Female ; Person = P1 | P2 | P3 ; Species = Indef | Def ; Animacy = Animate | Inanimate ; diff --git a/src/spanish/DocumentationSpaFunctor.gf b/src/spanish/DocumentationSpaFunctor.gf index fa09cdca..a23477ea 100644 --- a/src/spanish/DocumentationSpaFunctor.gf +++ b/src/spanish/DocumentationSpaFunctor.gf @@ -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 -> { t = "a" ; s1 = heading1 (nounHeading adjective_Category).s ; diff --git a/src/spanish/NamesSpa.gf b/src/spanish/NamesSpa.gf index 8164d81d..3940d26a 100644 --- a/src/spanish/NamesSpa.gf +++ b/src/spanish/NamesSpa.gf @@ -1,8 +1,14 @@ 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 { - s = gn.s ++ sn.s ; + s = gn.s ++ sn.s ! gn.g ; g = gn.g } ; @@ -30,18 +36,19 @@ lin UseLN n = heavyNP { lin InLN n = { - s = n.p.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 - } ; + s = "en" ++ + 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 + } ; } ; diff --git a/src/spanish/ParadigmsSpa.gf b/src/spanish/ParadigmsSpa.gf index 124f3aef..5f850596 100644 --- a/src/spanish/ParadigmsSpa.gf +++ b/src/spanish/ParadigmsSpa.gf @@ -137,17 +137,38 @@ oper -- Proper names need a string and a gender. -- 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 : 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 ; - p = {s = "en"; c = Nom; isDir = True} ; + onPrep = False ; art = NoArt ; g = g ; num = Sg} ; - mkLN : Str -> Gender -> Number -> LN = \s,g,num -> lin LN {s = s ; - p = {s = "en"; c = Nom; isDir = True} ; + onPrep = False ; art = NoArt ; g = g ; num = num} ; @@ -155,14 +176,6 @@ oper 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 @@ -350,8 +363,8 @@ oper Gender = MorphoSpa.Gender ; Number = MorphoSpa.Number ; CopulaType = DiffSpa.CopulaType ; - masculine = Masc ; - feminine = Fem ; + masculine, male = Masc ; + feminine, female = Fem ; singular = Sg ; plural = Pl ; serCopula = DiffSpa.serCopula ; diff --git a/src/swedish/DocumentationSwe.gf b/src/swedish/DocumentationSwe.gf index c5e011b8..230ba12a 100644 --- a/src/swedish/DocumentationSwe.gf +++ b/src/swedish/DocumentationSwe.gf @@ -41,16 +41,14 @@ lin s2 = frameTable ( tr (th "nom" ++ td (n.s ! Nom)) ++ tr (th "gen" ++ td (n.s ! Gen)) - ) ++ - heading1 ("Adverb") ++ - paragraph (n.c.s ++ n.s ! caseNP accusative) ; + ) ; } ; InflectionGN = \pn -> { t = "fnm" ; s1 = heading1 ("Förnamn" ++ case pn.g of { - Utr => "(utr)" ; - Neutr => "(neutr)" + Male => "(man)" ; + Female => "(kvinna)" }) ; s2 = frameTable ( tr (th "nom" ++ td (pn.s ! Nom)) ++ @@ -60,13 +58,10 @@ lin InflectionSN = \pn -> { t = "enm" ; - s1 = heading1 ("Efternamn" ++ case pn.g of { - Utr => "(utr)" ; - Neutr => "(neutr)" - }) ; + s1 = heading1 "Efternamn" ; s2 = frameTable ( - tr (th "nom" ++ td (pn.s ! Nom)) ++ - tr (th "gen" ++ td (pn.s ! Gen)) + tr (th "nom" ++ td (pn.s ! Male ! Nom)) ++ + tr (th "gen" ++ td (pn.s ! Male ! Gen)) ) } ; diff --git a/src/swedish/NamesSwe.gf b/src/swedish/NamesSwe.gf index a6a99337..b36acf3e 100644 --- a/src/swedish/NamesSwe.gf +++ b/src/swedish/NamesSwe.gf @@ -1,13 +1,28 @@ concrete NamesSwe of Names = CatSwe ** open CommonScand, ResSwe, Prelude in { -lin GivenName, MaleSurname, FemaleSurname = \pn -> { +lin GivenName = \pn -> { 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 } ; lin FullName gn sn = { - s = \\c => gn.s ! Nom ++ sn.s ! caseNP c ; - a = agrP3 gn.g Sg ; + s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! caseNP c ; + a = agrP3 Utr Sg ; isPron = False } ; @@ -17,6 +32,6 @@ lin FullName gn sn = { isPron = False } ; - InLN n = {s = n.c.s ++ n.s ! caseNP accusative} ; + InLN n = {s = "i" ++ n.s ! caseNP accusative} ; } diff --git a/src/swedish/ParadigmsSwe.gf b/src/swedish/ParadigmsSwe.gf index 2898f1fd..f87a6f58 100644 --- a/src/swedish/ParadigmsSwe.gf +++ b/src/swedish/ParadigmsSwe.gf @@ -155,12 +155,24 @@ oper geoPN : Str -> PN ; -- neuter, with identical genitive if ends in a vowel mkLN = overload { - mkLN : Str -> LN = \s -> lin LN (regPN s) ** {c={s="i";hasPrep=True}; 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 -> Number -> LN = \s,g,n -> lin LN (regGenPN s g) ** {c={s="i";hasPrep=True}; n=n} ; -- set other gender + mkLN : Str -> LN = \s -> lin LN (regPN s) ** {n=Sg}; -- default gender utrum + 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) ** {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 @@ -359,6 +371,8 @@ oper utrum = Utr ; neutrum = Neutr ; neuter = Neutr ; + male = Male ; + female = Female ; singular = Sg ; plural = Pl ; nominative = Nom ;