1
0
forked from GitHub/gf-rgl

started a separate module for names

This commit is contained in:
Krasimir Angelov
2023-07-24 17:24:13 +02:00
parent 8b1309c99d
commit 645de9955a
100 changed files with 611 additions and 227 deletions

View File

@@ -128,7 +128,8 @@ abstract Cat = Common ** {
N3 ; -- three-place relational noun e.g. "connection"
GN ; -- given name e.g. "George"
SN ; -- second name e.g. "Washington"
PN ; -- proper name e.g. "Paris"
LN ; -- location name e.g. "Sweden"
PN ; -- proper name
-- DEPRECATED: QuantSg, QuantPl
--- QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every"

View File

@@ -297,12 +297,6 @@ fun
fun
CardCNCard : Card -> CN -> Card ; -- three million, four lakh, six dozen etc
GivenName : GN -> PN ;
MaleSurname : SN -> PN ;
FemaleSurname : SN -> PN ;
PlSurname : SN -> PN ;
FullName : GN -> SN -> PN ;
fun
AnaphPron : NP -> Pron ;

View File

@@ -19,6 +19,6 @@ abstract Grammar =
Structural,
Idiom,
Tense,
Names,
Transfer
;

14
src/abstract/Names.gf Normal file
View File

@@ -0,0 +1,14 @@
abstract Names = Cat ** {
fun GivenName : GN -> NP ;
MaleSurname : SN -> NP ;
FemaleSurname : SN -> NP ;
PlSurname : SN -> NP ;
FullName : GN -> SN -> NP ;
fun UseLN : LN -> NP ;
PlainLN : LN -> NP ;
InLN : LN -> Adv ;
AdjLN : AP -> LN -> LN ;
}

View File

@@ -83,6 +83,6 @@ 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, PN = {s : NPCase => Str} ;
GN, SN, LN, PN = {s : NPCase => Str} ;
}

View File

@@ -12,9 +12,4 @@ lin PassVPSlash vps =
PassAgentVPSlash vps np =
insertAdv (appPrep "door" np.s) (insertInf (vps.s.s ! VPerf) (predV word_V)) ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\c => gn.s ! NPNom ++ sn.s ! c ;
} ;
}

View File

@@ -14,4 +14,5 @@ concrete GrammarAfr of Grammar =
TextX,
IdiomAfr,
StructuralAfr,
TenseX ;
TenseX,
NamesAfr ;

View File

@@ -0,0 +1,6 @@
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} ;
}

View File

@@ -81,7 +81,7 @@ incomplete concrete CatBantu of Cat =
-- N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ;
N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Prep} ;
N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Prep} ;
GN, SN, PN = {s : Case => Str ; g : Gender} ;
GN, SN, LN, PN = {s : Case => Str ; g : Gender} ;
--Tense = {s : Str ; t : ResKam.Tense} ;
linref

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} ;
GN = {s : Str; g : Sex} ;
SN = {s : Sex => Str; pl : Str} ;
PN = {s : Str; gn : GenNum} ;
LN, PN = {s : Str; gn : GenNum} ;
lindef
SSlash = \s -> {s = \\_ => s; c2 = {s=""; c=Acc}};

View File

