1
0
forked from GitHub/gf-core

new structure of Romance VP complete

This commit is contained in:
aarne
2006-02-17 23:57:14 +00:00
parent be3c9fe199
commit 5e9f0a908a
6 changed files with 103 additions and 40 deletions

View File

@@ -1,9 +1,9 @@
all: langs test
test:
echo "gr -cat=S -number=11 -prob | tb" | gf -probs=lang.gfprob langs.gfcm
echo "gr -cat=S -number=11 -prob | tb" | gf -nocf -probs=lang.gfprob langs.gfcm
langs:
echo "s ;; pm | wf langs.gfcm" | gf -src */Lang??*.gf english/LangEng.gf +RTS -M400M
echo "s ;; pm | wf langs.gfcm" | gf -src -nocf */Lang??*.gf english/LangEng.gf +RTS -M500M
stat:
wc */*.gfc

View File

@@ -2,6 +2,8 @@
instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelude in {
flags optimize=all ;
param
Prep = P_di | P_a | P_da | P_in | P_su | P_con ;
NPForm = Ton Case | Aton Case | PreClit | Poss {g : Gender ; n : Number} ; --- AAgr
@@ -77,14 +79,27 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
vpAgrClit : Agr -> VPAgr = \a ->
vpAgrNone ;
--- This assumes that Acc clitics are in place before Dat.
pronArg = \n,p,acc,dat ->
let
pacc = case acc of { --- only accusative refl handled
CRefl => case p of {
P3 => "si" ;
_ => argPron Fem n p Acc False --- no clitic after acc
} ;
CPron a => argPron a.g a.n a.p Acc False ;
_ => []
} ;
hasAcc = case acc of {
CNone => False ;
_ => True
} ;
pdat = case dat of {
CPron a => argPron a.g a.n a.p dative hasAcc ;
_ => []
} ;
in
<pdat ++ pacc, []> ;
placeNewClitic = \ci,c,pro,isc,old ->
case <ci.p1,c,isc> of {
<Acc,CPrep P_a, True> => pro.s ! PreClit ++ old ; -- there is an old clitic
{p3 = True} => pro.s ! Aton c ; -- no old but a new
_ => [] -- no clitics
} ;
negation : Polarity => (Str * Str) = table {
Pos => <[],[]> ;
@@ -109,14 +124,14 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
partQIndir = "ciò" ;
reflPron : Number => Person => Case => Str =
reflPron : Number -> Person -> Case -> Str =
let
cases : (x,y : Str) -> (Case => Str) = \me,moi -> table {
cases : (x,y : Str) -> (Case -> Str) = \me,moi,c -> case c of {
Acc | CPrep P_a => me ;
_ => moi
} ;
in
\\n,p => case <n,p> of {
\n,p -> case <n,p> of {
<Sg,P1> => cases "mi" "me" ;
<Sg,P2> => cases "ti" "te" ;
<Pl,P1> => cases "ci" "noi" ; -- unlike French with just one alt!
@@ -124,6 +139,30 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
_ => cases "si" "se"
} ;
argPron : Gender -> Number -> Person -> Case -> Bool -> Str =
let
cases : (x,y,z : Str) -> Case -> Bool -> Str =
\ci,ce,noi,c,isPre -> case c of {
Acc | CPrep P_a => if_then_Str isPre ce ci ;
_ => noi
} ;
cases4 : (x,y,z,u : Str) -> Case -> Bool -> Str =
\lo,gli,glie,lui,c,isPre -> case c of {
Acc => lo ;
CPrep P_a => if_then_Str isPre glie gli ;
_ => lui
} ;
in
\g,n,p -> case <g,n,p> of {
<_,Sg,P1> => cases "mi" "me" "me" ;
<_,Sg,P2> => cases "ti" "te" "te" ;
<_,Pl,P1> => cases "ci" "ce" "noi" ; -- unlike French with just one alt!
<_,Pl,P2> => cases "vi" "ve" "voi" ;
<Masc,Sg,P3> => cases4 "lo" "gli" "glie" "lui" ;
<Fem, Sg,P3> => cases4 "la" "le" "glie" "lei" ;
<_, Pl,P3> => cases4 "li" "li" "glie" "loro"
} ;
vRefl : VType = VRefl ;
isVRefl : VType -> Bool = \ty -> case ty of {
VRefl => True ;

View File

@@ -8,4 +8,6 @@
instance ResIta of ResRomance = DiffIta ** open CommonRomance, Prelude in {
flags optimize=all ;
} ;

View File

@@ -82,7 +82,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
partQIndir : Str ; -- ce, ciò
reflPron : Number -> Person -> Case -> Str ;
argPron : Gender -> Number -> Person -> Case -> Str ;
-- argPron : Gender -> Number -> Person -> Case -> Str ;
auxPassive : Verb ;

View File

@@ -2,6 +2,8 @@
instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelude in {
flags optimize=noexpand ;
param
Prep = P_de | P_a ;
NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
@@ -52,25 +54,24 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
vpAgrClit : Agr -> VPAgr = \a ->
vpAgrNone ;
--- This assumes that Acc clitics are in place before Dat.
placeNewClitic = \ci,c,pro,isc,old ->
if_then_Str isc (
case <ci.p3, pro.a.p> of {
<P2,P1> => old ++ pro.s ! Aton c ; -- te me, ---se me
<P3,P3> => "se" ++ old ; -- se lo
_ => pro.s ! Aton c ++ old -- indirect first
}) [] ; -- no clitics
{-
placeNewClitic = \ci,c,pro,isc,old ->
case <ci.p1, ci.p2, ci.p3, pro.a.p, isc> of {
<Acc, Sg, P2, P1, True> => old ++ pro.s ! Aton c ; -- te me, ---se me
<Acc, _, P3, P3, True> => "se" ++ old ; -- se lo
{p5 = True} => pro.s ! Aton c ++ old ; -- indirect first
_ => [] -- no clitics
} ;
-}
pronArg = \n,p,acc,dat ->
let
paccp = case acc of {
CRefl => <reflPron n p Acc, p> ;
CPron a => <argPron a.g a.n a.p Acc, a.p> ;
_ => <[],P2>
} ;
pdatp = case dat of {
CPron a => <argPron a.g a.n a.p dative, a.p> ;
_ => <[],P2>
}
in case <paccp.p2, pdatp.p2> of {
<P3,P3> => <"se" ++ paccp.p1, []> ;
_ => <pdatp.p1 ++ paccp.p1, []>
} ;
-- case <p,acc,dat> of {
-- <Sg,P2,CRefl,CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
-- <_,_,CPron {n = Sg ; p = P2},CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
negation : Polarity => (Str * Str) = table {
Pos => <[],[]> ;
@@ -95,19 +96,38 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
partQIndir = [] ; ---- ?
reflPron : Number => Person => Case => Str =
reflPron : Number -> Person -> Case -> Str = \n,p,c ->
let pro = argPron Fem n p c
in
case p of {
P3 => case c of {
Acc | CPrep P_a => "se" ;
_ => "sí"
} ;
_ => pro
} ;
argPron : Gender -> Number -> Person -> Case -> Str =
let
cases : (x,y : Str) -> (Case => Str) = \me,moi -> table {
cases : (x,y : Str) -> Case -> Str = \me,moi,c -> case c of {
Acc | CPrep P_a => me ;
_ => moi
} ;
cases3 : (x,y,z : Str) -> Case -> Str = \les,leur,eux,c -> case c of {
Acc => les ;
CPrep P_a => leur ;
_ => eux
} ;
in
\\n,p => case <n,p> of {
<Sg,P1> => cases "mi" "me" ;
<Sg,P2> => cases "ti" "te" ;
<Pl,P1> => cases "ci" "noi" ; -- unlike French with just one alt!
<Pl,P2> => cases "vi" "voi" ;
_ => cases "si" "se"
\g,n,p -> case <g,n,p> of {
<_,Sg,P1> => cases "me" "mí" ;
<_,Sg,P2> => cases "te" "tí" ;
<_,Pl,P1> => cases "nos" "nosotras" ; --- nosotros
<_,Pl,P2> => cases "vos" "vosotras" ; --- vosotros
<Fem,Sg,P3> => cases3 "la" "le" "ella" ;
<_, Sg,P3> => cases3 "lo" "le" "èl" ;
<Fem,Pl,P3> => cases3 "las" "les" "ellas" ;
<_, Pl,P3> => cases3 "los" "les" "ellos"
} ;
vRefl : VType = VRefl ;

View File

@@ -8,4 +8,6 @@
instance ResSpa of ResRomance = DiffSpa ** open CommonRomance, Prelude in {
flags optimize=noexpand ;
} ;