1
0
forked from GitHub/gf-core

new abstract implemented for exper/french

This commit is contained in:
aarne
2008-04-27 19:19:40 +00:00
parent 9d3f381e71
commit be6aa2b07f
13 changed files with 247 additions and 54 deletions

View File

@@ -1,2 +1,4 @@
--# -path=.:romance:abstract:../common:prelude
concrete NounFre of Noun = CatFre ** NounRomance with
(ResRomance = ResFre) ;

View File

@@ -16,7 +16,7 @@ lin
almost_AdA, almost_AdN = ss "presque" ;
always_AdV = ss "toujours" ;
although_Subj = ss ("bien" ++ elisQue) ** {m = Conjunct} ;
and_Conj = ss "et" ** {n = Pl} ;
and_Conj = {s1 = [] ; s2 = "et" ; n = Pl} ;
because_Subj = ss ("parce" ++ elisQue) ** {m = Indic} ;
before_Prep = mkPreposition "avant" ;
behind_Prep = mkPreposition "derrière" ;
@@ -63,11 +63,12 @@ lin
most_Predet = {s = \\_,c => prepCase c ++ ["la plupart"] ; c = CPrep P_de} ;
much_Det = {s = \\_,c => prepCase c ++ "beaucoup" ++ elisDe ; n = Pl} ;
must_VV = mkVV (devoir_V2 ** {lock_V = <>}) ;
no_Phr = ss "non" ;
---b no_Phr = ss "non" ;
no_Utt = ss "non" ;
on_Prep = mkPreposition "sur" ;
--- DEPREC one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "une" ! g} ;
only_Predet = {s = \\_,c => prepCase c ++ "seulement" ; c = Nom} ; --- seul(e)(s)
or_Conj = {s = "ou" ; n = Sg} ;
or_Conj = {s1 = [] ; s2 = "ou" ; n = Sg} ;
otherwise_PConj = ss "autrement" ;
part_Prep = complGen ;
please_Voc = ss ["s'il vous plaît"] ;
@@ -138,7 +139,8 @@ lin
why_IAdv = ss "pourquoi" ;
without_Prep = mkPreposition "sans" ;
with_Prep = mkPreposition "avec" ;
yes_Phr = ss "oui" ; --- si
yes_Utt = ss "oui" ; --- si
---b yes_Phr = ss "oui" ; --- si
youSg_Pron = mkPronoun
"tu" (elision "t") (elision "t") "toi" "ton" (elisPoss "t") "tes"
Masc Sg P2 ;

View File

@@ -1,2 +1,4 @@
--# -path=.:romance:abstract:../common:prelude
concrete VerbFre of Verb = CatFre ** VerbRomance with
(ResRomance = ResFre) ;

View File

@@ -21,7 +21,7 @@ incomplete concrete CatRomance of Cat =
Cl = {s : Direct => RTense => Anteriority => Polarity => Mood => Str} ;
ClSlash = {
s : Direct => AAgr => RTense => Anteriority => Polarity => Mood => Str ;
s : AAgr => Direct => RTense => Anteriority => Polarity => Mood => Str ;
c2 : Compl
} ;
Imp = {s : Polarity => ImpForm => Gender => Str} ;
@@ -73,10 +73,11 @@ incomplete concrete CatRomance of Cat =
-- Structural
Conj = {s : Str ; n : Number} ;
DConj = {s1,s2 : Str ; n : Number} ;
Subj = {s : Str ; m : Mood} ;
Prep = {s : Str ; c : Case ; isDir : Bool} ;
---b Conj = {s : Str ; n : Number} ;
---b DConj = {s1,s2 : Str ; n : Number} ;
Conj = {s1,s2 : Str ; n : Number} ;
Subj = {s : Str ; m : Mood} ;
Prep = {s : Str ; c : Case ; isDir : Bool} ;
-- Open lexical classes, e.g. Lexicon

View File