@@ -303,27 +303,6 @@ lin UseDAP dap = {
lin UseComp_estar = UseComp ;
UseComp_ser = UseComp ;
lin GivenName = \n -> {
s = n.s ;
gn = GSg (sex2gender n.g)
} ;
lin MaleSurname = \n -> {
s = n.s ! Male ;
gn = GSg Masc
} ;
lin FemaleSurname = \n -> {
s = n.s ! Female;
gn = GSg Fem
} ;
lin PlSurname = \n -> {
s = n.pl ;
gn = GPl
} ;
lin FullName gn sn = {
s = gn.s ++ sn.s ! gn.g ;
gn = GSg (sex2gender gn.g)
} ;
lin ProDrop pro = pro ;
lin AnaphPron np =

View File

@@ -15,7 +15,8 @@ concrete GrammarBul of Grammar =
TextBul,
StructuralBul,
IdiomBul,
TenseX - [CAdv,IAdv,AdV,SC]
TenseX - [CAdv,IAdv,AdV,SC],
NamesBul
** {
flags coding=utf8 ;

39
src/bulgarian/NamesBul.gf Normal file
View File

@@ -0,0 +1,39 @@
concrete NamesBul of Names = CatBul ** open ResBul in {
lin GivenName = \n -> {
s = table { RObj c => linCase c Pos ++ n.s;
_ => n.s
} ;
gn = GSg (sex2gender n.g) ;
p = NounP3 Pos
} ;
lin MaleSurname = \n -> {
s = table { RObj c => linCase c Pos ++ n.s ! Male;
_ => n.s ! Male
} ;
gn = GSg Masc ;
p = NounP3 Pos
} ;
lin FemaleSurname = \n -> {
s = table { RObj c => linCase c Pos ++ n.s ! Female;
_ => n.s ! Female
} ;
gn = GSg Fem ;
p = NounP3 Pos
} ;
lin PlSurname = \n -> {
s = table { RObj c => linCase c Pos ++ n.pl ;
_ => n.pl
} ;
gn = GPl ;
p = NounP3 Pos
} ;
lin FullName gn sn = {
s = table { RObj c => linCase c Pos ++ gn.s ++ sn.s ! gn.g ;
_ => gn.s ++ sn.s ! gn.g
} ;
gn = GSg (sex2gender gn.g) ;
p = NounP3 Pos
} ;
}

View File

@@ -15,10 +15,4 @@ concrete ExtendCat of Extend = CatCat ** ExtendRomanceFunctor-- -
ParadigmsCat in {
-- put your own definitions here
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
g = gn.g
} ;
} ;

View File

@@ -14,7 +14,8 @@ concrete GrammarCat of Grammar =
TextX - [SC,Temp,Tense,Pol,PPos,PNeg],
IdiomCat,
StructuralCat,
TenseCat
TenseCat,
NamesCat
** {

9
src/catalan/NamesCat.gf Normal file
View File

@@ -0,0 +1,9 @@
concrete NamesCat of Names = CatCat ** open ResCat in {
lin GivenName, MaleSurname, FemaleSurname = \n -> pn2np n ;
lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ;
g = gn.g
} ;
}

View File

@@ -79,7 +79,7 @@ concrete CatChi of Cat = CommonX - [Tense, Temp, Ant, Adv] ** open ResChi, Prelu
N = ResChi.Noun ;
N2 = ResChi.Noun ** {c2 : Preposition} ;
N3 = ResChi.Noun ** {c2,c3 : Preposition} ;
GN, SN, PN = ResChi.NP ;
GN, SN, LN, PN = ResChi.NP ;
-- overridden

View File

@@ -11,7 +11,7 @@ concrete ExtendChi of Extend = CatChi **
, MkVPI2, BaseVPI2, ConsVPI2, ConjVPI2, ComplVPI2
, ProDrop, ComplDirectVS, ComplDirectVQ
, PassVPSlash, PassAgentVPSlash
, GerundAdv, GerundNP ]
, GerundAdv, GerundNP, ApposNP ]
with (Grammar=GrammarChi) ** open
Prelude
, Coordination
@@ -79,13 +79,11 @@ concrete ExtendChi of Extend = CatChi **
AdvVP (UseV <lin V vq : V>)
(mkAdv (":" ++ quoted utt.s)) ; -- DEFAULT complement added as Adv in quotes
lin
ApposNP np1 np2 = {s = np1.s ++ np2.s} ;
oper
mkAdv : Str -> CatChi.Adv ;
mkAdv str = lin Adv {s = str ; advType = ATManner ; hasDe = False} ;
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s
} ;
};

View File

@@ -14,7 +14,8 @@ concrete GrammarChi of Grammar =
TextChi,
StructuralChi,
IdiomChi,
TenseChi
TenseChi,
NamesChi
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

8
src/chinese/NamesChi.gf Normal file
View File

@@ -0,0 +1,8 @@
concrete NamesChi of Names = CatChi ** {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s
} ;
}

View File

@@ -81,6 +81,6 @@ 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, PN = {s : NPCase => Str} ;
GN, SN, LN, PN = {s : NPCase => Str} ;
}

View File

@@ -121,9 +121,4 @@ lin
isPron = False
} ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\c => gn.s ! NPNom ++ sn.s ! c
} ;
}

View File

@@ -14,4 +14,5 @@ concrete GrammarDut of Grammar =
TextX,
IdiomDut,
StructuralDut,
TenseX ;
TenseX,
NamesDut ;

7
src/dutch/NamesDut.gf Normal file
View File

@@ -0,0 +1,7 @@
concrete NamesDut of Names = CatDut ** open Prelude, ResDut in {
lin GivenName, MaleSurname, FemaleSurname = \n -> noMerge ** {s = n.s ; a = agrP3 Sg ; isPron = False} ;
lin FullName gn sn =
noMerge ** {s = \\c => gn.s ! NPNom ++ sn.s ! c ; a = agrP3 Sg ; isPron = False} ;
}

View File

@@ -107,6 +107,11 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
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} ;
LN = {s : Case => Str;
p : Str; -- preposition "in Scandinavia", "on the Balkans"
art : Bool; -- plain name "United States" vs "the United States"
a : Agr;
} ;
lindef
SSlash = \s -> {s = s; c2 = ""} ;

