forked from GitHub/gf-core
Spanish in 1.4
This commit is contained in:
@@ -65,7 +65,7 @@ lin
|
||||
on_Prep = {s = [] ; c = CPrep P_su ; isDir = False} ;
|
||||
---- one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ;
|
||||
only_Predet = {s = \\_,c => prepCase c ++ "soltanto" ; c = Nom} ; --- solo|a|i|e
|
||||
or_Conj = {s1 = [] ; s2 = "o" ; n = Pl} ;
|
||||
or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ;
|
||||
otherwise_PConj = ss "altramente" ;
|
||||
part_Prep = complGen ;
|
||||
please_Voc = ss ["per favore"] ;
|
||||
|
||||
2
lib/resource-1.4/spanish/AdjectiveSpa.gf
Normal file
2
lib/resource-1.4/spanish/AdjectiveSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete AdjectiveSpa of Adjective = CatSpa ** AdjectiveRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
2
lib/resource-1.4/spanish/AdverbSpa.gf
Normal file
2
lib/resource-1.4/spanish/AdverbSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete AdverbSpa of Adverb = CatSpa ** AdverbRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
5963
lib/resource-1.4/spanish/BeschSpa.gf
Normal file
5963
lib/resource-1.4/spanish/BeschSpa.gf
Normal file
File diff suppressed because it is too large
Load Diff
4
lib/resource-1.4/spanish/CatSpa.gf
Normal file
4
lib/resource-1.4/spanish/CatSpa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete CatSpa of Cat = CommonX - [Tense,TPres,TPast,TFut,TCond] ** CatRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
2
lib/resource-1.4/spanish/ConjunctionSpa.gf
Normal file
2
lib/resource-1.4/spanish/ConjunctionSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ConjunctionSpa of Conjunction = CatSpa ** ConjunctionRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
167
lib/resource-1.4/spanish/DiffSpa.gf
Normal file
167
lib/resource-1.4/spanish/DiffSpa.gf
Normal file
@@ -0,0 +1,167 @@
|
||||
--# -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>
|
||||
}
|
||||
in case <<paccp.p2, pdatp.p2> : Person * Person> of {
|
||||
<P3,P3> => <"se" ++ paccp.p1, [],True> ;
|
||||
_ => <pdatp.p1 ++ paccp.p1, [],orB paccp.p3 pdatp.p3>
|
||||
} ;
|
||||
|
||||
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} ;
|
||||
|
||||
}
|
||||
2
lib/resource-1.4/spanish/ExtraRomanceSpa.gf
Normal file
2
lib/resource-1.4/spanish/ExtraRomanceSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete ExtraRomanceSpa of ExtraRomanceAbs = CatSpa ** ExtraRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
47
lib/resource-1.4/spanish/ExtraSpa.gf
Normal file
47
lib/resource-1.4/spanish/ExtraSpa.gf
Normal file
@@ -0,0 +1,47 @@
|
||||
concrete ExtraSpa of ExtraSpaAbs = ExtraRomanceSpa **
|
||||
open CommonRomance, PhonoSpa, MorphoSpa, ParadigmsSpa, ParamX, ResSpa in {
|
||||
|
||||
lin
|
||||
i8fem_Pron = mkPronoun
|
||||
"yo" "me" "me" "mí"
|
||||
"mi" "mi" "mis" "mis"
|
||||
Fem Sg P1 ;
|
||||
these8fem_NP = makeNP ["estas"] Fem Pl ;
|
||||
they8fem_Pron = mkPronoun
|
||||
"ellas" "las" "les" "ellas"
|
||||
"su" "su" "sus" "sus"
|
||||
Fem Pl P3 ;
|
||||
this8fem_NP = pn2np (mkPN ["esta"] Fem) ;
|
||||
those8fem_NP = makeNP ["esas"] Fem Pl ;
|
||||
|
||||
we8fem_Pron = mkPronoun
|
||||
"nosotras" "nos" "nos" "nosotras"
|
||||
"nuestro" "nuestra" "nuestros" "nuestras"
|
||||
Fem Pl P1 ;
|
||||
whoPl8fem_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Fem Pl} ;
|
||||
whoSg8fem_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Fem Sg} ;
|
||||
|
||||
youSg8fem_Pron = mkPronoun
|
||||
"tu" "te" "te" "tí"
|
||||
"tu" "tu" "tus" "tus"
|
||||
Fem Sg P2 ;
|
||||
youPl8fem_Pron = mkPronoun
|
||||
"vosotras" "vos" "vos" "vosotras"
|
||||
"vuestro" "vuestra" "vuestros" "vuestras"
|
||||
Fem Pl P2 ;
|
||||
youPol8fem_Pron = mkPronoun
|
||||
"usted" "la" "le" "usted"
|
||||
"su" "su" "sus" "sus"
|
||||
Fem Sg P3 ;
|
||||
|
||||
youPolPl_Pron = mkPronoun
|
||||
"ustedes" "las" "les" "usted"
|
||||
"su" "su" "sus" "sus"
|
||||
Masc Pl P3 ;
|
||||
youPolPl8fem_Pron = mkPronoun
|
||||
"ustedes" "las" "les" "usted"
|
||||
"su" "su" "sus" "sus"
|
||||
Fem Pl P3 ;
|
||||
|
||||
|
||||
}
|
||||
28
lib/resource-1.4/spanish/ExtraSpaAbs.gf
Normal file
28
lib/resource-1.4/spanish/ExtraSpaAbs.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
-- Structures special for Spanish. These are not implemented in other
|
||||
-- Romance languages.
|
||||
|
||||
abstract ExtraSpaAbs = ExtraRomanceAbs ** {
|
||||
|
||||
fun
|
||||
|
||||
-- Feminine variants of pronouns (those in $Structural$ are
|
||||
-- masculine, which is the default when gender is unknown).
|
||||
|
||||
i8fem_Pron : Pron ;
|
||||
these8fem_NP : NP ;
|
||||
they8fem_Pron : Pron ;
|
||||
this8fem_NP : NP ;
|
||||
those8fem_NP : NP ;
|
||||
|
||||
we8fem_Pron : Pron ; -- nosotras
|
||||
whoPl8fem_IP : IP ;
|
||||
whoSg8fem_IP : IP ;
|
||||
|
||||
youSg8fem_Pron : Pron ;
|
||||
youPl8fem_Pron : Pron ; -- vosotras
|
||||
youPol8fem_Pron : Pron ; -- usted
|
||||
|
||||
youPolPl_Pron : Pron ; -- ustedes
|
||||
youPolPl8fem_Pron : Pron ;
|
||||
|
||||
}
|
||||
22
lib/resource-1.4/spanish/GrammarSpa.gf
Normal file
22
lib/resource-1.4/spanish/GrammarSpa.gf
Normal file
@@ -0,0 +1,22 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarSpa of Grammar =
|
||||
NounSpa,
|
||||
VerbSpa,
|
||||
AdjectiveSpa,
|
||||
AdverbSpa,
|
||||
NumeralSpa,
|
||||
SentenceSpa,
|
||||
QuestionSpa,
|
||||
RelativeSpa,
|
||||
ConjunctionSpa,
|
||||
PhraseSpa,
|
||||
TextSpa - [Tense,TPres,TPast,TFut,TCond], -- special punctuation
|
||||
IdiomSpa,
|
||||
StructuralSpa
|
||||
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
43
lib/resource-1.4/spanish/IdiomSpa.gf
Normal file
43
lib/resource-1.4/spanish/IdiomSpa.gf
Normal file
@@ -0,0 +1,43 @@
|
||||
concrete IdiomSpa of Idiom = CatSpa **
|
||||
open (P = ParamX), MorphoSpa, ParadigmsSpa, BeschSpa, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
|
||||
GenericCl vp = mkClause "se" True (agrP3 Masc Sg) vp ; ---- just Italian ?
|
||||
|
||||
CleftNP np rs = mkClause [] True (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => rs.s ! Indic ! np.a)
|
||||
(insertComplement (\\_ => np.s ! Ton rs.c) (predV copula))) ;
|
||||
|
||||
CleftAdv ad s = mkClause [] True (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => conjThat ++ s.s ! Indic)
|
||||
(insertComplement (\\_ => ad.s) (predV copula))) ;
|
||||
|
||||
|
||||
ExistNP np =
|
||||
mkClause [] True (agrP3 Masc Sg)
|
||||
(insertComplement (\\_ => np.s ! Ton Acc) (predV (verboV (hay_3 "haber")))) ;
|
||||
ExistIP ip = {
|
||||
s = \\t,a,p,_ =>
|
||||
ip.s ! Nom ++
|
||||
(mkClause [] True (agrP3 Masc Sg) (predV (verboV (hay_3 "haber")))).s ! DDir ! t ! a ! p ! Indic
|
||||
} ;
|
||||
|
||||
ProgrVP vp =
|
||||
insertComplement
|
||||
(\\agr =>
|
||||
let
|
||||
clpr = 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
|
||||
)
|
||||
(predV (verboV (estar_2 "estar"))) ;
|
||||
|
||||
ImpPl1 vp = {s =
|
||||
(mkImperative False P1 vp).s ! Pos ! {n = Pl ; g = Masc} --- fem
|
||||
} ;
|
||||
|
||||
}
|
||||
71819
lib/resource-1.4/spanish/IrregSpa.gf
Normal file
71819
lib/resource-1.4/spanish/IrregSpa.gf
Normal file
File diff suppressed because it is too large
Load Diff
1092
lib/resource-1.4/spanish/IrregSpaAbs.gf
Normal file
1092
lib/resource-1.4/spanish/IrregSpaAbs.gf
Normal file
File diff suppressed because it is too large
Load Diff
10
lib/resource-1.4/spanish/LangSpa.gf
Normal file
10
lib/resource-1.4/spanish/LangSpa.gf
Normal file
@@ -0,0 +1,10 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete LangSpa of Lang =
|
||||
GrammarSpa,
|
||||
LexiconSpa
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
356
lib/resource-1.4/spanish/LexiconSpa.gf
Normal file
356
lib/resource-1.4/spanish/LexiconSpa.gf
Normal file
@@ -0,0 +1,356 @@
|
||||
--# -path=.:../romance:../common:../abstract:../../prelude
|
||||
|
||||
concrete LexiconSpa of Lexicon = CatSpa ** open
|
||||
(M=MorphoSpa), ParadigmsSpa, BeschSpa in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
airplane_N = regN "aeroplano" ; -- avión is masculine
|
||||
answer_V2S = mkV2S (regV "responder") dative ;
|
||||
apartment_N = regN "apartamento" ;
|
||||
apple_N = regN "manzana" ;
|
||||
art_N = regN "arte" ;
|
||||
ask_V2Q = mkV2Q (regV "preguntar") dative ;
|
||||
baby_N = regN "bebé" ; -- can be used for both fem. & masc.
|
||||
bad_A = prefA (mkADeg (regA "malo") (regA "peor")) ;
|
||||
bank_N = regN "banco" ;
|
||||
beautiful_A = prefA (regADeg "bello") ; -- bella
|
||||
become_VA = reflV (regV "convertir") ; --- convertirse en, volverse, ponerse
|
||||
beer_N = regN "cerveza" ;
|
||||
beg_V2V = mkV2V (regV "rogar") accusative dative ; -- pedir
|
||||
big_A = prefA (regADeg "grande") ;
|
||||
bike_N = regN "bicicleta" ;
|
||||
bird_N = regN "pájaro" ;
|
||||
black_A = regADeg "negro" ; -- negra
|
||||
blue_A = regADeg "azul" ;
|
||||
boat_N = regN "bote" ;
|
||||
book_N = regN "libro" ;
|
||||
boot_N = regN "bota" ;
|
||||
boss_N = regN "jefe" ;
|
||||
boy_N = regN "niño" ;
|
||||
bread_N = regN "pan" ;
|
||||
break_V2 = dirV2 (special_ppV (regV "romper") "roto") ;
|
||||
broad_A = regADeg "ancho" ;
|
||||
brother_N2 = deN2 (regN "hermano") ;
|
||||
brown_A = regADeg "marrón" ; --- *
|
||||
butter_N = regN "manteca" ;
|
||||
buy_V2 = dirV2 (regV "comprar") ;
|
||||
camera_N = regN "cámara" ; -- ["máquina fotográfica"]
|
||||
cap_N = regN "gorra" ;
|
||||
car_N = regN "auto" ;
|
||||
carpet_N = regN "alfombra" ;
|
||||
cat_N = regN "gato" ; -- gata
|
||||
ceiling_N = regN "techo" ;
|
||||
chair_N = regN "silla" ;
|
||||
cheese_N = regN "queso" ;
|
||||
child_N = regN "niño" ; -- niña
|
||||
church_N = regN "iglesia" ;
|
||||
city_N = femN (regN "ciudad") ; -- fem
|
||||
clean_A = regADeg "limpio" ;
|
||||
clever_A = regADeg "inteligente" ;
|
||||
close_V2 = dirV2 (regV "cerrar") ;
|
||||
coat_N = regN "abrigo" ;
|
||||
cold_A = regADeg "frío" ; -- fría
|
||||
come_V = verboV (venir_82 "venir") ;
|
||||
computer_N = regN "computadora" ; -- also computador, ordenador in Spain
|
||||
country_N = regN "país" ; -- masc
|
||||
cousin_N = regN "primo" ;
|
||||
cow_N = regN "vaca" ;
|
||||
die_V = verboV (morir_35b "morir") ;
|
||||
dirty_A = regADeg "sucio" ;
|
||||
distance_N3 = mkN3 (regN "distancia") genitive dative ;
|
||||
doctor_N = regN "médico" ; -- médica
|
||||
dog_N = regN "perro" ; -- perra
|
||||
door_N = regN "puerta" ;
|
||||
drink_V2 = dirV2 (regV "tomar") ; -- beber
|
||||
easy_A2V = mkA2V (regA "fácil") dative genitive ;
|
||||
eat_V2 = dirV2 (regV "comer") ;
|
||||
empty_A = regADeg "vacío" ;
|
||||
enemy_N = regN "enemigo" ; -- enemiga
|
||||
factory_N = regN "fábrica" ;
|
||||
father_N2 = deN2 (regN "padre") ;
|
||||
fear_VS = mkVS (regV "temer") ;
|
||||
find_V2 = dirV2 (verboV (encontrar_38 "encontrar")) ;
|
||||
fish_N = mascN (regN "pez") ;
|
||||
floor_N = regN "suelo" ; -- piso
|
||||
forget_V2 = dirV2 (regV "olvidar") ;
|
||||
fridge_N = regN "heladera" ;
|
||||
friend_N = regN "amigo" ; -- amiga
|
||||
fruit_N = regN "fruta" ;
|
||||
fun_AV = mkAV (regA "divertido") genitive ; -- entretenido
|
||||
garden_N = regN "jardín" ;
|
||||
girl_N = regN "niña" ;
|
||||
glove_N = regN "guante" ;
|
||||
gold_N = regN "oro" ;
|
||||
good_A = prefA (mkADeg (regA "bueno") (regA "mejor")) ; ---- adv?
|
||||
go_V = (verboV (ir_46 "ir")) ;
|
||||
green_A = regADeg "verde" ;
|
||||
harbour_N = regN "puerto" ;
|
||||
hate_V2 = dirV2 (regV "odiar") ;
|
||||
hat_N = regN "sombrero" ;
|
||||
have_V2 = dirV2 (verboV (tener_4 "tener")) ;
|
||||
hear_V2 = mkV2 (regV "escuchar") dative ; -- oír_51
|
||||
hill_N = regN "colina" ;
|
||||
hope_VS = mkVS (regV "esperar") ;
|
||||
horse_N = regN "caballo" ;
|
||||
hot_A = regADeg "caliente" ;
|
||||
house_N = regN "casa" ;
|
||||
important_A = regADeg "importante" ;
|
||||
industry_N = regN "industria" ;
|
||||
iron_N = regN "fierro" ;
|
||||
king_N = regN "rey" ;
|
||||
know_V2 = dirV2 (verboV (saber_71 "saber")) ; -- conocer
|
||||
lake_N = regN "lago" ;
|
||||
lamp_N = regN "lámpara" ;
|
||||
learn_V2 = dirV2 (regV "aprender") ;
|
||||
leather_N = regN "cuero" ;
|
||||
leave_V2 = dirV2 (regV "partir") ; -- irse, dejar
|
||||
like_V2 = dirV2 (regV "gustar") ;
|
||||
listen_V2 = dirV2 (regV "escuchar") ;
|
||||
live_V = verboV (vivir_7 "vivir") ;
|
||||
long_A = regADeg "largo" ;
|
||||
lose_V2 = dirV2 (verboV (defender_29 "perder")) ;
|
||||
love_N = regN "amor" ;
|
||||
love_V2 = dirV2 (regV "amar") ;
|
||||
man_N = regN "hombre" ; -- masc
|
||||
married_A2 = mkA2 (regA "casado") dative ;
|
||||
meat_N = femN (regN "carne") ;
|
||||
milk_N = femN (regN "leche") ;
|
||||
moon_N = regN "luna" ;
|
||||
mother_N2 = deN2 (femN (regN "madre")) ; -- fem
|
||||
mountain_N = regN "montaña" ;
|
||||
music_N = regN "música" ;
|
||||
narrow_A = regADeg "estrecho" ;
|
||||
new_A = prefA (regADeg "nuevo") ;
|
||||
newspaper_N = regN "periódico" ; -- diario
|
||||
oil_N = regN "aceite" ;
|
||||
old_A = prefA (regADeg "viejo") ;
|
||||
open_V2 = dirV2 (special_ppV (regV "abrir") "abierto") ;
|
||||
paint_V2A = mkV2A (regV "pintar") accusative (mkPrep "en") ;
|
||||
paper_N = regN "papel" ;
|
||||
paris_PN = mkPN "Paris" masculine ;
|
||||
peace_N = femN (regN "paz") ;
|
||||
pen_N = regN "lapicera" ;
|
||||
planet_N = mascN (regN "planeta") ;
|
||||
plastic_N = regN "plástico" ;
|
||||
play_V2 = dirV2 (verboV (jugar_47 "jugar")) ;
|
||||
policeman_N = mascN (regN "policía") ; -- fem refers to the institution
|
||||
priest_N = mascN (regN "cura") ; -- masc
|
||||
probable_AS = mkAS (regA "probable") ;
|
||||
queen_N = regN "reina" ;
|
||||
radio_N = femN (regN "radio") ;
|
||||
rain_V0 = mkV0 (verboV (llover_89 "llover")) ;
|
||||
read_V2 = dirV2 (verboV (creer_26 "leer")) ;
|
||||
red_A = regADeg "rojo" ;
|
||||
religion_N = mkN "religión" "religiones" feminine ;
|
||||
restaurant_N = regN "restaurante" ; -- restorán, restaurán, masc
|
||||
river_N = regN "río" ;
|
||||
rock_N = regN "roca" ;
|
||||
roof_N = regN "techo" ;
|
||||
rubber_N = regN "goma" ;
|
||||
run_V = regV "correr" ;
|
||||
say_VS = mkVS (verboV (decir_28 "decir")) ;
|
||||
school_N = regN "escuela" ;
|
||||
science_N = regN "ciencia" ;
|
||||
sea_N = regN "mar" ; -- masc & fem
|
||||
seek_V2 = dirV2 (regV "buscar") ;
|
||||
see_V2 = dirV2 (verboV (ver_83 "ver")) ;
|
||||
sell_V3 = dirV3 (regV "vender") dative ;
|
||||
send_V3 = dirV3 (regV "mandar") dative ;
|
||||
sheep_N = regN "oveja" ;
|
||||
ship_N = femN (regN "nave") ;
|
||||
shirt_N = regN "camisa" ;
|
||||
shoe_N = regN "zapato" ;
|
||||
shop_N = regN "negocio" ;
|
||||
short_A = regADeg "corto" ; --- breve
|
||||
silver_N = regN "plata" ;
|
||||
sister_N = regN "hermana" ;
|
||||
sleep_V = verboV (dormir_35 "dormir") ;
|
||||
small_A = prefA (regADeg "pequeño") ;
|
||||
snake_N = femN (regN "serpiente") ; -- fem
|
||||
sock_N = regN "media" ;
|
||||
speak_V2 = dirV2 (regV "hablar") ;
|
||||
star_N = regN "estrella" ;
|
||||
steel_N = regN "acero" ;
|
||||
stone_N = regN "piedra" ;
|
||||
stove_N = regN "horno" ; -- estufa
|
||||
student_N = regN "estudiante" ; -- used both for fem & masc
|
||||
stupid_A = regADeg "estúpido" ;
|
||||
sun_N = regN "sol" ;
|
||||
switch8off_V2 = dirV2 (regV "apagar") ;
|
||||
switch8on_V2 = dirV2 (regV "prender") ;
|
||||
table_N = regN "mesa" ;
|
||||
talk_V3 = mkV3 (regV "hablar") dative genitive ;
|
||||
teacher_N = regN "maestro" ; -- maestra
|
||||
teach_V2 = dirV2 (regV "enseñar") ;
|
||||
television_N = mkN "televisión" "televisiones" feminine ; -- televisor masc
|
||||
thick_A = regADeg "grueso" ;
|
||||
thin_A = regADeg "fino" ; -- delgado
|
||||
train_N = regN "tren" ;
|
||||
travel_V = regV "viajar" ;
|
||||
tree_N = regN "árbol" ;
|
||||
--- trousers_N = regN "pantalón" ; -- masc
|
||||
ugly_A = regADeg "feo" ;
|
||||
understand_V2 = dirV2 (regV "entender") ;
|
||||
university_N = femN (regN "universidad") ;
|
||||
village_N = regN "pueblo" ;
|
||||
wait_V2 = mkV2 (regV "esperar") dative ;
|
||||
walk_V = regV "caminar" ;
|
||||
warm_A = regADeg "tibio" ;
|
||||
war_N = regN "guerra" ;
|
||||
watch_V2 = dirV2 (regV "mirar") ; -- ver
|
||||
water_N = mascN (regN "agua") ;
|
||||
white_A = compADeg (regA "blanco") ;
|
||||
window_N = regN "ventana" ;
|
||||
wine_N = regN "vino" ;
|
||||
win_V2 = dirV2 (regV "ganar") ;
|
||||
woman_N = femN (regN "mujer") ;
|
||||
wonder_VQ = mkVQ (reflV (regV "preguntar")) ;
|
||||
wood_N = regN "madera" ;
|
||||
write_V2 = dirV2 (special_ppV (regV "escribir") "escrito") ;
|
||||
yellow_A = regADeg "amarillo" ;
|
||||
young_A = prefA (regADeg "joven") ;
|
||||
|
||||
do_V2 = dirV2 (verboV (hacer_44 "hacer")) ;
|
||||
now_Adv = mkAdv "ahora" ;
|
||||
already_Adv = mkAdv "ya" ;
|
||||
song_N = mkN "canción" "canciones" feminine ;
|
||||
add_V3 = dirV3 (regV "sumar") dative ;
|
||||
number_N = regN "número" ;
|
||||
put_V2 = dirV2 (verboV (poner_60 "poner")) ;
|
||||
stop_V = regV "parar" ;
|
||||
jump_V = regV "saltar" ;
|
||||
|
||||
left_Ord = M.mkOrd (regA "izquierda") ;
|
||||
right_Ord = M.mkOrd (regA "derecha") ;
|
||||
far_Adv = mkAdv "lejos" ; ----?
|
||||
correct_A = regA "correcto" ;
|
||||
dry_A = regA "seco" ;
|
||||
dull_A = regA "desafilado" ;
|
||||
full_A = regA "lleno" ;
|
||||
heavy_A = regA "pesado" ;
|
||||
near_A = regA "cerca" ;
|
||||
rotten_A = regA "podrido" ;
|
||||
round_A = regA "redondo" ;
|
||||
sharp_A = regA "filoso" ; -- afilado, puntiagudo
|
||||
smooth_A = regA "liso" ; -- suave
|
||||
straight_A = regA "directo" ;
|
||||
wet_A = regA "mojado" ;
|
||||
wide_A = regA "ancho" ; -- extenso
|
||||
animal_N = regN "animal" ; -- masc (sometimes fem when adj)
|
||||
ashes_N = regN "ceniza" ;
|
||||
back_N = regN "espalda" ;
|
||||
bark_N = regN "corteza" ;
|
||||
belly_N = regN "panza" ; -- barriga
|
||||
blood_N = femN (regN "sangre") ;
|
||||
bone_N = regN "hueso" ;
|
||||
breast_N = regN "seno" ; -- pecho
|
||||
cloud_N = femN (regN "nube") ;
|
||||
day_N = mascN (regN "día") ;
|
||||
dust_N = regN "polvo" ;
|
||||
ear_N = regN "oreja" ;
|
||||
earth_N = regN "tierra" ;
|
||||
egg_N = regN "huevo" ;
|
||||
eye_N = regN "ojo" ;
|
||||
fat_N = regN "grasa" ;
|
||||
feather_N = regN "pluma" ;
|
||||
fingernail_N = regN "uña" ;
|
||||
fire_N = regN "fuego" ;
|
||||
flower_N = femN (regN "flor") ;
|
||||
fog_N = regN "niebla" ;
|
||||
foot_N = regN "pie" ;
|
||||
forest_N = regN "bosque" ;
|
||||
grass_N = regN "pasto" ; -- hierba, césped (masc)
|
||||
guts_N = regN "tripa" ; -- gut=intestino ---- pl.t. tripas
|
||||
hair_N = regN "cabello" ; -- pelo
|
||||
hand_N = femN (regN "mano") ;
|
||||
head_N = regN "cabeza" ;
|
||||
heart_N = mkN "corazón" "corazones" masculine ;
|
||||
horn_N = regN "cuerno" ;
|
||||
husband_N = regN "marido" ; -- esposo
|
||||
ice_N = regN "hielo" ;
|
||||
knee_N = regN "rodilla" ;
|
||||
leaf_N = regN "hoja" ;
|
||||
leg_N = regN "pierna" ;
|
||||
liver_N = regN "hígado" ;
|
||||
louse_N = regN "piojo" ;
|
||||
mouth_N = regN "boca" ;
|
||||
name_N = regN "nombre" ;
|
||||
neck_N = regN "cuello" ;
|
||||
night_N = femN (regN "noche") ;
|
||||
nose_N = femN (regN "nariz") ;
|
||||
person_N = regN "persona" ;
|
||||
rain_N = regN "lluvia" ;
|
||||
road_N = femN (regN "calle") ; -- camino
|
||||
root_N = femN (regN "raíz") ;
|
||||
rope_N = regN "cuerda" ;
|
||||
salt_N = femN (regN "sal") ;
|
||||
sand_N = regN "arena" ;
|
||||
seed_N = regN "semilla" ;
|
||||
skin_N = femN (regN "piel") ; -- fem
|
||||
sky_N = regN "cielo" ;
|
||||
smoke_N = regN "humo" ;
|
||||
snow_N = femN (regN "nieve") ; -- fem
|
||||
stick_N = mkN "bastón" "bastones" masculine ; -- palo
|
||||
tail_N = regN "cola" ;
|
||||
tongue_N = regN "lengua" ;
|
||||
tooth_N = regN "diente" ;
|
||||
wife_N = regN "esposa" ;
|
||||
wind_N = regN "viento" ;
|
||||
wing_N = regN "ala" ;
|
||||
worm_N = regN "gusano" ; -- lombriz (fem)
|
||||
year_N = regN "año" ;
|
||||
bite_V2 = dirV2 (verboV (morder_50b "morder")) ;
|
||||
blow_V = regV "soplar" ;
|
||||
burn_V = regV "quemar" ;
|
||||
count_V2 = dirV2 (verboV (contar_38b "contar")) ;
|
||||
cut_V2 = dirV2 (regV "cortar") ;
|
||||
dig_V = regV "escarbar" ;
|
||||
fall_V = verboV (caer_20 "caer") ;
|
||||
fear_V2 = dirV2 (regV "temer") ;
|
||||
fight_V2 = dirV2 (regV "pelear") ;
|
||||
float_V = regV "flotar" ;
|
||||
flow_V = verboV (influir_45 "fluir") ; -- circular
|
||||
fly_V = regV "volar" ;
|
||||
freeze_V = regV "congelar" ;
|
||||
give_V3 = dirdirV3 (verboV (dar_27 "dar")) ;
|
||||
hit_V2 = dirV2 (regV "golpear") ;
|
||||
hold_V2 = dirV2 (verboV (tener_4 "tener")) ;
|
||||
hunt_V2 = dirV2 (regV "cazar") ;
|
||||
kill_V2 = dirV2 (regV "matar") ;
|
||||
laugh_V = regV "reir" ; ----V reír_67
|
||||
lie_V = reflV (regV "acostar") ; -- "acostarse"
|
||||
play_V = regV "jugar" ;
|
||||
pull_V2 = dirV2 (regV "tirar") ;
|
||||
push_V2 = dirV2 (regV "empujar") ;
|
||||
rub_V2 = dirV2 (regV "resfregar") ;
|
||||
scratch_V2 = dirV2 (regV "rascar") ;
|
||||
sew_V = regV "coser" ;
|
||||
sing_V = regV "cantar" ;
|
||||
sit_V = reflV (regV "sentar") ;
|
||||
smell_V = verboV (oler_52 "oler") ;
|
||||
spit_V = regV "escupir" ;
|
||||
split_V2 = dirV2 (regV "separar") ; -- dividir,) ;
|
||||
squeeze_V2 = dirV2 (regV "exprimir") ;
|
||||
stab_V2 = dirV2 (regV "apuñalar") ;
|
||||
stand_V = verboV (estar_2 "estar") ; ---- "estar de pie" ;
|
||||
suck_V2 = dirV2 (regV "chupar") ;
|
||||
swell_V = regV "tragar" ;
|
||||
swim_V = regV "nadar" ;
|
||||
think_V = regV "pensar" ;
|
||||
throw_V2 = dirV2 (regV "tirar") ;
|
||||
tie_V2 = dirV2 (regV "atar") ;
|
||||
turn_V = regV "doblar" ;
|
||||
vomit_V = regV "vomitar" ;
|
||||
wash_V2 = dirV2 (regV "lavar") ;
|
||||
wipe_V2 = dirV2 (regV "secar") ;
|
||||
breathe_V = (regV "respirar") ;
|
||||
|
||||
grammar_N = regN "gramática" ;
|
||||
language_N = regN "lengua" ;
|
||||
rule_N = regN "regla" ;
|
||||
|
||||
|
||||
} ;
|
||||
121
lib/resource-1.4/spanish/MorphoSpa.gf
Normal file
121
lib/resource-1.4/spanish/MorphoSpa.gf
Normal file
@@ -0,0 +1,121 @@
|
||||
--# -path=.:../romance:../common:../../prelude
|
||||
|
||||
--1 A Simple Spanish Resource Morphology
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsSpa$, which
|
||||
-- gives a higher-level access to this module.
|
||||
|
||||
resource MorphoSpa = CommonRomance, ResSpa **
|
||||
open PhonoSpa, Prelude, Predef in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
--
|
||||
-- The following macro is useful for creating the forms of number-dependent
|
||||
-- tables, such as common nouns.
|
||||
|
||||
oper
|
||||
numForms : (_,_ : Str) -> Number => Str = \vino, vini ->
|
||||
table {Sg => vino ; Pl => vini} ;
|
||||
|
||||
-- For example:
|
||||
|
||||
nomVino : Str -> Number => Str = \vino ->
|
||||
numForms vino (vino + "s") ;
|
||||
|
||||
nomPilar : Str -> Number => Str = \pilar ->
|
||||
numForms pilar (pilar + "es") ;
|
||||
|
||||
nomTram : Str -> Number => Str = \tram ->
|
||||
numForms tram tram ;
|
||||
|
||||
-- Common nouns are inflected in number and have an inherent gender.
|
||||
|
||||
mkNoun : (Number => Str) -> Gender -> Noun = \mecmecs,gen ->
|
||||
{s = mecmecs ; g = gen} ;
|
||||
|
||||
mkNounIrreg : Str -> Str -> Gender -> Noun = \mec,mecs ->
|
||||
mkNoun (numForms mec mecs) ;
|
||||
|
||||
mkNomReg : Str -> Noun = \mec ->
|
||||
case last mec of {
|
||||
"o" | "e" => mkNoun (nomVino mec) Masc ;
|
||||
"a" => mkNoun (nomVino mec) Fem ;
|
||||
"z" => mkNounIrreg mec (init mec + "ces") Fem ;
|
||||
_ => mkNoun (nomPilar mec) Masc
|
||||
} ;
|
||||
|
||||
--2 Adjectives
|
||||
--
|
||||
-- Adjectives are conveniently seen as gender-dependent nouns.
|
||||
-- Here are some patterns. First one that describes the worst case.
|
||||
|
||||
mkAdj : (_,_,_,_,_ : Str) -> Adj = \solo,sola,soli,sole,solamente ->
|
||||
{s = table {
|
||||
AF Masc n => numForms solo soli ! n ;
|
||||
AF Fem n => numForms sola sole ! n ;
|
||||
AA => solamente
|
||||
}
|
||||
} ;
|
||||
|
||||
-- Then the regular and invariant patterns.
|
||||
|
||||
adjSolo : Str -> Adj = \solo ->
|
||||
let
|
||||
sol = Predef.tk 1 solo
|
||||
in
|
||||
mkAdj solo (sol + "a") (sol + "os") (sol + "as") (sol + "amente") ;
|
||||
|
||||
adjUtil : Str -> Str -> Adj = \util,utiles ->
|
||||
mkAdj util util utiles utiles (util + "mente") ;
|
||||
|
||||
adjBlu : Str -> Adj = \blu ->
|
||||
mkAdj blu blu blu blu blu ; ---
|
||||
|
||||
mkAdjReg : Str -> Adj = \solo ->
|
||||
case last solo of {
|
||||
"o" => adjSolo solo ;
|
||||
"e" => adjUtil solo (solo + "s") ;
|
||||
_ => adjUtil solo (solo + "es")
|
||||
---- _ => adjBlu solo
|
||||
} ;
|
||||
|
||||
--2 Personal pronouns
|
||||
--
|
||||
-- All the eight personal pronouns can be built by the following macro.
|
||||
-- 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
|
||||
} ;
|
||||
a = {g = g ; n = n ; p = p} ;
|
||||
hasClit = True
|
||||
} ;
|
||||
|
||||
|
||||
--2 Determiners
|
||||
--
|
||||
-- Determiners, traditionally called indefinite pronouns, are inflected
|
||||
-- in gender and number, like adjectives.
|
||||
|
||||
pronForms : Adj -> Gender -> Number -> Str = \tale,g,n -> tale.s ! AF g n ;
|
||||
|
||||
}
|
||||
2
lib/resource-1.4/spanish/NounSpa.gf
Normal file
2
lib/resource-1.4/spanish/NounSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete NounSpa of Noun = CatSpa ** NounRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
142
lib/resource-1.4/spanish/NumeralSpa.gf
Normal file
142
lib/resource-1.4/spanish/NumeralSpa.gf
Normal file
@@ -0,0 +1,142 @@
|
||||
concrete NumeralSpa of Numeral = CatSpa **
|
||||
open CommonRomance, ResRomance, MorphoSpa, Prelude in {
|
||||
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
||||
Sub100 = {s : CardOrd => Str ; n : Number} ;
|
||||
Sub1000 = {s : CardOrd => Str ; n : Number} ;
|
||||
Sub1000000 = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
lin n2 =
|
||||
mkTal "dos" "doce" "veinte" "doscientos"
|
||||
"segundo" "duodécimo" "vigésimo" "ducentésimo" ;
|
||||
lin n3 =
|
||||
mkTal "tres" "trece" "treinta" "trescientos"
|
||||
"tercero" "decimotercero" "trigésimo" "tricentesimo" ;
|
||||
lin n4 =
|
||||
mkTal "cuatro" "catorce" "cuarenta" "cuatrocientos"
|
||||
"cuarto" "decimocuarto" "cuadragésimo" "cuadringentesimo" ;
|
||||
lin n5 =
|
||||
mkTal "cinco" "quince" "cinquenta" "quinientos"
|
||||
"quinto" "decimoquinto" "quincuagésimo" "guingentésimo" ;
|
||||
lin n6 =
|
||||
mkTal "seis" "dieciséis" "sesenta" "seiscientos"
|
||||
"sexto" "decimosexto" "sexagésimo" "sexcentesimo" ;
|
||||
lin n7 =
|
||||
mkTal "siete" "diecisiéte" "setenta" "setecientos"
|
||||
"séptimo" "decimoséptimo" "septuagésimo" "septingentesimo" ;
|
||||
lin n8 =
|
||||
mkTal "ocho" "dieciocho" "ochenta" "ochocientos"
|
||||
"octavo" "decimoctavo" "octogésimo" "octingentésimo" ;
|
||||
lin n9 =
|
||||
mkTal "nueve" "diecinueve" "noventa" "novecientos"
|
||||
"noveno" "decimonoveno" "nonagésimo" "noningentésimo" ;
|
||||
|
||||
lin pot01 =
|
||||
let uno = (mkTal "uno" "once" "diez" "ciento" "primero" "undécimo"
|
||||
"décimo" "centésimo").s in
|
||||
{s =\\f,g => case <f,g> of {
|
||||
<ental pred,_> => [] ;
|
||||
<ental _, NCard Fem> => "una" ;
|
||||
<hundra False, NCard _> => "cien" ;
|
||||
<hundra True, NCard Fem> => "ciento" ;
|
||||
_ => uno ! f ! g
|
||||
} ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
lin pot0 d = {s = d.s ; n = Pl} ;
|
||||
lin pot110 = spl ((mkTal "diez" [] [] [] "decimo" [] [] []).s ! ental indip) ;
|
||||
lin pot111 = spl ((mkTal "once" [] [] [] "undécimo" [] [] []).s ! ental indip) ;
|
||||
lin pot1to19 d = spl (d.s ! ton) ;
|
||||
lin pot0as1 n = {s = n.s ! ental indip ; n = n.n} ;
|
||||
lin pot1 d = spl (d.s ! tiotal) ;
|
||||
lin pot1plus d e =
|
||||
{s = \\g => d.s ! tiotal ! g ++ y_CardOrd g ++ e.s ! ental indip ! g ; n = Pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = spl (d.s ! hundra False) ;
|
||||
lin pot2plus d e =
|
||||
{s = \\g => d.s ! hundra True ! g ++ e.s ! g ; n = Pl} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = spl (\\g => n.s ! NCard Masc ++ mil g) ;
|
||||
lin pot3plus n m = {s = \\g => n.s ! NCard Masc ++ mil g ++ m.s ! g ; n = Pl} ;
|
||||
|
||||
oper
|
||||
mkTal : (x1,_,_,_,_,_,_,x8 : Str) -> {s : DForm => CardOrd => Str} =
|
||||
\due,dodici,venti,ducento,secondo,dodicesimo,ventesimo,ducentesimo ->
|
||||
{s = \\d,co => case <d,co> of {
|
||||
<ental _, NCard _> => due ;
|
||||
<ental _, NOrd g n> => pronForms (adjSolo secondo) g n ;
|
||||
<tiotal, NCard _> => venti ;
|
||||
<tiotal, NOrd g n> => regCard ventesimo g n ;
|
||||
<ton, NCard _> => venti ;
|
||||
<ton, NOrd g n> => regCard ventesimo g n ;
|
||||
<hundra _, NCard Masc> => ducento ;
|
||||
<hundra _, NCard Fem> => Predef.tk 2 ducento + "as" ;
|
||||
<hundra _, NOrd g n> => regCard ducentesimo g n
|
||||
}
|
||||
} ;
|
||||
|
||||
regCard : Str -> Gender -> Number -> Str = \ventesimo ->
|
||||
pronForms (adjSolo ventesimo) ;
|
||||
|
||||
spl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \s -> {
|
||||
s = s ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
mil : CardOrd -> Str = \g ->
|
||||
(mkTal "mil" [] [] [] "milésimo" [] [] []).s ! ental indip ! g ;
|
||||
|
||||
y_CardOrd : CardOrd -> Str = \co -> case co of {
|
||||
NCard _ => "y" ;
|
||||
_ => []
|
||||
} ;
|
||||
|
||||
param
|
||||
DForm = ental Pred | ton | tiotal | hundra Bool ;
|
||||
Pred = pred | indip ;
|
||||
|
||||
|
||||
-- numerals as sequences of digits
|
||||
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
s = \\o => d.s ! NCard Masc ++ i.s ! o ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk3Dig "1" "1:o" Sg ; ---- gender
|
||||
D_2 = mk2Dig "2" "2:o" ;
|
||||
D_3 = mk2Dig "3" "3:o" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":o") ;
|
||||
|
||||
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||
s = table {NCard _ => c ; NOrd _ _ => o} ; ---- gender
|
||||
n = n
|
||||
} ;
|
||||
|
||||
TDigit = {
|
||||
n : Number ;
|
||||
s : CardOrd => Str
|
||||
} ;
|
||||
|
||||
}
|
||||
464
lib/resource-1.4/spanish/ParadigmsSpa.gf
Normal file
464
lib/resource-1.4/spanish/ParadigmsSpa.gf
Normal file
@@ -0,0 +1,464 @@
|
||||
--# -path=.:../romance:../common:../abstract:../../prelude
|
||||
|
||||
--1 Spanish Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2004 - 2006
|
||||
--
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoSpa.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string arguments of the paradigms.
|
||||
--
|
||||
-- The structure of functions for each word class $C$ is the following:
|
||||
-- first we give a handful of patterns that aim to cover all
|
||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||
-- escape to construct the most irregular words of type $C$. For
|
||||
-- verbs, there is a fairly complete list of irregular verbs in
|
||||
-- [``IrregSpa`` ../../spanish/IrregSpa.gf].
|
||||
|
||||
resource ParadigmsSpa =
|
||||
open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
CommonRomance,
|
||||
ResSpa,
|
||||
MorphoSpa,
|
||||
BeschSpa,
|
||||
CatSpa in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
masculine : Gender ;
|
||||
feminine : Gender ;
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
-- Prepositions used in many-argument functions are either strings
|
||||
-- (including the 'accusative' empty string) or strings that
|
||||
-- amalgamate with the following word (the 'genitive' "de" and the
|
||||
-- 'dative' "a").
|
||||
|
||||
accusative : Prep ;
|
||||
genitive : Prep ;
|
||||
dative : Prep ;
|
||||
|
||||
mkPrep : Str -> Prep ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
mkN : overload {
|
||||
|
||||
-- The regular function takes the singular form and the gender,
|
||||
-- and computes the plural and the gender by a heuristic.
|
||||
-- The heuristic says that the gender is feminine for nouns
|
||||
-- ending with "a" or "z", and masculine for all other words.
|
||||
-- Nouns ending with "a", "o", "e" have the plural with "s",
|
||||
-- those ending with "z" have "ces" in plural; all other nouns
|
||||
-- have "es" as plural ending. The accent is not dealt with.
|
||||
|
||||
mkN : (luz : Str) -> N ;
|
||||
|
||||
-- A different gender can be forced.
|
||||
|
||||
mkN : Str -> Gender -> N ;
|
||||
|
||||
-- The worst case has two forms (singular + plural) and the gender.
|
||||
|
||||
mkN : (baston,bastones : Str) -> Gender -> N
|
||||
} ;
|
||||
|
||||
|
||||
--3 Compound nouns
|
||||
--
|
||||
-- Some nouns are ones where the first part is inflected as a noun but
|
||||
-- the second part is not inflected. e.g. "número de teléfono".
|
||||
-- They could be formed in syntax, but we give a shortcut here since
|
||||
-- they are frequent in lexica.
|
||||
|
||||
compN : N -> Str -> N ;
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns ("fille de x") need a case and a preposition.
|
||||
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
|
||||
-- The most common cases are the genitive "de" and the dative "a",
|
||||
-- with the empty preposition.
|
||||
|
||||
deN2 : N -> N2 ;
|
||||
aN2 : N -> N2 ;
|
||||
|
||||
-- Three-place relational nouns ("la connessione di x a y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
--
|
||||
-- In some cases, you may want to make a complex $CN$ into a
|
||||
-- relational noun (e.g. "the old town hall of"). However, $N2$ and
|
||||
-- $N3$ are purely lexical categories. But you can use the $AdvCN$
|
||||
-- and $PrepNP$ constructions to build phrases like this.
|
||||
|
||||
--
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names need a string and a gender.
|
||||
-- The default gender is feminine for names ending with "a", otherwise masculine.
|
||||
|
||||
mkPN : overload {
|
||||
mkPN : (Anna : Str) -> PN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN
|
||||
} ;
|
||||
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
mkA : overload {
|
||||
|
||||
-- For regular adjectives, all forms are derived from the
|
||||
-- masculine singular. The types of adjectives that are recognized are
|
||||
-- "alto", "fuerte", "util". Comparison is formed by "mas".
|
||||
|
||||
mkA : (util : Str) -> A ;
|
||||
|
||||
-- One-place adjectives compared with "mas" need five forms in the worst
|
||||
-- case (masc and fem singular, masc plural, adverbial).
|
||||
|
||||
mkA : (solo,sola,solos,solas,solamente : Str) -> A ;
|
||||
|
||||
-- In the worst case, two separate adjectives are given:
|
||||
-- the positive ("bueno"), and the comparative ("mejor").
|
||||
|
||||
mkA : (bueno : A) -> (mejor : A) -> A
|
||||
} ;
|
||||
|
||||
-- The functions above create postfix adjectives. To switch
|
||||
-- them to prefix ones (i.e. ones placed before the noun in
|
||||
-- modification, as in "buen vino"), the following function is
|
||||
-- provided.
|
||||
|
||||
prefixA : A -> A ;
|
||||
|
||||
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
|
||||
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position
|
||||
-- after the verb.
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
|
||||
-- Some appear next to the verb (e.g. "siempre").
|
||||
|
||||
mkAdV : Str -> AdV ;
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
|
||||
|
||||
--2 Verbs
|
||||
|
||||
mkV : overload {
|
||||
|
||||
-- Regular verbs are ones inflected like "cortar", "deber", or "vivir".
|
||||
-- The regular verb function is the first conjugation ("ar") recognizes
|
||||
-- the variations corresponding to the patterns
|
||||
-- "actuar, cazar, guiar, pagar, sacar". The module $BeschSpa$ gives
|
||||
-- the complete set of "Bescherelle" conjugations.
|
||||
|
||||
mkV : (pagar : Str) -> V ;
|
||||
|
||||
-- Verbs with vowel alternatition in the stem - easiest to give with
|
||||
-- two forms, e.g. "mostrar"/"muestro".
|
||||
|
||||
mkV : (mostrar,muestro : Str) -> V ;
|
||||
|
||||
-- Most irreguler verbs are found in $IrregSpa$. If this is not enough,
|
||||
-- the module $BeschSpa$ gives all the patterns of the "Bescherelle"
|
||||
-- book. To use them in the category $V$, wrap them with the function
|
||||
|
||||
mkV : Verbum -> V
|
||||
} ;
|
||||
|
||||
-- To form reflexive verbs:
|
||||
|
||||
reflV : V -> V ;
|
||||
|
||||
-- Verbs with a deviant passive participle: just give the participle
|
||||
-- in masculine singular form as second argument.
|
||||
|
||||
special_ppV : V -> Str -> V ;
|
||||
|
||||
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs).
|
||||
|
||||
mkV2 : overload {
|
||||
mkV2 : Str -> V2 ;
|
||||
mkV2 : V -> V2 ;
|
||||
mkV2 : V -> Prep -> V2
|
||||
} ;
|
||||
|
||||
|
||||
-- You can reuse a $V2$ verb in $V$.
|
||||
|
||||
v2V : V2 -> V ;
|
||||
|
||||
--3 Three-place verbs
|
||||
--
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- hablar, a, di
|
||||
dirV3 : V -> Prep -> V3 ; -- dar,(accusative),a
|
||||
dirdirV3 : V -> V3 ; -- dar,(dative),(accusative)
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "quiero hablar"
|
||||
deVV : V -> VV ; -- "terminar de hablar"
|
||||
aVV : V -> VV ; -- "aprender a hablar"
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> Prep -> AV ;
|
||||
mkA2V : A -> Prep -> Prep -> A2V ;
|
||||
|
||||
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
|
||||
-- and the second argument is given
|
||||
-- as an adverb. Likewise
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0 : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
|
||||
|
||||
--.
|
||||
--2 The definitions of the paradigms
|
||||
--
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
|
||||
Gender = MorphoSpa.Gender ;
|
||||
Number = MorphoSpa.Number ;
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
accusative = complAcc ** {lock_Prep = <>} ;
|
||||
genitive = complGen ** {lock_Prep = <>} ;
|
||||
dative = complDat ** {lock_Prep = <>} ;
|
||||
mkPrep p = {s = p ; c = Acc ; isDir = False ; lock_Prep = <>} ;
|
||||
|
||||
|
||||
mk2N x y g = mkNounIrreg x y g ** {lock_N = <>} ;
|
||||
regN x = mkNomReg x ** {lock_N = <>} ;
|
||||
compN x y = {s = \\n => x.s ! n ++ y ; g = x.g ; lock_N = <>} ;
|
||||
femN x = {s = x.s ; g = feminine ; lock_N = <>} ;
|
||||
mascN x = {s = x.s ; g = masculine ; lock_N = <>} ;
|
||||
|
||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
|
||||
deN2 n = mkN2 n genitive ;
|
||||
aN2 n = mkN2 n dative ;
|
||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
|
||||
|
||||
mk2PN x g = {s = x ; g = g} ** {lock_PN = <>} ;
|
||||
regPN x = mk2PN x g where {
|
||||
g = case last x of {
|
||||
"a" => feminine ;
|
||||
_ => masculine
|
||||
}
|
||||
} ;
|
||||
|
||||
makeNP x g n = {s = (pn2np (mk2PN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
|
||||
|
||||
mk5A a b c d e =
|
||||
compADeg {s = \\_ => (mkAdj a b c d e).s ; isPre = False ; lock_A = <>} ;
|
||||
regA a = compADeg {s = \\_ => (mkAdjReg a).s ; isPre = False ; lock_A = <>} ;
|
||||
prefA a = {s = a.s ; isPre = True ; lock_A = <>} ;
|
||||
|
||||
mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
|
||||
|
||||
mkADeg a b =
|
||||
{s = table {Posit => a.s ! Posit ; _ => b.s ! Posit} ;
|
||||
isPre = a.isPre ; lock_A = <>} ;
|
||||
compADeg a =
|
||||
{s = table {Posit => a.s ! Posit ; _ => \\f => "más" ++ a.s ! Posit ! f} ;
|
||||
isPre = a.isPre ;
|
||||
lock_A = <>} ;
|
||||
regADeg a = compADeg (regA a) ;
|
||||
|
||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||
|
||||
regV x = -- cortar actuar cazar guiar pagar sacar
|
||||
let
|
||||
ar = Predef.dp 2 x ;
|
||||
z = Predef.dp 1 (Predef.tk 2 x) ;
|
||||
verb = case ar of {
|
||||
"ir" => vivir_7 x ;
|
||||
"er" => deber_6 x ;
|
||||
_ => case z of {
|
||||
"u" => actuar_9 x ;
|
||||
"z" => cazar_21 x ;
|
||||
"i" => guiar_43 x ;
|
||||
"g" => pagar_53 x ;
|
||||
"c" => sacar_72 x ;
|
||||
_ => cortar_5 x
|
||||
}
|
||||
}
|
||||
in verbBesch verb ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
|
||||
reflV v = {s = v.s ; vtyp = VRefl ; lock_V = <>} ;
|
||||
|
||||
verboV ve = verbBesch ve ** {vtyp = VHabere ; lock_V = <>} ;
|
||||
|
||||
reflVerboV : Verbum -> V = \ve -> reflV (verboV ve) ;
|
||||
|
||||
special_ppV ve pa = {
|
||||
s = table {
|
||||
VPart g n => (adjSolo pa).s ! AF g n ;
|
||||
p => ve.s ! p
|
||||
} ;
|
||||
lock_V = <> ;
|
||||
vtyp = VHabere
|
||||
} ;
|
||||
|
||||
regAltV x y = verboV (regAlternV x y) ;
|
||||
|
||||
mk2V2 v p = {s = v.s ; vtyp = v.vtyp ; c2 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mk2V2 v accusative ;
|
||||
v2V v = v ** {lock_V = <>} ;
|
||||
|
||||
mkV3 v p q = {s = v.s ; vtyp = v.vtyp ;
|
||||
c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v accusative p ;
|
||||
dirdirV3 v = dirV3 v dative ;
|
||||
|
||||
V0 : Type = V ;
|
||||
AS, AV : Type = A ;
|
||||
A2S, A2V : Type = A2 ;
|
||||
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
mkVS v = v ** {m = \\_ => Indic ; lock_VS = <>} ; ---- more moods
|
||||
mkV2S v p = mk2V2 v p ** {mn,mp = Indic ; lock_V2S = <>} ;
|
||||
mkVV v = v ** {c2 = complAcc ; lock_VV = <>} ;
|
||||
deVV v = v ** {c2 = complGen ; lock_VV = <>} ;
|
||||
aVV v = v ** {c2 = complDat ; lock_VV = <>} ;
|
||||
mkV2V v p t = mkV3 v p t ** {lock_V2V = <>} ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
mkV2A v p q = mkV3 v p q ** {lock_V2A = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
mkV2Q v p = mk2V2 v p ** {lock_V2Q = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_AS = <>} ; ---- more moods
|
||||
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
||||
mkAV v p = v ** {c = p.p1 ; s2 = p.p2 ; lock_AV = <>} ;
|
||||
mkA2V v p q = mkA2 v p ** {s3 = q.p2 ; c3 = q.p1 ; lock_A2V = <>} ;
|
||||
|
||||
---
|
||||
|
||||
mkN = overload {
|
||||
mkN : (luz : Str) -> N = regN ;
|
||||
mkN : Str -> Gender -> N = \s,g -> {s = (regN s).s ; g = g ; lock_N = <>};
|
||||
mkN : (baston,bastones : Str) -> Gender -> N = mk2N
|
||||
} ;
|
||||
regN : Str -> N ;
|
||||
mk2N : (baston,bastones : Str) -> Gender -> N ;
|
||||
mascN : N -> N ;
|
||||
femN : N -> N ;
|
||||
|
||||
|
||||
mkPN = overload {
|
||||
mkPN : (Anna : Str) -> PN = regPN ;
|
||||
mkPN : (Pilar : Str) -> Gender -> PN = mk2PN
|
||||
} ;
|
||||
mk2PN : Str -> Gender -> PN ; -- Juan
|
||||
regPN : Str -> PN ; -- feminine for "-a", otherwise masculine
|
||||
|
||||
-- To form a noun phrase that can also be plural,
|
||||
-- you can use the worst-case function.
|
||||
|
||||
makeNP : Str -> Gender -> Number -> NP ;
|
||||
|
||||
mkA = overload {
|
||||
mkA : (util : Str) -> A = regA ;
|
||||
mkA : (solo,sola,solos,solas,solamente : Str) -> A = mk5A ;
|
||||
mkA : (bueno : A) -> (mejor : A) -> A = mkADeg ;
|
||||
} ;
|
||||
|
||||
mk5A : (solo,sola,solos,solas, solamente : Str) -> A ;
|
||||
regA : Str -> A ;
|
||||
mkADeg : A -> A -> A ;
|
||||
compADeg : A -> A ;
|
||||
regADeg : Str -> A ;
|
||||
prefA : A -> A ;
|
||||
prefixA = prefA ;
|
||||
|
||||
mkV = overload {
|
||||
mkV : (pagar : Str) -> V = regV ;
|
||||
mkV : (mostrar,muestro : Str) -> V = regAltV ;
|
||||
mkV : Verbum -> V = verboV
|
||||
} ;
|
||||
regV : Str -> V ;
|
||||
regAltV : (mostrar,muestro : Str) -> V ;
|
||||
verboV : Verbum -> V ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2 = \s -> dirV2 (regV s) ;
|
||||
mkV2 : V -> V2 = dirV2 ;
|
||||
mkV2 : V -> Prep -> V2 = mk2V2
|
||||
} ;
|
||||
mk2V2 : V -> Prep -> V2 ;
|
||||
dirV2 : V -> V2 ;
|
||||
|
||||
|
||||
|
||||
} ;
|
||||
14
lib/resource-1.4/spanish/PhonoSpa.gf
Normal file
14
lib/resource-1.4/spanish/PhonoSpa.gf
Normal file
@@ -0,0 +1,14 @@
|
||||
resource PhonoSpa = open Prelude in {
|
||||
|
||||
--3 Elision
|
||||
--
|
||||
-- The phonological rule of *elision* can be defined as follows in GF.
|
||||
-- In Spanish it includes both vowels and 'h'.
|
||||
|
||||
oper
|
||||
vocale : Strs = strs {
|
||||
"a" ; "e" ; "h" ; "i" ; "o" ; "u"
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
2
lib/resource-1.4/spanish/PhraseSpa.gf
Normal file
2
lib/resource-1.4/spanish/PhraseSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete PhraseSpa of Phrase = CatSpa ** PhraseRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
2
lib/resource-1.4/spanish/QuestionSpa.gf
Normal file
2
lib/resource-1.4/spanish/QuestionSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete QuestionSpa of Question = CatSpa ** QuestionRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
2
lib/resource-1.4/spanish/RelativeSpa.gf
Normal file
2
lib/resource-1.4/spanish/RelativeSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete RelativeSpa of Relative = CatSpa ** RelativeRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
13
lib/resource-1.4/spanish/ResSpa.gf
Normal file
13
lib/resource-1.4/spanish/ResSpa.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
--1 Spanish auxiliary operations.
|
||||
--
|
||||
---- This module contains operations that are needed to make the
|
||||
---- resource syntax work. To define everything that is needed to
|
||||
---- implement $Test$, it moreover contains regular lexical
|
||||
---- patterns needed for $Lex$.
|
||||
--
|
||||
|
||||
instance ResSpa of ResRomance = DiffSpa ** open CommonRomance, Prelude in {
|
||||
|
||||
--- flags optimize=noexpand ;
|
||||
|
||||
} ;
|
||||
2
lib/resource-1.4/spanish/SentenceSpa.gf
Normal file
2
lib/resource-1.4/spanish/SentenceSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete SentenceSpa of Sentence = CatSpa ** SentenceRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
7
lib/resource-1.4/spanish/Spanish.gf
Normal file
7
lib/resource-1.4/spanish/Spanish.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
--# -path=.:../romance:../abstract:../common:prelude
|
||||
|
||||
concrete Spanish of SpanishAbs =
|
||||
LangSpa,
|
||||
IrregSpa,
|
||||
ExtraSpa
|
||||
** {} ;
|
||||
5
lib/resource-1.4/spanish/SpanishAbs.gf
Normal file
5
lib/resource-1.4/spanish/SpanishAbs.gf
Normal file
@@ -0,0 +1,5 @@
|
||||
abstract SpanishAbs =
|
||||
Lang,
|
||||
IrregSpaAbs,
|
||||
ExtraSpaAbs
|
||||
** {} ;
|
||||
159
lib/resource-1.4/spanish/StructuralSpa.gf
Normal file
159
lib/resource-1.4/spanish/StructuralSpa.gf
Normal file
@@ -0,0 +1,159 @@
|
||||
concrete StructuralSpa of Structural = CatSpa **
|
||||
open PhonoSpa, MorphoSpa, ParadigmsSpa, BeschSpa, Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
|
||||
above_Prep = mkPrep "sobre" ;
|
||||
after_Prep = {s = ["despues"] ; c = MorphoSpa.genitive ; isDir = False} ;
|
||||
all_Predet = {
|
||||
s = \\a,c => prepCase c ++ aagrForms "todo" "toda" "todos" "todas" ! a ;
|
||||
c = Nom
|
||||
} ;
|
||||
almost_AdA, almost_AdN = ss "casi" ;
|
||||
always_AdV = ss "siempre" ;
|
||||
although_Subj = ss "benché" ** {m = Conjunct} ;
|
||||
and_Conj = {s1 = [] ; s2 = "y" ; n = Pl} ;
|
||||
because_Subj = ss "porque" ** {m = Indic} ;
|
||||
before_Prep = {s = "antes" ; c = MorphoSpa.genitive ; isDir = False} ;
|
||||
behind_Prep = {s = "detrás" ; c = MorphoSpa.genitive ; isDir = False} ;
|
||||
between_Prep = mkPrep "entre" ;
|
||||
both7and_DConj = {s1,s2 = etConj.s ; n = Pl} ;
|
||||
but_PConj = ss "pero" ;
|
||||
by8agent_Prep = mkPrep "por" ;
|
||||
by8means_Prep = mkPrep "por" ;
|
||||
can8know_VV = mkVV (verboV (saber_71 "saber")) ;
|
||||
can_VV = mkVV (verboV (poder_58 "poder")) ;
|
||||
during_Prep = mkPrep "durante" ; ----
|
||||
either7or_DConj = {s1,s2 = "o" ; n = Sg} ;
|
||||
everybody_NP = makeNP ["todos"] Masc Pl ;
|
||||
every_Det = {s = \\_,_ => "cada" ; n = Sg} ;
|
||||
everything_NP = pn2np (mkPN ["todo"] Masc) ;
|
||||
everywhere_Adv = ss ["en todas partes"] ;
|
||||
few_Det = {s = \\g,c => prepCase c ++ genForms "pocos" "pocas" ! g ; n = Pl} ;
|
||||
--- first_Ord = {s = \\ag => (regA "primero").s ! Posit ! AF ag.g ag.n} ;
|
||||
for_Prep = mkPrep "por" ;
|
||||
from_Prep = complGen ; ---
|
||||
he_Pron =
|
||||
mkPronoun
|
||||
"el" "lo" "le" "él"
|
||||
"su" "su" "sus" "sus"
|
||||
Masc Sg P3 ;
|
||||
here_Adv = mkAdv "aquí" ; -- acá
|
||||
here7to_Adv = mkAdv ["para acá"] ;
|
||||
here7from_Adv = mkAdv ["de acá"] ;
|
||||
how_IAdv = ss "como" ;
|
||||
how8many_IDet =
|
||||
{s = \\g,c => prepCase c ++ genForms "cuantos" "cuantas" ! g ; n = Pl} ;
|
||||
if_Subj = ss "si" ** {m = Indic} ;
|
||||
in8front_Prep = {s = "delante" ; c = MorphoSpa.genitive ; isDir = False} ;
|
||||
i_Pron =
|
||||
mkPronoun
|
||||
"yo" "me" "me" "mí"
|
||||
"mi" "mi" "mis" "mis"
|
||||
Masc Sg P1 ;
|
||||
in_Prep = mkPrep "en" ;
|
||||
it_Pron =
|
||||
mkPronoun
|
||||
"el" "lo" "le" "él"
|
||||
"su" "su" "sus" "sus"
|
||||
Masc Sg P3 ;
|
||||
less_CAdv = ss "meno" ; ----
|
||||
many_Det = {s = \\g,c => prepCase c ++ genForms "muchos" "muchas" ! g ; n = Pl} ;
|
||||
more_CAdv = ss "mas" ;
|
||||
most_Predet = {s = \\_,c => prepCase c ++ ["la mayor parte"] ; c = CPrep P_de} ;
|
||||
much_Det = {s = \\g,c => prepCase c ++ genForms "mucho" "mucha" ! g ; n = Sg} ;
|
||||
must_VV = mkVV (verboV (deber_6 "deber")) ;
|
||||
no_Utt = ss "no" ;
|
||||
on_Prep = mkPrep "sobre" ;
|
||||
--- one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ;
|
||||
only_Predet = {s = \\_,c => prepCase c ++ "solamente" ; c = Nom} ;
|
||||
or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ;
|
||||
otherwise_PConj = ss "otramente" ;
|
||||
part_Prep = complGen ;
|
||||
please_Voc = ss ["por favor"] ;
|
||||
possess_Prep = complGen ;
|
||||
quite_Adv = ss "bastante" ;
|
||||
she_Pron =
|
||||
mkPronoun
|
||||
"ella" "la" "le" "ella"
|
||||
"su" "su" "sus" "sus"
|
||||
Fem Sg P3 ;
|
||||
so_AdA = ss "tanto" ;
|
||||
somebody_NP = pn2np (mkPN ["algún"] Masc) ;
|
||||
somePl_Det = {s = \\g,c => prepCase c ++ genForms "algunos" "algunas" ! g ; n = Pl} ;
|
||||
someSg_Det = {s = \\g,c => prepCase c ++ genForms "algun" "alguna" ! g ; n = Sg} ;
|
||||
something_NP = pn2np (mkPN ["algo"] Masc) ;
|
||||
somewhere_Adv = ss ["en ninguna parte"] ;
|
||||
that_Quant = {
|
||||
s = table {
|
||||
Sg => \\g,c => prepCase c ++ genForms "ese" "esa" ! g ;
|
||||
Pl => \\g,c => prepCase c ++ genForms "esos" "esas" ! g
|
||||
}
|
||||
} ;
|
||||
there_Adv = mkAdv "allí" ; -- allá
|
||||
there7to_Adv = mkAdv ["para allá"] ;
|
||||
there7from_Adv = mkAdv ["de allá"] ;
|
||||
therefore_PConj = ss ["por eso"] ;
|
||||
they_Pron = mkPronoun
|
||||
"ellos" "los" "les" "ellos"
|
||||
"su" "su" "sus" "sus"
|
||||
Masc Pl P3 ;
|
||||
this_Quant = {
|
||||
s = table {
|
||||
Sg => \\g,c => prepCase c ++ genForms "este" "esta" ! g ;
|
||||
Pl => \\g,c => prepCase c ++ genForms "estos" "estas" ! g
|
||||
}
|
||||
} ;
|
||||
through_Prep = mkPrep "por" ;
|
||||
too_AdA = ss "demasiado" ;
|
||||
to_Prep = complDat ;
|
||||
under_Prep = mkPrep "bajo" ;
|
||||
very_AdA = ss "muy" ;
|
||||
want_VV = mkVV (verboV (querer_64 "querer")) ;
|
||||
we_Pron =
|
||||
mkPronoun
|
||||
"nosotros" "nos" "nos" "nosotros"
|
||||
"nuestro" "nuestra" "nuestros" "nuestras"
|
||||
Masc Pl P1 ;
|
||||
whatSg_IP = {s = \\c => prepCase c ++ ["qué"] ; a = aagr Masc Sg} ;
|
||||
whatPl_IP = {s = \\c => prepCase c ++ ["qué"] ; a = aagr Masc Pl} ; ---
|
||||
when_IAdv = ss "cuando" ;
|
||||
when_Subj = ss "cuando" ** {m = Indic} ;
|
||||
where_IAdv = ss "donde" ;
|
||||
which_IQuant = {s = table {
|
||||
Sg => \\g,c => prepCase c ++ "qué" ; --- cual
|
||||
Pl => \\g,c => prepCase c ++ "qué"
|
||||
}
|
||||
} ;
|
||||
whoPl_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Masc Pl} ;
|
||||
whoSg_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Masc Sg} ;
|
||||
why_IAdv = ss "porqué" ;
|
||||
without_Prep = mkPrep "sin" ;
|
||||
with_Prep = mkPrep "con" ;
|
||||
yes_Utt = ss "sí" ;
|
||||
youSg_Pron = mkPronoun
|
||||
"tu" "te" "te" "tí"
|
||||
"tu" "tu" "tus" "tus"
|
||||
Masc Sg P2 ;
|
||||
youPl_Pron =
|
||||
mkPronoun
|
||||
"vosotros" "vos" "vos" "vosotros"
|
||||
"vuestro" "vuestra" "vuestros" "vuestras"
|
||||
Masc Pl P2 ;
|
||||
youPol_Pron =
|
||||
mkPronoun
|
||||
"usted" "la" "le" "usted"
|
||||
"su" "su" "sus" "sus"
|
||||
Masc Sg P3 ;
|
||||
|
||||
oper
|
||||
etConj : {s : Str ; n : MorphoSpa.Number} = {s = pre {
|
||||
"y" ;
|
||||
"y" / strs {"ya" ; "ye" ; "yo" ; "yu"} ;
|
||||
"e" / strs {"i" ; "hi" ; "y"}
|
||||
}} ** {n = Pl} ;
|
||||
|
||||
}
|
||||
|
||||
11
lib/resource-1.4/spanish/TextSpa.gf
Normal file
11
lib/resource-1.4/spanish/TextSpa.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
concrete TextSpa of Text = CommonX - [Tense,TPres,TPast,TFut,TCond] ** {
|
||||
|
||||
-- This works for the special punctuation marks of Spanish.
|
||||
|
||||
lin
|
||||
TEmpty = {s = []} ;
|
||||
TFullStop x xs = {s = x.s ++ "." ++ xs.s} ;
|
||||
TQuestMark x xs = {s = "¿" ++ x.s ++ "?" ++ xs.s} ;
|
||||
TExclMark x xs = {s = "¡" ++ x.s ++ "!" ++ xs.s} ;
|
||||
|
||||
}
|
||||
2
lib/resource-1.4/spanish/VerbSpa.gf
Normal file
2
lib/resource-1.4/spanish/VerbSpa.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete VerbSpa of Verb = CatSpa ** VerbRomance with
|
||||
(ResRomance = ResSpa) ;
|
||||
Reference in New Issue
Block a user