@@ -60,7 +60,7 @@ oper
conjGender : Gender -> Gender -> Gender = \m,n ->
case <m,n> of {
<Fem,Fem> => Fem ;
_ => Fem
_ => Masc
} ;
conjAgr : Agr -> Agr -> Agr = \a,b -> {

View File

@@ -5,6 +5,7 @@ incomplete concrete ConjunctionRomance of Conjunction =
lin
{---b
ConjS conj ss = conjunctTable Mood conj ss ;
DConjS conj ss = conjunctDistrTable Mood conj ss ;
@@ -26,6 +27,20 @@ incomplete concrete ConjunctionRomance of Conjunction =
DConjAP conj ss = conjunctDistrTable AForm conj ss ** {
isPre = ss.isPre
} ;
---}
ConjS conj ss = conjunctDistrTable Mood conj ss ;
ConjAdv conj ss = conjunctDistrSS conj ss ;
ConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
a = {g = ss.a.g ; n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
hasClit = False
} ;
ConjAP conj ss = conjunctDistrTable AForm conj ss ** {
isPre = ss.isPre
} ;
-- These fun's are generated from the list cat's.

View File

@@ -32,12 +32,29 @@ incomplete concrete NounRomance of Noun =
hasClit = False
} ;
RelNP np rs = {
s = \\c => np.s ! c ++ rs.s ! Indic ! np.a ;
a = np.a ;
hasClit = False
} ;
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ;
a = np.a ;
hasClit = False
} ;
DetQuantOrd quant num ord = {
s = \\g,c => quant.s ! num.n ! g ! c ++ num.s ! g ++
ord.s ! aagr g num.n ;
n = num.n
} ;
DetQuant quant num = {
s = \\g,c => quant.s ! num.n ! g ! c ++ num.s ! g ;
n = num.n
} ;
{---b
DetSg quant ord = {
s = \\g,c => quant.s ! False ! Sg ! g ! c ++ ord.s ! aagr g Sg ;
@@ -50,6 +67,17 @@ incomplete concrete NounRomance of Noun =
} ;
-}
DetNP det =
let
g = Masc ; ---- Fem in Extra
n = det.n
in {
s = \\c => let cs = npform2case c in
det.s ! g ! cs ;
a = agrP3 g n ;
hasClit = False
} ;
PossPron p = {
s = \\n,g,c => possCase g n c ++ p.s ! Poss (aagr g n) ---- il mio!
} ;
@@ -62,16 +90,51 @@ incomplete concrete NounRomance of Noun =
---b NumInt n = {s = \\_ => n.s ; isNum = True ; n = Pl} ;
---b OrdInt n = {s = \\_ => n.s ++ "."} ; ---
NumDigits nu = {s = \\g => nu.s ! NCard g ; isNum = True ; n = nu.n} ;
NumCard n = n ** {isNum = True} ;
NumDigits nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdDigits nu = {s = \\a => nu.s ! NOrd a.g a.n} ;
NumNumeral nu = {s = \\g => nu.s ! NCard g ; isNum = True ; n = nu.n} ;
NumNumeral nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ;
OrdNumeral nu = {s = \\a => nu.s ! NOrd a.g a.n} ;
AdNum adn num = {s = \\a => adn.s ++ num.s ! a ; isNum = num.isNum ; n = num.n} ;
OrdSuperl adj = {s = \\a => adj.s ! Superl ! AF a.g a.n} ;
DetArtOrd quant num ord = {
s = \\g,c => quant.s ! num.isNum ! num.n ! g ! c ++ num.s ! g ++
ord.s ! aagr g num.n ;
n = num.n
} ;
DetArtCard quant num = {
s = \\g,c => quant.s ! True ! num.n ! g ! c ++ num.s ! g ;
n = num.n
} ;
DetArtSg det cn =
let
g = cn.g ;
n = Sg
in {
s = \\c => let cs = npform2case c in
det.s ! False ! n ! g ! cs ++ cn.s ! n ;
a = agrP3 g n ;
hasClit = False
} ;
DetArtPl det cn =
let
g = cn.g ;
n = Pl
in {
s = \\c => let cs = npform2case c in
det.s ! False ! n ! g ! cs ++ cn.s ! n ;
a = agrP3 g n ;
hasClit = False
} ;
DefArt = {
s = \\_,n,g,c => artDef g n c
} ;
@@ -80,6 +143,15 @@ incomplete concrete NounRomance of Noun =
s = \\b,n,g,c => if_then_Str b [] (artIndef g n c) ;
} ;
MassNP cn = let
g = cn.g ;
n = Sg
in {
s = \\c => partitive g (npform2case c) ++ cn.s ! n ;
a = agrP3 g n ;
hasClit = False
} ;
{---b
MassDet = {
s = \\b,n,g,c => case <b,n> of {
@@ -94,10 +166,15 @@ incomplete concrete NounRomance of Noun =
UseN, UseN2 = \noun -> noun ;
---b UseN3 = \noun -> noun ;
Use2N3 f = f ;
Use3N3 f = f ** {c2 = f.c3} ;
ComplN2 f x = {
s = \\n => f.s ! n ++ appCompl f.c2 x.s ;
g = f.g ;
} ;
ComplN3 f x = {
s = \\n => f.s ! n ++ appCompl f.c2 x.s ;
g = f.g ;

View File

@@ -19,7 +19,7 @@ incomplete concrete PhraseRomance of Phrase =
UttAdv adv = adv ;
NoPConj = {s = []} ;
PConjConj conj = conj ;
PConjConj conj = {s = conj.s2} ;
NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! Ton Nom} ;

View File

@@ -26,7 +26,7 @@ incomplete concrete QuestionRomance of Question =
s = \\t,a,p =>
let
cls : Direct -> Str =
\d -> slash.s ! d ! ip.a ! t ! a ! p ! Indic ;
\d -> slash.s ! ip.a ! d ! t ! a ! p ! Indic ;
who = slash.c2.s ++ ip.s ! slash.c2.c
in table {
QDir => who ++ cls DInv ;
@@ -60,6 +60,42 @@ incomplete concrete QuestionRomance of Question =
s = \\c => ip.s ! c ++ adv.s ;
a = ip.a
} ;
IdetCN idet cn =
let
g = cn.g ;
n = idet.n ;
a = aagr g n
in {
s = \\c => idet.s ! g ! c ++ cn.s ! n ;
a = a
} ;
IdetIP idet =
let
g = Masc ; ---- Fem in Extra
n = idet.n ;
a = aagr g n
in {
s = \\c => idet.s ! g ! c ;
a = a
} ;
IdetQuant idet num =
let
n = num.n ;
in {
s = \\g,c => idet.s ! n ! g ! c ++ num.s ! g ;
n = n
} ;
CompIAdv a = {s = \\_ => a.s} ;
CompIP p = {s = \\_ => p.s ! Nom} ;
}
{- ---b
IDetCN idet num ord cn =
let
@@ -71,6 +107,3 @@ incomplete concrete QuestionRomance of Question =
a = a
} ;
-}
CompIAdv a = {s = \\_ => a.s} ;
}

