mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-24 18:46:28 -06:00
started a separate module for names
This commit is contained in:
@@ -237,4 +237,7 @@ instance DiffSpa of DiffRomance - [iAdvQuestionInv,otherInv,partAgr,stare_V,vpAg
|
||||
|
||||
polNegDirSubj = RPos ;
|
||||
|
||||
param
|
||||
HasArt = NoArt | UseArt ;
|
||||
|
||||
}
|
||||
|
||||
@@ -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) ;
|
||||
|
||||
@@ -14,7 +14,8 @@ concrete GrammarSpa of Grammar =
|
||||
TextSpa - [SC,Temp,Tense,Pol,PPos,PNeg], -- special punctuation
|
||||
IdiomSpa,
|
||||
StructuralSpa,
|
||||
TenseSpa
|
||||
TenseSpa,
|
||||
NamesSpa
|
||||
|
||||
** {
|
||||
|
||||
|
||||
@@ -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 ;
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user