(Fre) Update A,A2 to not have Degree

This commit is contained in:
Inari Listenmaa
2021-09-14 18:16:13 +08:00
parent b696b9e932
commit 5281c3ba71
4 changed files with 131 additions and 121 deletions

View File

@@ -4,14 +4,16 @@ instance DiffFre of DiffRomance - [
imperClit, imperClit,
invertedClause, invertedClause,
verbHyphen, verbHyphen,
iAdvQuestionInv iAdvQuestionInv,
] -- for comparative forms
ComparAgr, af2compar, aagr2compar
]
= open CommonRomance, PhonoFre, Prelude in { = open CommonRomance, PhonoFre, Prelude in {
flags optimize=noexpand ; coding=utf8 ; flags optimize=noexpand ; coding=utf8 ;
-- flags optimize=all ; -- flags optimize=all ;
param param
Prepos = P_de | P_a | PNul ; Prepos = P_de | P_a | PNul ;
VType = VTyp VAux VBool ; -- True means that -t- is required as in va-t-il, alla-t-il VType = VTyp VAux VBool ; -- True means that -t- is required as in va-t-il, alla-t-il
VAux = VHabere | VEsse | VRefl ; VAux = VHabere | VEsse | VRefl ;
@@ -23,7 +25,7 @@ instance DiffFre of DiffRomance - [
prepCase : Case -> Str = \c -> case c of { prepCase : Case -> Str = \c -> case c of {
Nom => [] ; Nom => [] ;
Acc => [] ; Acc => [] ;
CPrep P_a => "à" ; CPrep P_a => "à" ;
CPrep P_de => elisDe ; CPrep P_de => elisDe ;
CPrep PNul => [] CPrep PNul => []
@@ -73,9 +75,9 @@ instance DiffFre of DiffRomance - [
---- pronArg = pronArgGen Neg ; --- takes more space and time ---- pronArg = pronArgGen Neg ; --- takes more space and time
pronArg : Number -> Person -> CAgr -> CAgr -> Str * Str * Bool = pronArg : Number -> Person -> CAgr -> CAgr -> Str * Str * Bool =
\n,p,acc,dat -> \n,p,acc,dat ->
let let
pacc = case acc of { pacc = case acc of {
CRefl => <case p of { CRefl => <case p of {
P3 => elision "s" ; --- use of reflPron incred. expensive P3 => elision "s" ; --- use of reflPron incred. expensive
@@ -98,9 +100,9 @@ instance DiffFre of DiffRomance - [
-- Positive polarity is used in the imperative: stressed for 1st and -- Positive polarity is used in the imperative: stressed for 1st and
-- 2nd persons. -- 2nd persons.
pronArgGen : RPolarity -> Number -> Person -> CAgr -> CAgr -> Str * Str = pronArgGen : RPolarity -> Number -> Person -> CAgr -> CAgr -> Str * Str =
\b,n,p,acc,dat -> \b,n,p,acc,dat ->
let let
cas : Person -> Case -> Case = \pr,c -> case <pr,b> of { cas : Person -> Case -> Case = \pr,c -> case <pr,b> of {
<P1 | P2, RPos> => CPrep P_de ; --- encoding in argPron <P1 | P2, RPos> => CPrep P_de ; --- encoding in argPron
_ => c _ => c
@@ -123,9 +125,9 @@ instance DiffFre of DiffRomance - [
_ => <pdat ++ pacc, []> _ => <pdat ++ pacc, []>
} ; } ;
mkImperative b p vp = mkImperative b p vp =
\\pol,g,n => \\pol,g,n =>
let let
agr = Ag g n p ; agr = Ag g n p ;
num = if_then_else Number b Pl n ; num = if_then_else Number b Pl n ;
verb = vp.s.s ! vImper num p ; verb = vp.s.s ! vImper num p ;
@@ -135,14 +137,14 @@ instance DiffFre of DiffRomance - [
<Sg,False> => <"toi",elision "t",True> ; <Sg,False> => <"toi",elision "t",True> ;
_ => <"vous","vous",True> _ => <"vous","vous",True>
} ; } ;
_ => <[],[],False> _ => <[],[],False>
} ; } ;
clpr = <vp.clit1 ++ vp.clit2, vp.clit3.hasClit> ; clpr = <vp.clit1 ++ vp.clit2, vp.clit3.hasClit> ;
compl = vp.comp ! agr ++ vp.ext ! pol compl = vp.comp ! agr ++ vp.ext ! pol
in in
case pol of { case pol of {
RPos => verb ++ if_then_Str refl.p3 bindHyphen [] ++ refl.p1 ++ RPos => verb ++ if_then_Str refl.p3 bindHyphen [] ++ refl.p1 ++
if_then_Str clpr.p2 bindHyphen [] ++ vp.clit3.imp ++ if_then_Str clpr.p2 bindHyphen [] ++ vp.clit3.imp ++
compl ; compl ;
RNeg _ => neg.p1 ++ refl.p2 ++ clpr.p1 ++ verb ++ neg.p2 ++ compl RNeg _ => neg.p1 ++ refl.p2 ++ clpr.p1 ++ verb ++ neg.p2 ++ compl
} ; } ;
@@ -157,6 +159,11 @@ instance DiffFre of DiffRomance - [
bindHyphen : Str = BIND ++ "-" ++ BIND ; bindHyphen : Str = BIND ++ "-" ++ BIND ;
piuComp = "plus" ;
ComparAgr = AAgr ;
af2compar = aform2aagr ;
aagr2compar = id AAgr ;
CopulaType = {} ; CopulaType = {} ;
selectCopula = \isEstar -> copula ; selectCopula = \isEstar -> copula ;
serCopula = <> ; serCopula = <> ;
@@ -175,7 +182,7 @@ instance DiffFre of DiffRomance - [
clitInf _ cli inf = cli ++ inf ; clitInf _ cli inf = cli ++ inf ;
relPron : Bool => AAgr => Case => Str = \\b,a,c => relPron : Bool => AAgr => Case => Str = \\b,a,c =>
let let
lequel = case <a.g,a.n,c> of { lequel = case <a.g,a.n,c> of {
<Masc,Sg, CPrep P_de> => "duquel" ; <Masc,Sg, CPrep P_de> => "duquel" ;
@@ -215,8 +222,8 @@ instance DiffFre of DiffRomance - [
_ => pron _ => pron
} ; } ;
argPron : Gender -> Number -> Person -> Case -> Str = argPron : Gender -> Number -> Person -> Case -> Str =
let let
cases : (x,y : Str) -> Case -> Str = \me,moi,c -> case c of { cases : (x,y : Str) -> Case -> Str = \me,moi,c -> case c of {
Acc | CPrep P_a => me ; Acc | CPrep P_a => me ;
_ => moi _ => moi
@@ -226,8 +233,8 @@ instance DiffFre of DiffRomance - [
CPrep P_a => leur ; CPrep P_a => leur ;
_ => eux _ => eux
} ; } ;
in in
\g,n,p -> case <g,n,p> of { \g,n,p -> case <g,n,p> of {
<_,Sg,P1> => cases (elision "m") "moi" ; <_,Sg,P1> => cases (elision "m") "moi" ;
<_,Sg,P2> => cases (elision "t") "toi" ; <_,Sg,P2> => cases (elision "t") "toi" ;
<_,Pl,P1> => \_ -> "nous" ; <_,Pl,P1> => \_ -> "nous" ;
@@ -280,7 +287,7 @@ instance DiffFre of DiffRomance - [
polNegDirSubj = RNeg True ; polNegDirSubj = RNeg True ;
invertedClause : invertedClause :
VType -> (RTense * Anteriority * Number * Person) -> Bool -> (Str * Str) -> Str -> (clit,fin,inf,compl,subj,ext : Str) -> Str = VType -> (RTense * Anteriority * Number * Person) -> Bool -> (Str * Str) -> Str -> (clit,fin,inf,compl,subj,ext : Str) -> Str =
\vtyp,vform,hasClit,neg,bindHyph,clit,fin,inf,compl,subj,ext -> case <vtyp,vform,hasClit> of { \vtyp,vform,hasClit,neg,bindHyph,clit,fin,inf,compl,subj,ext -> case <vtyp,vform,hasClit> of {

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common --# -path=.:../abstract:../common
incomplete concrete DocumentationFreFunctor of Documentation = CatFre ** open incomplete concrete DocumentationFreFunctor of Documentation = CatFre ** open
Terminology, -- the interface to be instantiated Terminology, -- the interface to be instantiated
ResFre, ResFre,
CommonRomance, CommonRomance,
@@ -19,22 +19,22 @@ lincat
Definition = {s : Str} ; Definition = {s : Str} ;
Document = {s : Str} ; Document = {s : Str} ;
Tag = {s : Str} ; Tag = {s : Str} ;
{- {-
-} --# notpresent -} --# notpresent
oper oper
heading : N -> Str = \n -> (nounHeading n).s ; heading : N -> Str = \n -> (nounHeading n).s ;
lin lin
InflectionN, InflectionN3, InflectionN3 = \noun -> { InflectionN, InflectionN3, InflectionN3 = \noun -> {
t = "n" ; t = "n" ;
s1 = heading1 (heading noun_Category ++ s1 = heading1 (heading noun_Category ++
case noun.g of { case noun.g of {
Masc => "("+heading masculine_Parameter+")" ; Masc => "("+heading masculine_Parameter+")" ;
Fem => "("+heading feminine_Parameter+")" Fem => "("+heading feminine_Parameter+")"
}) ; }) ;
s2 = frameTable ( s2 = frameTable (
tr (th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (td (noun.s ! Sg) ++ td (noun.s ! Pl)) tr (td (noun.s ! Sg) ++ td (noun.s ! Pl))
) )
@@ -45,8 +45,8 @@ lin
s1 = heading1 (nounHeading adjective_Category).s ; s1 = heading1 (nounHeading adjective_Category).s ;
s2 = frameTable ( s2 = frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++ tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading masculine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Masc Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Masc Pl))) ++ tr (th (heading masculine_Parameter) ++ td (adj.s ! genNum2Aform Masc Sg) ++ td (adj.s ! genNum2Aform Masc Pl)) ++
tr (th (heading feminine_Parameter) ++ td (adj.s ! Posit ! (genNum2Aform Fem Sg)) ++ td (adj.s ! Posit ! (genNum2Aform Fem Pl))) tr (th (heading feminine_Parameter) ++ td (adj.s ! genNum2Aform Fem Sg) ++ td (adj.s ! genNum2Aform Fem Pl))
) )
} ; } ;
@@ -141,23 +141,23 @@ lin
MkDocument d i e = ss (i.s1 ++ d.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph MkDocument d i e = ss (i.s1 ++ d.s ++ i.s2 ++ paragraph e.s) ; -- explanation appended in a new paragraph
MkTag i = ss i.t ; MkTag i = ss i.t ;
oper oper
verbExample : CatFre.Cl -> Str = \cl -> verbExample : CatFre.Cl -> Str = \cl ->
(S.mkUtt cl).s (S.mkUtt cl).s
++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent ++ ";" ++ (S.mkUtt (S.mkS S.anteriorAnt cl)).s --# notpresent
; ;
inflVerb : Verb -> Str = \verb -> inflVerb : Verb -> Str = \verb ->
let let
vfin : CommonRomance.VF -> Str = \f -> vfin : CommonRomance.VF -> Str = \f ->
verb.s ! f ; verb.s ! f ;
ttable : TMood -> Str = \tense -> ttable : TMood -> Str = \tense ->
frameTable ( frameTable (
tr (th "" ++ tr (th "" ++
th (heading singular_Parameter) ++ th (heading singular_Parameter) ++
th (heading plural_Parameter)) ++ th (heading plural_Parameter)) ++
tr (th "1.p" ++ tr (th "1.p" ++
td (vfin (VFin tense Sg P1)) ++ td (vfin (VFin tense Sg P1)) ++
td (vfin (VFin tense Pl P1))) ++ td (vfin (VFin tense Pl P1))) ++
tr (th "2.p" ++ tr (th "2.p" ++
@@ -170,11 +170,11 @@ oper
ttable2 : (Mood -> TMood) -> Str = \f -> ttable2 : (Mood -> TMood) -> Str = \f ->
frameTable ( frameTable (
tr (intagAttr "th" "colspan=2" "" ++ tr (intagAttr "th" "colspan=2" "" ++
th (heading indicative_Parameter) ++ th (heading indicative_Parameter) ++
th (heading conjunctive_Parameter)) ++ th (heading conjunctive_Parameter)) ++
tr (intagAttr "th" "rowspan=3" (heading singular_Parameter) ++ tr (intagAttr "th" "rowspan=3" (heading singular_Parameter) ++
th "1.p" ++ th "1.p" ++
td (vfin (VFin (f Indic) Sg P1)) ++ td (vfin (VFin (f Indic) Sg P1)) ++
td (vfin (VFin (f Conjunct) Sg P1))) ++ td (vfin (VFin (f Conjunct) Sg P1))) ++
tr (th "2.p" ++ tr (th "2.p" ++
@@ -182,7 +182,7 @@ oper
td (vfin (VFin (f Conjunct) Sg P2))) ++ td (vfin (VFin (f Conjunct) Sg P2))) ++
tr (th "3.p" ++ tr (th "3.p" ++
td (vfin (VFin (f Indic) Sg P3)) ++ td (vfin (VFin (f Indic) Sg P3)) ++
td (vfin (VFin (f Conjunct) Sg P3))) ++ td (vfin (VFin (f Conjunct) Sg P3))) ++
tr (intagAttr "th" "rowspan=3" (heading plural_Parameter) ++ tr (intagAttr "th" "rowspan=3" (heading plural_Parameter) ++
th "1.p" ++ th "1.p" ++
td (vfin (VFin (f Indic) Pl P1)) ++ td (vfin (VFin (f Indic) Pl P1)) ++
@@ -190,7 +190,7 @@ oper
tr (th "2.p" ++ tr (th "2.p" ++
td (vfin (VFin (f Indic) Pl P2)) ++ td (vfin (VFin (f Indic) Pl P2)) ++
td (vfin (VFin (f Conjunct) Pl P2))) ++ td (vfin (VFin (f Conjunct) Pl P2))) ++
tr (th "3.p" ++ tr (th "3.p" ++
td (vfin (VFin (f Indic) Pl P3)) ++ td (vfin (VFin (f Indic) Pl P3)) ++
td (vfin (VFin (f Conjunct) Pl P3))) td (vfin (VFin (f Conjunct) Pl P3)))
) ; ) ;
@@ -209,17 +209,17 @@ oper
paragraph (vfin (VInfin False)) ++ paragraph (vfin (VInfin False)) ++
heading2 (heading imperative_Parameter) ++ heading2 (heading imperative_Parameter) ++
frameTable ( frameTable (
tr (th "sg.2.p" ++ td (vfin (VImper SgP2))) ++ tr (th "sg.2.p" ++ td (vfin (VImper SgP2))) ++
tr (th "pl.1.p" ++ td (vfin (VImper PlP1))) ++ tr (th "pl.1.p" ++ td (vfin (VImper PlP1))) ++
tr (th "pl.2.p" ++ td (vfin (VImper PlP2))) tr (th "pl.2.p" ++ td (vfin (VImper PlP2)))
) ++ ) ++
heading2 (heading participle_Parameter) ++ heading2 (heading participle_Parameter) ++
frameTable ( frameTable (
tr (th (heading past_Parameter) ++ td (vfin (VPart Masc Sg))) ++ tr (th (heading past_Parameter) ++ td (vfin (VPart Masc Sg))) ++
tr (th (heading present_Parameter) ++ td (vfin VGer)) tr (th (heading present_Parameter) ++ td (vfin VGer))
) ; ) ;
{- --# notpresent {- --# notpresent
-} -}
} }

View File

@@ -1,11 +1,11 @@
--# -path=.:../romance:../common:../abstract:../../prelude --# -path=.:../romance:../common:../abstract:../../prelude
concrete LexiconFre of Lexicon = CatFre ** concrete LexiconFre of Lexicon = CatFre **
open (M = MorphoFre), PhonoFre, ParadigmsFre, IrregFre in { open (M = MorphoFre), PhonoFre, ParadigmsFre, IrregFre in {
flags flags
coding=utf8 ; coding=utf8 ;
optimize=values ; optimize=values ;
lin lin
airplane_N = regGenN "avion" masculine ; airplane_N = regGenN "avion" masculine ;
@@ -17,8 +17,8 @@ lin
baby_N = regGenN "bébé" masculine ; baby_N = regGenN "bébé" masculine ;
bad_A = prefA (mkADeg (regA "mauvais") (regA "pire")) ; bad_A = prefA (mkADeg (regA "mauvais") (regA "pire")) ;
bank_N = regGenN "banque" feminine ; bank_N = regGenN "banque" feminine ;
beautiful_A = beautiful_A =
prefA (compADeg (mkA "beau" "bel" "belle" "beaux" "bellement")) ; prefA (mkA "beau" "bel" "belle" "beaux" "bellement") ;
become_VA = mkVA devenir_V ; become_VA = mkVA devenir_V ;
beer_N = regGenN "bière" feminine ; beer_N = regGenN "bière" feminine ;
beg_V2V = mkV2V (regV "demander") accusative dative ; beg_V2V = mkV2V (regV "demander") accusative dative ;
@@ -87,7 +87,7 @@ lin
girl_N = regGenN "fille" feminine ; girl_N = regGenN "fille" feminine ;
glove_N = regGenN "gant" masculine ; glove_N = regGenN "gant" masculine ;
gold_N = regGenN "or" masculine ; gold_N = regGenN "or" masculine ;
good_A = prefA (mkADeg (mkA "bon" "bonne" "bons" "bien") good_A = prefA (mkADeg (mkA "bon" "bonne" "bons" "bien")
(mkA "meilleur" "meilleure" "meilleurs" "mieux")) ; (mkA "meilleur" "meilleure" "meilleurs" "mieux")) ;
go_V = aller_V ; go_V = aller_V ;
green_A = regA "vert" ; green_A = regA "vert" ;
@@ -104,7 +104,7 @@ lin
industry_N = regGenN "industrie" feminine ; industry_N = regGenN "industrie" feminine ;
iron_N = regGenN "fer" masculine ; iron_N = regGenN "fer" masculine ;
king_N = regGenN "roi" masculine ; king_N = regGenN "roi" masculine ;
know_V2 = connaître_V2 ; know_V2 = connaître_V2 ;
know_VQ = mkVQ (lin V savoir_V2) ; know_VQ = mkVQ (lin V savoir_V2) ;
know_VS = mkVS (lin V savoir_V2) ; know_VS = mkVS (lin V savoir_V2) ;
lake_N = regGenN "lac" masculine ; lake_N = regGenN "lac" masculine ;
@@ -115,7 +115,7 @@ lin
like_V2 = dirV2 (regV "aimer") ; like_V2 = dirV2 (regV "aimer") ;
listen_V2 = dirV2 (regV "écouter") ; listen_V2 = dirV2 (regV "écouter") ;
live_V = v2V vivre_V2 ; live_V = v2V vivre_V2 ;
long_A = compADeg (mkA "long" "longue" "longs" "longuement") ; long_A = mkA "long" "longue" "longs" "longuement" ;
lose_V2 = perdre_V2 ; lose_V2 = perdre_V2 ;
love_N = regGenN "amour" masculine ; love_N = regGenN "amour" masculine ;
love_V2 = dirV2 (regV "aimer") ; love_V2 = dirV2 (regV "aimer") ;
@@ -128,12 +128,12 @@ lin
mountain_N = regGenN "montagne" feminine ; mountain_N = regGenN "montagne" feminine ;
music_N = regGenN "musique" feminine ; music_N = regGenN "musique" feminine ;
narrow_A = regA "étroit" ; narrow_A = regA "étroit" ;
new_A = new_A =
prefA (compADeg (mkA "nouveau" "nouvel" "nouvelle" "nouveaux" "nouvellement")) ; prefA (mkA "nouveau" "nouvel" "nouvelle" "nouveaux" "nouvellement") ;
newspaper_N = regGenN "journal" masculine ; newspaper_N = regGenN "journal" masculine ;
oil_N = regGenN "huile" feminine ; oil_N = regGenN "huile" feminine ;
old_A = old_A =
prefA (compADeg (mkA "vieux" "vieil" "vieille" "vieux" "vieillement")) ; prefA (mkA "vieux" "vieil" "vieille" "vieux" "vieillement") ;
open_V2 = ouvrir_V2 ; open_V2 = ouvrir_V2 ;
paint_V2A = mkV2A (v2V peindre_V2) accusative (mkPrep "en") ; paint_V2A = mkV2A (v2V peindre_V2) accusative (mkPrep "en") ;
paper_N = regGenN "papier" masculine ; paper_N = regGenN "papier" masculine ;
@@ -193,7 +193,7 @@ lin
teacher_N = regGenN "professeur" masculine ; teacher_N = regGenN "professeur" masculine ;
teach_V2 = dirV2 (regV "enseigner") ; teach_V2 = dirV2 (regV "enseigner") ;
television_N = regGenN "télévision" feminine ; television_N = regGenN "télévision" feminine ;
thick_A = compADeg (mkA "épais" "épaisse" "épais" "épaissement") ; thick_A = mkA "épais" "épaisse" "épais" "épaissement" ;
thin_A = regA "fin" ; thin_A = regA "fin" ;
train_N = regGenN "train" masculine ; train_N = regGenN "train" masculine ;
travel_V = regV "voyager" ; travel_V = regV "voyager" ;
@@ -203,13 +203,13 @@ lin
understand_V2 = comprendre_V2 ; understand_V2 = comprendre_V2 ;
university_N = regGenN "université" feminine ; university_N = regGenN "université" feminine ;
village_N = regGenN "village" masculine ; village_N = regGenN "village" masculine ;
wait_V2 = attendre_V2 ; wait_V2 = attendre_V2 ;
walk_V = regV "marcher" ; walk_V = regV "marcher" ;
warm_A = regA "chaud" ; warm_A = regA "chaud" ;
war_N = regGenN "guerre" masculine ; war_N = regGenN "guerre" masculine ;
watch_V2 = dirV2 (regV "regarder") ; watch_V2 = dirV2 (regV "regarder") ;
water_N = regGenN "eau" feminine ; water_N = regGenN "eau" feminine ;
white_A = compADeg (mkA "blanc" "blanche" "blancs" "blanchement") ; white_A = mkA "blanc" "blanche" "blancs" "blanchement" ;
window_N = regGenN "fenêtre" feminine ; window_N = regGenN "fenêtre" feminine ;
wine_N = regGenN "vin" masculine ; wine_N = regGenN "vin" masculine ;
win_V2 = dirV2 (regV "gagner") ; ---- vaincre win_V2 = dirV2 (regV "gagner") ; ---- vaincre
@@ -309,7 +309,7 @@ lin
wing_N = regN "aile" ; wing_N = regN "aile" ;
worm_N = regN "ver" ; worm_N = regN "ver" ;
year_N = regN "an" ; --- année year_N = regN "an" ; --- année
bite_V2 = mordre_V2 ; bite_V2 = mordre_V2 ;
blow_V = regV "souffler" ; blow_V = regV "souffler" ;
breathe_V = regV "respirer" ; breathe_V = regV "respirer" ;
burn_V = regV "brûler" ; burn_V = regV "brûler" ;

View File

@@ -4,12 +4,12 @@
-- --
-- Aarne Ranta 2001 - 2006 -- Aarne Ranta 2001 - 2006
-- --
-- This is an API for the user of the resource grammar -- This is an API for the user of the resource grammar
-- for adding lexical items. It gives functions for forming -- for adding lexical items. It gives functions for forming
-- expressions of open categories: nouns, adjectives, verbs. -- expressions of open categories: nouns, adjectives, verbs.
-- --
-- Closed categories (determiners, pronouns, conjunctions) are -- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API, $Structural.gf$. -- accessed through the resource syntax API, $Structural.gf$.
-- --
-- The main difference with $MorphoFre.gf$ is that the types -- The main difference with $MorphoFre.gf$ is that the types
-- referred to are compiled resource grammar types. We have moreover -- referred to are compiled resource grammar types. We have moreover
@@ -24,23 +24,23 @@
-- separate module [``IrregFre`` ../../french/IrregFre.gf], -- separate module [``IrregFre`` ../../french/IrregFre.gf],
-- which covers all irregularly inflected verbs. -- which covers all irregularly inflected verbs.
resource ParadigmsFre = resource ParadigmsFre =
open open
(Predef=Predef), (Predef=Predef),
Prelude, Prelude,
MorphoFre, MorphoFre,
BeschFre, BeschFre,
CatFre in { CatFre in {
flags optimize=all ; flags optimize=all ;
coding=utf8 ; coding=utf8 ;
--2 Parameters --2 Parameters
-- --
-- To abstract over gender names, we define the following identifiers. -- To abstract over gender names, we define the following identifiers.
oper oper
Gender : Type ; Gender : Type ;
masculine : Gender ; masculine : Gender ;
feminine : Gender ; feminine : Gender ;
@@ -72,9 +72,9 @@ oper
mkN : overload { mkN : overload {
-- The regular function uses heuristics to compute the -- The regular function uses heuristics to compute the
-- plural and the gender from the singular. The plural -- plural and the gender from the singular. The plural
-- heuristic currently -- heuristic currently
-- covers the cases "pas-pas", "prix-prix", "nez-nez", -- covers the cases "pas-pas", "prix-prix", "nez-nez",
-- "bijou-bijoux", "cheveu-cheveux", "plateau-plateaux", "cheval-chevaux". -- "bijou-bijoux", "cheveu-cheveux", "plateau-plateaux", "cheval-chevaux".
-- The gender heuristic is less reliable: it treats as feminine all -- The gender heuristic is less reliable: it treats as feminine all
-- nouns ending with "e" and "ion", all others as masculine. -- nouns ending with "e" and "ion", all others as masculine.
@@ -85,30 +85,30 @@ oper
mkN : (foie : Str) -> Gender -> N ; --% mkN : (foie : Str) -> Gender -> N ; --%
-- In the worst case, both singular and plural forms and the gender are needed. -- In the worst case, both singular and plural forms and the gender are needed.
mkN : (oeil,yeux : Str) -> Gender -> N ; -- worst-case noun mkN : (oeil,yeux : Str) -> Gender -> N ; -- worst-case noun
--3 Compound nouns --3 Compound nouns
-- --
-- Some nouns are ones where the first part is inflected as a noun but -- Some nouns are ones where the first part is inflected as a noun but
-- the second part is not inflected. e.g. "numéro de téléphone". -- the second part is not inflected. e.g. "numéro de téléphone".
-- They could be formed in syntax, but we give a shortcut here since -- They could be formed in syntax, but we give a shortcut here since
-- they are frequent in lexica. -- they are frequent in lexica.
mkN : N -> Str -> N -- compound noun, e.g. numéro + de téléphone mkN : N -> Str -> N -- compound noun, e.g. numéro + de téléphone
} ; } ;
--3 Relational nouns --3 Relational nouns
-- --
-- Relational nouns ("fille de x") need a case and a preposition. -- Relational nouns ("fille de x") need a case and a preposition.
mkN2 : N -> Prep -> N2 ; -- e.g. fille + genitive mkN2 : N -> Prep -> N2 ; -- e.g. fille + genitive
-- The most common cases are the genitive "de" and the dative "à", -- The most common cases are the genitive "de" and the dative "à",
-- with the empty preposition. -- with the empty preposition.
deN2 : N -> N2 ; --% deN2 : N -> N2 ; --%
@@ -126,7 +126,7 @@ oper
-- $N3$ are purely lexical categories. But you can use the $AdvCN$ -- $N3$ are purely lexical categories. But you can use the $AdvCN$
-- and $PrepNP$ constructions to build phrases like this. -- and $PrepNP$ constructions to build phrases like this.
-- --
--3 Proper names and noun phrases --3 Proper names and noun phrases
-- --
-- Proper names need a string and a gender. If no gender is given, the -- Proper names need a string and a gender. If no gender is given, the
@@ -146,7 +146,7 @@ oper
-- For regular adjectives, all forms are derived from the -- For regular adjectives, all forms are derived from the
-- masculine singular. The heuristic takes into account certain -- masculine singular. The heuristic takes into account certain
-- deviant endings: "banal-banale-banaux", "chinois-chinoise-chinois", -- deviant endings: "banal-banale-banaux", "chinois-chinoise-chinois",
-- "heureux-heureuse-heureux", "italien-italienne", "jeune-jeune", -- "heureux-heureuse-heureux", "italien-italienne", "jeune-jeune",
-- "amer-amère", "carré- - -carrément", "joli- - -joliment". -- "amer-amère", "carré- - -carrément", "joli- - -joliment".
@@ -174,7 +174,7 @@ oper
mkA : A -> A -> A ; -- irregular comparison, e.g. bon-meilleur mkA : A -> A -> A ; -- irregular comparison, e.g. bon-meilleur
mkA : A -> CopulaType -> A -- force copula type mkA : A -> CopulaType -> A -- force copula type
} ; } ;
-- The functions create by default postfix adjectives. To switch -- The functions create by default postfix adjectives. To switch
@@ -195,7 +195,7 @@ oper
--2 Adverbs --2 Adverbs
-- Adverbs are not inflected. Most lexical ones have position -- Adverbs are not inflected. Most lexical ones have position
-- after the verb. -- after the verb.
mkAdv : Str -> Adv ; -- ordinary adverb mkAdv : Str -> Adv ; -- ordinary adverb
@@ -210,10 +210,10 @@ oper
--2 Verbs --2 Verbs
-- --
-- Irregular verbs are given in the module $IrregFre$. -- Irregular verbs are given in the module $IrregFre$.
-- If a verb should be missing in that list, the module -- If a verb should be missing in that list, the module
-- $BeschFre$ gives all the patterns of the "Bescherelle" book. -- $BeschFre$ gives all the patterns of the "Bescherelle" book.
-- --
-- Regular verbs are ones with the infinitive "er" or "ir", the -- Regular verbs are ones with the infinitive "er" or "ir", the
-- latter with plural present indicative forms as "finissons". -- latter with plural present indicative forms as "finissons".
-- The regular verb function in the first conjugation recognizes -- The regular verb function in the first conjugation recognizes
@@ -222,7 +222,7 @@ oper
-- --
-- Sometimes, however, it is not predictable which variant of the "er" -- Sometimes, however, it is not predictable which variant of the "er"
-- conjugation is to be selected. Then it is better to use the function -- conjugation is to be selected. Then it is better to use the function
-- that gives the third person singular present indicative and future -- that gives the third person singular present indicative and future
-- (("il") "jette", "jettera") as second argument. -- (("il") "jette", "jettera") as second argument.
mkV : overload { mkV : overload {
@@ -249,7 +249,7 @@ oper
} ; } ;
-- The function $mkV$ gives the default compound auxiliary "avoir". -- The function $mkV$ gives the default compound auxiliary "avoir".
-- To change it to "être", use the following function. -- To change it to "être", use the following function.
etreV : V -> V ; -- force auxiliary to be être (default avoir) etreV : V -> V ; -- force auxiliary to be être (default avoir)
@@ -261,13 +261,13 @@ oper
--3 Two-place verbs --3 Two-place verbs
-- --
-- Two-place verbs need a preposition, except the special case with direct object. -- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). -- (transitive verbs).
mkV2 = overload { mkV2 = overload {
mkV2 : Str -> V2 --% mkV2 : Str -> V2 --%
= \s -> dirV2 (regV s) ; = \s -> dirV2 (regV s) ;
mkV2 : V -> V2 -- direct transitive mkV2 : V -> V2 -- direct transitive
= dirV2 ; = dirV2 ;
mkV2 : V -> Prep -> V2 -- e.g. se fier + genitive mkV2 : V -> Prep -> V2 -- e.g. se fier + genitive
= mmkV2 = mmkV2
} ; } ;
@@ -279,7 +279,7 @@ oper
-- the first one or both can be absent. -- the first one or both can be absent.
mkV3 : overload { mkV3 : overload {
mkV3 : V -> V3 ; -- donner (+ accusative + dative) mkV3 : V -> V3 ; -- donner (+ accusative + dative)
mkV3 : V -> Prep -> V3 ; -- placer (+ accusative) + dans mkV3 : V -> Prep -> V3 ; -- placer (+ accusative) + dans
mkV3 : V -> Prep -> Prep -> V3 -- parler + dative + genitive mkV3 : V -> Prep -> Prep -> V3 -- parler + dative + genitive
} ; } ;
@@ -319,7 +319,7 @@ oper
mkA2V : A -> Prep -> Prep -> A2V ; --% mkA2V : A -> Prep -> Prep -> A2V ; --%
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$, -- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
-- and the second argument is given as an adverb. Likewise -- and the second argument is given as an adverb. Likewise
-- $V0$ is just $V$. -- $V0$ is just $V$.
V0 : Type ; --% V0 : Type ; --%
@@ -332,7 +332,7 @@ oper
-- hidden from the document. -- hidden from the document.
Gender = MorphoFre.Gender ; Gender = MorphoFre.Gender ;
Number = MorphoFre.Number ; Number = MorphoFre.Number ;
masculine = Masc ; masculine = Masc ;
feminine = Fem ; feminine = Fem ;
@@ -361,7 +361,7 @@ oper
g = case <x : Str> of { g = case <x : Str> of {
_ + ("e" | "ion") => Fem ; _ + ("e" | "ion") => Fem ;
_ => Masc _ => Masc
} }
} ; } ;
regGenN x g = mkNomReg x g ** {lock_N = <>} ; regGenN x g = mkNomReg x g ** {lock_N = <>} ;
compN : N -> Str -> N ; compN : N -> Str -> N ;
@@ -369,10 +369,10 @@ oper
mkN = overload { mkN = overload {
mkN : Str -> N = regN ; mkN : Str -> N = regN ;
mkN : Str -> Gender -> N = regGenN ; mkN : Str -> Gender -> N = regGenN ;
mkN : (oeil,yeux : Str) -> Gender -> N = mk2N ; mkN : (oeil,yeux : Str) -> Gender -> N = mk2N ;
mkN : N -> Str -> N = compN mkN : N -> Str -> N = compN
} ; } ;
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
@@ -394,24 +394,24 @@ oper
} ; } ;
mk4A masc fem mascpl aa = mk5A masc masc fem mascpl aa ; mk4A masc fem mascpl aa = mk5A masc masc fem mascpl aa ;
mk5A masc mascv fem mascpl aa = compADeg {s = \\_ => (mkAdj' masc mascv fem mascpl aa).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ; mk5A masc mascv fem mascpl aa = compADeg (mkAdj' masc mascv fem mascpl aa) ;
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; copTyp = serCopula ; lock_A = <>} ; regA a = compADeg (mkAdjReg a);
prefA a = {s = a.s ; isPre = True ; copTyp = a.copTyp ; lock_A = <>} ; prefA a = a ** {isPre = True} ;
adjCopula a cop = a ** {copTyp = cop} ; adjCopula a cop = a ** {copTyp = cop} ;
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
mkA = overload { mkA = overload {
mkA : Str -> A = regA ; mkA : Str -> A = regA ;
mkA : (sec,seche : Str) -> A = \sec,seche -> mk4A sec seche (sec + "s") (seche + "ment") ; mkA : (sec,seche : Str) -> A = \sec,seche -> mk4A sec seche (sec + "s") (seche + "ment") ;
mkA : (banal,banale,banaux : Str) -> A = \sec,seche,secs -> mk4A sec seche secs (seche + "ment") ; mkA : (banal,banale,banaux : Str) -> A = \sec,seche,secs -> mk4A sec seche secs (seche + "ment") ;
mkA : (banal,banale,banaux,banalement : Str) -> A = mk4A ; mkA : (banal,banale,banaux,banalement : Str) -> A = mk4A ;
mkA : (vieux,vieil,vieille,vieuxs,vieuxment : Str) -> A = mk5A ; mkA : (vieux,vieil,vieille,vieuxs,vieuxment : Str) -> A = mk5A ;
mkA : A -> A -> A = mkADeg ; mkA : A -> A -> A = mkADeg ;
mkA : A -> CopulaType -> A = adjCopula ; mkA : A -> CopulaType -> A = adjCopula ;
}; };
prefixA a = {s = a.s ; isPre = True ; copTyp = a.copTyp ; lock_A = <>} ; prefixA = prefA ;
mkAdv x = ss x ** {lock_Adv = <>} ; mkAdv x = ss x ** {lock_Adv = <>} ;
mkAdV x = ss x ** {lock_AdV = <>} ; mkAdV x = ss x ** {lock_AdV = <>} ;
@@ -437,7 +437,7 @@ oper
A2S, A2V : Type = A2 ; A2S, A2V : Type = A2 ;
mkV0 v = v ** {lock_V0 = <>} ; mkV0 v = v ** {lock_V0 = <>} ;
mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ; mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ;
subjVS v = v ** {m = \\_ => Conjunct ; lock_VS = <>} ; subjVS v = v ** {m = \\_ => Conjunct ; lock_VS = <>} ;
mkV2S = overload { mkV2S = overload {
@@ -471,13 +471,13 @@ oper
--------------------------- obsolete --------------------------- obsolete
makeNP : Str -> Gender -> Number -> NP ; makeNP : Str -> Gender -> Number -> NP ;
makeNP x g n = {s = (pn2np {s=x;g= g}).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False ; lock_NP = <>} ; makeNP x g n = {s = (pn2np {s=x;g= g}).s; a = agrP3 g n ; hasClit = False ; isPol = False ; isNeg = False ; lock_NP = <>} ;
regPN : Str -> PN ; regPN : Str -> PN ;
mk2PN : Str -> Gender -> PN = \x,g -> {s = x ; g = g} ** {lock_PN = <>} ; mk2PN : Str -> Gender -> PN = \x,g -> {s = x ; g = g} ** {lock_PN = <>} ;
mkADeg : A -> A -> A ; mkADeg : A -> A -> A ;
compADeg : A -> A ; compADeg : Adj -> A ;
regA : Str -> A ; regA : Str -> A ;
mk4A : (banal,banale,banaux,banalement : Str) -> A ; mk4A : (banal,banale,banaux,banalement : Str) -> A ;
@@ -486,31 +486,34 @@ oper
prefA : A -> A ; prefA : A -> A ;
adjCopula : A -> CopulaType -> A ; adjCopula : A -> CopulaType -> A ;
mkADeg a b = mkADeg a b = a ** {
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ; isPre = a.isPre ; copTyp = a.copTyp ; lock_A = <>} ; compar = \\aagr => b.s ! aagr2aform aagr ; -- meilleur, meilleure, meilleurs, meilleures
compADeg a = isDeg = True } ;
{s = table {Posit => a.s ! Posit ; _ => \\f => "plus" ++ a.s ! Posit ! f} ; compADeg a = lin A
isPre = a.isPre ; {s = a.s ;
copTyp = a.copTyp ; compar = \\_ => nonExist ; --
lock_A = <>} ; isPre = False ; -- default values
copTyp = <> ;
isDeg = False
} ;
mkV = overload { mkV = overload {
mkV : Str -> V = regV ; mkV : Str -> V = regV ;
mkV : (jeter,jette : Str) -> V = mkV : (jeter,jette : Str) -> V =
\x,y -> let v = vvf (mkVerb2Reg x y) in {s = v ; vtyp = VTyp VHabere (getVerbT v) ; lock_V = <> ; p = []} ; \x,y -> let v = vvf (mkVerb2Reg x y) in {s = v ; vtyp = VTyp VHabere (getVerbT v) ; lock_V = <> ; p = []} ;
mkV : (jeter,jette,jettera : Str) -> V = reg3V ; mkV : (jeter,jette,jettera : Str) -> V = reg3V ;
mkV : V2 -> V = v2V ; mkV : V2 -> V = v2V ;
mkV : (tenir,tiens,tenons,tiennent,tint,tiendra,tenu : Str) -> V mkV : (tenir,tiens,tenons,tiennent,tint,tiendra,tenu : Str) -> V
= \tenir,tiens,tenons,tiennent,tint,tiendra,tenu -> = \tenir,tiens,tenons,tiennent,tint,tiendra,tenu ->
let v = vvf (mkVerb7 tenir tiens tenons tiennent tint tiendra tenu) in let v = vvf (mkVerb7 tenir tiens tenons tiennent tint tiendra tenu) in
{s = v ; vtyp = VTyp VHabere (getVerbT v) ; lock_V = <> ; p = []} ; {s = v ; vtyp = VTyp VHabere (getVerbT v) ; lock_V = <> ; p = []} ;
mkV : (tenir,tiens,tient,tenons,tenez,tiennent,tienne,tenions,tiensI,tint,tiendra,tenu : Str) -> V mkV : (tenir,tiens,tient,tenons,tenez,tiennent,tienne,tenions,tiensI,tint,tiendra,tenu : Str) -> V
= \tenir,tiens,tient,tenons,tenez,tiennent,tienne,tenions,tiensI,tint,tiendra,tenu -> = \tenir,tiens,tient,tenons,tenez,tiennent,tienne,tenions,tiensI,tint,tiendra,tenu ->
let v = vvf (mkVerb12 tenir tiens tient tenons tenez tiennent tienne tenions tiensI tint tiendra tenu) in let v = vvf (mkVerb12 tenir tiens tient tenons tenez tiennent tienne tenions tiensI tint tiendra tenu) in
{s = v ; vtyp = VTyp VHabere (getVerbT v) ; lock_V = <> ; p = []} ; {s = v ; vtyp = VTyp VHabere (getVerbT v) ; lock_V = <> ; p = []} ;
mkV : V -> V mkV : V -> V
= \v -> v ; = \v -> v ;
mkV : V -> Str -> V mkV : V -> Str -> V
= \v,p -> v ** {p = p} ; ---- to recognize particles in dict, not yet in lincat V = \v,p -> v ** {p = p} ; ---- to recognize particles in dict, not yet in lincat V
} ; } ;