View File

@@ -474,13 +474,6 @@ lin CardCNCard card cn =
lin theyFem_Pron = mkPron "they" "them" "their" "theirs" plural P3 feminine ;
lin theyNeutr_Pron = mkPron "they" "them" "their" "theirs" plural P3 nonhuman ;
lin GivenName gn = gn ;
lin MaleSurname, FemaleSurname = \sn -> sn ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! c ;
g = gn.g
} ;
lin AnaphPron np =
case np.a of {
AgP1 Sg => i_Pron ;

View File

@@ -14,7 +14,8 @@ concrete GrammarEng of Grammar =
TextX - [Pol,PPos,PNeg,SC,CAdv],
StructuralEng,
IdiomEng,
TenseX - [Pol,PPos,PNeg,SC,CAdv]
TenseX - [Pol,PPos,PNeg,SC,CAdv],
NamesEng
** open ResEng, Prelude in {
flags startcat = Phr ; unlexer = text ; lexer = text ;

31
src/english/NamesEng.gf Normal file
View File

@@ -0,0 +1,31 @@
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 UseLN n = {
s = \\c => case n.art of {
True => "the" ++ n.s ! npcase2case c ;
False => n.s ! npcase2case c
} ;
a = n.a
} ;
lin PlainLN n = {
s = \\c => n.s ! npcase2case c ;
a = n.a
} ;
lin InLN n = {
s = n.p ++ case n.art of {
True => "the" ++ n.s ! Nom ;
False => n.s ! Nom
} ;
} ;
lin AdjLN ap n = n ** {
s = \\c => preOrPost ap.isPre (ap.s ! n.a) (n.s ! c) ;
} ;
}

View File

@@ -129,6 +129,24 @@ 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 ;
a = agrP3 Sg} ;
mkLN : Str -> Number -> LN = \s,n ->
lin LN {s = table {Gen => s + "'s" ; _ => s} ;
p = "in" ;
art = False ;
a = agrP3 n} ;
} ;
defLN : LN -> LN = \n -> n ** {art = True} ;
prepLN : LN -> Str -> LN = \n,s -> n ** {p = s} ;
mkPN : overload {
mkPN : Str -> PN ;

View File

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

View File

@@ -436,10 +436,4 @@ concrete ExtendEst of Extend =
-- : VP -> Adv ; -- ilma raamatut nägemata
WithoutVP vp = {s = "ilma" ++ infVPdefault vp InfMata} ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! c
} ;
}

View File

@@ -12,7 +12,8 @@ concrete GrammarEst of Grammar =
TextX,
IdiomEst,
StructuralEst,
TenseX
TenseX,
NamesEst
** {
flags startcat = Phr ; unlexer = finnish ; lexer = text ;

14
src/estonian/NamesEst.gf Normal file
View File

@@ -0,0 +1,14 @@
concrete NamesEst of Names = CatEst ** open ResEst, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> emptyNP ** {
s = \\c => n.s ! npform2case Sg c ;
a = agrP3 Sg ;
isPron = False
} ;
lin FullName gn sn = emptyNP ** {
s = \\c => gn.s ! Nom ++ sn.s ! npform2case Sg c ;
a = agrP3 Sg ;
isPron = False
} ;
}

View File

@@ -95,7 +95,7 @@ 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, PN = SPN ;
GN, SN, LN, PN = SPN ;
linref
SSlash = \ss -> ss.s ++ ss.c2.s.p1 ;

View File

@@ -241,10 +241,4 @@ lin UttAccNP np = {s = P.addNegation np.isNeg ++ np.s ! NPAcc} ;
lin AdjAsCN ap = {s = ap.s ! True ; postmod = \\_ => ap.p ; h = Back} ; ---- Harmony just a guess
lin AdjAsNP ap = MassNP (AdjAsCN ap) ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! c
} ;
}

View File

@@ -14,7 +14,8 @@ concrete GrammarFin of Grammar =
TextX,
IdiomFin,
StructuralFin,
TenseX
TenseX,
NamesFin
** {
flags startcat = Phr ; unlexer = finnish ; lexer = text ;

14
src/finnish/NamesFin.gf Normal file
View File

@@ -0,0 +1,14 @@
concrete NamesFin of Names = CatFin ** open ResFin, StemFin, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> {
s = snoun2np Sg n ;
a = agrP3 Sg ;
isPron = False ; isNeg = False
} ;
lin FullName gn sn = {
s = snoun2np Sg {s = \\c => gn.s ! Nom ++ sn.s ! c} ;
a = agrP3 Sg ;
isPron = False ; isNeg = False
} ;
}

View File

