mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-06-02 14:48:54 -06:00
resource = resource-1.0
This commit is contained in:
234
lib/resource-0.9/spanish/BasicSpa.gf
Normal file
234
lib/resource-0.9/spanish/BasicSpa.gf
Normal file
@@ -0,0 +1,234 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete BasicSpa of Basic = CategoriesSpa ** open ParadigmsSpa, BeschSpa in {
|
||||
|
||||
-- words contributed by Ana Bove, May 2005
|
||||
---- TO CHECK: verb conjugations marked ----V
|
||||
|
||||
flags
|
||||
startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||
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_ADeg = prefADeg (mkADeg (regA "malo") (regA "peor")) ;
|
||||
bank_N = regN "banco" ;
|
||||
beautiful_ADeg = prefADeg (regADeg "bello") ; -- bella
|
||||
become_VA = regV "conventir" ; --- convertirse en, volverse, ponerse
|
||||
beer_N = regN "cerveza" ;
|
||||
beg_V2V = mkV2V (regV "rogar") accusative dative ; -- pedir
|
||||
big_ADeg = prefADeg (regADeg "grande") ;
|
||||
bike_N = regN "bicicleta" ;
|
||||
bird_N = regN "pájaro" ;
|
||||
black_ADeg = regADeg "negro" ; -- negra
|
||||
blue_ADeg = 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_ADeg = regADeg "ancho" ;
|
||||
brother_N2 = deN2 (regN "hermano") ;
|
||||
brown_ADeg = 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_ADeg = regADeg "limpio" ;
|
||||
clever_ADeg = regADeg "inteligente" ;
|
||||
close_V2 = dirV2 (regV "cerrar") ;
|
||||
coat_N = regN "abrigo" ;
|
||||
cold_ADeg = 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_ADeg = 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_ADeg = 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_ADeg = prefADeg (mkADeg (regA "bueno") (regA "mejor")) ; ---- adv?
|
||||
go_V = (verboV (ir_46 "ir")) ;
|
||||
green_ADeg = 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_ADeg = regADeg "caliente" ;
|
||||
house_N = regN "casa" ;
|
||||
important_ADeg = 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_ADeg = 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_ADeg = regADeg "estrecho" ;
|
||||
new_ADeg = prefADeg (regADeg "nuevo") ;
|
||||
newspaper_N = regN "periódico" ; -- diario
|
||||
oil_N = regN "aceite" ;
|
||||
old_ADeg = prefADeg (regADeg "viejo") ;
|
||||
open_V2 = dirV2 (special_ppV (regV "abrir") "abierto") ;
|
||||
paint_V2A = mkV2A (regV "pintar") accusative ;
|
||||
paper_N = regN "papel" ;
|
||||
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_ADeg = 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_ADeg = regADeg "corto" ; --- breve
|
||||
silver_N = regN "plata" ;
|
||||
sister_N = regN "hermana" ;
|
||||
sleep_V = verboV (dormir_35 "dormir") ;
|
||||
small_ADeg = prefADeg (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_ADeg = 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_ADeg = regADeg "grueso" ;
|
||||
thin_ADeg = regADeg "fino" ; -- delgado
|
||||
train_N = regN "tren" ;
|
||||
travel_V = regV "viajar" ;
|
||||
tree_N = regN "árbol" ;
|
||||
--- trousers_N = regN "pantalón" ; -- masc
|
||||
ugly_ADeg = 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_ADeg = regADeg "tibio" ;
|
||||
war_N = regN "guerra" ;
|
||||
watch_V2 = dirV2 (regV "mirar") ; -- ver
|
||||
water_N = mascN (regN "agua") ;
|
||||
white_ADeg = compADeg (regA "blanco") ;
|
||||
window_N = regN "ventana" ;
|
||||
wine_N = regN "vino" ;
|
||||
win_V2 = dirV2 (regV "ganar") ;
|
||||
woman_N = femN (regN "mujer") ;
|
||||
wonder_VQ = mkVQ (regV "preguntar") ; ---- preguntarse
|
||||
wood_N = regN "madera" ;
|
||||
write_V2 = dirV2 (special_ppV (regV "escribir") "escrito") ;
|
||||
yellow_ADeg = regADeg "amarillo" ;
|
||||
young_ADeg = prefADeg (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" ;
|
||||
here_Adv = mkAdv "aquí" ; -- acá
|
||||
here7to_Adv = mkAdv ["para acá"] ;
|
||||
here7from_Adv = mkAdv ["de acá"] ;
|
||||
there_Adv = mkAdv "allí" ; -- allá
|
||||
there7to_Adv = mkAdv ["para allá"] ;
|
||||
there7from_Adv = mkAdv ["de allá"] ;
|
||||
|
||||
} ;
|
||||
5760
lib/resource-0.9/spanish/BeschSpa.gf
Normal file
5760
lib/resource-0.9/spanish/BeschSpa.gf
Normal file
File diff suppressed because it is too large
Load Diff
4
lib/resource-0.9/spanish/CategoriesSpa.gf
Normal file
4
lib/resource-0.9/spanish/CategoriesSpa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete CategoriesSpa of Categories =
|
||||
CategoriesRomance with (SyntaxRomance=SyntaxSpa) ;
|
||||
4
lib/resource-0.9/spanish/ClauseSpa.gf
Normal file
4
lib/resource-0.9/spanish/ClauseSpa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete ClauseSpa of Clause = CategoriesSpa **
|
||||
ClauseRomance with (SyntaxRomance=SyntaxSpa) ;
|
||||
25
lib/resource-0.9/spanish/CountrySpa.gf
Normal file
25
lib/resource-0.9/spanish/CountrySpa.gf
Normal file
@@ -0,0 +1,25 @@
|
||||
concrete CountrySpa of Country = open CategoriesSpa, ParadigmsSpa in {
|
||||
|
||||
lincat
|
||||
Country = PN ;
|
||||
Nationality = A ;
|
||||
Language = N ;
|
||||
|
||||
lin
|
||||
Denmark = mkPN "Dinamarca" feminine ;
|
||||
England = mkPN "Inglaterra" feminine ;
|
||||
Finland = mkPN "Finlandia" feminine ;
|
||||
France = mkPN "Francia" feminine ;
|
||||
Germany = mkPN "Germania" feminine ;
|
||||
Italy = mkPN "Italia" feminine ;
|
||||
Norway = mkPN "Noruega" feminine ;
|
||||
Russia = mkPN "Rusia" feminine ;
|
||||
Spain = mkPN "España" feminine ;
|
||||
Sweden = mkPN "Suecia" feminine ;
|
||||
|
||||
Danish = regA "danés" ;
|
||||
English = regA "inglés" ;
|
||||
|
||||
DanishLang = regN "danés" ;
|
||||
EnglishLang = regN "inglés" ;
|
||||
} ;
|
||||
23
lib/resource-0.9/spanish/LangSpa.gf
Normal file
23
lib/resource-0.9/spanish/LangSpa.gf
Normal file
@@ -0,0 +1,23 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete LangSpa of Lang =
|
||||
RulesSpa,
|
||||
ClauseSpa,
|
||||
StructuralSpa,
|
||||
BasicSpa,
|
||||
TimeSpa,
|
||||
CountrySpa,
|
||||
MathSpa
|
||||
|
||||
** open Prelude, ParadigmsSpa in {
|
||||
|
||||
lin
|
||||
AdvDate d = prefixSS "el" d ;
|
||||
AdvTime t = prefixSS ["a las"] t ;
|
||||
NWeekday w = w ;
|
||||
PNWeekday w = mkPN (w.s ! singular) w.g ;
|
||||
|
||||
PNCountry x = x ;
|
||||
ANationality x = x ;
|
||||
NLanguage x = x ;
|
||||
}
|
||||
4
lib/resource-0.9/spanish/MathSpa.gf
Normal file
4
lib/resource-0.9/spanish/MathSpa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete MathSpa of Math = CategoriesSpa **
|
||||
MathRomance with (SyntaxRomance=SyntaxSpa) ;
|
||||
211
lib/resource-0.9/spanish/MorphoSpa.gf
Normal file
211
lib/resource-0.9/spanish/MorphoSpa.gf
Normal file
@@ -0,0 +1,211 @@
|
||||
--# -path=.:../romance:../../prelude
|
||||
|
||||
--1 A Simple Spanish Resource Morphology
|
||||
--
|
||||
-- Aarne Ranta 2002--2003
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. It moreover contains the most usual inflectional patterns.
|
||||
-- The patterns for verbs contain the complete "Bescherelle" conjugation
|
||||
-- tables.
|
||||
--
|
||||
-- We use the parameter types and word classes defined in $TypesSpa.gf$.
|
||||
|
||||
resource MorphoSpa = open (Predef=Predef), Prelude, TypesSpa, BeschSpa in {
|
||||
|
||||
--2 Some phonology
|
||||
--
|
||||
--3 Elision
|
||||
--
|
||||
-- The phonological rule of *elision* can be defined as follows in GF.
|
||||
-- In Italian it includes both vowels and the *impure 's'*.
|
||||
|
||||
oper
|
||||
vocale : Strs = strs {
|
||||
"a" ; "e" ; "h" ; "i" ; "o" ; "u"
|
||||
} ;
|
||||
|
||||
elisQue = "que" ; --- no elision in Italian
|
||||
elisDe = "de" ;
|
||||
|
||||
--2 Nouns
|
||||
--
|
||||
-- The following macro is useful for creating the forms of number-dependent
|
||||
-- tables, such as common nouns.
|
||||
|
||||
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.
|
||||
|
||||
mkCNom : (Number => Str) -> Gender -> CNom = \mecmecs,gen ->
|
||||
{s = mecmecs ; g = gen} ;
|
||||
|
||||
mkCNomIrreg : Str -> Str -> Gender -> CNom = \mec,mecs ->
|
||||
mkCNom (numForms mec mecs) ;
|
||||
|
||||
mkNomReg : Str -> CNom = \mec ->
|
||||
case last mec of {
|
||||
"o" | "e" => mkCNom (nomVino mec) Masc ;
|
||||
"a" => mkCNom (nomVino mec) Fem ;
|
||||
"z" => mkCNomIrreg mec (init mec + "ces") Fem ;
|
||||
_ => mkCNom (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) ->
|
||||
PronGen -> Number -> Person -> ClitType -> Pronoun =
|
||||
\il,le,lui,Lui,son,sa,ses,see,g,n,p,c ->
|
||||
{s = table {
|
||||
Ton Nom => il ;
|
||||
Ton x => prepCase x ++ Lui ;
|
||||
Aton Nom => il ; ---- [] ;
|
||||
Aton Acc => le ;
|
||||
---- Aton (CPrep P_de) => "ne" ; --- hmm
|
||||
Aton (CPrep P_a) => lui ;
|
||||
Aton (CPrep q) => strPrep q ++ Lui ; ---- GF bug with c or p!
|
||||
Poss Sg Masc => son ;
|
||||
Poss Sg Fem => sa ;
|
||||
Poss Pl Masc => ses ;
|
||||
Poss Pl Fem => see
|
||||
} ;
|
||||
g = g ;
|
||||
n = n ;
|
||||
p = p ;
|
||||
c = c
|
||||
} ;
|
||||
|
||||
-- used in constructions like "(no) hay ..."
|
||||
|
||||
pronEmpty : Number -> Pronoun = \n -> mkPronoun
|
||||
[]
|
||||
[]
|
||||
[]
|
||||
[]
|
||||
[] [] [] []
|
||||
(PGen Masc)
|
||||
n
|
||||
P3
|
||||
Clit2 ;
|
||||
|
||||
--2 Reflexive pronouns
|
||||
--
|
||||
-- It is simply a function depending on number and person.
|
||||
|
||||
pronRefl : Number -> Person -> Str = \n,p -> case <n,p> of {
|
||||
<Sg,P1> => "me" ;
|
||||
<Sg,P2> => "te" ;
|
||||
<_, P3> => "se" ;
|
||||
<Pl,P1> => "nos" ;
|
||||
<Pl,P2> => "vos"
|
||||
} ;
|
||||
|
||||
|
||||
--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 ;
|
||||
|
||||
qualPron : Gender -> Number -> Str = pronForms (adjUtil "cuál" "cuales") ;
|
||||
|
||||
talPron : Gender -> Number -> Str = pronForms (adjUtil "tál" "tales") ;
|
||||
|
||||
tuttoPron : Gender -> Number -> Str = pronForms (adjSolo "todo") ;
|
||||
|
||||
--2 Articles
|
||||
--
|
||||
-- The definite article has quite some variation: three parameters and
|
||||
-- elision. This is the simples definition we have been able to find.
|
||||
|
||||
artDefTable : 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"
|
||||
} ;
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
--3 The Bescherelle conjugations.
|
||||
--
|
||||
-- The following conjugations tables were generated using FM software
|
||||
-- from a Haskell source.
|
||||
--
|
||||
-- The verb "essere" is often used in syntax.
|
||||
|
||||
verbSer = verbPres (ser_7 "ser") AHabere ;
|
||||
verbHaber = verbPres (haber_10 "haber") AHabere ;
|
||||
|
||||
-- for bw compatibility
|
||||
|
||||
ser_7 : Str -> Verbum = ser_1 ;
|
||||
haber_10 : Str -> Verbum = haber_3 ;
|
||||
|
||||
-- for Numerals
|
||||
|
||||
param DForm = unit | teen | ten | hundred ;
|
||||
param Modif = mod | unmod | conj ;
|
||||
|
||||
oper spl : Str -> {s : Gender => Str ; n : Number} = \s -> {s = \\_ =>
|
||||
s ; n = Pl} ;
|
||||
|
||||
uno : Gender => Str = table {Masc => "uno" ; Fem => "una"} ;
|
||||
yuno : Gender => Str = \\g => "y" ++ uno ! g ;
|
||||
|
||||
}
|
||||
66
lib/resource-0.9/spanish/NumeralsSpa.gf
Normal file
66
lib/resource-0.9/spanish/NumeralsSpa.gf
Normal file
@@ -0,0 +1,66 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete NumeralsSpa of Numerals = open TypesSpa, MorphoSpa in {
|
||||
|
||||
-- by Carlos Gonzalia, Chalmers, 1999
|
||||
-- original source automatically translated to new GF by AR
|
||||
-- modified by addition of gender and number 30/3/2005
|
||||
|
||||
lincat Numeral = {s : Gender => Str ; n : Number} ;
|
||||
lincat Digit = {inh : Modif ; s : {p1 : DForm ; p2 : Modif} => Str} ;
|
||||
lincat Sub10 = {s : {p1 : DForm ; p2 : Modif} => Gender => Str ; n : Number} ;
|
||||
lincat Sub100 = {s : Gender => Str ; n : Number} ;
|
||||
lincat Sub1000 = {s : Gender => Str ; n : Number} ;
|
||||
lincat Sub1000000 = {s : Gender => Str ; n : Number} ;
|
||||
|
||||
lin num x0 = x0 ;
|
||||
|
||||
lin n2 =
|
||||
{inh = mod ; s = table {{p1 = unit ; p2 = mod} => "dos" ; {p1 = unit ; p2 = unmod} => "dos" ; {p1 = unit ; p2 = conj} => "y" ++ "dos" ; {p1 = teen ; p2 = mod} => "doce" ; {p1 = teen ; p2 = unmod} => "doce" ; {p1 = teen ; p2 = conj} => "doce" ; {p1 = ten ; p2 = mod} => "veinti" ; {p1 = ten ; p2 = unmod} => "veinte" ; {p1 = ten ; p2 = conj} => "veinte" ; {p1 = hundred ; p2 = mod} => "doscientos" ; {p1 = hundred ; p2 = unmod} => "doscientos" ; {p1 = hundred ; p2 = conj} => "doscientos"}} ;
|
||||
lin n3 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "tres" ; {p1 = unit ; p2 = unmod} => "tres" ; {p1 = unit ; p2 = conj} => "y" ++ "tres" ; {p1 = teen ; p2 = mod} => "trece" ; {p1 = teen ; p2 = unmod} => "trece" ; {p1 = teen ; p2 = conj} => "trece" ; {p1 = ten ; p2 = mod} => "treinta" ; {p1 = ten ; p2 = unmod} => "treinta" ; {p1 = ten ; p2 = conj} => "treinta" ; {p1 = hundred ; p2 = mod} => "trescientos" ; {p1 = hundred ; p2 = unmod} => "trescientos" ; {p1 = hundred ; p2 = conj} => "trescientos"}} ;
|
||||
lin n4 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "cuatro" ; {p1 = unit ; p2 = unmod} => "cuatro" ; {p1 = unit ; p2 = conj} => "y" ++ "cuatro" ; {p1 = teen ; p2 = mod} => "catorce" ; {p1 = teen ; p2 = unmod} => "catorce" ; {p1 = teen ; p2 = conj} => "catorce" ; {p1 = ten ; p2 = mod} => "cuarenta" ; {p1 = ten ; p2 = unmod} => "cuarenta" ; {p1 = ten ; p2 = conj} => "cuarenta" ; {p1 = hundred ; p2 = mod} => "cuatrocientos" ; {p1 = hundred ; p2 = unmod} => "cuatrocientos" ; {p1 = hundred ; p2 = conj} => "cuatrocientos"}} ;
|
||||
lin n5 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "cinco" ; {p1 = unit ; p2 = unmod} => "cinco" ; {p1 = unit ; p2 = conj} => "y" ++ "cinco" ; {p1 = teen ; p2 = mod} => "quince" ; {p1 = teen ; p2 = unmod} => "quince" ; {p1 = teen ; p2 = conj} => "quince" ; {p1 = ten ; p2 = mod} => "cincuenta" ; {p1 = ten ; p2 = unmod} => "cincuenta" ; {p1 = ten ; p2 = conj} => "cincuenta" ; {p1 = hundred ; p2 = mod} => "quinientos" ; {p1 = hundred ; p2 = unmod} => "quinientos" ; {p1 = hundred ; p2 = conj} => "quinientos"}} ;
|
||||
lin n6 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "seis" ; {p1 = unit ; p2 = unmod} => "seis" ; {p1 = unit ; p2 = conj} => "y" ++ "seis" ; {p1 = teen ; p2 = mod} => "dieciseis" ; {p1 = teen ; p2 = unmod} => "dieciseis" ; {p1 = teen ; p2 = conj} => "dieciseis" ; {p1 = ten ; p2 = mod} => "sesenta" ; {p1 = ten ; p2 = unmod} => "sesenta" ; {p1 = ten ; p2 = conj} => "sesenta" ; {p1 = hundred ; p2 = mod} => "seiscientos" ; {p1 = hundred ; p2 = unmod} => "seiscientos" ; {p1 = hundred ; p2 = conj} => "seiscientos"}} ;
|
||||
lin n7 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "siete" ; {p1 = unit ; p2 = unmod} => "siete" ; {p1 = unit ; p2 = conj} => "y" ++ "siete" ; {p1 = teen ; p2 = mod} => "diecisiete" ; {p1 = teen ; p2 = unmod} => "diecisiete" ; {p1 = teen ; p2 = conj} => "diecisiete" ; {p1 = ten ; p2 = mod} => "setenta" ; {p1 = ten ; p2 = unmod} => "setenta" ; {p1 = ten ; p2 = conj} => "setenta" ; {p1 = hundred ; p2 = mod} => "setecientos" ; {p1 = hundred ; p2 = unmod} => "setecientos" ; {p1 = hundred ; p2 = conj} => "setecientos"}} ;
|
||||
lin n8 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "ocho" ; {p1 = unit ; p2 = unmod} => "ocho" ; {p1 = unit ; p2 = conj} => "y" ++ "ocho" ; {p1 = teen ; p2 = mod} => "dieciocho" ; {p1 = teen ; p2 = unmod} => "dieciocho" ; {p1 = teen ; p2 = conj} => "dieciocho" ; {p1 = ten ; p2 = mod} => "ochenta" ; {p1 = ten ; p2 = unmod} => "ochenta" ; {p1 = ten ; p2 = conj} => "ochenta" ; {p1 = hundred ; p2 = mod} => "ochocientos" ; {p1 = hundred ; p2 = unmod} => "ochocientos" ; {p1 = hundred ; p2 = conj} => "ochocientos"}} ;
|
||||
lin n9 =
|
||||
{inh = conj ; s = table {{p1 = unit ; p2 = mod} => "nueve" ; {p1 = unit ; p2 = unmod} => "nueve" ; {p1 = unit ; p2 = conj} => "y" ++ "nueve" ; {p1 = teen ; p2 = mod} => "diecinueve" ; {p1 = teen ; p2 = unmod} => "diecinueve" ; {p1 = teen ; p2 = conj} => "diecinueve" ; {p1 = ten ; p2 = mod} => "noventa" ; {p1 = ten ; p2 = unmod} => "noventa" ; {p1 = ten ; p2 = conj} => "noventa" ; {p1 = hundred ; p2 = mod} => "novecientos" ; {p1 = hundred ; p2 = unmod} => "novecientos" ; {p1 = hundred ; p2 = conj} => "novecientos"}} ;
|
||||
lin pot01 =
|
||||
{s = table {{p1 = unit ; p2 = mod} => uno ; {p1 = unit ; p2 = unmod}
|
||||
=> uno ; {p1 = unit ; p2 = conj} => yuno ; {p1 = teen ; p2 = mod} =>
|
||||
uno ; {p1 = teen ; p2 = unmod} => uno ; {p1 = teen ; p2 = conj} =>
|
||||
yuno ; {p1 = ten ; p2 = mod} => uno ; {p1 = ten ; p2 = unmod} => uno
|
||||
; {p1 = ten ; p2 = conj} => yuno ; {p1 = hundred ; p2 = mod} =>
|
||||
\\_ => "ciento" ; {p1 = hundred ; p2 = unmod} => \\_ => "cien" ; {p1 = hundred ; p2 = conj} => yuno} ; n = Sg} ;
|
||||
lin pot0 d =
|
||||
{s = \\f,g => d.s ! f ; n = Pl} ;
|
||||
lin pot110 =
|
||||
spl "diez" ;
|
||||
lin pot111 =
|
||||
spl "once" ;
|
||||
lin pot1to19 d =
|
||||
spl (d.s ! {p1 = teen ; p2 = unmod}) ;
|
||||
lin pot0as1 n =
|
||||
{s = n.s ! {p1 = unit ; p2 = unmod} ; n = n.n} ;
|
||||
lin pot1 d =
|
||||
spl (d.s ! {p1 = ten ; p2 = unmod}) ;
|
||||
lin pot1plus d e =
|
||||
{s = \\g => (d.s ! {p1 = ten ; p2 = mod}) ++ e.s ! {p1 = unit ; p2 =
|
||||
d.inh} ! g ; n = Pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d =
|
||||
spl (d.s ! {p1 = hundred ; p2 = unmod} ! Masc) ;
|
||||
lin pot2plus d e =
|
||||
{s = \\g => (d.s ! {p1 = hundred ; p2 = mod}) ! Masc ++ e.s ! g ; n = Pl} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n =
|
||||
spl (n.s ! Masc ++ "mil") ;
|
||||
lin pot3plus n m =
|
||||
{s = \\g => n.s ! Masc ++ "mil" ++ m.s ! g ; n = Pl} ;
|
||||
}
|
||||
368
lib/resource-0.9/spanish/ParadigmsSpa.gf
Normal file
368
lib/resource-0.9/spanish/ParadigmsSpa.gf
Normal file
@@ -0,0 +1,368 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
--1 Spanish Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2005
|
||||
--
|
||||
-- This is an API to the user of the resource grammar
|
||||
-- for adding lexical items. It give shortcuts for forming
|
||||
-- expressions of basic categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $resource.Abs.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoIta.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, not stems, as string
|
||||
-- arguments of the paradigms.
|
||||
--
|
||||
-- The following modules are presupposed:
|
||||
|
||||
resource ParadigmsSpa =
|
||||
open Prelude, (Types = TypesSpa), SyntaxSpa, MorphoSpa, BeschSpa,
|
||||
RulesSpa in {
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
|
||||
oper
|
||||
Bool : Type ;
|
||||
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' "à").
|
||||
|
||||
Preposition : Type ;
|
||||
|
||||
accusative : Preposition ;
|
||||
dative : Preposition ;
|
||||
genitive : Preposition ;
|
||||
|
||||
mkPreposition : Str -> Preposition ;
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Worst case: two forms (singular + plural),
|
||||
-- and the gender.
|
||||
|
||||
mkN : (_,_ : Str) -> Gender -> N ; -- uomo, uomini, masculine
|
||||
|
||||
-- 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.
|
||||
|
||||
regN : Str -> N ;
|
||||
|
||||
-- To force a different gender, use one of the following functions.
|
||||
|
||||
mascN : N -> N ;
|
||||
femN : N -> 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. "numéro de téléphone".
|
||||
-- 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 -> Preposition -> 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 -> Preposition -> Preposition -> 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.
|
||||
|
||||
mkPN : Str -> Gender -> PN ; -- Jean
|
||||
|
||||
-- To form a noun phrase that can also be plural,
|
||||
-- you can use the worst-case function.
|
||||
|
||||
mkNP : Str -> Gender -> Number -> NP ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
-- Non-comparison one-place adjectives need five forms in the worst
|
||||
-- case (masc and fem singular, masc plural, adverbial).
|
||||
|
||||
mkA : (solo,sola,soli,sole, solamente : Str) -> A ;
|
||||
|
||||
-- For regular adjectives, all other forms are derived from the
|
||||
-- masculine singular. The types of adjectives that are recognized are
|
||||
-- "alto", "fuerte", "util".
|
||||
|
||||
regA : Str -> A ;
|
||||
|
||||
-- These functions create postfix adjectives. To switch
|
||||
-- them to prefix ones (i.e. ones placed before the noun in
|
||||
-- modification, as in "petite maison"), the following function is
|
||||
-- provided.
|
||||
|
||||
prefA : A -> A ;
|
||||
|
||||
--3 Two-place adjectives
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Preposition -> A2 ;
|
||||
|
||||
--3 Comparison adjectives
|
||||
|
||||
-- Comparison adjectives are in the worst case put up from two
|
||||
-- adjectives: the positive ("bueno"), and the comparative ("mejor").
|
||||
|
||||
mkADeg : A -> A -> ADeg ;
|
||||
|
||||
-- If comparison is formed by "mas", as usual in Spanish,
|
||||
-- the following pattern is used:
|
||||
|
||||
compADeg : A -> ADeg ;
|
||||
|
||||
-- The regular pattern is the same as $regA$ for plain adjectives,
|
||||
-- with comparison by "mas".
|
||||
|
||||
regADeg : Str -> ADeg ;
|
||||
|
||||
-- From a given $ADeg$, it is possible to get back to $A$.
|
||||
|
||||
adegA : ADeg -> A ;
|
||||
|
||||
-- For prefixed adjectives, the following function is
|
||||
-- provided.
|
||||
|
||||
prefADeg : ADeg -> ADeg ;
|
||||
|
||||
--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
|
||||
--
|
||||
-- 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.
|
||||
|
||||
regV : Str -> V ;
|
||||
|
||||
-- The module $BeschSpa$ gives all the patterns of the "Bescherelle"
|
||||
-- book. To use them in the category $V$, wrap them with the function
|
||||
|
||||
verboV : Verbum -> 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). Notice that a particle comes from the $V$.
|
||||
|
||||
mkV2 : V -> Preposition -> V2 ;
|
||||
|
||||
dirV2 : V -> 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 -> Preposition -> Preposition -> V3 ; -- parler, à, de
|
||||
dirV3 : V -> Preposition -> V3 ; -- donner,_,à
|
||||
dirdirV3 : V -> V3 ; -- donner,_,_
|
||||
|
||||
--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 -> Preposition -> V2S ;
|
||||
mkVV : V -> VV ; -- plain infinitive: "je veux parler"
|
||||
deVV : V -> VV ; -- "j'essaie de parler"
|
||||
aVV : V -> VV ; -- "j'arrive à parler"
|
||||
mkV2V : V -> Preposition -> Preposition -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Preposition -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Preposition -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
subjAS : A -> AS ;
|
||||
mkA2S : A -> Preposition -> A2S ;
|
||||
mkAV : A -> Preposition -> AV ;
|
||||
mkA2V : A -> Preposition -> Preposition -> A2V ;
|
||||
|
||||
|
||||
--2 Definitions of the paradigms
|
||||
--
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
--.
|
||||
|
||||
Bool = Prelude.Bool ;
|
||||
Gender = SyntaxSpa.Gender ;
|
||||
Preposition = SyntaxSpa.Case * Str ;
|
||||
Number = SyntaxSpa.Number ;
|
||||
|
||||
masculine = Masc ;
|
||||
feminine = Fem ;
|
||||
|
||||
accusative = <Types.accusative,[]> ;
|
||||
genitive = <Types.genitive,[]> ;
|
||||
dative = <Types.dative,[]> ;
|
||||
mkPreposition p = <Acc,p> ;
|
||||
|
||||
singular = Types.singular ;
|
||||
plural = Types.plural ;
|
||||
|
||||
mkN x y g = mkCNomIrreg 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 = <> ; c = p.p1 ; s2 = p.p2} ;
|
||||
deN2 n = mkN2 n genitive ;
|
||||
aN2 n = mkN2 n dative ;
|
||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c = p.p1 ; s2 = p.p2 ; c3 = q.p1 ; s3 = q.p2} ;
|
||||
|
||||
mkPN x g = {s = x ; g = g} ** {lock_PN = <>} ;
|
||||
mkNP x g n = let np = mkNameNounPhrase x g in
|
||||
{s = np.s ; g = np.g ; p = np.p ; c = np.c ; n = n ; lock_NP = <>} ;
|
||||
|
||||
mkA a b c d e = mkAdj a b c d e ** {p = False ; lock_A = <>} ;
|
||||
regA a = mkAdjReg a ** {p = False ; lock_A = <>} ;
|
||||
prefA a = {s = a.s ; p = True ; lock_A = <>} ;
|
||||
|
||||
mkA2 a p = a ** {c = p.p1 ; s2 = p.p2 ; lock_A2 = <>} ;
|
||||
|
||||
mkADeg a b = {s = table {Pos => a.s ; _ => b.s} ; p = a.p ; lock_ADeg = <>} ;
|
||||
compADeg a = {s = table {Pos => a.s ; _ => \\f => "mas" ++ a.s ! f} ; p = a.p ;
|
||||
lock_ADeg = <>} ;
|
||||
regADeg a = compADeg (regA a) ;
|
||||
prefADeg a = {s = a.s ; p = True ; lock_ADeg = <>} ;
|
||||
|
||||
adegA a = {s = a.s ! Pos ; p = a.p ; lock_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 verbPres verb AHabere ** {lock_V = <>} ;
|
||||
|
||||
verboV ve = verbPres ve AHabere ** {lock_V = <>} ;
|
||||
|
||||
special_ppV ve pa = {
|
||||
s = table {
|
||||
VPart g n => (adjSolo pa).s ! AF g n ;
|
||||
p => ve.s ! p
|
||||
} ;
|
||||
lock_V = <> ;
|
||||
aux = AHabere
|
||||
} ;
|
||||
|
||||
mkV2 v p = {s = v.s ; aux = v.aux ; s2 = p.p2 ; c = p.p1 ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v accusative ;
|
||||
v2V v = v ** {lock_V = <>} ;
|
||||
|
||||
mkV3 v p q = {s = v.s ; aux = v.aux ;
|
||||
s2 = p.p2 ; s3 = q.p2 ; c = p.p1 ; c3 = q.p1 ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v accusative p ;
|
||||
dirdirV3 v = dirV3 v dative ;
|
||||
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
mkVS v = v ** {mn,mp = Ind ; lock_VS = <>} ; ---- more moods
|
||||
mkV2S v p = mkV2 v p ** {mn,mp = Ind ; lock_V2S = <>} ;
|
||||
mkVV v = v ** {c = accusative.p1 ; lock_VV = <>} ;
|
||||
deVV v = v ** {c = genitive.p1 ; lock_VV = <>} ;
|
||||
aVV v = v ** {c = dative.p1 ; lock_VV = <>} ;
|
||||
mkV2V v p t = mkV2 v p ** {c3 = t.p1 ; s3 = p.p2 ; lock_V2V = <>} ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
||||
|
||||
mkAS v = v ** {mn,mp = Ind ; lock_AS = <>} ; ---- more moods
|
||||
mkA2S v p = mkA2 v p ** {mn,mp = Ind ; 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 = <>} ;
|
||||
|
||||
} ;
|
||||
3
lib/resource-0.9/spanish/ResourceSpa.gf
Normal file
3
lib/resource-0.9/spanish/ResourceSpa.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete ResourceSpa of Resource = RulesSpa, ClauseSpa, StructuralSpa ** {} ;
|
||||
4
lib/resource-0.9/spanish/RulesSpa.gf
Normal file
4
lib/resource-0.9/spanish/RulesSpa.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
concrete RulesSpa of Rules = CategoriesSpa **
|
||||
RulesRomance with (SyntaxRomance=SyntaxSpa) ;
|
||||
95
lib/resource-0.9/spanish/StructuralSpa.gf
Normal file
95
lib/resource-0.9/spanish/StructuralSpa.gf
Normal file
@@ -0,0 +1,95 @@
|
||||
--# -path=.:../romance:../abstract:../../prelude
|
||||
|
||||
|
||||
concrete StructuralSpa of Structural = CategoriesSpa, NumeralsSpa **
|
||||
open SyntaxSpa, MorphoSpa, BeschSpa, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
UseNumeral n = {s = \\g => n.s !g ; n = n.n ; isNo = False} ;
|
||||
|
||||
above_Prep = justPrep "sobre" ;
|
||||
after_Prep = {s = "después" ; c = genitive} ;
|
||||
all8mass_Det = mkDeterminer singular "todo" "toda" ;
|
||||
all_NDet = mkDeterminerNum ["todos los"] ["todas las"] ;
|
||||
almost_Adv = ss "casi" ;
|
||||
although_Subj = ss "benché" ** {m = Con} ;
|
||||
and_Conj = etConj ;
|
||||
because_Subj = ss "porque" ** {m = Ind} ;
|
||||
before_Prep = {s = "antes" ; c = genitive} ;
|
||||
behind_Prep = {s = "detrás" ; c = genitive} ;
|
||||
between_Prep = justPrep "entre" ;
|
||||
both_AndConjD = etetConj ;
|
||||
by8agent_Prep = justPrep "por" ;
|
||||
by8means_Prep = justPrep "por" ;
|
||||
can8know_VV = mkVerbVerbDir (verbPres (saber_71 "saber") AHabere) ;
|
||||
can_VV = mkVerbVerbDir (verbPres (poder_58 "poder") AHabere) ; ----
|
||||
during_Prep = justPrep "durante" ; ----
|
||||
either8or_ConjD = ououConj ;
|
||||
everybody_NP = normalNounPhrase (\\c => prepCase c ++ "todos") Masc Pl ;
|
||||
every_Det = chaqueDet ;
|
||||
everything_NP = mkNameNounPhrase ["todo"] Masc ;
|
||||
everywhere_Adv = ss ["en todas partes"] ;
|
||||
from_Prep = justCase (CPrep P_de) ;
|
||||
he_NP = pronNounPhrase pronIl ;
|
||||
how8many_IDet = mkDeterminer plural "cuántos" "cuántas" ;
|
||||
how_IAdv = commentAdv ;
|
||||
if_Subj = siSubj ;
|
||||
in8front_Prep = {s = "delante" ; c = genitive} ;
|
||||
i_NP = pronNounPhrase pronJe ;
|
||||
in_Prep = justPrep "en" ;
|
||||
it_NP = pronNounPhrase pronIl ;
|
||||
many_Det = mkDeterminer plural "muchos" "muchas" ;
|
||||
most8many_Det = plupartDet ;
|
||||
most_Det = mkDeterminer1 singular (["la mayor parte"] ++ elisDe) ; --- de
|
||||
much_Det = mkDeterminer1 singular "mucho" ;
|
||||
must_VV = mkVerbVerbDir (verbPres (deber_6 "deber") AHabere) ; ----
|
||||
no_Phr = nonPhr ;
|
||||
on_Prep = justPrep "sobre" ; ----
|
||||
or_Conj = ouConj ;
|
||||
otherwise_Adv = ss "otramente" ;
|
||||
part_Prep = justCase genitive ; ---
|
||||
possess_Prep = justCase genitive ;
|
||||
quite_Adv = ss "bastante" ;
|
||||
she_NP = pronNounPhrase pronElle ;
|
||||
so_Adv = ss "tanto" ; ----
|
||||
somebody_NP = mkNameNounPhrase ["algún"] Masc ;
|
||||
some_Det = mkDeterminer singular "algun" "alguna" ;
|
||||
some_NDet = mkDeterminerNum "algunos" "algunas" ;
|
||||
something_NP = mkNameNounPhrase ["algo"] Masc ;
|
||||
somewhere_Adv = ss ["en ninguna parte"] ;
|
||||
that_Det = mkDeterminer singular "ese" "esa" ;
|
||||
that_NP = mkNameNounPhrase ["eso"] Masc ;
|
||||
therefore_Adv = ss ["por eso"] ;
|
||||
these_NDet = mkDeterminerNum "estos" "estas" ;
|
||||
they8fem_NP = pronNounPhrase pronElles ;
|
||||
they_NP = pronNounPhrase pronIls ;
|
||||
this_Det = mkDeterminer singular "este" "esta" ;
|
||||
this_NP = mkNameNounPhrase ["esto"] Masc ;
|
||||
those_NDet = mkDeterminerNum "esos" "esas" ;
|
||||
thou_NP = pronNounPhrase pronTu ;
|
||||
through_Prep = justPrep "por" ;
|
||||
too_Adv = ss "demasiado" ;
|
||||
to_Prep = justCase dative ; ---
|
||||
under_Prep = justPrep "bajo" ;
|
||||
very_Adv = ss "muy" ;
|
||||
want_VV = mkVerbVerbDir (verbPres (querer_64 "querer") AHabere) ; ----
|
||||
we_NP = pronNounPhrase pronNous ;
|
||||
what8one_IP = intPronWhat singular ;
|
||||
what8many_IP = intPronWhat plural ;
|
||||
when_IAdv = quandAdv ;
|
||||
when_Subj = quandSubj ;
|
||||
where_IAdv = ouAdv ;
|
||||
which8many_IDet = mkDeterminerNum "cuales" "cuales" ** {n = Pl} ;
|
||||
which8one_IDet = quelDet ;
|
||||
who8one_IP = intPronWho singular ;
|
||||
who8many_IP = intPronWho plural ;
|
||||
why_IAdv = pourquoiAdv ;
|
||||
without_Prep = justPrep "sin" ;
|
||||
with_Prep = justPrep "con" ;
|
||||
ye_NP = pronNounPhrase pronVous ;
|
||||
yes_Phr = ouiPhr ;
|
||||
you_NP = pronNounPhrase pronVous ;
|
||||
|
||||
}
|
||||
|
||||
248
lib/resource-0.9/spanish/SwadeshLexSpa.gf
Normal file
248
lib/resource-0.9/spanish/SwadeshLexSpa.gf
Normal file
@@ -0,0 +1,248 @@
|
||||
--# -path=.:../abstract:../../prelude:../romance
|
||||
|
||||
concrete SwadeshLexSpa of SwadeshLex = CategoriesSpa
|
||||
** open StructuralSpa, RulesSpa, SyntaxSpa, ParadigmsSpa,
|
||||
BasicSpa, BeschSpa, Prelude in {
|
||||
|
||||
-- words contributed by Ana Bove, May 2005
|
||||
|
||||
lin
|
||||
|
||||
-- Pronouns
|
||||
|
||||
i_NP = i_NP ;
|
||||
thou_NP = thou_NP ;
|
||||
he_NP = he_NP ;
|
||||
we_NP = we_NP ;
|
||||
you_NP = you_NP ;
|
||||
they_NP = they_NP ;
|
||||
who8many_IP = who8many_IP ;
|
||||
who8one_IP = who8one_IP ;
|
||||
what8many_IP = what8many_IP ;
|
||||
what8one_IP = what8one_IP ;
|
||||
|
||||
-- Determiners
|
||||
|
||||
this_Det = this_Det ;
|
||||
that_Det = that_Det ;
|
||||
all_NDet = all_NDet ;
|
||||
many_Det = many_Det ;
|
||||
some_Det = some_Det ;
|
||||
few_Det = mkDeterminer Pl "pocos" "pocas" ;
|
||||
other_Det = mkDeterminer Pl "otros" "otras" ;
|
||||
|
||||
|
||||
-- Adverbs
|
||||
|
||||
here_Adv = here_Adv;
|
||||
there_Adv = there_Adv;
|
||||
where_IAdv = where_IAdv;
|
||||
when_IAdv = when_IAdv;
|
||||
how_IAdv = how_IAdv;
|
||||
|
||||
-- not : Adv ; -- ?
|
||||
|
||||
-- Conjunctions
|
||||
|
||||
and_Conj = and_Conj ;
|
||||
|
||||
-- Prepositions
|
||||
|
||||
at_Prep = justCase dative.p1 ;
|
||||
in_Prep = StructuralSpa.in_Prep ;
|
||||
with_Prep = StructuralSpa.with_Prep ;
|
||||
|
||||
-- Numerals
|
||||
|
||||
one_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))) ;
|
||||
two_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))) ;
|
||||
three_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3))))) ;
|
||||
four_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n4))))) ;
|
||||
five_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))) ;
|
||||
|
||||
|
||||
-- Adjectives
|
||||
|
||||
bad_ADeg = bad_ADeg ;
|
||||
big_ADeg = big_ADeg ;
|
||||
black_ADeg = black_ADeg ;
|
||||
cold_ADeg = cold_ADeg ;
|
||||
correct_ADeg = regADeg "correcto" ;
|
||||
dirty_ADeg = dirty_ADeg ;
|
||||
dry_ADeg = regADeg "seco" ;
|
||||
dull_ADeg = regADeg "desafilado" ;
|
||||
far_ADeg = regADeg "lejos" ; ----?
|
||||
full_ADeg = regADeg "lleno" ;
|
||||
good_ADeg = good_ADeg ;
|
||||
green_ADeg = green_ADeg ;
|
||||
heavy_ADeg = regADeg "pesado" ;
|
||||
long_ADeg = long_ADeg ;
|
||||
narrow_ADeg = narrow_ADeg ;
|
||||
near_ADeg = regADeg "cerca" ;
|
||||
new_ADeg = new_ADeg ;
|
||||
old_ADeg = old_ADeg ;
|
||||
red_ADeg = red_ADeg ;
|
||||
rotten_ADeg = regADeg "podrido" ;
|
||||
round_ADeg = regADeg "redondo" ;
|
||||
sharp_ADeg = regADeg "filoso" ; -- afilado, puntiagudo
|
||||
short_ADeg = short_ADeg ;
|
||||
small_ADeg = small_ADeg ;
|
||||
smooth_ADeg = regADeg "liso" ; -- suave
|
||||
straight_ADeg = regADeg "directo" ;
|
||||
thick_ADeg = thick_ADeg ;
|
||||
thin_ADeg = thin_ADeg ;
|
||||
warm_ADeg = warm_ADeg ;
|
||||
wet_ADeg = regADeg "mojado" ;
|
||||
white_ADeg = white_ADeg ;
|
||||
wide_ADeg = regADeg "ancho" ; -- extenso
|
||||
yellow_ADeg = yellow_ADeg ;
|
||||
|
||||
left_A = regA "izquierda" ;
|
||||
right_A = regA "derecha" ;
|
||||
|
||||
-- Nouns
|
||||
|
||||
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
|
||||
bird_N = bird_N;
|
||||
blood_N = femN (regN "sangre") ;
|
||||
bone_N = regN "hueso" ;
|
||||
breast_N = regN "seno" ; -- pecho
|
||||
child_N = child_N ;
|
||||
cloud_N = femN (regN "nube") ;
|
||||
day_N = mascN (regN "día") ;
|
||||
dog_N = dog_N ;
|
||||
dust_N = regN "polvo" ;
|
||||
ear_N = regN "oreja" ;
|
||||
earth_N = regN "tierra" ;
|
||||
egg_N = regN "huevo" ;
|
||||
eye_N = regN "ojo" ;
|
||||
fat_N = regN "grasa" ;
|
||||
father_N = UseN2 father_N2 ;
|
||||
feather_N = regN "pluma" ;
|
||||
fingernail_N = regN "uña" ;
|
||||
fire_N = regN "fuego" ;
|
||||
fish_N = fish_N ;
|
||||
flower_N = femN (regN "flor") ;
|
||||
fog_N = regN "niebla" ;
|
||||
foot_N = regN "pie" ;
|
||||
forest_N = regN "bosque" ;
|
||||
fruit_N = fruit_N ;
|
||||
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" ;
|
||||
lake_N = lake_N ;
|
||||
leaf_N = regN "hoja" ;
|
||||
leg_N = regN "pierna" ;
|
||||
liver_N = regN "hígado" ;
|
||||
louse_N = regN "piojo" ;
|
||||
man_N = man_N ;
|
||||
meat_N = meat_N ;
|
||||
moon_N = moon_N ;
|
||||
mother_N = UseN2 mother_N2 ;
|
||||
mountain_N = mountain_N ;
|
||||
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" ;
|
||||
river_N = river_N ;
|
||||
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" ;
|
||||
sea_N = sea_N ;
|
||||
seed_N = regN "semilla" ;
|
||||
skin_N = femN (regN "piel") ; -- fem
|
||||
sky_N = regN "cielo" ;
|
||||
smoke_N = regN "humo" ;
|
||||
snake_N = snake_N ;
|
||||
snow_N = femN (regN "nieve") ; -- fem
|
||||
star_N = star_N ;
|
||||
stick_N = mkN "bastón" "bastones" masculine ; -- palo
|
||||
stone_N = stone_N ;
|
||||
sun_N = sun_N ;
|
||||
tail_N = regN "cola" ;
|
||||
tongue_N = regN "lengua" ;
|
||||
tooth_N = regN "diente" ;
|
||||
tree_N = tree_N ;
|
||||
water_N = water_N ;
|
||||
wife_N = regN "esposa" ;
|
||||
wind_N = regN "viento" ;
|
||||
wing_N = regN "ala" ;
|
||||
woman_N = woman_N ;
|
||||
worm_N = regN "gusano" ; -- lombriz (fem)
|
||||
year_N = regN "año" ;
|
||||
|
||||
-- Verbs
|
||||
|
||||
bite_V = verboV (morder_50b "morder") ;
|
||||
blow_V = regV "soplar" ;
|
||||
breathe_V = regV "respirar" ;
|
||||
burn_V = regV "quemar" ;
|
||||
come_V = BasicSpa.come_V ;
|
||||
count_V = verboV (contar_38b "contar") ;
|
||||
cut_V = regV "cortar" ;
|
||||
die_V = BasicSpa.die_V ;
|
||||
dig_V = regV "escarbar" ;
|
||||
drink_V = regV "tomar" ;
|
||||
eat_V = regV "comer" ;
|
||||
fall_V = verboV (caer_20 "caer") ;
|
||||
fear_V = fear_VS ;
|
||||
fight_V = regV "pelear" ;
|
||||
float_V = regV "flotar" ;
|
||||
flow_V = verboV (influir_45 "fluir") ; -- circular
|
||||
fly_V = regV "volar" ;
|
||||
freeze_V = regV "congelar" ;
|
||||
give_V = verboV (dar_27 "dar") ;
|
||||
hear_V = hear_V2 ;
|
||||
hit_V = regV "golpear" ; -- pegar
|
||||
hold_V = verboV (tener_4 "tener") ; -- agarrar
|
||||
hunt_V = regV "cazar" ;
|
||||
kill_V = regV "matar" ;
|
||||
know_V = know_V2 ;
|
||||
laugh_V = regV "reir" ; ----V reír_67
|
||||
lie_V = regV "mentir" ; -- "acostarse"
|
||||
live_V = live_V ;
|
||||
play_V = regV "jugar" ;
|
||||
pull_V = regV "tirar" ;
|
||||
push_V = regV "empujar" ;
|
||||
rub_V = regV "resfregar" ; -- frotar
|
||||
say_V = say_VS ;
|
||||
scratch_V = regV "rascar" ;
|
||||
see_V = see_V2 ;
|
||||
sew_V = regV "coser" ;
|
||||
sing_V = regV "cantar" ;
|
||||
sit_V = regV "sentar" ; ----V verboV (sedere_84 "sentarse") ;
|
||||
sleep_V = sleep_V ;
|
||||
smell_V = verboV (oler_52 "oler") ;
|
||||
spit_V = regV "escupir" ;
|
||||
split_V = regV "separar" ; -- dividir, partir
|
||||
squeeze_V = regV "exprimir" ;
|
||||
stab_V = regV "apuñalar" ;
|
||||
stand_V = verboV (estar_2 "estar") ; ---- "estar de pie" ;
|
||||
suck_V = regV "chupar" ;
|
||||
swell_V = regV "tragar" ;
|
||||
swim_V = regV "nadar" ;
|
||||
think_V = regV "pensar" ;
|
||||
throw_V = regV "tirar" ;
|
||||
tie_V = regV "atar" ;
|
||||
turn_V = regV "doblar" ;
|
||||
vomit_V = regV "vomitar" ;
|
||||
walk_V = regV "caminar" ;
|
||||
wash_V = regV "lavar" ;
|
||||
wipe_V = regV "secar" ;
|
||||
}
|
||||
381
lib/resource-0.9/spanish/SyntaxSpa.gf
Normal file
381
lib/resource-0.9/spanish/SyntaxSpa.gf
Normal file
@@ -0,0 +1,381 @@
|
||||
--# -path=.:../romance:../../prelude
|
||||
|
||||
instance SyntaxSpa of SyntaxRomance =
|
||||
TypesSpa ** open Prelude, (CO=Coordination), MorphoSpa, BeschSpa in {
|
||||
oper
|
||||
nameNounPhrase = \jean ->
|
||||
normalNounPhrase
|
||||
(\\c => prepCase c ++ jean.s)
|
||||
jean.g
|
||||
Sg ;
|
||||
|
||||
nounPhraseOn = mkNameNounPhrase "se" Masc ; --- can be plural dep. on object
|
||||
|
||||
pronImpers : NounPhrase = mkNameNounPhrase [] Masc ;
|
||||
|
||||
partitiveNounPhrase = \n,vino ->
|
||||
normalNounPhrase
|
||||
(table {
|
||||
CPrep P_de => elisDe ++ vino.s ! n ;
|
||||
c => prepCase c ++ artDef vino.g n (CPrep P_de) ++ vino.s ! n
|
||||
}
|
||||
)
|
||||
vino.g
|
||||
n ;
|
||||
|
||||
chaqueDet = mkDeterminer1 Sg "cada" ;
|
||||
tousDet = mkDeterminer Pl ["todos los"] ["todas las"] ; --- gli
|
||||
plupartDet = mkDeterminer1 Pl ["la mayor parte de"] ; --- dei, degli, delle
|
||||
unDet = mkDeterminer Sg artUno artUna ;
|
||||
plDet = mkDeterminer1 Pl [] ; --- dei, degli, delle
|
||||
|
||||
quelDet = mkDeterminer1 Sg "cuál" ; ----
|
||||
|
||||
npGenPoss = \n,ton,mec ->
|
||||
\\c => artDef mec.g n c ++ ton.s ! Poss n mec.g ++ mec.s ! n ; --- mia madre
|
||||
|
||||
npGenPossNum = \nu,ton,mec ->
|
||||
\\c => artDef mec.g Pl c ++ ton.s ! Poss Pl mec.g ++ nu.s ! mec.g ++ mec.s ! Pl ;
|
||||
|
||||
existNounPhrase np =
|
||||
let
|
||||
verbHay =
|
||||
{s = table {
|
||||
VFin (VPres Ind) Sg P3 => "hay" ;
|
||||
v => verbHaber.s ! v
|
||||
} ;
|
||||
aux = verbHaber.aux
|
||||
}
|
||||
in
|
||||
sats2clause (
|
||||
mkSatsObject (pronEmpty Sg) (mkTransVerbCas verbHay accusative) np) ;
|
||||
|
||||
reflPron : Number => Person => NPFormA => Str = \\n,p =>
|
||||
case p of {
|
||||
P3 => table {
|
||||
Ton x => prepCase x ++ "sé" ;
|
||||
Aton _ => "si" ;
|
||||
Poss Sg Masc => "suo" ;
|
||||
Poss Sg Fem => "sua" ;
|
||||
Poss Pl Masc => "suoi" ;
|
||||
Poss Pl _ => "sue"
|
||||
} ;
|
||||
_ => (personPron Masc n p).s
|
||||
} ;
|
||||
|
||||
personPron : Gender -> Number -> Person -> Pronoun = \g,n,p ->
|
||||
case <n,p> of {
|
||||
<Sg,P1> => pronJe ;
|
||||
<Sg,P2> => pronTu ;
|
||||
<Sg,P3> => case g of {
|
||||
Masc => pronIl ;
|
||||
Fem => pronElle
|
||||
} ;
|
||||
<Pl,P1> => pronNous ;
|
||||
<Pl,P2> => pronVous ;
|
||||
<Pl,P3> => case g of {
|
||||
Masc => pronIls ;
|
||||
Fem => pronIls
|
||||
}
|
||||
} ;
|
||||
|
||||
{- ----
|
||||
existNounPhrase = \delvino -> {
|
||||
s = \\m =>
|
||||
case m of {
|
||||
Ind => "hay" ;
|
||||
Con => "haya"
|
||||
} ++ delvino.s ! stressed accusative
|
||||
} ;
|
||||
-}
|
||||
|
||||
mkAdjSolo : Str -> Bool -> Adjective = \adj,p ->
|
||||
mkAdjective (adjSolo adj) p ;
|
||||
|
||||
mkAdjUtil : Str -> Str -> Bool -> Adjective = \adj,as,p ->
|
||||
mkAdjective (adjUtil adj as) p ;
|
||||
|
||||
mkAdjDegrSolo : Str -> Bool -> AdjDegr = \adj,p ->
|
||||
mkAdjDegrLong (adjSolo adj) p ;
|
||||
|
||||
mkAdjDegrUtil : Str -> Str -> Bool -> AdjDegr = \adj,as,p ->
|
||||
mkAdjDegrLong (adjUtil adj as) p ;
|
||||
|
||||
comparConj = "que" ;
|
||||
|
||||
-- The commonest case for functions is common noun + "de".
|
||||
|
||||
funGen : CommNounPhrase -> Function = \mere ->
|
||||
mere ** complementCas genitive ;
|
||||
|
||||
-- Chains of "cui" - "cui" do not arise.
|
||||
|
||||
funRelPron = \mere,lequel ->
|
||||
{s = table {
|
||||
RComplex g n c => variants {
|
||||
case mere.c of {
|
||||
CPrep P_de => artDef mere.g n c ++
|
||||
lequel.s ! RSimple dative ++ mere.s ! n ;
|
||||
_ => nonExist} ;
|
||||
artDef mere.g n c ++ mere.s ! n ++
|
||||
mere.s2 ++ lequel.s ! RComplex g n mere.c
|
||||
} ;
|
||||
_ => nonExist
|
||||
} ;
|
||||
g = RG mere.g
|
||||
} ;
|
||||
|
||||
-- Verbs
|
||||
|
||||
negVerb = \va -> "no" ++ va ;
|
||||
|
||||
copula = verbSer ;
|
||||
|
||||
isClitCase = \c -> case c of {
|
||||
Acc => True ;
|
||||
CPrep P_a => True ; -- dative
|
||||
_ => False
|
||||
} ;
|
||||
|
||||
-- Spanish only has one compound auxiliary.
|
||||
|
||||
auxVerb ve = verbHaber ;
|
||||
|
||||
-- The negation of a verb.
|
||||
|
||||
posNeg = \b,v,c ->
|
||||
if_then_else Str b
|
||||
(v ++ c)
|
||||
("no" ++ v ++ c) ;
|
||||
|
||||
embedConj = "que" ;
|
||||
|
||||
-- Relative pronouns
|
||||
|
||||
identRelPron = {
|
||||
s = table {
|
||||
RSimple c => relPronForms ! c ;
|
||||
RComplex g n c => composRelPron g n c
|
||||
} ;
|
||||
g = RNoGen
|
||||
} ;
|
||||
|
||||
suchPron = talPron ;
|
||||
|
||||
composRelPron = ilqualPron ;
|
||||
|
||||
allRelForms = \lequel,g,n,c ->
|
||||
variants {
|
||||
lequel.s ! RSimple c ;
|
||||
lequel.s ! RComplex g n c
|
||||
} ;
|
||||
|
||||
-- Interrogative pronouns
|
||||
|
||||
nounIntPron = \n, mec ->
|
||||
{s = \\c => prepCase c ++ qualPron mec.g n ++ mec.s ! n ;
|
||||
g = mec.g ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
intPronWho = \num -> {
|
||||
s = \\c => prepCase c ++ "quién" ;
|
||||
g = Masc ; --- can we decide this?
|
||||
n = num
|
||||
} ;
|
||||
|
||||
intPronWhat = \num -> {
|
||||
s = table {
|
||||
c => prepCase c ++ "qué"
|
||||
} ;
|
||||
g = Masc ; --- can we decide this?
|
||||
n = num
|
||||
} ;
|
||||
|
||||
-- Questions
|
||||
{- ----
|
||||
questVerbPhrase = \jean,dort ->
|
||||
{s = table {
|
||||
DirQ => (predVerbPhrase jean dort).s ! Ind ;
|
||||
IndirQ => "si" ++ (predVerbPhrase jean dort).s ! Ind
|
||||
}
|
||||
} ;
|
||||
|
||||
existNounPhraseQuest = \delvino ->
|
||||
let cedelvino = (existNounPhrase delvino).s ! Ind
|
||||
in {
|
||||
s = \\m => case m of {DirQ => [] ; _ => "si"} ++ cedelvino
|
||||
} ;
|
||||
|
||||
intSlash = \Qui, Tuvois ->
|
||||
let {qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ; tuvois = Tuvois.s ! Ind} in
|
||||
{s = table {
|
||||
DirQ => qui ++ tuvois ;
|
||||
IndirQ => qui ++ tuvois
|
||||
}
|
||||
} ;
|
||||
-}
|
||||
|
||||
intSlash = \Qui, Tuvois ->
|
||||
{s = \\b,cl =>
|
||||
let
|
||||
qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ;
|
||||
tuvois = Tuvois.s ! b ! cl
|
||||
in
|
||||
table {
|
||||
DirQ => qui ++ tuvois ;
|
||||
IndirQ => qui ++ tuvois
|
||||
}
|
||||
} ;
|
||||
|
||||
---- moved from MorphoIta
|
||||
|
||||
-- A macro for defining gender-dependent tables will be useful.
|
||||
-- Its first application is in the indefinite article.
|
||||
|
||||
genForms = \matto, matta ->
|
||||
table {Masc => matto ; Fem => matta} ;
|
||||
|
||||
artUno : Str = "un" ;
|
||||
artUna : Str = "una" ;
|
||||
|
||||
artIndef = \g,n,c -> case n of {
|
||||
Sg => prepCase c ++ genForms artUno artUna ! g ;
|
||||
_ => prepCase c ++ []
|
||||
} ;
|
||||
|
||||
artDef = \g,n,c -> artDefTable ! g ! n ! c ;
|
||||
|
||||
-- The composable pronoun "il quale" is inflected by varying the definite
|
||||
-- article and the determiner "quale" in the expected way.
|
||||
|
||||
ilqualPron : Gender -> Number -> Case -> Str = \g,n,c ->
|
||||
artDef g n c ++ qualPron g n ;
|
||||
|
||||
pronJe = mkPronoun
|
||||
"yo" --- (variants {"yo" ; []}) etc
|
||||
"me"
|
||||
"me"
|
||||
"mí"
|
||||
"mi" "mi" "mis" "mis"
|
||||
PNoGen -- gender cannot be known from pronoun alone
|
||||
Sg
|
||||
P1
|
||||
Clit1 ;
|
||||
|
||||
pronTu = mkPronoun
|
||||
"tu"
|
||||
"te"
|
||||
"te"
|
||||
"tí"
|
||||
"tu" "tu" "tus" "tus"
|
||||
PNoGen
|
||||
Sg
|
||||
P2
|
||||
Clit1 ;
|
||||
|
||||
pronIl = mkPronoun
|
||||
"el"
|
||||
"lo"
|
||||
"le"
|
||||
"él"
|
||||
"su" "su" "sus" "sus"
|
||||
(PGen Masc)
|
||||
Sg
|
||||
P3
|
||||
Clit2 ;
|
||||
|
||||
pronElle = mkPronoun
|
||||
"ella"
|
||||
"la"
|
||||
"le"
|
||||
"ella"
|
||||
"su" "su" "sus" "sus"
|
||||
(PGen Fem)
|
||||
Sg
|
||||
P3
|
||||
Clit2 ;
|
||||
|
||||
pronNous = mkPronoun
|
||||
"nosotros" ---- nosotras
|
||||
"nos"
|
||||
"nos"
|
||||
"nosotros"
|
||||
"nuestro" "nuestra" "nuestros" "nuestras"
|
||||
(PGen Masc)
|
||||
Pl
|
||||
P1
|
||||
Clit3 ;
|
||||
|
||||
pronVous = mkPronoun
|
||||
"vosotros" ---- vosotras
|
||||
"vos"
|
||||
"vos"
|
||||
"vosotros"
|
||||
"vuestro" "vuestra" "vuestros" "vuestras"
|
||||
(PGen Masc)
|
||||
Pl
|
||||
P2
|
||||
Clit3 ;
|
||||
|
||||
pronIls = mkPronoun
|
||||
"ellos"
|
||||
"los"
|
||||
"les"
|
||||
"ellos"
|
||||
"su" "su" "sus" "sus"
|
||||
(PGen Masc)
|
||||
Pl
|
||||
P3
|
||||
Clit1 ;
|
||||
|
||||
pronElles = mkPronoun
|
||||
"ellas"
|
||||
"las"
|
||||
"les"
|
||||
"ellas"
|
||||
"su" "su" "sus" "sus"
|
||||
(PGen Fem)
|
||||
Pl
|
||||
P3
|
||||
Clit1 ;
|
||||
|
||||
commentAdv = ss "como" ;
|
||||
quandAdv = ss "cuando" ;
|
||||
ouAdv = ss "donde" ;
|
||||
pourquoiAdv = ss "porqué" ;
|
||||
|
||||
-- The forms of "y" and "o" depend on the prefix of the word that
|
||||
-- follows.
|
||||
|
||||
etConj = {s = pre {
|
||||
"y" ;
|
||||
"y" / strs {"ya" ; "ye" ; "yo" ; "yu"} ;
|
||||
"e" / strs {"i" ; "hi" ; "y"}
|
||||
}} ** {n = Pl} ;
|
||||
ouConj = {s = pre {"o" ; "u" / strs {"o" ; "ho"}}} ** {n = Sg} ;
|
||||
|
||||
etetConj = sd2 "y" "y" ** {n = Pl} ;
|
||||
ououConj = sd2 "o" "o" ** {n = Sg} ;
|
||||
niniConj = sd2 "no" "ni" ** {n = Sg} ; ----
|
||||
siSubj = ss "si" ** {m = Ind} ;
|
||||
quandSubj = ss "cuando" ** {m = Ind} ;
|
||||
|
||||
ouiPhr = ss ["Sí ."] ;
|
||||
nonPhr = ss ["No ."] ;
|
||||
|
||||
negNe = "no" ; negPas = [] ;
|
||||
|
||||
progressiveSats subj vp =
|
||||
mkSatsObject subj
|
||||
(mkTransVerbDir (verbPres (estar_2 "estar") AHabere)) --- hack to reuse
|
||||
(nameNounPhrase (mkProperName ( --- this function
|
||||
vp.s ! VIGerund ! (pgen2gen subj.g) ! subj.n ! subj.p) Masc)) ;
|
||||
|
||||
conjunctCase : CaseA -> CaseA = \c -> case c of {
|
||||
CPrep _ => accusative ;
|
||||
_ => c
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
32
lib/resource-0.9/spanish/TimeSpa.gf
Normal file
32
lib/resource-0.9/spanish/TimeSpa.gf
Normal file
@@ -0,0 +1,32 @@
|
||||
concrete TimeSpa of Time = NumeralsSpa **
|
||||
open Prelude, MorphoSpa, CategoriesSpa, ParadigmsSpa in {
|
||||
|
||||
lincat
|
||||
Date = SS ;
|
||||
Weekday = N ;
|
||||
Hour = SS ;
|
||||
Minute = SS ;
|
||||
Time = SS ;
|
||||
|
||||
lin
|
||||
DayDate day = ss (day.s ! singular) ;
|
||||
DayTimeDate day time = ss (day.s ! singular ++ ["a las"] ++ time.s) ; --- a la una
|
||||
|
||||
FormalTime h m = ss (["a las"] ++ h.s ++ "y" ++ m.s) ;
|
||||
PastTime h m = ss (["a las"] ++ h.s ++ "y" ++ h.s) ;
|
||||
ToTime h m = ss (["a las"] ++ h.s ++ "menos" ++ m.s) ;
|
||||
ExactTime h = ss (h.s ++ "exactamente") ;
|
||||
|
||||
NumHour n = ss (n.s ! feminine) ;
|
||||
NumMinute n = ss (n.s ! feminine) ;
|
||||
|
||||
monday = regN "lunes" ;
|
||||
tuesday = regN "martes" ;
|
||||
wednesday = regN "miércoles" ;
|
||||
thursday = regN "jueves" ;
|
||||
friday = regN "viernes" ;
|
||||
saturday = regN "sábado" ;
|
||||
sunday = regN "domingo" ;
|
||||
|
||||
|
||||
} ;
|
||||
161
lib/resource-0.9/spanish/TypesSpa.gf
Normal file
161
lib/resource-0.9/spanish/TypesSpa.gf
Normal file
@@ -0,0 +1,161 @@
|
||||
--1 Spanish Word Classes and Morphological Parameters
|
||||
--
|
||||
-- This is a resource module for Spanish morphology, defining the
|
||||
-- morphological parameters and word classes of Spanish.
|
||||
-- The morphology is so far only
|
||||
-- complete w.r.t. the syntax part of the resource grammar.
|
||||
-- It does not include those parameters that are not needed for
|
||||
-- analysing individual words: such parameters are defined in syntax modules.
|
||||
|
||||
instance TypesSpa of TypesRomance = {
|
||||
|
||||
-- First we give values to the abstract types.
|
||||
|
||||
param
|
||||
Case = Nom | Acc | CPrep Prep ;
|
||||
|
||||
Prep = P_de | P_a ;
|
||||
|
||||
NPForm = Ton Case | Aton Case | Poss Number Gender ;
|
||||
|
||||
--2 Prepositions
|
||||
--
|
||||
-- The type $Case$ in $types.Ita.gf$ has the dative and genitive
|
||||
-- cases, which are relevant for pronouns and the definite article,
|
||||
-- but which are otherwise expressed by prepositions.
|
||||
|
||||
oper
|
||||
prepCase = \c -> case c of {
|
||||
Nom => [] ;
|
||||
Acc => [] ;
|
||||
CPrep p => strPrep p
|
||||
} ;
|
||||
|
||||
strPrep : Prep -> Str = \p -> case p of {
|
||||
P_de => "de" ;
|
||||
P_a => "a"
|
||||
} ;
|
||||
|
||||
prepositional = accusative ;
|
||||
|
||||
oper
|
||||
CaseA = Case ;
|
||||
NPFormA = NPForm ;
|
||||
|
||||
nominative = Nom ;
|
||||
accusative = Acc ;
|
||||
genitive = CPrep P_de ;
|
||||
dative = CPrep P_a ;
|
||||
|
||||
stressed = Ton ;
|
||||
unstressed = Aton ;
|
||||
|
||||
oper
|
||||
pform2case = \p -> case p of {
|
||||
Ton x => x ;
|
||||
Aton x => x ;
|
||||
Poss _ _ => genitive
|
||||
} ;
|
||||
|
||||
case2pform = \c -> case c of {
|
||||
Nom => Aton Nom ;
|
||||
Acc => Aton Acc ;
|
||||
_ => Ton c
|
||||
} ;
|
||||
|
||||
case2pformClit = \c -> case c of {
|
||||
Nom => Aton Nom ;
|
||||
Acc => Aton Acc ;
|
||||
CPrep P_a => Aton c ;
|
||||
_ => Ton c
|
||||
} ;
|
||||
|
||||
-- Comparative adjectives are only sometimes formed morphologically
|
||||
-- (actually: by different morphemes).
|
||||
|
||||
mkAdjComp : (_,_ : AForm => Str) -> AdjComp =
|
||||
\buono, migliore ->
|
||||
{s = table {Pos => buono ; _ => migliore}} ;
|
||||
|
||||
-- Usually the comparison forms are built by prefixing the word
|
||||
-- "mas". The definite article needed in the superlative is provided in
|
||||
-- $syntax.Ita.gf$.
|
||||
|
||||
adjCompLong : Adj -> AdjComp = \caro ->
|
||||
mkAdjComp
|
||||
caro.s
|
||||
(\\gn => "mas" ++ caro.s ! gn) ;
|
||||
|
||||
|
||||
-- Relative pronouns: the case-dependent parameter type.
|
||||
|
||||
param RelForm = RSimple Case | RComplex Gender Number Case ;
|
||||
|
||||
oper RelFormA = RelForm ;
|
||||
|
||||
npRelForm : NPFormA -> RelFormA = \np -> case np of {
|
||||
Ton c => RSimple c ;
|
||||
Aton c => RSimple c ;
|
||||
Poss _ _ => RSimple genitive
|
||||
} ;
|
||||
|
||||
--2 Relative pronouns
|
||||
--
|
||||
-- The simple (atonic) relative pronoun shows genuine variation in all of the
|
||||
-- cases.
|
||||
|
||||
relPronForms = table {
|
||||
Nom | Acc => "que" ;
|
||||
CPrep P_a => "cuyo" ;
|
||||
CPrep p => strPrep p ++ "cuyo"
|
||||
} ;
|
||||
|
||||
-- Verbs: conversion from full verbs to present-tense verbs.
|
||||
|
||||
verbPres = \amare,a -> {s = table {
|
||||
VInfin => amare.s ! VI Infn ;
|
||||
VFin (VPres Ind) n p => amare.s ! VP (Pres Ind n p) ;
|
||||
VFin (VPres Sub) n p => amare.s ! VP (Pres Sub n p) ;
|
||||
VFin (VImperf Ind) n p => amare.s ! VP (Impf Ind n p) ;
|
||||
VFin (VImperf Sub) n p => amare.s ! VP (Impf Sub n p) ;
|
||||
VFin VPasse n p => amare.s ! VP (Pret n p) ;
|
||||
VFin VFut n p => amare.s ! VP (Fut Ind n p) ;
|
||||
VFin VCondit n p => amare.s ! VP (Cond n p) ;
|
||||
VImper SgP2 => amare.s ! VP (Imp Sg P2) ;
|
||||
VImper PlP1 => amare.s ! VP (Imp Pl P1) ;
|
||||
VImper PlP2 => amare.s ! VP (Imp Pl P2) ;
|
||||
VPart g n => amare.s ! VP (Pass n g) ;
|
||||
VGer => amare.s ! VI Ger
|
||||
} ;
|
||||
aux = a
|
||||
} ;
|
||||
|
||||
|
||||
-- The full conjunction is a table on $VForm$:
|
||||
|
||||
param
|
||||
VImpers =
|
||||
Infn
|
||||
| Ger
|
||||
| Part
|
||||
;
|
||||
|
||||
VPers =
|
||||
Pres Mode Number Person
|
||||
| Impf Mode Number Person
|
||||
| Pret Number Person
|
||||
| Fut Mode Number Person
|
||||
| Cond Number Person
|
||||
| Imp Number Person
|
||||
| Pass Number Gender
|
||||
;
|
||||
|
||||
VForm =
|
||||
VI VImpers
|
||||
| VP VPers
|
||||
;
|
||||
|
||||
-- This is the full verb type.
|
||||
|
||||
oper Verbum = {s : VForm => Str} ;
|
||||
}
|
||||
1506
lib/resource-0.9/spanish/fmSpa.gf
Normal file
1506
lib/resource-0.9/spanish/fmSpa.gf
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user