View File

@@ -32,7 +32,7 @@ incomplete concrete RelativeRomance of Relative =
in
slash.c2.s ++
rp.s ! False ! aag ! slash.c2.c ++
slash.s ! DDir ! aag ! t ! a ! p ! m ; --- ragr
slash.s ! aag ! DDir ! t ! a ! p ! m ; --- ragr
c = Acc
} ;

View File

@@ -122,7 +122,7 @@ oper
clDat = cc.p2 ;
clit2 = vp.clit2 ;
neg = vp.neg ;
comp = \\a => vp.comp ! a ++ cc.p3 ;
comp = \\a => cc.p3 ++ vp.comp ! a ;
ext = vp.ext ;
} ;
@@ -195,6 +195,8 @@ oper
ext = \\p => vp.ext ! p ++ co ! p ;
} ;
mkVPSlash : Compl -> VP -> VP ** {c2 : Compl} = \c,vp -> vp ** {c2 = c} ;
mkClause : Str -> Bool -> Agr -> VP ->
{s : Direct => RTense => Anteriority => Polarity => Mood => Str} =
\subj,hasClit,agr,vp -> {

View File

@@ -14,18 +14,18 @@ incomplete concrete SentenceRomance of Sentence =
}
} ;
{---- OK but inefficient
SlashVP np v2 =
{s = \\d,ag =>case <v2.c2.c,v2.c2.isDir> of {
<Acc,True> =>
(mkClause (np.s ! Aton Nom) np.hasClit np.a
(insertAgr ag v2)).s ! d ;
_ => (mkClause (np.s ! Aton Nom) np.hasClit np.a v2).s ! d
} ;
-- agreement decided afterwards: la fille qu'il a trouvée
{s = \\ag =>
let vp = case <v2.c2.c, v2.c2.isDir> of {
<Acc,True> => insertAgr ag v2 ;
_ => v2
}
in (mkClause (np.s ! Aton Nom) np.hasClit np.a vp).s ;
c2 = v2.c2
} ;
---b
{---b
SlashV2 np v2 =
{s = \\d,ag =>case <v2.c2.c,v2.c2.isDir> of {
<Acc,True> =>
@@ -46,26 +46,25 @@ incomplete concrete SentenceRomance of Sentence =
} ;
-}
AdvSlash slash adv = {
s = \\d,ag,t,a,b,m => slash.s ! d! ag ! t ! a ! b ! m ++ adv.s ;
s = \\ag,d,t,a,b,m => slash.s ! ag ! d ! t ! a ! b ! m ++ adv.s ;
c2 = slash.c2
} ;
SlashPrep cl prep = {
s = \\d,_ => cl.s ! d ;
s = \\_ => cl.s ;
c2 = {s = prep.s ; c = prep.c ; isDir = False}
} ;
{---- OK but inefficient
SlashVS np vs slash =
{s = \\d,ag =>
{s = \\ag =>
(mkClause
(np.s ! Aton Nom) np.hasClit np.a
(insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b)) --- ag?
(insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b))
(predV vs))
).s ! d ;
).s ;
c2 = slash.c2
} ;
-}
EmbedS s = {s = conjThat ++ s.s ! Indic} ; --- mood
EmbedQS qs = {s = qs.s ! QIndir} ;
EmbedVP vp = {s = infVP vp (agrP3 Masc Sg)} ; --- agr ---- compl
@@ -81,11 +80,15 @@ incomplete concrete SentenceRomance of Sentence =
c = cl.c
} ;
UseSlash t a p cl = {
s = \\agr,mo =>
t.s ++ a.s ++ p.s ++ cl.s ! DDir ! agr ! t.t ! a.a ! p.p ! mo ;
s = \\ag,mo =>
t.s ++ a.s ++ p.s ++ cl.s ! ag ! DDir ! t.t ! a.a ! p.p ! mo ;
c2 = cl.c2
} ;
AdvS a s = {s = \\o => a.s ++ "," ++ s.s ! o} ;
RelS s r = {
s = \\o => s.s ! o ++ "," ++ partQIndir ++ r.s ! Indic ! agrP3 Masc Sg
} ;
}