@@ -338,4 +338,7 @@ instance DiffFre of DiffRomance - [
verbHyphen : Verb -> Str = \v -> v.s ! (VInfin True) ; --- kluge: use this field to store - or -t-
param
HasArt = NoArt | UseArt | AlwaysArt ;
} ;

View File

@@ -59,10 +59,4 @@ lin ApposNP np1 np2 = np1 ** { -- guessed by KA
} ;
} ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
g = gn.g
} ;
}

View File

@@ -14,7 +14,8 @@ concrete GrammarFre of Grammar =
TextX - [SC,Temp,Tense,Pol,PPos,PNeg],
IdiomFre,
StructuralFre,
TenseFre
TenseFre,
NamesFre
** {
flags startcat = Phr ;

36
src/french/NamesFre.gf Normal file
View File

@@ -0,0 +1,36 @@
concrete NamesFre of Names = CatFre ** open Prelude, ResFre, CommonRomance, PhonoFre in {
lin GivenName, MaleSurname, FemaleSurname = \n -> pn2np n ;
lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ;
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 {
AlwaysArt | 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 = 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
} ;
} ;
lin AdjLN ap n = n ** {
s = preOrPost ap.isPre (ap.s ! AF n.g n.num) n.s ;
} ;
}

View File

@@ -132,6 +132,27 @@ 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.
mkLN = overload {
mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ;
p = {s=""; c=CPrep P_a; isDir=True} ;
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} ;
art = NoArt ;
g = g ;
num = num} ;
} ;
defLN : LN -> LN = \n -> n ** {art = AlwaysArt} ;
useDefLN : LN -> LN = \n -> n ** {art = UseArt} ;
prepLN : LN -> Compl -> LN = \n,s -> n ** {p = s} ;
mkPN : overload {
mkPN : Str -> PN ; -- feminine if ends with "e", otherwise masculine
mkPN : Str -> Gender -> PN ; -- gender deviant from the simple rule

View File

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

View File

@@ -142,16 +142,6 @@ lin
n = Pl
} ;
lin GivenName = \n -> { s = n.s; g = sex2gender n.g; n = Sg } ;
lin MaleSurname = \n -> { s = n.s ! Male ; g = Masc; n = Sg } ;
lin FemaleSurname = \n -> { s = n.s ! Female ; g = Fem; n = Sg } ;
lin PlSurname = \n -> { s = n.s ! Male ; g = Masc; n = Pl } ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! c ;
g = sex2gender gn.g ;
n = Sg
} ;
lin PassVPSlash vp =
insertObj (\\_ => (PastPartAP vp).s ! APred) (predV werdenPass) **
{ c1 = subjPrep vp.c2 } ;

View File

@@ -14,7 +14,8 @@ concrete GrammarGer of Grammar =
TextX - [Tense,Temp],
IdiomGer,
StructuralGer,
TenseGer
TenseGer,
NamesGer
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

38
src/german/NamesGer.gf Normal file
View File

@@ -0,0 +1,38 @@
concrete NamesGer of Names = CatGer ** open ResGer in {
lin GivenName gn = {
s = \\c => usePrepC c (\k -> gn.s ! k) ;
a = agrgP3 (sex2gender gn.g) Sg ;
w = WLight ;
rc, ext = []
} ;
lin MaleSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ;
a = agrgP3 Masc Sg ;
w = WLight ;
rc, ext = []
} ;
lin FemaleSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Female ! k) ;
a = agrgP3 Fem Sg ;
w = WLight ;
rc, ext = []
} ;
lin PlSurname sn = {
s = \\c => usePrepC c (\k -> sn.s ! Male ! k) ;
a = agrgP3 Masc Pl ;
w = WLight ;
rc, ext = []
} ;
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 = []
} ;
}

View File

@@ -16,12 +16,6 @@ concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor -
ParadigmsIta in {
-- put your own definitions here
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
g = gn.g
} ;
lin PassVPSlash vps = passVPSlash vps [] ;
PassAgentVPSlash vps np = passVPSlash

View File

@@ -14,7 +14,8 @@ concrete GrammarIta of Grammar =
TextX - [SC,Temp,Tense,Pol,PPos,PNeg,TPres,TPast,TFut,TCond],
IdiomIta,
StructuralIta,
TenseIta
TenseIta,
NamesIta
** {

9
src/italian/NamesIta.gf Normal file
View File

@@ -0,0 +1,9 @@
concrete NamesIta of Names = CatIta ** open ResIta in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> pn2np n ;
lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ;
g = gn.g
} ;
}

View File

