Files
gf-core/lib/resource-1.0/romance/CommonRomance.gf

59 lines
1.7 KiB
Plaintext

----1 Auxiliary operations common for Romance languages
--
-- This module contains operations that are shared by the Romance
-- languages. The complete set of auxiliary operations needed to
-- implement [Test Test.html] is defined in [ResRomance ResRomance.html],
-- which depends on [DiffRomance DiffRomance.html].
--
resource CommonRomance = ParamRomance ** open Prelude in {
flags optimize=all ;
oper
genForms : Str -> Str -> Gender => Str = \bon,bonne ->
table {
Masc => bon ;
Fem => bonne
} ;
aagrForms : (x1,_,_,x4 : Str) -> (AAgr => Str) = \tout,toute,tous,toutes ->
table {
{g = g ; n = Sg} => genForms tout toute ! g ;
{g = g ; n = Pl} => genForms tous toutes ! g
} ;
Noun = {s : Number => Str ; g : Gender} ;
Adj = {s : AForm => Str} ;
VP : Type = {
s : VPForm => {
fin : Agr => Str ; -- ai
inf : AAgr => Str -- dit
} ;
agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
neg : Polarity => (Str * Str) ; -- ne-pas
clit1 : Agr => Str ; -- se
clit2 : Str ; -- lui
comp : Agr => Str ; -- content(e) ; à ma mère ; hier
ext : Polarity => Str ; -- que je dors / que je dorme
} ;
appVPAgr : VPAgr -> AAgr -> AAgr = \vp,agr ->
case vp of {
VPAgrSubj => agr ;
VPAgrClit a => a
} ;
vpAgrNone : VPAgr = VPAgrClit (aagr Masc Sg) ;
param
VPAgr =
VPAgrSubj -- elle est partie, elle s'est vue
| VPAgrClit -- elle a dormi; elle les a vues
{g : Gender ; n : Number} ;
}