View File

@@ -6,11 +6,6 @@ incomplete concrete VerbRomance of Verb =
lin
UseV = predV ;
{---b
ComplV2 v np1 = insertObject v.c2 np1 (predV v) ;
ComplV3 v np1 np2 = insertObject v.c3 np2 (insertObject v.c2 np1 (predV v)) ;
ComplVV v vp =
insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v) ;
ComplVS v s = insertExtrapos (\\b => conjThat ++ s.s ! (v.m ! b)) (predV v) ;
@@ -18,6 +13,79 @@ incomplete concrete VerbRomance of Verb =
ComplVA v ap =
insertComplement (\\a => ap.s ! AF a.g a.n) (predV v) ;
SlashV2a v = mkVPSlash v.c2 (predV v) ;
Slash2V3 v np = mkVPSlash v.c3 (insertObject v.c2 np (predV v)) ;
Slash3V3 v np = mkVPSlash v.c2 (insertObject v.c3 np (predV v)) ;
SlashV2V v vp =
mkVPSlash v.c2
(insertComplement
(\\a => prepCase v.c2.c ++ infVP vp a)
(predV v)) ;
SlashV2S v s =
mkVPSlash v.c2
(insertExtrapos
(\\b => s.s ! Indic) ---- mood
(predV v)) ;
SlashV2Q v q =
mkVPSlash v.c2
(insertExtrapos
(\\_ => q.s ! QIndir)
(predV v)) ;
SlashV2A v ap =
let af = AF Masc Sg
{- ---- lincat should be fixed
let af = case v.c3.isDir of {
True => AF np.a.g np.a.n ; -- ... bleues
_ => AF Masc Sg -- il les peint en bleu
}
-}
in
mkVPSlash v.c2
(insertComplement
(\\_ => v.c3.s ++ prepCase v.c3.c ++ ap.s ! af)
(predV v)) ;
ComplSlash vp np = insertObject vp.c2 np vp ;
ReflVP v = case v.c2.isDir of {
True => v ** {vtyp = vRefl} ;
False => insertComplement
(\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) v
} ;
SlashVV v vp =
mkVPSlash vp.c2
(insertComplement (\\a => prepCase v.c2.c ++ infVP vp a) (predV v)) ;
SlashV2VNP v np vp =
mkVPSlash vp.c2
(insertComplement
(\\a => prepCase v.c2.c ++ infVP vp a)
(insertObject v.c2 np (predV v))) ;
UseComp comp = insertComplement comp.s (predV copula) ;
CompAP ap = {s = \\ag => ap.s ! AF ag.g ag.n} ;
CompNP np = {s = \\_ => np.s ! Ton Acc} ;
CompAdv a = {s = \\_ => a.s} ;
AdvVP vp adv = insertAdv adv.s vp ;
AdVVP adv vp = insertAdV adv.s vp ;
PassV2 v = insertComplement (\\a => v.s ! VPart a.g a.n) (predV auxPassive) ;
}
{---b
ComplV2 v np1 = insertObject v.c2 np1 (predV v) ;
ComplV3 v np1 np2 = insertObject v.c3 np2 (insertObject v.c2 np1 (predV v)) ;
ComplV2V v np vp =
insertComplement (\\a => prepCase v.c2.c ++ infVP vp a)
(insertObject v.c2 np (predV v)) ;
@@ -44,18 +112,6 @@ incomplete concrete VerbRomance of Verb =
(\\a => v.c2.s ++ reflPron a.n a.p v.c2.c) (predV v)
} ;
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = complAcc ; vtyp = vv.vtyp} ;
-}
UseComp comp = insertComplement comp.s (predV copula) ;
CompAP ap = {s = \\ag => ap.s ! AF ag.g ag.n} ;
CompNP np = {s = \\_ => np.s ! Ton Acc} ;
CompAdv a = {s = \\_ => a.s} ;
AdvVP vp adv = insertAdv adv.s vp ;
AdVVP adv vp = insertAdV adv.s vp ;
PassV2 v = insertComplement (\\a => v.s ! VPart a.g a.n) (predV auxPassive) ;
---b UseVS, UseVQ = \vv -> {s = vv.s ; c2 = complAcc ; vtyp = vv.vtyp} ;
}