@@ -115,7 +115,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in {
N = ResKor.Noun ;
N2 = ResKor.Noun2 ;
N3 = ResKor.Noun3 ;
GN, SN, PN = ResKor.NounPhrase ;
GN, SN, LN, PN = ResKor.NounPhrase ;
linref
V, V2, V3 = linVerb ;

View File

@@ -9,10 +9,4 @@ concrete ExtendKor of Extend = CatKor
-- : NP -> NP -> NP
ApposNP np1 np2 = np1 ** {s = \\nf => np1.s ! nf ++ np2.s ! nf} ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\nf => gn.s ! nf ++ sn.s ! nf ;
p = gn.p
} ;
} ;

View File

@@ -12,7 +12,8 @@ concrete GrammarKor of Grammar =
TextX,
StructuralKor,
IdiomKor,
TenseX
TenseX,
NamesKor
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

9
src/korean/NamesKor.gf Normal file
View File

@@ -0,0 +1,9 @@
concrete NamesKor of Names = CatKor ** open ResKor in {
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\nf => gn.s ! nf ++ sn.s ! nf ;
p = gn.p
} ;
}

View File

@@ -118,7 +118,7 @@ concrete CatMlt of Cat = CommonX - [Adv] ** open ResMlt, Prelude in {
N = Noun ;
N2 = Noun ** {c2 : Compl} ;
N3 = Noun ** {c2, c3 : Compl} ;
GN, SN, PN = ProperNoun ;
GN, SN, LN, PN = ProperNoun ;
-- Overridden from CommonX

View File

@@ -24,10 +24,4 @@ concrete ExtraMlt of ExtraMltAbs = CatMlt **
a = p.a ;
} ;
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
a = gn.a
} ;
}

View File

@@ -20,7 +20,8 @@ concrete GrammarMlt of Grammar =
TextX - [Adv],
StructuralMlt,
IdiomMlt,
TenseX - [Adv]
TenseX - [Adv],
NamesMlt
** {
flags coding=utf8 ;

16
src/maltese/NamesMlt.gf Normal file
View File

@@ -0,0 +1,16 @@
concrete NamesMlt of Names = CatMlt ** open ResMlt, Prelude in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> {
s = \\c => n.s ;
a = n.a ;
isPron = False ;
isDefn = False
} ;
lin FullName gn sn = {
s = \\c => gn.s ++ sn.s ;
a = gn.a ;
isPron = False ;
isDefn = False
} ;
}

View File

@@ -119,7 +119,7 @@ concrete CatPol of Cat = CommonX - [CAdv] ** open ResPol, Prelude, (R = ParamX)
N3 = Noun ** { c1, c2 : Complement } ;
GN, SN, PN = NounPhrase;
GN, SN, LN, PN = NounPhrase;
CAdv = {s,p,sn,pn : Str} ;

View File

@@ -40,13 +40,4 @@ oper
-- KA: PassVPSlash is derived from PassV2. Objects might be ignored
lin PassVPSlash vps = setImienne vps True;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
nom = gn.nom ++ sn.nom ;
voc = gn.nom ++ sn.voc ;
dep = \\c => gn.nom ++ sn.dep ! c ;
gn = gn.gn ;
p = gn.p
} ;
}

View File

@@ -15,6 +15,7 @@ concrete GrammarPol of Grammar =
PhrasePol,
TenseX - [CAdv],
TextX - [CAdv],
NamesPol,
StructuralPol,
IdiomPol
** { flags startcat = Phr ; unlexer = text ; lexer = text ;} ;

12
src/polish/NamesPol.gf Normal file
View File

@@ -0,0 +1,12 @@
concrete NamesPol of Names = CatPol ** {
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
nom = gn.nom ++ sn.nom ;
voc = gn.nom ++ sn.voc ;
dep = \\c => gn.nom ++ sn.dep ! c ;
gn = gn.gn ;
p = gn.p
} ;
}

View File

@@ -116,10 +116,4 @@ concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor -
youPolPlFem_Pron = pronAgr youPolPl_Pron Fem Pl P2 ;
theyFem_Pron = mkPronFrom S.they_Pron "elas" "as" "lhes" "elas" Fem Pl P3 ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
g = gn.g
} ;
} ;

View File

@@ -14,7 +14,8 @@ concrete GrammarPor of Grammar =
TextPor - [SC,Temp,Tense,Pol,PPos,PNeg], -- special punctuation
IdiomPor,
StructuralPor,
TensePor
TensePor,
NamesPor
** {

View File

@@ -0,0 +1,9 @@
concrete NamesPor of Names = CatPor ** open ResPor in {
lin GivenName, MaleSurname, FemaleSurname = \n -> pn2np n ;
lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ;
g = gn.g
} ;
}

View File

@@ -111,6 +111,13 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
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;
} ;
-- tense augmented with passé simple
lincat

View File

@@ -218,4 +218,6 @@ oper
stare_V : Verb ;
stare_V = essere_V ;
param HasArt ;
} ;

View File

