mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
new structure of Romance VP complete
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
all: langs test
|
all: langs test
|
||||||
|
|
||||||
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:
|
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:
|
stat:
|
||||||
wc */*.gfc
|
wc */*.gfc
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelude in {
|
instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
param
|
param
|
||||||
Prep = P_di | P_a | P_da | P_in | P_su | P_con ;
|
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
|
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 ->
|
vpAgrClit : Agr -> VPAgr = \a ->
|
||||||
vpAgrNone ;
|
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 {
|
negation : Polarity => (Str * Str) = table {
|
||||||
Pos => <[],[]> ;
|
Pos => <[],[]> ;
|
||||||
@@ -109,14 +124,14 @@ instance DiffIta of DiffRomance = open CommonRomance, PhonoIta, BeschIta, Prelud
|
|||||||
|
|
||||||
partQIndir = "ciò" ;
|
partQIndir = "ciò" ;
|
||||||
|
|
||||||
reflPron : Number => Person => Case => Str =
|
reflPron : Number -> Person -> Case -> Str =
|
||||||
let
|
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 ;
|
Acc | CPrep P_a => me ;
|
||||||
_ => moi
|
_ => moi
|
||||||
} ;
|
} ;
|
||||||
in
|
in
|
||||||
\\n,p => case <n,p> of {
|
\n,p -> case <n,p> of {
|
||||||
<Sg,P1> => cases "mi" "me" ;
|
<Sg,P1> => cases "mi" "me" ;
|
||||||
<Sg,P2> => cases "ti" "te" ;
|
<Sg,P2> => cases "ti" "te" ;
|
||||||
<Pl,P1> => cases "ci" "noi" ; -- unlike French with just one alt!
|
<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"
|
_ => 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 ;
|
vRefl : VType = VRefl ;
|
||||||
isVRefl : VType -> Bool = \ty -> case ty of {
|
isVRefl : VType -> Bool = \ty -> case ty of {
|
||||||
VRefl => True ;
|
VRefl => True ;
|
||||||
|
|||||||
@@ -8,4 +8,6 @@
|
|||||||
|
|
||||||
instance ResIta of ResRomance = DiffIta ** open CommonRomance, Prelude in {
|
instance ResIta of ResRomance = DiffIta ** open CommonRomance, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=all ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ interface DiffRomance = open CommonRomance, Prelude in {
|
|||||||
partQIndir : Str ; -- ce, ciò
|
partQIndir : Str ; -- ce, ciò
|
||||||
|
|
||||||
reflPron : Number -> Person -> Case -> Str ;
|
reflPron : Number -> Person -> Case -> Str ;
|
||||||
argPron : Gender -> Number -> Person -> Case -> Str ;
|
-- argPron : Gender -> Number -> Person -> Case -> Str ;
|
||||||
|
|
||||||
auxPassive : Verb ;
|
auxPassive : Verb ;
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelude in {
|
instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=noexpand ;
|
||||||
|
|
||||||
param
|
param
|
||||||
Prep = P_de | P_a ;
|
Prep = P_de | P_a ;
|
||||||
NPForm = Ton Case | Aton Case | Poss {g : Gender ; n : Number} ; --- AAgr
|
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 ->
|
vpAgrClit : Agr -> VPAgr = \a ->
|
||||||
vpAgrNone ;
|
vpAgrNone ;
|
||||||
|
|
||||||
--- This assumes that Acc clitics are in place before Dat.
|
pronArg = \n,p,acc,dat ->
|
||||||
|
let
|
||||||
placeNewClitic = \ci,c,pro,isc,old ->
|
paccp = case acc of {
|
||||||
if_then_Str isc (
|
CRefl => <reflPron n p Acc, p> ;
|
||||||
case <ci.p3, pro.a.p> of {
|
CPron a => <argPron a.g a.n a.p Acc, a.p> ;
|
||||||
<P2,P1> => old ++ pro.s ! Aton c ; -- te me, ---se me
|
_ => <[],P2>
|
||||||
<P3,P3> => "se" ++ old ; -- se lo
|
} ;
|
||||||
_ => pro.s ! Aton c ++ old -- indirect first
|
pdatp = case dat of {
|
||||||
}) [] ; -- no clitics
|
CPron a => <argPron a.g a.n a.p dative, a.p> ;
|
||||||
|
_ => <[],P2>
|
||||||
{-
|
}
|
||||||
placeNewClitic = \ci,c,pro,isc,old ->
|
in case <paccp.p2, pdatp.p2> of {
|
||||||
case <ci.p1, ci.p2, ci.p3, pro.a.p, isc> of {
|
<P3,P3> => <"se" ++ paccp.p1, []> ;
|
||||||
<Acc, Sg, P2, P1, True> => old ++ pro.s ! Aton c ; -- te me, ---se me
|
_ => <pdatp.p1 ++ paccp.p1, []>
|
||||||
<Acc, _, P3, P3, True> => "se" ++ old ; -- se lo
|
} ;
|
||||||
{p5 = True} => pro.s ! Aton c ++ old ; -- indirect first
|
-- case <p,acc,dat> of {
|
||||||
_ => [] -- no clitics
|
-- <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 {
|
negation : Polarity => (Str * Str) = table {
|
||||||
Pos => <[],[]> ;
|
Pos => <[],[]> ;
|
||||||
@@ -95,19 +96,38 @@ instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelud
|
|||||||
|
|
||||||
partQIndir = [] ; ---- ?
|
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
|
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 ;
|
Acc | CPrep P_a => me ;
|
||||||
_ => moi
|
_ => moi
|
||||||
} ;
|
} ;
|
||||||
|
cases3 : (x,y,z : Str) -> Case -> Str = \les,leur,eux,c -> case c of {
|
||||||
|
Acc => les ;
|
||||||
|
CPrep P_a => leur ;
|
||||||
|
_ => eux
|
||||||
|
} ;
|
||||||
in
|
in
|
||||||
\\n,p => case <n,p> of {
|
\g,n,p -> case <g,n,p> of {
|
||||||
<Sg,P1> => cases "mi" "me" ;
|
<_,Sg,P1> => cases "me" "mí" ;
|
||||||
<Sg,P2> => cases "ti" "te" ;
|
<_,Sg,P2> => cases "te" "tí" ;
|
||||||
<Pl,P1> => cases "ci" "noi" ; -- unlike French with just one alt!
|
<_,Pl,P1> => cases "nos" "nosotras" ; --- nosotros
|
||||||
<Pl,P2> => cases "vi" "voi" ;
|
<_,Pl,P2> => cases "vos" "vosotras" ; --- vosotros
|
||||||
_ => cases "si" "se"
|
<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 ;
|
vRefl : VType = VRefl ;
|
||||||
|
|||||||
@@ -8,4 +8,6 @@
|
|||||||
|
|
||||||
instance ResSpa of ResRomance = DiffSpa ** open CommonRomance, Prelude in {
|
instance ResSpa of ResRomance = DiffSpa ** open CommonRomance, Prelude in {
|
||||||
|
|
||||||
|
flags optimize=noexpand ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user