refactored romance VP. Now it is possible to parse with Spanish and Catalan; for the rest, some Slash rules still pose a problem. Some clitic and agreement things unfinished. All this in next-lib only; resource 1.4 untouched

This commit is contained in:
aarne
2008-10-30 20:38:51 +00:00
parent 4558f2064d
commit bd71b12224
28 changed files with 276 additions and 241 deletions

View File

@@ -50,7 +50,7 @@ langsCoding = [
langs = map fst langsCoding
-- languagues for which to compile Lang
langsLang = langs `except` ["Ara","Bul","Ina","Rus"]
langsLang = langs `except` ["Ara","Bul","Ina","Rus","Hin","Tha"]
-- languages for which to compile Try
langsAPI = langsLang `except` ["Ara","Bul","Hin","Ina","Rus","Tha"]

View File

@@ -3,9 +3,9 @@ RUNMAKE=$(RUNGHC) Make.hs
GF_LIB_PATH=..
.PHONY: all present alltenses lang api math prelude test demo synopsis link compiled clean
.PHONY: all present alltenses lang api math prelude test demo synopsis link compiled constructX clean
all: link prelude present alltenses compat
all: link prelude constructX present alltenses compat
present:
$(RUNMAKE) present lang
@@ -28,6 +28,10 @@ prelude:
gfc prelude/*.gf
cp -p prelude/*.gfo ../prelude
constructX:
gfc common/ConstructX.gf
cp -p common/ConstructX.gfo ../prelude
test:
$(RUNMAKE) test

View File

@@ -1,6 +1,6 @@
--# -path=.:alltenses:prelude
resource TryEng = SyntaxEng, LexiconEng, ParadigmsEng - [mkAdv] **
resource TryEng = SyntaxEng-[mkAdN], LexiconEng, ParadigmsEng - [mkAdv,mkAdN] **
open (P = ParadigmsEng), in {
oper
@@ -9,5 +9,10 @@ oper
mkAdv : Str -> Adv = P.mkAdv ;
} ;
mkAdN = overload {
mkAdN : CAdv -> AdN = SyntaxEng.mkAdN ;
mkAdN : Str -> AdN = P.mkAdN ;
} ;
}

View File

@@ -86,22 +86,24 @@ oper
-- <_,_,CPron {n = Sg ; p = P2},CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
infForm _ _ _ _ = True ;
mkImperative _ p vp = { --- politeness
mkImperative b p vp = {
s = \\pol,aag =>
let
agr = aag ** {p = p} ;
verb = case <aag.n, pol> of {
<Sg,Neg> => (vp.s ! VPFinite (VPres Conjunct) Simul).fin ! agr ;
_ => (vp.s ! VPImperat).fin ! agr
} ;
pe = case b of {True => P3 ; _ => p} ;
agr = aag ** {p = pe} ;
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
----e verb = case <aag.n, pol,pe> of {
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
----e _ => (vp.s ! VPImperat).fin ! agr
----e } ;
verb = (vp.s ! VPImperat).fin ! agr ; ----e
neg = vp.neg ! pol ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;
} ;
negation : Polarity => (Str * Str) = table {
Pos => <[],[]> ;
Neg => <"no",[]>

View File

@@ -5,7 +5,7 @@ concrete IdiomCat of Idiom = CatCat **
lin
ExistNP np = mkClause [] True (agrP3 Masc Sg)
(insertClit2 "hi" (insertComplement (\\_ => np.s ! Ton Acc) (predV haver_V))) ;
(insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton) (predV haver_V))) ;
GenericCl vp = mkClause "hom" True (agrP3 Masc Sg) vp ;
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
@@ -14,7 +14,7 @@ concrete IdiomCat of Idiom = CatCat **
insertComplement
(\\agr =>
let
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
clpr = <vp.clit1,vp.clit2> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
in
(vp.s ! VPGerund).inf ! (aagr agr.g agr.n) ++ clpr.p1 ++ obj
@@ -25,7 +25,7 @@ concrete IdiomCat of Idiom = CatCat **
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => np.s ! Ton rs.c) (predV copula))) ;
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
ExistIP ip = {
@@ -33,7 +33,7 @@ concrete IdiomCat of Idiom = CatCat **
ip.s ! Nom ++
(mkClause [] True
(agrP3 Masc Sg)
(insertClit2 "hi" (insertComplement (\\_ => ip.s ! Acc) (predV haver_V))))
(insertClit3 "hi" (insertComplement (\\_ => ip.s ! Acc) (predV haver_V))))
.s ! DDir ! t ! a ! p ! Indic
} ;

View File

@@ -100,24 +100,31 @@ oper
---- The use of "ne" as atonic genitive is debatable.
---- We follow the rule that the atonic nominative is empty.
--
mkPronoun : (_,_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,Lui,son,sa,ses,see,g,n,p ->
{s = table {
Ton Nom => il ;
Ton x => prepCase x ++ Lui ;
Aton Nom => strOpt il ; ---- [] ;
Aton Acc => le ;
Aton (CPrep P_a) => lui ;
Aton q => prepCase q ++ Lui ; ---- GF bug with c or p!
Poss {n = Sg ; g = Masc} => son ;
Poss {n = Sg ; g = Fem} => sa ;
Poss {n = Pl ; g = Masc} => ses ;
Poss {n = Pl ; g = Fem} => see
let
alui : Case -> Str = \x -> prepCase x ++ Lui ;
in {
s = table {
Nom => {c1 = [] ; c2 = [] ; comp = il ; ton = Lui} ;
Acc => {c1 = le ; c2 = [] ; comp = [] ; ton = Lui} ;
CPrep P_a => {c1 = [] ; c2 = lui ; comp = [] ; ton = alui (CPrep P_a)} ;
c => {c1 = [] ; c2 = [] ; comp, ton = alui c}
} ;
poss = \\n,g => case <n,g> of {
<Sg,Masc> => son ;
<Sg,Fem> => sa ;
<Pl,Masc> => ses ;
<Pl,Fem> => see
} ;
a = {g = g ; n = n ; p = p} ;
hasClit = True
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;
--
--
----2 Determiners

View File

@@ -124,8 +124,8 @@ instance DiffFre of DiffRomance = open CommonRomance, PhonoFre, Prelude in {
agr = {g = aag.g ; n = num ; p = p} ;
verb = (vp.s ! VPImperat).fin ! agr ;
neg = vp.neg ! pol ;
hascl = (pronArg agr.n agr.p vp.clAcc vp.clDat).p3 ;
clpr = pronArgGen pol agr.n agr.p vp.clAcc vp.clDat ;
hascl = False ; ----e(pronArg agr.n agr.p vp.clAcc vp.clDat).p3 ;
clpr = <[],[]> ; ----e pronArgGen pol agr.n agr.p vp.clAcc vp.clDat ;
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in
case pol of {

View File

@@ -9,19 +9,19 @@ concrete IdiomFre of Idiom = CatFre **
ExistNP np =
mkClause "il" True (agrP3 Masc Sg)
(insertClit2 "y" (insertComplement (\\_ => np.s ! Ton Acc) (predV avoir_V))) ;
(insertClit3 "y" (insertComplement (\\_ => (np.s ! Acc).ton) (predV avoir_V))) ;
ExistIP ip = {
s = \\t,a,p,_ =>
ip.s ! Nom ++
(mkClause "il" True (agrP3 Masc Sg)
(insertClit2 "y" (predV avoir_V))).s
(insertClit3 "y" (predV avoir_V))).s
! DDir ! t ! a ! p ! Indic ---- DInv
} ;
CleftNP np rs = mkClause elisCe True (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => np.s ! Ton rs.c) (predV copula))) ;
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
CleftAdv ad s = mkClause elisCe True (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic)

View File

@@ -163,18 +163,22 @@ oper
mkPronoun : (_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,Lui,son,sa,ses,g,n,p ->
{s = table {
Ton x => prepCase x ++ Lui ;
Aton Nom => il ;
Aton Acc => le ;
Aton (CPrep P_de) => "en" ; --- hmm
Aton (CPrep _) => lui ;
Poss {n = Sg ; g = Masc} => son ;
Poss {n = Sg ; g = Fem} => sa ;
Poss {n = Pl} => ses
} ;
a = {g = g ; n = n ; p = p} ;
hasClit = True
let
alui : Case -> Str = \x -> prepCase x ++ Lui ;
in {
s = table {
Nom => {c1 = [] ; c2 = [] ; comp = il ; ton = Lui} ;
Acc => {c1 = le ; c2 = [] ; comp = [] ; ton = Lui} ;
CPrep P_a => {c1 = [] ; c2 = lui ; comp = [] ; ton = alui (CPrep P_a)} ;
c => {c1 = [] ; c2 = [] ; comp, ton = alui c}
} ;
poss = \\n,g => case <n,g> of {
<Sg,Masc> => son ;
<Sg,Fem> => sa ;
_ => ses
} ;
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;
elisPoss : Str -> Str = \s ->

View File

@@ -112,11 +112,12 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
let
pe = case b of {True => P3 ; _ => p} ;
agr = aag ** {p = pe} ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
verb = case <aag.n, pol,pe> of {
<Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
_ => (vp.s ! VPImperat).fin ! agr
} ;
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
----e verb = case <aag.n, pol,pe> of {
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
----e _ => (vp.s ! VPImperat).fin ! agr
----e } ;
verb = (vp.s ! VPImperat).fin ! agr ; ----e
neg = vp.neg ! pol ;
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in

View File

@@ -11,7 +11,7 @@ concrete IdiomIta of Idiom = CatIta **
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => np.s ! Ton rs.c) (predV copula))) ;
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
@@ -19,15 +19,15 @@ concrete IdiomIta of Idiom = CatIta **
ExistNP np =
mkClause [] True (agrP3 np.a.g np.a.n)
(insertClit2 (elision "ci" "c'" "ci")
(insertComplement (\\_ => np.s ! Ton Nom)
(insertClit3 (elision "ci" "c'" "ci")
(insertComplement (\\_ => (np.s ! Nom).ton)
(predV copula))) ;
ExistIP ip = {
s = \\t,a,p,_ =>
ip.s ! Nom ++
(mkClause [] True (agrP3 ip.a.g ip.a.n)
(insertClit2 (elision "ci" "c'" "ci")
(insertClit3 (elision "ci" "c'" "ci")
(predV copula))).s ! DDir ! t ! a ! p ! Indic
} ;
@@ -36,7 +36,7 @@ concrete IdiomIta of Idiom = CatIta **
insertComplement
(\\agr =>
let
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
in
(vp.s ! VPGerund).inf ! (aagr agr.g agr.n) ++ clpr.p1 ++ obj

View File

@@ -135,6 +135,30 @@ oper
-- given in $DiffIta.argPron$ and therefore wouldn't be needed in the
-- pronoun itself.)
mkPronoun : (_,_,_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,glie,Lui,son,sa,ses,see,g,n,p ->
let
alui : Case -> Str = \x -> prepCase x ++ Lui ;
in {
s = table {
Nom => {c1 = [] ; c2 = [] ; comp = il ; ton = Lui} ;
Acc => {c1 = le ; c2 = [] ; comp = [] ; ton = Lui} ;
CPrep P_a => {c1 = [] ; c2 = lui ; comp = [] ; ton = alui (CPrep P_a)} ;
c => {c1 = [] ; c2 = [] ; comp, ton = alui c}
} ;
----e glie??
poss = \\n,g => case <n,g> of {
<Sg,Masc> => son ;
<Sg,Fem> => sa ;
<Pl,Masc> => ses ;
<Pl,Fem> => see
} ;
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;
{- --e
mkPronoun : (_,_,_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,glie,Lui,son,sa,ses,see,g,n,p ->
@@ -154,6 +178,7 @@ oper
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;
-}
--2 Determiners
--

View File

@@ -8,7 +8,7 @@ incomplete concrete AdjectiveRomance of Adjective =
isPre = a.isPre
} ;
ComparA a np = {
s = \\af => a.s ! Compar ! af ++ conjThan ++ np.s ! Ton Nom ;
s = \\af => a.s ! Compar ! af ++ conjThan ++ (np.s ! Nom).ton ;
isPre = False
} ;
UseComparA a = {
@@ -26,7 +26,7 @@ incomplete concrete AdjectiveRomance of Adjective =
-- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 adj np = {
s = \\af => adj.s ! Posit ! af ++ appCompl adj.c2 np.s ;
s = \\af => adj.s ! Posit ! af ++ appCompl adj.c2 np ;
isPre = False
} ;

View File

@@ -6,20 +6,19 @@ incomplete concrete AdverbRomance of Adverb =
s = a.s ! Posit ! AA
} ;
ComparAdvAdj cadv a np = {
s = cadv.s ++ a.s ! Posit ! AA ++ conjThan ++ np.s ! Ton Nom
s = cadv.s ++ a.s ! Posit ! AA ++ conjThan ++ (np.s ! Nom).ton
} ;
ComparAdvAdjS cadv a s = {
s = cadv.s ++ a.s ! Posit ! AA ++ conjThan ++ s.s ! Conjunct --- ne
} ;
PrepNP prep np = {s = prep.s ++ np.s ! case2npform prep.c} ;
PrepNP prep np = {s = prep.s ++ (np.s ! prep.c).ton} ;
AdAdv = cc2 ;
SubjS subj s = {
s = subj.s ++ s.s ! subj.m
} ;
---b AdvSC s = s ;
AdnCAdv cadv = {s = cadv.s ++ conjThan} ;

View File

@@ -55,7 +55,8 @@ incomplete concrete CatRomance of Cat =
-- Noun
CN = {s : Number => Str ; g : Gender} ;
NP,Pron = Pronoun ;
Pron = Pronoun ;
NP = NounPhrase ;
Det = {
s : Gender => Case => Str ;
n : Number ;

View File

@@ -203,9 +203,9 @@ oper
} ;
agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
neg : Polarity => (Str * Str) ; -- ne-pas
clAcc : CAgr ; -- le/se
clDat : CAgr ; -- lui
clit2 : Str ; -- y en
clit1 : Str ; -- le/se
clit2 : Str ; -- lui
clit3 : Str ; -- y en
comp : Agr => Str ; -- content(e) ; à ma mère ; hier
ext : Polarity => Str ; -- que je dors / que je dorme
} ;

View File

@@ -5,38 +5,14 @@ incomplete concrete ConjunctionRomance of Conjunction =
lin
{---b
ConjS conj ss = conjunctTable Mood conj ss ;
DConjS conj ss = conjunctDistrTable Mood conj ss ;
ConjAdv conj ss = conjunctSS conj ss ;
DConjAdv conj ss = conjunctDistrSS conj ss ;
ConjNP conj ss = conjunctTable NPForm conj ss ** {
a = {g = ss.a.g ; n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
hasClit = False
} ;
DConjNP 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 = conjunctTable AForm conj ss ** {
isPre = ss.isPre
} ;
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 ** {
ConjNP conj ss = heavyNP (conjunctDistrTable Case 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
} ;
@@ -49,13 +25,13 @@ incomplete concrete ConjunctionRomance of Conjunction =
BaseAdv = twoSS ;
ConsAdv = consrSS comma ;
BaseNP x y = {
s1 = \\c => x.s ! stressedCase c ;
s2 = \\c => y.s ! (conjunctCase c) ;
s1 = \\c => (x.s ! c).ton ;
s2 = \\c => (y.s ! c).ton ; ----e (conjunctCase c) ;
a = conjAgr x.a y.a
} ;
ConsNP x xs = {
s1 = \\c => x.s ! stressedCase c ++ comma ++ xs.s1 ! (conjunctCase c) ;
s2 = \\c => xs.s2 ! (conjunctCase c) ;
s1 = \\c => (x.s ! c).ton ++ comma ++ xs.s1 ! c ; ----e (conjunctCase c) ;
s2 = \\c => xs.s2 ! c ; ----e (conjunctCase c) ;
a = conjAgr x.a xs.a
} ;
BaseAP x y = twoTable AForm x y ** {isPre = andB x.isPre y.isPre} ;
@@ -64,7 +40,7 @@ incomplete concrete ConjunctionRomance of Conjunction =
lincat
[S] = {s1,s2 : Mood => Str} ;
[Adv] = {s1,s2 : Str} ;
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
[NP] = {s1,s2 : Case => Str ; a : Agr} ;
[AP] = {s1,s2 : AForm => Str ; isPre : Bool} ;
}

View File

@@ -8,9 +8,8 @@ incomplete concrete NounRomance of Noun =
let
g = cn.g ;
n = det.n
in {
s = \\c => let cs = npform2case c in
det.s ! g ! cs ++ cn.s ! n ++ det.s2 ;
in heavyNP {
s = \\c => det.s ! g ! c ++ cn.s ! n ++ det.s2 ;
a = agrP3 g n ;
hasClit = False
} ;
@@ -19,27 +18,26 @@ incomplete concrete NounRomance of Noun =
UsePron p = p ;
PredetNP pred np = {
s = \\c => pred.s ! aagr (np.a.g) (np.a.n) ! npform2case c ++ --- subtype
np.s ! case2npform pred.c ;
PredetNP pred np = heavyNP {
s = \\c => pred.s ! aagr (np.a.g) (np.a.n) ! c ++ (np.s ! pred.c).ton ;
a = np.a ;
hasClit = False
} ;
PPartNP np v2 = {
s = \\c => np.s ! c ++ v2.s ! VPart np.a.g np.a.n ;
PPartNP np v2 = heavyNP {
s = \\c => (np.s ! c).ton ++ v2.s ! VPart np.a.g np.a.n ;
a = np.a ;
hasClit = False
} ;
RelNP np rs = {
s = \\c => np.s ! c ++ rs.s ! Indic ! np.a ;
RelNP np rs = heavyNP {
s = \\c => (np.s ! c).ton ++ rs.s ! Indic ! np.a ;
a = np.a ;
hasClit = False
} ;
AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ;
AdvNP np adv = heavyNP {
s = \\c => (np.s ! c).ton ++ adv.s ;
a = np.a ;
hasClit = False
} ;
@@ -65,16 +63,15 @@ incomplete concrete NounRomance of Noun =
let
g = Masc ; ---- Fem in Extra
n = det.n
in {
s = \\c => let cs = npform2case c in
det.sp ! g ! cs ;
in heavyNP {
s = det.sp ! g ;
a = agrP3 g n ;
hasClit = False
} ;
PossPron p = {
s = \\_,n,g,c => possCase g n c ++ p.s ! Poss (aagr g n) ; ---- il mio!
sp = \\ n,g,c => possCase g n c ++ p.s ! Poss (aagr g n) ; ---- not for Fre
s = \\_,n,g,c => possCase g n c ++ p.poss ! n ! g ; ---- il mio!
sp = \\ n,g,c => possCase g n c ++ p.poss ! n ! g ; ---- not for Fre
s2 = []
} ;
@@ -108,8 +105,8 @@ incomplete concrete NounRomance of Noun =
MassNP cn = let
g = cn.g ;
n = Sg
in {
s = \\c => partitive g (npform2case c) ++ cn.s ! n ;
in heavyNP {
s = \\c => partitive g c ++ cn.s ! n ;
a = agrP3 g n ;
hasClit = False
} ;
@@ -117,19 +114,18 @@ incomplete concrete NounRomance of Noun =
-- This is based on record subtyping.
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 ;
s = \\n => f.s ! n ++ appCompl f.c2 x ;
g = f.g ;
} ;
ComplN3 f x = {
s = \\n => f.s ! n ++ appCompl f.c2 x.s ;
s = \\n => f.s ! n ++ appCompl f.c2 x ;
g = f.g ;
c2 = f.c3
} ;
@@ -156,7 +152,7 @@ incomplete concrete NounRomance of Noun =
} ;
ApposCN cn np = let g = cn.g in {
s = \\n => cn.s ! n ++ np.s ! Ton Nom ;
s = \\n => cn.s ! n ++ (np.s ! Nom).ton ;
g = g
} ;

View File

@@ -14,7 +14,7 @@ incomplete concrete PhraseRomance of Phrase =
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
UttIAdv iadv = iadv ;
UttNP np = {s = np.s ! Ton Nom} ;
UttNP np = {s = (np.s ! Nom).ton} ;
UttVP vp = {s = infVP vp (agrP3 Fem Sg)} ; --- Agr
UttAdv adv = adv ;
@@ -22,6 +22,6 @@ incomplete concrete PhraseRomance of Phrase =
PConjConj conj = {s = conj.s2} ;
NoVoc = {s = []} ;
VocNP np = {s = "," ++ np.s ! Ton Nom} ;
VocNP np = {s = "," ++ (np.s ! Nom).ton} ;
}

View File

@@ -50,7 +50,7 @@ incomplete concrete QuestionRomance of Question =
s = \\t,a,p,_ =>
let
vp = predV copula ;
cls = (mkClause (np.s ! Aton Nom) np.hasClit np.a vp).s !
cls = (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s !
DInv ! t ! a ! p ! Indic ;
why = icomp.s ! {g = np.a.g ; n = np.a.n}
in why ++ cls

View File

@@ -37,7 +37,7 @@ incomplete concrete RelativeRomance of Relative =
} ;
FunRP p np rp = {
s = \\_,a,c => np.s ! Ton Nom ++ p.s ++ rp.s ! True ! a ! p.c ;
s = \\_,a,c => (np.s ! Nom).ton ++ p.s ++ rp.s ! True ! a ! p.c ;
a = {g = np.a.g ; n = np.a.n} ;
hasAgr = True
} ;

View File

@@ -12,7 +12,22 @@ oper
nominative : Case = Nom ;
accusative : Case = Acc ;
Pronoun = {s : NPForm => Str ; a : Agr ; hasClit : Bool} ;
--e Pronoun = {s : NPForm => Str ; a : Agr ; hasClit : Bool} ;
NounPhrase : Type = {
s : Case => {c1,c2,comp,ton : Str} ;
a : Agr ;
hasClit : Bool
} ;
Pronoun : Type = NounPhrase ** {
poss : Number => Gender => Str ---- also: substantival
} ;
heavyNP : {s : Case => Str ; a : Agr} -> NounPhrase = \np -> {
s = \\c => {comp,ton = np.s ! c ; c1,c2 = []} ;
a = np.a ;
hasClit = False
} ;
--e
Compl : Type = {s : Str ; c : Case ; isDir : Bool} ;
@@ -20,11 +35,11 @@ oper
complGen : Compl = {s = [] ; c = genitive ; isDir = False} ;
complDat : Compl = {s = [] ; c = dative ; isDir = True} ;
pn2np : {s : Str ; g : Gender} -> Pronoun = \pn -> {
s = \\c => prepCase (npform2case c) ++ pn.s ;
a = agrP3 pn.g Sg ;
hasClit = False
} ;
--e
pn2np : {s : Str ; g : Gender} -> NounPhrase = \pn -> heavyNP {
s = \\c => prepCase c ++ pn.s ;
a = agrP3 pn.g Sg
} ;
npform2case : NPForm -> Case = \p -> case p of {
Ton x => x ;
@@ -45,21 +60,23 @@ oper
_ => c
} ;
appCompl : Compl -> (NPForm => Str) -> Str = \comp,np ->
comp.s ++ np ! Ton comp.c ;
appCompl : Compl -> NounPhrase -> Str = \comp,np ->
comp.s ++ (np.s ! comp.c).ton ;
--e appCompl : Compl -> (NPForm => Str) -> Str = \comp,np ->
--e comp.s ++ np ! Ton comp.c ;
oper
VP : Type = {
s : Verb ;
agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
neg : Polarity => (Str * Str) ; -- ne-pas
clAcc : CAgr ; -- le/se
clDat : CAgr ; -- lui
clit2 : Str ; -- y en
comp : Agr => Str ; -- content(e) ; à ma mère ; hier
ext : Polarity => Str ; -- que je dors / que je dorme
} ;
s : Verb ;
agr : VPAgr ; -- dit/dite dep. on verb, subj, and clitic
neg : Polarity => (Str * Str) ; -- ne-pas
clit1 : Str ; -- le/se
clit2 : Str ; -- lui
clit3 : Str ; -- y en
comp : Agr => Str ; -- content(e) ; à ma mère ; hier
ext : Polarity => Str ; -- que je dors / que je dorme
} ;
useVP : VP -> VPC = \vp ->
@@ -101,16 +118,13 @@ oper
VPGerund => vf (\_ -> []) (\_ -> vger) ;
VPInfinit Simul b=> vf (\_ -> []) (\_ -> vinf b)
} ;
agr = vp.agr ; -- partAgr typ ;
neg = vp.neg ; -- negation ;
clAcc = vp.clAcc ; -- case isVRefl typ of {
-- True => CRefl ;
-- _ => CNone
-- } ;
clDat = vp.clDat ; -- CNone ; --- no dative refls
clit2 = vp.clit2 ; -- [] ;
comp = vp.comp ; -- \\a => [] ;
ext = vp.ext -- \\p => []
agr = vp.agr ;
neg = vp.neg ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
comp = vp.comp ;
ext = vp.ext
} ;
predV : Verb -> VP = \verb ->
@@ -120,18 +134,24 @@ oper
s = {s = verb.s ; vtyp = typ} ;
agr = partAgr typ ;
neg = negation ;
{- ----e
clAcc = case isVRefl typ of {
True => CRefl ;
_ => CNone
} ;
clDat = CNone ; --- no dative refls
-}
clit1 = [] ;
clit2 = [] ;
clit3 = [] ;
comp = \\a => [] ;
ext = \\p => []
} ;
insertObject : Compl -> Pronoun -> VP -> VP = \c,np,vp ->
insertObject : Compl -> NounPhrase -> VP -> VP = \c,np,vp ->
let
obj = np.s ! c.c ;
{- ----e
vpacc = vp.clAcc ;
vpdat = vp.clDat ;
vpagr = vp.agr ;
@@ -146,24 +166,29 @@ oper
} ;
_ => noNewClit
} ;
-} ----e
in {
s = vp.s ;
agr = cc.p4 ;
clAcc = cc.p1 ;
clDat = cc.p2 ;
clit2 = vp.clit2 ;
s = vp.s ;
agr = vp.agr ; ----e
clit1 = vp.clit1 ++ obj.c1 ;
clit2 = vp.clit2 ++ obj.c2 ;
clit3 = vp.clit3 ;
comp = \\a => vp.comp ! a ++ c.s ++ obj.comp ;
----e agr = cc.p4 ;
---- clAcc = cc.p1 ;
---- clDat = cc.p2 ;
----e comp = \\a => cc.p3 ++ vp.comp ! a ;
neg = vp.neg ;
comp = \\a => cc.p3 ++ vp.comp ! a ;
ext = vp.ext ;
} ;
insertComplement : (Agr => Str) -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
neg = vp.neg ;
comp = \\a => vp.comp ! a ++ co ! a ;
ext = vp.ext ;
@@ -176,20 +201,21 @@ oper
insertAgr : AAgr -> VP -> VP = \ag,vp -> {
s = vp.s ;
agr = vpAgrClit (agrP3 ag.g ag.n) ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
neg = vp.neg ;
comp = vp.comp ;
ext = vp.ext ;
} ;
----e
insertRefl : VP -> VP = \vp -> {
s = {s = vp.s.s ; vtyp = vRefl} ;
agr = vp.agr ;
clAcc = CRefl ;
clDat = vp.clDat ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
neg = vp.neg ;
comp = vp.comp ;
ext = vp.ext ;
@@ -198,9 +224,9 @@ oper
insertAdv : Str -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
neg = vp.neg ;
comp = \\a => vp.comp ! a ++ co ;
ext = vp.ext ;
@@ -209,20 +235,20 @@ oper
insertAdV : Str -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
neg = \\b => let vpn = vp.neg ! b in {p1 = vpn.p1 ; p2 = vpn.p2 ++ co} ;
comp = vp.comp ;
ext = vp.ext ;
} ;
insertClit2 : Str -> VP -> VP = \co,vp -> {
insertClit3 : Str -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit2 = vp.clit2 ++ co ; ---- y en
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ++ co ;
neg = vp.neg ;
comp = vp.comp ;
ext = vp.ext ;
@@ -231,9 +257,9 @@ oper
insertExtrapos : (Polarity => Str) -> VP -> VP = \co,vp -> {
s = vp.s ;
agr = vp.agr ;
clAcc = vp.clAcc ;
clDat = vp.clDat ;
clit1 = vp.clit1 ;
clit2 = vp.clit2 ;
clit3 = vp.clit3 ;
neg = vp.neg ;
comp = vp.comp ;
ext = \\p => vp.ext ! p ++ co ! p ;
@@ -258,15 +284,16 @@ oper
verb = vps.fin ! agr ;
inf = vps.inf ! (appVPAgr vp.agr (aagr agr.g agr.n)) ; --- subtype bug
neg = vp.neg ! b ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! b
--e clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
--e compl = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! b
clit = vp.clit1 ++ vp.clit2 ++ vp.clit3 ;
compl = vp.comp ! agr ++ vp.ext ! b
in
case d of {
DDir =>
subj ++ neg.p1 ++ clpr.p1 ++ vp.clit2 ++ verb ++ neg.p2 ++ inf ;
subj ++ neg.p1 ++ clit ++ verb ++ neg.p2 ++ inf ;
DInv =>
neg.p1 ++ clpr.p1 ++ vp.clit2 ++ verb ++
preOrPost hasClit subj (neg.p2 ++ inf)
neg.p1 ++ clit ++ verb ++ preOrPost hasClit subj (neg.p2 ++ inf)
}
++ compl
} ;
@@ -277,14 +304,15 @@ oper
infVP : VP -> Agr -> Str = \vpr,agr ->
let
vp = useVP vpr ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
iform = infForm agr.n agr.p vp.clAcc vp.clDat ;
----e clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
-- iform = infForm agr.n agr.p vp.clAcc vp.clDat ;
iform = False ;
inf = (vp.s ! VPInfinit Simul iform).inf ! (aagr agr.g agr.n) ;
neg = vp.neg ! Pos ; --- Neg not in API
obj = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
-- neg = vp.neg ! Pos ; --- Neg not in API
-- obj = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
in
clitInf clpr.p3 (clpr.p1 ++ vp.clit2) inf ++ obj ;
----e clitInf clpr.p3 (clpr.p1 ++ vp.clit2) inf ++ obj ;
inf ;
}
-- insertObject:

View File

@@ -4,7 +4,7 @@ incomplete concrete SentenceRomance of Sentence =
flags optimize=all_subs ;
lin
PredVP np vp = mkClause (np.s ! Aton Nom) np.hasClit np.a vp ;
PredVP np vp = mkClause (np.s ! Nom).comp np.hasClit np.a vp ;
PredSCVP sc vp = mkClause sc.s False (agrP3 Masc Sg) vp ;
@@ -17,34 +17,16 @@ incomplete concrete SentenceRomance of Sentence =
SlashVP np v2 =
-- 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 ;
let
vp = v2
----e vp = case <v2.c2.c, v2.c2.isDir> of {
---- <Acc,True> => insertAgr ag v2 ;
---- _ => v2
----e }
in (mkClause (np.s ! Nom).comp np.hasClit np.a vp).s ;
c2 = v2.c2
} ;
{---b
SlashV2 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 (predV v2))).s ! d ;
_ => (mkClause (np.s ! Aton Nom) np.hasClit np.a (predV v2)).s ! d
} ;
c2 = v2.c2
} ;
SlashVVV2 np vv v2 =
{s = \\d,_ =>
(mkClause
(np.s ! Aton Nom) np.hasClit np.a
(insertComplement
(\\a => prepCase vv.c2.c ++ v2.s ! VInfin False) (predV vv))).s ! d;
c2 = v2.c2
} ;
-}
AdvSlash slash adv = {
s = \\ag,d,t,a,b,m => slash.s ! ag ! d ! t ! a ! b ! m ++ adv.s ;
c2 = slash.c2
@@ -58,7 +40,7 @@ incomplete concrete SentenceRomance of Sentence =
SlashVS np vs slash =
{s = \\ag =>
(mkClause
(np.s ! Aton Nom) np.hasClit np.a
(np.s ! Nom).comp np.hasClit np.a
(insertExtrapos (\\b => conjThat ++ slash.s ! ag ! (vs.m ! b))
(predV vs))
).s ;

View File

@@ -7,18 +7,18 @@ lin
FloatPN i = {s = i.s ; g = Masc} ;
NumPN i = {s = i.s!Masc ; g = Masc} ;
CNIntNP cn i = {
s = \\c => cn.s ! Sg ++ i.s ;
CNIntNP cn i = heavyNP {
s = \\c => prepCase c ++ cn.s ! Sg ++ i.s ;
a = agrP3 cn.g Sg ;
hasClit = False
} ;
CNSymbNP det cn xs = let g = cn.g in {
s = \\c => det.s ! g ! npform2case c ++ cn.s ! det.n ++ xs.s ;
CNSymbNP det cn xs = let g = cn.g in heavyNP {
s = \\c => det.s ! g ! c ++ cn.s ! det.n ++ xs.s ;
a = agrP3 g det.n ;
hasClit = False
} ;
CNNumNP cn i = {
s = \\c => artDef cn.g Sg (npform2case c) ++ cn.s ! Sg ++ i.s ! Masc ;
CNNumNP cn i = heavyNP {
s = \\c => artDef cn.g Sg c ++ cn.s ! Sg ++ i.s ! Masc ;
a = agrP3 cn.g Sg ;
hasClit = False
} ;

View File

@@ -74,7 +74,7 @@ incomplete concrete VerbRomance of Verb =
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} ;
CompNP np = {s = \\_ => (np.s ! Nom).ton} ;
CompAdv a = {s = \\_ => a.s} ;
AdvVP vp adv = insertAdv adv.s vp ;

View File

@@ -95,12 +95,13 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
let
pe = case b of {True => P3 ; _ => p} ;
agr = aag ** {p = pe} ;
verb = case <aag.n, pol, pe> of {
<Sg,Neg,P2> => (vp.s ! VPFinite (VPres Conjunct) Simul).fin ! agr ;
_ => (vp.s ! VPImperat).fin ! agr
} ;
clpr = <[],[],False> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
----e verb = case <aag.n, pol,pe> of {
----e <Sg,Neg,P2> => (vp.s ! VPInfinit Simul clpr.p3).inf ! aag ;
----e _ => (vp.s ! VPImperat).fin ! agr
----e } ;
verb = (vp.s ! VPImperat).fin ! agr ; ----e
neg = vp.neg ! pol ;
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
compl = neg.p2 ++ clpr.p2 ++ vp.comp ! agr ++ vp.ext ! pol
in
neg.p1 ++ verb ++ bindIf clpr.p3 ++ clpr.p1 ++ compl ;

View File

@@ -11,7 +11,7 @@ concrete IdiomSpa of Idiom = CatSpa **
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => rs.s ! Indic ! np.a)
(insertComplement (\\_ => np.s ! Ton rs.c) (predV copula))) ;
(insertComplement (\\_ => (np.s ! rs.c).ton) (predV copula))) ;
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
@@ -20,7 +20,7 @@ concrete IdiomSpa of Idiom = CatSpa **
ExistNP np =
mkClause [] True (agrP3 Masc Sg)
(insertComplement (\\_ => np.s ! Ton Acc) (predV (verboV (hay_3 "haber")))) ;
(insertComplement (\\_ => (np.s ! Acc).ton) (predV (verboV (hay_3 "haber")))) ;
ExistIP ip = {
s = \\t,a,p,_ =>
ip.s ! Nom ++
@@ -31,7 +31,7 @@ concrete IdiomSpa of Idiom = CatSpa **
insertComplement
(\\agr =>
let
clpr = pronArg agr.n agr.p vp.clAcc vp.clDat ;
clpr = <vp.clit1,vp.clit2> ; ----e pronArg agr.n agr.p vp.clAcc vp.clDat ;
obj = clpr.p2 ++ vp.comp ! agr ++ vp.ext ! Pos ---- pol
in
(vp.s ! VPGerund).inf ! (aagr agr.g agr.n) ++ clpr.p1 ++ obj

View File

@@ -94,20 +94,24 @@ oper
mkPronoun : (_,_,_,_,_,_,_,_ : Str) ->
Gender -> Number -> Person -> Pronoun =
\il,le,lui,Lui,son,sa,ses,see,g,n,p ->
{s = table {
Ton Nom => il ;
Ton x => prepCase x ++ Lui ;
Aton Nom => strOpt il ; ---- [] ;
Aton Acc => le ;
Aton (CPrep P_a) => lui ;
Aton q => prepCase q ++ Lui ; ---- GF bug with c or p!
Poss {n = Sg ; g = Masc} => son ;
Poss {n = Sg ; g = Fem} => sa ;
Poss {n = Pl ; g = Masc} => ses ;
Poss {n = Pl ; g = Fem} => see
let
alui : Case -> Str = \x -> prepCase x ++ Lui ;
in {
s = table {
Nom => {c1 = [] ; c2 = [] ; comp = il ; ton = Lui} ;
Acc => {c1 = le ; c2 = [] ; comp = [] ; ton = Lui} ;
CPrep P_a => {c1 = [] ; c2 = lui ; comp = [] ; ton = alui (CPrep P_a)} ;
c => {c1 = [] ; c2 = [] ; comp, ton = alui c}
} ;
poss = \\n,g => case <n,g> of {
<Sg,Masc> => son ;
<Sg,Fem> => sa ;
<Pl,Masc> => ses ;
<Pl,Fem> => see
} ;
a = {g = g ; n = n ; p = p} ;
hasClit = True
a = {g = g ; n = n ; p = p} ;
hasClit = True
} ;