@@ -131,7 +131,7 @@ concrete CatRon of Cat =
N3 = Noun ** {c2,c3 : Compl} ;
GN, SN, PN = {s : NCase => Str ; g : Gender ; n : Number; a : Animacy} ;
GN, SN, LN, PN = {s : NCase => Str ; g : Gender ; n : Number; a : Animacy} ;
Comp = {s : Agr => Str} ;

View File

@@ -1,7 +1,7 @@
--# -path=.:../common:../abstract
concrete ExtendRon of Extend =
CatRon ** ExtendFunctor - [PassVPSlash, GivenName, MaleSurname, FemaleSurname, FullName]
CatRon ** ExtendFunctor - [PassVPSlash]
with
(Grammar = GrammarRon) **
open ResRon in {
@@ -17,12 +17,4 @@ lin iFem_Pron = mkPronoun "eu" "mine" "mie" [] [] "meu" "mea" "mei" "mele" Fem S
-- KA: derived from PassV2, objects are ignored
lin PassVPSlash vps = insertSimpObj (\\a => vps.s ! PPasse a.g a.n Indef ANomAcc) auxPassive ** {lock_VP = <>};
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = { -- KA: guessed
s = \\c => gn.s ! No ++ sn.s ! c ;
g = gn.g ;
n = gn.n ;
a = gn.a
} ;
}

View File

@@ -15,7 +15,8 @@ concrete GrammarRon of Grammar =
TextX - [CAdv,Temp,Tense],
-- Prelude, MorphoRon, Coordination,
StructuralRon,
TenseRon
TenseRon,
NamesRon
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

34
src/romanian/NamesRon.gf Normal file
View File

@@ -0,0 +1,34 @@
concrete NamesRon of Names = CatRon ** open ResRon, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \pn -> -- KA: guessed
let
g = pn.g ;
n = pn.n ;
ag = agrP3 g n ;
hc = getClit pn.a
in {
s = \\c => {comp = pn.s ! c ;
clit = \\cs => if_then_Str hc ((genCliticsCase ag c).s ! cs) [] } ;
a = ag;
nForm = if_then_else NForm hc HasClit (HasRef False) ;
isPronoun = False ; isPol = False;
indForm = pn.s ! No
} ;
lin FullName gn sn = -- KA: guessed
let
g = gn.g ;
n = gn.n ;
ag = agrP3 g n ;
hc = getClit gn.a
in {
s = \\c => {comp = gn.s ! No ++ sn.s ! c ;
clit = \\cs => if_then_Str hc ((genCliticsCase ag c).s ! cs) [] } ;
a = ag;
nForm = if_then_else NForm hc HasClit (HasRef False) ;
isPronoun = False ; isPol = False;
indForm = gn.s ! No ++ sn.s ! No
} ;
}

View File

@@ -1,7 +1,7 @@
concrete CatRus of Cat = CommonX ** open ResRus, Prelude in {
flags coding=utf8 ; optimize=all ;
lincat
N, GN, SN, PN = ResRus.NounForms ;
N, GN, SN, LN, PN = ResRus.NounForms ;
N2 = ResRus.Noun2Forms ;
N3 = ResRus.Noun3Forms ;

View File

@@ -217,26 +217,4 @@ lin
oper
rus_quoted : Str -> Str = \s -> "«" ++ s ++ "»" ; ---- TODO bind ; move to Prelude?
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
lin FullName gn sn = {
snom = gn.snom ++ sn.snom ;
sgen = gn.snom ++ sn.sgen ;
sdat = gn.snom ++ sn.sdat ;
sacc = gn.snom ++ sn.sacc ;
sins = gn.snom ++ sn.sins ;
sprep = gn.snom ++ sn.sprep ;
sloc = gn.snom ++ sn.sloc ;
sptv = gn.snom ++ sn.sptv ;
svoc = gn.snom ++ sn.svoc ;
pnom = gn.snom ++ sn.pnom ;
pgen = gn.snom ++ sn.pgen ;
pdat = gn.snom ++ sn.pdat ;
pacc = gn.snom ++ sn.pacc ;
pins = gn.snom ++ sn.pins ;
pprep = gn.snom ++ sn.pprep ;
g = gn.g ;
mayben = gn.mayben ;
anim = gn.anim
} ;
} ;

View File

@@ -14,5 +14,6 @@ concrete GrammarRus of Grammar =
TextX,
StructuralRus,
IdiomRus,
TenseRus
** { flags startcat = Phr ; unlexer = text ; lexer = text ; coding=utf8 ;} ;
TenseRus,
NamesRus
** { flags startcat = Phr ; unlexer = text ; lexer = text ; coding=utf8 ;} ;

25
src/russian/NamesRus.gf Normal file
View File

