mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-28 20:36:29 -06:00
Merge branch 'GrammaticalFramework:master' into master
This commit is contained in:
@@ -251,4 +251,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta,
|
||||
|
||||
polNegDirSubj = RPos ;
|
||||
|
||||
param
|
||||
HasArt = NoArt | UseArt ;
|
||||
|
||||
}
|
||||
|
||||
@@ -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 ;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
--# -path=alltenses:../common:../abstract:../romance
|
||||
concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor-- -
|
||||
-- [
|
||||
-- ]
|
||||
concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor -
|
||||
[
|
||||
PassVPSlash, PassAgentVPSlash
|
||||
]
|
||||
-- don't forget to put the names of your own
|
||||
-- definitions here
|
||||
with
|
||||
@@ -15,10 +16,19 @@ 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
|
||||
vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
||||
|
||||
oper
|
||||
passVPSlash : VPSlash -> Str -> VP = \vps, agent ->
|
||||
let auxvp = predV auxPassive
|
||||
in
|
||||
vps ** {
|
||||
s = auxvp.s ;
|
||||
agr = auxvp.agr ;
|
||||
comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ;
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@ concrete GrammarIta of Grammar =
|
||||
TextX - [SC,Temp,Tense,Pol,PPos,PNeg,TPres,TPast,TFut,TCond],
|
||||
IdiomIta,
|
||||
StructuralIta,
|
||||
TenseIta
|
||||
TenseIta,
|
||||
NamesIta
|
||||
|
||||
** {
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
concrete NamesIta of Names = CatIta ** open ResIta, CommonRomance, Prelude in {
|
||||
|
||||
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 ! 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 ;
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
concrete NumeralIta of Numeral = CatIta [Numeral,Digits] **
|
||||
concrete NumeralIta of Numeral = CatIta [Numeral,Digits,Decimal] **
|
||||
open CommonRomance, ResRomance, MorphoIta, PhonoIta, Prelude in {
|
||||
|
||||
lincat
|
||||
@@ -137,6 +137,20 @@ param Pred = pred | indip ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
PosDecimal d = d ** {hasDot=False} ;
|
||||
NegDecimal d = {
|
||||
s = \\o => "-" ++ BIND ++ d.s ! o ;
|
||||
n = Pl ;
|
||||
hasDot=False
|
||||
} ;
|
||||
IFrac d i = {
|
||||
s = \\o => d.s ! NCard Masc ++
|
||||
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||
i.s ! o;
|
||||
n = Pl ;
|
||||
hasDot=True
|
||||
} ;
|
||||
|
||||
oper
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c Pl ;
|
||||
|
||||
@@ -145,7 +145,38 @@ oper
|
||||
mkPN : N -> PN ; -- get 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 ;
|
||||
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
|
||||
|
||||
@@ -327,8 +358,8 @@ oper
|
||||
|
||||
Gender = MorphoIta.Gender ;
|
||||
Number = MorphoIta.Number ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
masculine, male = Masc ;
|
||||
feminine, female = Fem ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
@@ -558,4 +589,6 @@ oper
|
||||
mk2V2 : V -> Prep -> V2 ;
|
||||
dirV2 : V -> V2 ;
|
||||
|
||||
mkMU : Str -> MU = \s -> lin MU {s=s; isPre=False} ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -23,7 +23,7 @@ lincat
|
||||
|
||||
lin
|
||||
noun_Category = mkN "nome" ;
|
||||
adjective_Category = mkN "addiettivo" ;
|
||||
adjective_Category = mkN "aggettivo" ;
|
||||
verb_Category = mkN "verbe" masculine ;
|
||||
|
||||
gender_ParameterType = mkN "genere" masculine ;
|
||||
@@ -31,7 +31,7 @@ lin
|
||||
singular_Parameter = mkN "singolare" ;
|
||||
plural_Parameter = mkN "plurale" ;
|
||||
|
||||
masculine_Parameter = mkN "maschio" ;
|
||||
masculine_Parameter = mkN "maschile" ;
|
||||
feminine_Parameter = mkN "femminile" ;
|
||||
neuter_Parameter = mkN "neutro" ;
|
||||
|
||||
@@ -65,4 +65,4 @@ lin
|
||||
|
||||
exampleGr_N = mkN "esempio" masculine ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user