mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-21 01:06:21 -06:00
started a separate module for names
This commit is contained in:
@@ -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 ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -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
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -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
36
src/french/NamesFre.gf
Normal 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 ;
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user