@@ -0,0 +1,25 @@
concrete NamesRus of Names = CatRus ** open ResRus, Prelude in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \pn ->
{ s=\\cas => (nounFormsNoun pn).s ! Sg ! cas ;
pron=False;
a=Ag (gennum pn.g Sg) 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
} ;
pron=False;
a=Ag (gennum gn.g Sg) P3
} ;
}

View File

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

View File

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

View File

@@ -57,14 +57,5 @@ lin
youPolPl_Pron = youPol_Pron ;
youPolPlFem_Pron = youPlFem_Pron ;
lin GivenName = \n -> {s = n.s; g = sex2agender n.g; n = Sg} ;
lin MaleSurname = \n -> {s = n.s ! Male; g = AMasc Animate; n = Sg} ;
lin FemaleSurname = \n -> {s = n.s ! Female; g = AFem; n = Sg} ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! c ;
g = sex2agender gn.g ;
n = Sg
} ;
}

View File

@@ -14,7 +14,8 @@ concrete GrammarSlv of Grammar =
TextX - [Pol,PPos,PNeg],
StructuralSlv,
IdiomSlv, ----AR
TenseX
TenseX,
NamesSlv
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

24
src/slovenian/NamesSlv.gf Normal file
View File

@@ -0,0 +1,24 @@
concrete NamesSlv of Names = CatSlv ** open ResSlv, Prelude in {
lin GivenName = \n -> {
s = n.s;
a = {g=agender2gender (sex2agender n.g); n=Sg; p=P3};
isPron = False
} ;
lin MaleSurname = \n -> {
s = n.s ! Male;
a = {g=Masc; n=Sg; p=P3};
isPron = False
} ;
lin FemaleSurname = \n -> {
s = n.s ! Female;
a = {g=Fem; n=Sg; p=P3};
isPron = False
} ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! gn.g ! c ;
a = {g=agender2gender (sex2agender gn.g); n=Sg; p=P3};
isPron = False
} ;
}

View File

@@ -118,7 +118,7 @@ concrete CatSom of Cat = CommonX - [Adv,IAdv] ** open ResSom, Prelude in {
N = ResSom.Noun ;
N2 = ResSom.Noun2 ;
N3 = ResSom.Noun3 ;
GN, SN, PN = ResSom.PNoun ;
GN, SN, LN, PN = ResSom.PNoun ;
Adv = ResSom.Adverb ; -- Preposition of an adverbial can merge with obligatory complements of the verb.

View File

@@ -17,10 +17,4 @@ lin
-- FocusAdV : AdV -> S -> Utt ; -- never will I sleep
-- FocusAP : AP -> NP -> Utt ; -- green was the tree
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
a = gn.a
} ;
} ;

View File

@@ -12,7 +12,8 @@ concrete GrammarSom of Grammar =
TextX - [Adv,IAdv],
StructuralSom,
IdiomSom,
TenseX - [Adv,IAdv]
TenseX - [Adv,IAdv],
NamesSom
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

18
src/somali/NamesSom.gf Normal file
View File

@@ -0,0 +1,18 @@
concrete NamesSom of Names = CatSom ** open ResSom, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \n -> n ** {
s = \\c => n.s ;
isPron = False ;
st = Definite ;
empty = [] ;
};
lin FullName gn sn = {
s = \\c => gn.s ++ sn.s ;
a = gn.a ;
isPron = False ;
st = Definite ;
empty = [] ;
} ;
}

View File

@@ -237,4 +237,7 @@ instance DiffSpa of DiffRomance - [iAdvQuestionInv,otherInv,partAgr,stare_V,vpAg
polNegDirSubj = RPos ;
param
HasArt = NoArt | UseArt ;
}

View File

@@ -106,12 +106,6 @@ concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
lin UseComp_estar comp = insertComplement comp.s (predV I.estar_V) ;
UseComp_ser comp = insertComplement comp.s (predV copula) ;
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> n ;
lin FullName gn sn = {
s = gn.s ++ sn.s ;
g = gn.g
} ;
lin PassVPSlash vps = passVPSlash vps [] ;
PassAgentVPSlash vps np = passVPSlash
vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;

View File

@@ -14,7 +14,8 @@ concrete GrammarSpa of Grammar =
TextSpa - [SC,Temp,Tense,Pol,PPos,PNeg], -- special punctuation
IdiomSpa,
StructuralSpa,
TenseSpa
TenseSpa,
NamesSpa
** {

52
src/spanish/NamesSpa.gf Normal file
View File

@@ -0,0 +1,52 @@
concrete NamesSpa of Names = CatSpa ** open Prelude, ResSpa, CommonRomance in {
lin GivenName, MaleSurname, FemaleSurname, PlSurname = \n -> pn2np n ;
lin FullName gn sn = pn2np {
s = gn.s ++ sn.s ;
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 = 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
} ;
} ;
lin AdjLN ap n = n ** {
s = preOrPost ap.isPre (ap.s ! AF n.g n.num) n.s ;
} ;
}

