summaryrefslogtreecommitdiff
path: root/old-lib/resource/spanish/DiffSpa.gf
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2009-06-22 15:39:08 +0000
committeraarne <aarne@chalmers.se>2009-06-22 15:39:08 +0000
commite89fdae2fa1626348d8025824a7469252fa85e42 (patch)
treec7d46bbd0494043b4bd6f917a25a7687517d0547 /old-lib/resource/spanish/DiffSpa.gf
parent3049b59b35b25381a7c6787444165c200d66e08b (diff)
next-lib renamed to lib, lib to old-lib
Diffstat (limited to 'old-lib/resource/spanish/DiffSpa.gf')
-rw-r--r--old-lib/resource/spanish/DiffSpa.gf182
1 files changed, 182 insertions, 0 deletions
diff --git a/old-lib/resource/spanish/DiffSpa.gf b/old-lib/resource/spanish/DiffSpa.gf
new file mode 100644
index 000000000..668aa79c0
--- /dev/null
+++ b/old-lib/resource/spanish/DiffSpa.gf
@@ -0,0 +1,182 @@
+--# -path=.:../romance:../abstract:../common:prelude
+
+instance DiffSpa of DiffRomance = open CommonRomance, PhonoSpa, BeschSpa, Prelude in {
+
+ flags optimize=noexpand ;
+
+ param
+ Prepos = P_de | P_a ;
+ VType = VHabere | VRefl ;
+
+ oper
+ dative : Case = CPrep P_a ;
+ genitive : Case = CPrep P_de ;
+
+ prepCase = \c -> case c of {
+ Nom => [] ;
+ Acc => [] ;
+ CPrep P_de => "de" ;
+ CPrep P_a => "a"
+ } ;
+
+ artDef : Gender -> Number -> Case -> Str = \g,n,c ->
+ case <g,n,c> of {
+ <Masc,Sg, CPrep P_de> => "del" ;
+ <Masc,Sg, CPrep P_a> => "al" ;
+ <Masc,Sg, _> => prepCase c ++ "el" ;
+ <Fem ,Sg, _> => prepCase c ++ "la" ;
+ <Masc,Pl, _> => prepCase c ++ "los" ;
+ <Fem ,Pl, _> => prepCase c ++ "las"
+ } ;
+
+-- In these two, "de de/du/des" becomes "de".
+
+ artIndef = \g,n,c -> case n of {
+ Sg => prepCase c ++ genForms "un" "una" ! g ;
+ _ => prepCase c ++ genForms "unos" "unas" ! g
+ } ;
+
+ possCase = \_,_,c -> prepCase c ;
+
+ partitive = \_,c -> prepCase c ;
+
+{-
+ partitive = \g,c -> case c of {
+ CPrep P_de => "de" ;
+ _ => prepCase c ++ artDef g Sg (CPrep P_de)
+ } ;
+-}
+
+ conjunctCase : NPForm -> NPForm = \c -> case c of {
+ Ton Nom | Aton Nom => Ton Nom ;
+ _ => Ton Acc
+ } ;
+
+ auxVerb : VType -> (VF => Str) = \_ -> haber_V.s ;
+
+ partAgr : VType -> VPAgr = \vtyp -> vpAgrNone ;
+
+ vpAgrClit : Agr -> VPAgr = \a ->
+ vpAgrNone ;
+
+ pronArg = \n,p,acc,dat ->
+ let
+ paccp = case acc of {
+ CRefl => <reflPron n p Acc, p,True> ;
+ CPron ag an ap => <argPron ag an ap Acc, ap,True> ;
+ _ => <[],P2,False>
+ } ;
+ pdatp = case dat of {
+ CPron ag an ap => <argPron ag an ap dative, ap,True> ;
+ _ => <[],P2,False>
+ } ;
+ peither = case acc of {
+ CRefl | CPron _ _ _ => True ;
+ _ => case dat of {
+ CPron _ _ _ => True ;
+ _ => False
+ }
+ } ;
+ defaultPronArg = <pdatp.p1 ++ paccp.p1, [], peither>
+---- defaultPronArg = <pdatp.p1 ++ paccp.p1, [], orB paccp.p3 pdatp.p3>
+ in
+ ---- case <<paccp.p2, pdatp.p2> : Person * Person> of {
+ ---- <P3,P3> => <"se" ++ paccp.p1, [], True> ;
+ ---- _ => defaultPronArg
+ --- } ;
+ ---- 8/6/2008 efficiency problem in pgf generation: replace the case expr with
+ ---- a constant produces an error in V3 predication with two pronouns
+ defaultPronArg ;
+
+ infForm _ _ _ _ = True ;
+
+ mkImperative b p vp = {
+ s = \\pol,aag =>
+ 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
+ } ;
+ 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",[]>
+ } ;
+
+ conjThan = "que" ;
+ conjThat = "que" ;
+ subjIf = "si" ;
+
+
+ clitInf b cli inf = inf ++ bindIf b ++ cli ;
+
+ relPron : Bool => AAgr => Case => Str = \\b,a,c =>
+ case c of {
+ Nom | Acc => "que" ;
+ CPrep P_a => "cuyo" ;
+ _ => prepCase c ++ "cuyo"
+ } ;
+
+ pronSuch : AAgr => Str = aagrForms "tál" "tál" "tales" "tales" ;
+
+ quelPron : AAgr => Str = aagrForms "cuál" "cuál" "cuales" "cuales" ;
+
+ partQIndir = [] ; ---- ?
+
+ 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,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
+ \g,n,p -> case <<g,n,p> : Gender * Number * Person> 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 ;
+ isVRefl : VType -> Bool = \ty -> case ty of {
+ VRefl => True ;
+ _ => False
+ } ;
+
+ auxPassive : Verb = copula ;
+
+ copula = verbBeschH (ser_1 "ser") ;
+
+ haber_V : Verb = verbBeschH (haber_3 "haber") ;
+
+ verbBeschH : Verbum -> Verb = \v -> verbBesch v ** {vtyp = VHabere} ;
+
+}