resturcturing french resource

This commit is contained in:
aarne
2004-11-17 14:33:15 +00:00
parent 36121a1698
commit 15fd8ec71b
19 changed files with 3432 additions and 9 deletions

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete CategoriesFre of Categories =
CategoriesRomance with (SyntaxRomance=SyntaxFre) ;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
concrete NumeralsFre of Numerals = open TypesFre, MorphoFre in {
lincat Numeral = {s : Str} ;
lincat Digit = {inh : DForm ; inh1 : Number ; s : DForm => Str} ;
lincat Sub10 = {inh : Number ; s : {p1 : DForm ; p2 : Place} => Str} ;
lincat Sub100 = {s : Place => Str} ;
lincat Sub1000 = {s : Place => Str} ;
lincat Sub1000000 = {s : Str} ;
lin num x0 =
{s = x0.s} ;
lin n2 =
{inh = unit ; inh1 = Sg ; s = table {unit => "deux" ; teen => "douze" ; jten => "vingt" ; ten => "vingt" ; tenplus => "vingt"}} ;
lin n3 =
{inh = unit ; inh1 = Sg ; s = table {unit => "trois" ; teen => "treize" ; jten => "trente" ; ten => "trente" ; tenplus => "trente"}} ;
lin n4 =
{inh = unit ; inh1 = Sg ; s = table {unit => "quatre" ; teen => "quatorze" ; jten => "quarante" ; ten => "quarante" ; tenplus => "quarante"}} ;
lin n5 =
{inh = unit ; inh1 = Sg ; s = table {unit => "cinq" ; teen => "quinze" ; jten => "cinquante" ; ten => "cinquante" ; tenplus => "cinquante"}} ;
lin n6 =
{inh = unit ; inh1 = Sg ; s = table {unit => "six" ; teen => "seize" ; jten => "soixante" ; ten => "soixante" ; tenplus => "soixante"}} ;
lin n7 =
{inh = teen ; inh1 = Sg ; s = table {unit => "sept" ; teen => "dix" ++ "-" ++ "sept" ; jten => "soixante" ++ "-" ++ "dix" ; ten => "soixante" ++ "-" ++ "dix" ; tenplus => "soixante"}} ;
lin n8 =
{inh = unit ; inh1 = Pl ; s = table {unit => "huit" ; teen => "dix" ++ "-" ++ "huit" ; jten => "quatre" ++ "-" ++ "vingts" ; ten => "quatre" ++ "-" ++ "vingt" ; tenplus => "quatre" ++ "-" ++ "vingt"}} ;
lin n9 =
{inh = teen ; inh1 = Pl ; s = table {unit => "neuf" ; teen => "dix" ++ "-" ++ "neuf" ; jten => "quatre" ++ "-" ++ "vingt" ++ "-" ++ "dix" ; ten => "quatre" ++ "-" ++ "vingt" ++ "-" ++ "dix" ; tenplus => "quatre" ++ "-" ++ "vingt"}} ;
lin pot01 =
{inh = Sg ; s = table {{p1 = unit ; p2 = indep} => "un" ; {p1 = unit ; p2 = attr} => [] ; {p1 = teen ; p2 = indep} => "onze" ; {p1 = teen ; p2 = attr} => [] ; {p1 = jten ; p2 = indep} => "dix" ; {p1 = jten ; p2 = attr} => [] ; {p1 = ten ; p2 = indep} => "dix" ; {p1 = ten ; p2 = attr} => [] ; {p1 = tenplus ; p2 = indep} => "dix" ; {p1 = tenplus ; p2 = attr} => []}} ;
lin pot0 d =
{inh = Pl ; s = table {{p1 = unit ; p2 = indep} => d.s ! unit ; {p1 = unit ; p2 = attr} => d.s ! unit ; {p1 = teen ; p2 = indep} => d.s ! teen ; {p1 = teen ; p2 = attr} => d.s ! teen ; {p1 = jten ; p2 = indep} => d.s ! jten ; {p1 = jten ; p2 = attr} => d.s ! jten ; {p1 = ten ; p2 = indep} => d.s ! ten ; {p1 = ten ; p2 = attr} => d.s ! ten ; {p1 = tenplus ; p2 = indep} => d.s ! tenplus ; {p1 = tenplus ; p2 = attr} => d.s ! tenplus}} ;
lin pot110 =
{s = table {indep => "dix" ; attr => "dix"}} ;
lin pot111 =
{s = table {indep => "onze" ; attr => "onze"}} ;
lin pot1to19 d =
{s = table {indep => d.s ! teen ; attr => d.s ! teen}} ;
lin pot0as1 n =
{s = table {indep => n.s ! {p1 = unit ; p2 = indep} ; attr => n.s ! {p1 = unit ; p2 = attr}}} ;
lin pot1 d =
{s = table {indep => d.s ! jten ; attr => d.s ! ten}} ;
lin pot1plus d e =
{s = table {indep => (d.s ! tenplus) ++ (table {{p1 = Sg ; p2 = Sg} => "et" ; {p1 = Sg ; p2 = pl} => "-" ; {p1 = Pl ; p2 = Sg} => "-" ; {p1 = Pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++ e.s ! {p1 = d.inh ; p2 = indep} ; attr => (d.s ! tenplus) ++ (table {{p1 = Sg ; p2 = Sg} => "et" ; {p1 = Sg ; p2 = pl} => "-" ; {p1 = Pl ; p2 = Sg} => "-" ; {p1 = Pl ; p2 = pl} => "-"} ! {p1 = d.inh1 ; p2 = e.inh}) ++ e.s ! {p1 = d.inh ; p2 = indep}}} ;
lin pot1as2 n =
{s = table {indep => n.s ! indep ; attr => n.s ! attr}} ;
lin pot2 d =
{s = table {indep => (d.s ! {p1 = unit ; p2 = attr}) ++ table {Sg => "cent" ; Pl => "cents"} ! (d.inh) ; attr => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent"}} ;
lin pot2plus d e =
{s = table {indep => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep ; attr => (d.s ! {p1 = unit ; p2 = attr}) ++ "cent" ++ e.s ! indep}} ;
lin pot2as3 n =
{s = n.s ! indep} ;
lin pot3 n =
{s = (n.s ! attr) ++ "mille"} ;
lin pot3plus n m =
{s = (n.s ! attr) ++ "mille" ++ m.s ! indep} ;
}

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete RulesFre of Rules =
RulesRomance with (SyntaxRomance=SyntaxFre) ;

View File

@@ -0,0 +1,113 @@
--# -path=.:../romance:../abstract:../../prelude
concrete StructuralFre of Structural = CategoriesFre, NumeralsFre **
open SyntaxFre, MorphoFre, Prelude in {
lin
INP = pronNounPhrase pronJe ;
ThouNP = pronNounPhrase pronTu ;
HeNP = pronNounPhrase pronIl ;
SheNP = pronNounPhrase pronElle ;
WeNumNP n = pronNounPhrase (pronWithNum pronNous n) ;
YeNumNP n = pronNounPhrase (pronWithNum pronVous n) ;
YouNP = pronNounPhrase pronVous ;
TheyNP = pronNounPhrase pronIls ;
-- Here is a point where the API is really inadequate for French,
-- which distinguishes between masculine and feminine "they".
-- The following solution is not attractive.
--- TheyNP = pronNounPhrase (variants {pronIls ; pronElles}) ;
ThisNP = mkNameNounPhrase ["ceci"] Masc ;
ThatNP = mkNameNounPhrase ["ça"] Masc ;
TheseNumNP n = mkNameNounPhrase ("ceux" ++ n.s ! Masc ++ "ci") Masc ;
ThoseNumNP n = mkNameNounPhrase ("ceux" ++ n.s ! Masc ++ "là") Masc ;
UseNumeral n = {s = \\_ => n.s} ; ---- gender
ItNP = pronNounPhrase pronIl ;
EveryDet = chaqueDet ;
AllMassDet = toutDet ;
AllNumDet = tousDet ;
WhichDet = quelDet ;
WhichNumDet = mkDeterminerNum plural "quels" "quelles" ;
MostsDet = plupartDet ;
MostDet = mkDeterminer1 singular (["la plupart"] ++ elisDe) ; --- de
SomeDet = mkDeterminer1 singular "quelque" ;
SomeNumDet = mkDeterminerNum plural "quelques" "quelques" ;
NoDet = mkDeterminer singular "aucun" "aucune" ; --- ne
NoNumDet = mkDeterminerNum plural ("aucun" ++ "des") ("aucune" ++ "des") ; --- ne
AnyDet = mkDeterminer1 singular "quelque" ; ---
AnyNumDet = mkDeterminerNum plural "quelques" "quelques" ; ---
ManyDet = mkDeterminer1 plural "plusieurs" ;
MuchDet = mkDeterminer1 singular ("beaucoup" ++ elisDe) ; --- de
ThisDet = mkDeterminer singular (pre {"ce" ; "cet" / voyelle}) "cette" ; --- ci
ThatDet = mkDeterminer singular (pre {"ce" ; "cet" / voyelle}) "cette" ; --- là
TheseNumDet = mkDeterminerNum plural "ces" "ces" ; --- ci
ThoseNumDet = mkDeterminerNum plural "ces" "ces" ; --- là
HowIAdv = commentAdv ;
WhenIAdv = quandAdv ;
WhereIAdv = ouAdv ;
WhyIAdv = pourquoiAdv ;
AndConj = etConj ;
OrConj = ouConj ;
BothAnd = etetConj ;
EitherOr = ououConj ;
NeitherNor = niniConj ; --- requires ne !
IfSubj = siSubj ;
WhenSubj = quandSubj ;
PhrYes = ouiPhr ;
PhrNo = nonPhr ; --- and also Si!
VeryAdv = ss "très" ;
TooAdv = ss "trop" ;
OtherwiseAdv = ss "autrement" ;
ThereforeAdv = ss "donc" ;
EverybodyNP = mkNameNounPhrase ["tout le monde"] Masc ;
SomebodyNP = mkNameNounPhrase ["quelqu'un"] Masc ;
NobodyNP = mkNameNounPhrase ["personne"] Masc ; --- ne
EverythingNP = mkNameNounPhrase ["tout"] Masc ;
SomethingNP = mkNameNounPhrase ["quelque chose"] Masc ;
NothingNP = mkNameNounPhrase ["rien"] Masc ; --- ne
CanVV = mkVerbVerbDir (verbPres (conj3pouvoir "pouvoir")) ;
CanKnowVV = mkVerbVerbDir (verbPres (conj3savoir "savoir")) ;
MustVV = mkVerbVerbDir (verbPres (conj3devoir "devoir")) ;
WantVV = mkVerbVerbDir (verbPres (conj3vouloir "vouloir")) ;
EverywhereNP = ss "partout" ;
SomewhereNP = ss ["quelque part"] ; --- ne - pas
NowhereNP = ss ["nulle part"] ;
AlthoughSubj = ss ("bien" ++ elisQue) ** {m = Con} ;
AlmostAdv = ss "presque" ;
QuiteAdv = ss "assez" ;
InPrep = justPrep "dans" ;
OnPrep = justPrep "sur" ;
ToPrep = justCase dative ; ---
ThroughPrep = justPrep "par" ;
AbovePrep = {s = ["au dessus"] ; c = genitive} ;
UnderPrep = justPrep "sous" ;
InFrontPrep = justPrep "devant" ;
BehindPrep = justPrep "derrière" ;
BetweenPrep = justPrep "entre" ;
FromPrep = justCase genitive ; ---
BeforePrep = justPrep "avant" ;
DuringPrep = justPrep "pendant" ;
AfterPrep = justPrep "après" ;
WithPrep = justPrep "avec" ;
WithoutPrep = justPrep "sans" ;
ByMeansPrep = justPrep "par" ;
PossessPrep = justCase genitive ;
PartPrep = justCase genitive ; ---
AgentPrep = justPrep "par" ;
}

View File

@@ -0,0 +1,334 @@
--# -path=.:../romance:../../prelude
instance SyntaxFre of SyntaxRomance = TypesFre ** open Prelude, (CO=Coordination), MorphoFre in {
oper
nameNounPhrase = \jean ->
normalNounPhrase
(\\c => prepCase c ++ jean.s)
jean.g
Sg ;
nounPhraseOn = mkNameNounPhrase "on" Masc ;
partitiveNounPhrase = \n,vin ->
normalNounPhrase
(table {
Gen => elisDe ++ vin.s ! n ;
c => prepCase c ++ artDef vin.g n Gen ++ vin.s ! n
}
)
vin.g
n ;
chaqueDet = mkDeterminer1 Sg "chaque" ;
toutDet : Determiner =
{s = \\g => genForms "tout" "toute" ! g ++ artDef g Sg nominative ;
n = Pl
} ;
tousDet : Numeral -> Determiner = \nu ->
{s = \\g => genForms "tous" "toutes" ! g ++ artDef g Pl nominative ++ nu.s ! g ;
n = Pl
} ;
plupartDet = mkDeterminer1 Pl ["la plupart des"] ;
unDet = mkDeterminer Sg "un" "une" ;
plDet = mkDeterminer1 Pl "des" ; ---
quelDet = mkDeterminer Sg "quel" "quelle" ;
quelsDet = mkDeterminer Pl "quels" "quelles" ;
npGenPoss = \n,ton,mec ->
\\c => prepCase c ++ ton.s ! Poss n mec.g ++ mec.s ! n ;
npGenPossNum = \nu,ton,mec ->
\\c => prepCase c ++ ton.s ! Poss Pl mec.g ++ nu.s ! mec.g ++ mec.s ! Pl ;
existNounPhrase = \duvin -> {
s = \\m =>
case m of {
Ind => ["il y a"] ;
Con => ["il y ait"]
} ++ duvin.s ! stressed accusative --- il y en a ; have to define "y"
} ;
mkAdjReg : Str -> Bool -> Adjective = \adj,p ->
mkAdjective (adjGrand adj) p ;
comparConj = elisQue ;
mkAdjDegrReg : Str -> Bool -> AdjDegr = \adj,p ->
mkAdjDegrLong (adjGrand adj) p ;
-- The commonest case for functions is common noun + "de".
funDe : CommNounPhrase -> Function = \mere ->
mere ** complementCas genitive ;
-- Chains of "dont" - "dont" do not arise.
funRelPron : Function -> RelPron -> RelPron = \mere,lequel ->
{s = table {
RComplex g n c => variants {
case mere.c of { ---
Gen => lequel.s ! RSimple Gen ++
artDef mere.g n c ++ mere.s ! n ;
_ => nonExist} ;
artDef mere.g n c ++ mere.s ! n ++
mere.s2 ++ lequel.s ! RComplex g n mere.c
} ;
_ => nonExist
} ;
g = RG mere.g
} ;
-- Verbs
negVerb = \va -> elisNe ++ va ++ "pas" ;
copula = \b -> (etreNetre b).s ;
isTransVerbClit = \v -> case v.c of {
Acc => True ;
Dat => True ;
_ => False
} ;
-- The "ne - pas" negation.
posNeg = \b,v,c ->
if_then_else Str b
(v ++ c)
(elisNe ++ v ++ "pas" ++ c) ; --- exception: infinitive!
-- Exampe: 'to be or not to be'.
etreNetre : Bool -> VerbPres = \b ->
{s = \\w => posNeg b (verbEtre.s ! w) []} ; ---- v reveals a BUG in refresh
embedConj = elisQue ;
-- Relative pronouns
identRelPron = {
s = table {
RSimple c => relPronForms ! c ;
RComplex g n c => composRelPron g n c
} ;
g = RNoGen
} ;
suchPron = telPron ;
composRelPron = lequelPron ;
allRelForms = \lequel,g,n,c ->
variants {
lequel.s ! RSimple c ;
lequel.s ! RComplex g n c
} ;
-- Interrogative pronouns
nounIntPron = \n, mec ->
{s = \\c => prepCase c ++ quelPron mec.g n ++ mec.s ! n ;
g = mec.g ;
n = n
} ;
intPronWho = \num -> {
s = \\c => prepCase c ++ "qui" ;
g = Masc ; --- can we decide this?
n = num
} ;
intPronWhat = \num -> {
s = table {
Gen => ["de quoi"] ;
Acc => ["à quoi"] ;
c => elisQue
} ;
g = Masc ; --- can we decide this?
n = num
} ;
-- Questions
questVerbPhrase = \jean,dort ->
{s = table {
DirQ => optStr (estCeQue Acc) ++ (predVerbPhrase jean dort).s ! Ind ;
IndirQ => elisSi ++ (predVerbPhrase jean dort).s ! Ind
}
} ;
existNounPhraseQuest = \duvin -> {
s = \\m =>
case m of {
DirQ => optStr (estCeQue Acc) ++ ["il y a"] ;
IndirQ => elisSi ++ ["il y a"]
}
++ duvin.s ! stressed accusative --- il y en a ; have to define "y"
} ;
intVerbPhrase = \qui, dort ->
{s = table {
DirQ => qui.s ! Nom ++ optStr (estCeQue Nom) ++
dort.s ! qui.g ! VFin Ind qui.n P3 ;
IndirQ => "ce" ++ qui.s ! Nom ++ dort.s ! qui.g ! VFin Ind qui.n P3
}
} ;
intSlash = \Qui, Tuvois ->
let {qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ; tuvois = Tuvois.s ! Ind} in
{s = table {
DirQ => qui ++ optStr (estCeQue Acc) ++ tuvois ;
IndirQ => ifCe Tuvois.c ++ qui ++ tuvois
}
} ;
-- An auxiliary to distinguish between
-- "je ne sais pas" ("ce qui dort" / "ce que tu veux" / "à qui tu penses").
ifCe : Case -> Str = \c -> case c of {
Nom => "ce" ;
Acc => "ce" ;
_ => []
} ;
questAdverbial = \quand, jean, dort ->
let {jeandort = (predVerbPhrase jean dort).s ! Ind} in
{s = table {
DirQ => quand.s ++ optStr (estCeQue Acc) ++ jeandort ;
IndirQ => quand.s ++ jeandort
}
} ;
----- moved from Morpho
--2 Articles
--
-- A macro for defining gender-dependent tables will be useful.
-- Its first application is in the indefinite article.
--
-- Notice that the plural genitive is special: "de femmes".
genForms : Str -> Str -> Gender => Str = \bon,bonne ->
table {Masc => bon ; Fem => bonne} ;
artIndef = \g,n,c -> case <n,c> of {
<Sg,_> => prepCase c ++ genForms "un" "une" ! g ;
<Pl,Gen> => elisDe ;
_ => prepCase c ++ "des"
} ;
artDef = \g,n,c -> artDefTable ! g ! n ! c ;
pronJe = mkPronoun
(elision "j")
(elision "m")
(elision "m")
"moi"
"mon" (elisPoss "m") "mes"
PNoGen -- gender cannot be known from pronoun alone
Sg
P1
Clit1 ;
pronTu = mkPronoun
"tu"
(elision "t")
(elision "t")
"toi"
"ton" (elisPoss "t") "tes"
PNoGen
Sg
P2
Clit1 ;
pronIl = mkPronoun
"il"
(elision "l")
"lui"
"lui"
"son" (elisPoss "s") "ses"
(PGen Masc)
Sg
P3
Clit2 ;
pronElle = mkPronoun
"elle"
elisLa
"lui"
"elle"
"son" (elisPoss "s") "ses"
(PGen Fem)
Sg
P3
Clit2 ;
pronNous = mkPronoun
"nous"
"nous"
"nous"
"nous"
"notre" "notre" "nos"
PNoGen
Pl
P1
Clit3 ;
pronVous = mkPronoun
"vous"
"vous"
"vous"
"vous"
"votre" "votre" "vos"
PNoGen
Pl --- depends!
P2
Clit3 ;
pronIls = mkPronoun
"ils"
"les"
"leur"
"eux"
"leur" "leur" "leurs"
(PGen Masc)
Pl
P3
Clit1 ;
pronElles = mkPronoun
"elles"
"les"
"leur"
"elles"
"leur" "leur" "leurs"
(PGen Fem)
Pl
P3
Clit1 ;
-- moved from ResFra
commentAdv = ss "comment" ;
quandAdv = ss "quand" ;
ouAdv = ss "où" ;
pourquoiAdv = ss "pourquoi" ;
etConj = ss "et" ** {n = Pl} ;
ouConj = ss "ou" ** {n = Sg} ;
etetConj = sd2 "et" "et" ** {n = Pl} ;
ououConj = sd2 "ou" "ou" ** {n = Sg} ;
niniConj = sd2 "ni" "ni" ** {n = Sg} ; --- requires ne !
siSubj = ss elisSi ** {m = Ind} ;
quandSubj = ss "quand" ** {m = Ind} ;
ouiPhr = ss ["Oui ."] ;
nonPhr = ss ["Non ."] ; --- and also Si!
}

View File

@@ -0,0 +1,47 @@
--# -path=.:../romance:../abstract:../../prelude
concrete TestResourceFre of TestResource = RulesFre, StructuralFre **
open Prelude, TypesFre, MorphoFre, SyntaxFre in {
flags startcat=Phr ; lexer=text ; parser=chart ; unlexer=text ;
lin
Big = mkAdjDegrReg "grand" adjPre ;
American = mkAdjective (adjGrand "américain") adjPost ;
Finnish = mkAdjective (adjGrand "finlandais") adjPost ;
Married = mkAdjCompl (adjJoli "marié") adjPost (complementCas dative) ;
Small = mkAdjDegrReg "petit" adjPre ;
Old = mkAdjDegrLong (mkAdj "vieux" "vieux" "vieille" "vieillement") adjPre ;
Young = mkAdjDegrLong (adjJeune "jeune") adjPre ;
Happy = mkAdjDegrLong (adjHeureux "heureux") adjPre ;
Wine = mkCNomReg "vin" Masc ;
Bar = mkCNomReg "bar" Masc ;
Man = mkCNomReg "homme" Masc ;
Woman = mkCNomReg "femme" Fem ;
Car = mkCNomReg "voiture" Fem ;
Light = mkCNomReg "lumière" Fem ;
House = mkCNomReg "maison" Fem ;
Bottle = mkCNomReg "bouteille" Fem ;
Walk = verbPres (conj1aimer "marcher") ;
Run = verbPres (conj3courir "courir") ;
Send = mkTransVerbDir (verbPres (conj1envoyer "envoyer")) ;
Love = mkTransVerbDir (verbPres (conj1aimer "aimer")) ;
Drink = mkTransVerbDir (verbPres (conj3boire "boire")) ;
Wait = mkTransVerbDir (verbPres (conj3rendre "attendre")) ;
Give = mkDitransVerb (verbPres (conj1aimer "donner")) [] dative [] accusative ;
Prefer = mkDitransVerb (verbPres (conj1aimer "preférer")) [] accusative [] dative ;
Say = verbSent (verbPres (conj3dire "dire")) Ind Ind ;
Prove = verbSent (verbPres (conj1aimer "démontrer")) Ind Ind ;
SwitchOn = mkTransVerbDir (verbPres (conj1aimer "allumer")) ;
SwitchOff = mkTransVerbDir (verbPres (conj3peindre "éteindre")) ;
Mother = funDe (mkCNomReg "mère" Fem) ;
Uncle = funDe (mkCNomReg "oncle" Masc) ;
Connection = mkCNomReg "connection" Fem **
{s2 = [] ; c = genitive ; s3 = [] ; c3 = dative} ;
Well = ss "bien" ;
Always = ss "toujours" ;
John = mkProperName "Jean" Masc ;
Mary = mkProperName "Marie" Fem ;
}

View File

@@ -0,0 +1,169 @@
--1 French Word Classes and Morphological Parameters
--
-- This is a resource module for Italian morphology, defining the
-- morphological parameters and word classes of Italian.
-- The morphology is so far only
-- complete w.r.t. the syntax part of the resource grammar.
-- It does not include those parameters that are not needed for
-- analysing individual words: such parameters are defined in syntax modules.
instance TypesFre of TypesRomance = {
-- Now we can give values to the abstract types.
param
Case = Nom | Acc | Gen | Dat ; -- corresp. to prepositions de and à
NPForm = Ton Case | Aton Case | Poss Number Gender ;
oper
CaseA = Case ;
NPFormA = NPForm ;
nominative = Nom ;
accusative = Acc ;
genitive = Gen ;
dative = Dat ;
prepositional = accusative ;
stressed = Ton ;
unstressed = Aton ;
------------------------- move this somewhere else!
--2 Some phonology
--
--3 Elision
--
-- The phonological rule of *elision* can be defined as follows in GF.
-- There is one thing that is not treated properly: the "h aspiré",
-- which is not separated orthographically from the "h muet".
-- Our definition works correctly only for the "h muet".
oper
voyelle : Strs = strs {
"a" ; "â" ; "à" ; "e" ; "ê" ; "é" ; "è" ;
"h" ;
"i" ; "î" ; "o" ; "ô" ; "u" ; "û" ; "y"
} ;
elision : Str -> Str = \d -> d + pre {"e" ; "'" / voyelle} ;
-- The following morphemes are the most common uses of elision.
elisDe = elision "d" ;
elisLa = pre {"la" ; "l'" / voyelle} ;
elisLe = elision "l" ;
elisNe = elision "n" ;
elisQue = elision "qu" ;
-- The subjunction "si" has a special kind of elision. The rule is
-- only approximatively correct, for "si" is not really elided before
-- the string "il" in general, but before the pronouns "il" and "ils".
elisSi = pre {"si" ; "s'" / strs {"il"}} ;
--2 Prepositions
--
-- The type $Cas$ in $types.Fra.gf$ has the dative and genitive
-- cases, which are relevant for pronouns and the definite article,
-- but which are otherwise expressed by prepositions.
prepCase = \c -> case c of {
Nom => [] ;
Acc => [] ;
Gen => elisDe ;
Dat => "à"
} ;
--2 Relative pronouns
--
-- The simple (atonic) relative pronoun shows genuine variation in all of the
-- cases.
relPronForms = table {
Nom => "qui" ; Gen => "dont" ; Dat => ["à qui"] ; Acc => elisQue
} ;
-- Usually the comparison forms are built by prefixing the word
-- "plus". The definite article needed in the superlative is provided in
-- $syntax.Fra.gf$.
adjCompLong : Adj -> AdjComp = \cher ->
mkAdjComp
cher.s
(\\a => "plus" ++ cher.s ! a) ;
-- Comparative adjectives are only sometimes formed morphologically
-- (actually: by different morphemes).
mkAdjComp : (_,_ : AForm => Str) -> AdjComp =
\bon, meilleur ->
{s = table {Pos => bon ; _ => meilleur}} ;
------------------------------
-- Their inflection tables has tonic and atonic forms, as well as
-- the possessive forms, which are inflected like determiners.
--
-- Example: "lui, de lui, à lui" - "il,le,lui" - "son,sa,ses".
--
-- Examples of each: "Jean" ; "je"/"te" ; "il"/"elle"/"ils"/"elles" ; "nous"/"vous".
-- The following coercions are useful:
oper
pform2case = \p -> case p of {
Ton x => x ;
Aton x => x ;
Poss _ _ => Gen
} ;
case2pform = \c -> case c of {
Nom => Aton Nom ;
Acc => Aton Acc ;
_ => Ton c
} ;
case2pformClit = \c -> case c of {
Nom => Aton Nom ;
Acc => Aton Acc ;
Dat => Aton Dat ;
_ => Ton c
} ;
-- Relative pronouns: the case-dependent parameter type.
param RelForm = RSimple Case | RComplex Gender Number Case ;
oper RelFormA = RelForm ;
-- Verbs: conversion from full verbs to present-tense verbs.
verbPres = \aller -> {s = table {
VInfin => aller ! Inf ;
VFin Ind n p => aller ! Indic Pres n p ;
VFin Sub n p => aller ! Subjo SPres n p ;
VImper np => aller ! Imper np ;
VPart g n => aller ! Part (PPasse g n)
}} ;
-- The full conjunction is a table on $VForm$:
param
Temps = Pres | Imparf | Passe | Futur ;
TSubj = SPres | SImparf ;
TPart = PPres | PPasse Gender Number ;
VForm = Inf
| Indic Temps Number Person
| Cond Number Person
| Subjo TSubj Number Person
| Imper NumPersI
| Part TPart ;
-- This is the full verb type.
oper
Verbum : Type = VForm => Str ;
}