View File

@@ -137,6 +137,25 @@ oper
-- Proper names need a string and a gender.
-- The default gender is feminine for names ending with "a", otherwise masculine.
mkLN = overload {
mkLN : Str -> Gender -> LN = \s,g ->
lin LN {s = s ;
p = {s = "en"; c = Nom; isDir = True} ;
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} ;
art = NoArt ;
g = g ;
num = num} ;
} ;
defLN : LN -> LN = \n -> n ** {art = UseArt} ;
mkPN : overload {
mkPN : (Anna : Str) -> PN ; -- feminine for "-a"
mkPN : (Pilar : Str) -> Gender -> PN ; -- force gender

View File

@@ -14,7 +14,8 @@ concrete GrammarSwa of Grammar =
TextX,
StructuralSwa,
IdiomSwa,
TenseX
TenseX,
NamesSwa
** {
flags startcat = Phr ;

1
src/swahili/NamesSwa.gf Normal file
View File

@@ -0,0 +1 @@
concrete NamesSwa of Names = CatSwa ** { }

View File

@@ -392,11 +392,5 @@ lin UseDAPMasc, UseDAPFem = \dap ->
lin CardCNCard card cn =
{s = \\g => card.s ! cn.g ++ cn.s ! card.n ! DIndef ! Nom ; n = Pl} ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! c ;
g = gn.g
} ;
}

View File

@@ -14,7 +14,8 @@ concrete GrammarSwe of Grammar =
TextX -[Tense,Temp],
IdiomSwe,
StructuralSwe,
TenseSwe
TenseSwe,
NamesSwe
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

14
src/swedish/NamesSwe.gf Normal file
View File

@@ -0,0 +1,14 @@
concrete NamesSwe of Names = CatSwe ** open CommonScand, ResSwe, Prelude in {
lin GivenName, MaleSurname, FemaleSurname = \pn -> {
s = \\c => pn.s ! caseNP c ;
a = agrP3 pn.g Sg ;
isPron = False
} ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! caseNP c ;
a = agrP3 gn.g Sg ;
isPron = False
} ;
}

View File

@@ -71,6 +71,6 @@ concrete CatTha of Cat = CommonX ** open ResTha, Prelude in {
N = ResTha.Noun ;
N2 = ResTha.Noun ** {c2 : Str} ;
N3 = ResTha.Noun ** {c2,c3 : Str} ;
GN, SN, PN = ResTha.NP ;
GN, SN, LN, PN = ResTha.NP ;
}

View File

@@ -14,7 +14,8 @@ concrete GrammarTha of Grammar =
TextTha,
StructuralTha,
IdiomTha,
TenseX
TenseX,
NamesTha
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;

1
src/thai/NamesTha.gf Normal file
View File

@@ -0,0 +1 @@
concrete NamesTha of Names = CatTha ** { }

View File

@@ -49,7 +49,7 @@ concrete CatTur of Cat = CommonX - [CAdv,AdN] ** open ResTur, HarmonyTur, Prelud
N = Noun ;
N2 = Noun ** {c : Prep} ;
N3 = Noun ** {c1,c2 : Prep} ;
GN, SN, PN = {
GN, SN, LN, PN = {
s : Case => Str ;
h : Harmony ;
n : Number

View File

@@ -7,12 +7,4 @@ concrete ExtendTur of Extend = CatTur ** open ResTur in {
a = {n=num.n; p=P3} ;
} ;
lin GivenName, MaleSurname, FemaleSurname = \n -> n ** {n = Sg};
lin PlSurname = \n -> n ** {n = Pl};
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! c ;
h = sn.h ;
n = Sg
} ;
}

View File

@@ -14,7 +14,8 @@ concrete GrammarTur of Grammar =
StructuralTur,
PhraseTur,
IdiomTur,
TenseX - [CAdv, AdN]
TenseX - [CAdv, AdN],
NamesTur
** {
flags startcat = Phr ;

19
src/turkish/NamesTur.gf Normal file
View File

@@ -0,0 +1,19 @@
concrete NamesTur of Names = CatTur ** open ResTur in {
lin GivenName, MaleSurname, FemaleSurname = \n -> {
s = \\c => n.s ! c;
h = n.h;
a = {n = Sg; p = P3}
} ;
lin PlSurname = \n -> {
s = \\c => n.s ! c;
h = n.h;
a = {n = Pl; p = P3}
} ;
lin FullName gn sn = {
s = \\c => gn.s ! Nom ++ sn.s ! c;
h = sn.h;
a = {n = Sg; p = P3}
} ;
}