1
0
forked from GitHub/gf-core

spanish and catalan in 1.4

This commit is contained in:
aarne
2008-05-31 19:32:01 +00:00
parent b238539745
commit 41b10c8035
29 changed files with 9887 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
concrete AdjectiveCat of Adjective = CatCat ** AdjectiveRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,2 @@
concrete AdverbCat of Adverb = CatCat ** AdverbRomance with
(ResRomance = ResCat) ;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../common:prelude
concrete CatCat of Cat = CommonX - [Tense,TPres,TPast,TFut,TCond] ** CatRomance with -- JS restore TPast for notpresent
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,7 @@
--# -path=.:../romance:../abstract:../common:prelude
concrete Catalan of CatalanAbs =
LangCat,
IrregCat,
ExtraCat
** {} ;

View File

@@ -0,0 +1,5 @@
abstract CatalanAbs =
Lang,
IrregCatAbs,
ExtraCatAbs
** {} ;

View File

@@ -0,0 +1,2 @@
concrete ConjunctionCat of Conjunction = CatCat ** ConjunctionRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,174 @@
--# -path=.:../romance:../abstract:../common:prelude
instance DiffCat of DiffRomance = open CommonRomance, PhonoCat, BeschCat, 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> => pre {"del" ; ["de l'"] / vocalForta} ;
<Masc,Sg, CPrep P_a> => pre {"al" ; ["a l'"] / vocalForta} ;
<Masc,Sg, _> => elisEl ;
<Fem, Sg, _> => prepCase c ++ elisLa ;
<_, Pl, CPrep P_de> => "dels" ;
<_, Pl, CPrep P_a> => "als" ;
<Masc, Pl, _ > => "els" ;
<Fem, Pl, _ > => "les"
} ;
artIndef = \g,n,c -> case <n,c> of {
<Sg,CPrep P_de> => genForms ["d' un"] ["d' una"] ! g ;
<Pl,CPrep P_de> => genForms ["d' uns"] ["d' unes"] ! g ;
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
<Pl,_> => prepCase c ++ genForms "uns" "unes" ! g
} ;
possCase = \_,_,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) = \_ -> haver_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> of {
<P3,P3> => <"se" ++ paccp.p1, [],True> ;
_ => <pdatp.p1 ++ paccp.p1, [],orB paccp.p3 pdatp.p3>
} ;
--case <p,acc,dat> of {
-- <Sg,P2,CRefl,CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
-- <_,_,CPron {n = Sg ; p = P2},CPron {n = Sg ; p = P1}> => <"te" ++ "me", []> ;
mkImperative _ p vp = { --- politeness
s = \\pol,aag =>
let
agr = aag ** {p = p} ;
verb = case <aag.n, pol> of {
<Sg,Neg> => (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 ; --- JS copied from DiffSpa
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 "tal" "tal" "tals" "tals" ;
quelPron : AAgr => Str = aagrForms "qual" "qual" "quals" "quals" ;
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> of {
<_,Sg,P1> => cases "em" "mí" ;
<_,Sg,P2> => cases "et" "tú" ;
<_,Pl,P1> => cases "ens" "nosaltres" ; --- nosotros
<_,Pl,P2> => cases "us" "vosaltres" ; --- vosotros
<Fem,Sg,P3> => cases3 "la" "li" "ella" ;
<Masc, Sg,P3> => cases3 "el" "li" "ell" ;
<Fem,Pl,P3> => cases3 "les" "les" "elles" ;
<Masc, Pl,P3> => cases3 "els" "els" "ells"
} ;
vRefl : VType = VRefl ;
isVRefl : VType -> Bool = \ty -> case ty of {
VRefl => True ;
_ => False
} ;
auxPassive : Verb = copula ;
copula = verbBeschH (ser_52 "ser") ;
haver_V : Verb = verbBeschH (haver_59 "haver") ;
verbBeschH : Verbum -> Verb = \v -> verbBesch v ** {vtyp = VHabere} ;
}

View File

@@ -0,0 +1,47 @@
concrete ExtraCat of ExtraCatAbs = ExtraRomanceCat **
open CommonRomance, PhonoCat, MorphoCat, ParadigmsCat, ParamX, ResCat in {
-- lin
-- i8fem_Pron = mkPronoun
-- "yo" "me" "me" "mí"
-- "mi" "mi" "mis" "mis"
-- Fem Sg P1 ;
-- these8fem_NP = mkNP ["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 = mkNP ["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 ;
}

View File

@@ -0,0 +1,28 @@
-- Structures special for Catalan. These are not implemented in other
-- Romance languages.
abstract ExtraCatAbs = 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 ;
}

View File

@@ -0,0 +1,2 @@
concrete ExtraRomanceCat of ExtraRomanceAbs = CatCat ** ExtraRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,22 @@
--# -path=.:../romance:../abstract:../common:prelude
concrete GrammarCat of Grammar =
NounCat,
VerbCat,
AdjectiveCat,
AdverbCat,
NumeralCat,
SentenceCat,
QuestionCat,
RelativeCat,
ConjunctionCat,
PhraseCat,
TextX - [Tense,TPres,TPast,TFut,TCond],
IdiomCat,
StructuralCat
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -0,0 +1,24 @@
concrete IdiomCat of Idiom = CatCat **
open MorphoCat, ParadigmsCat, BeschCat, Prelude in {
flags optimize=all_subs ;
lin
ExistNP np = mkClause [] True (agrP3 Masc Sg)
(insertClit2 "hi" (insertComplement (\\_ => np.s ! Ton Acc) (predV haver_V))) ;
GenericCl vp = mkClause "hom" True (agrP3 Masc Sg) vp ;
ImpersCl vp = mkClause [] True (agrP3 Masc Sg) vp ;
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 (verbV (estar_54 "estar"))) ;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
--# -path=.:../romance:../abstract:../common:prelude
concrete LangCat of Lang =
GrammarCat,
LexiconCat
** {
flags startcat = Phr ; unlexer = text ; lexer = text ;
} ;

View File

@@ -0,0 +1,357 @@
--# -path=.:../romance:../common:../abstract:../../prelude
concrete LexiconCat of Lexicon = CatCat ** open
(M=MorphoCat), ParadigmsCat, BeschCat in {
flags
optimize=values ;
oper
regFN : Str -> N = \s -> femN (regN s) ;
regMN : Str -> N = \s -> regN s ;
lin
airplane_N = regMN "avió" ;
answer_V2S = mkV2S (regV "respondre") dative ;
apartment_N = regMN "pis" ;
apple_N = regFN "poma" ;
art_N = regMN "art" ;
-- ask_V2Q = mkV2Q (regV "preguntar") dative ;
baby_N = regMN "nadó" ;
bad_A = mkADeg (regA "dolent") (regA "pitjor") ;
bank_N = regMN "banc" ;
beautiful_A = prefA (regADeg "bell") ;
-- become_VA = reflV (regV "convertir") ; --- convertirse en, volverse, ponerse
beer_N = regFN "cervesa" ;
-- beg_V2V = mkV2V (regV "rogar") accusative dative ; -- pedir
big_A = regADeg "gros" ;
bike_N = regFN "bicicleta" ;
bird_N = regMN "ocell" ;
black_A = regADeg "negre" ;
blue_A = regADeg "blau" ;
boat_N = regFN "barca" ;
book_N = regMN "llibre" ;
boot_N = regFN "bota" ;
boss_N = regMN "cap" ;
boy_N = regMN "noi" ;
bread_N = regMN "pa" ;
break_V2 = dirV2 (regV "trencar") ;
broad_A = regADeg "ample" ;
brother_N2 = deN2 (regMN "germà") ;
brown_A = compADeg (mkA "marró" "marrona" "marrons" "marrones" "marronament") ; --- *
butter_N = regFN "mantega" ;
buy_V2 = dirV2 (regV "comprar") ;
camera_N = regFN "càmara" ; -- ["máquina fotográfica"]
cap_N = regFN "gorra" ;
car_N = regMN "cotxe" ;
carpet_N = regFN "catifa" ;
cat_N = regMN "gat" ; -- gata
ceiling_N = regMN "sostre" ;
chair_N = regFN "cadira" ;
cheese_N = regMN "formatge" ;
child_N = regMN "nen" ; -- nena
church_N = regFN "església" ;
city_N = regFN "ciutat" ;
clean_A = regADeg "net" ;
clever_A = regADeg "inteligent" ;
close_V2 = dirV2 (regV "tancar") ;
coat_N = regMN "abric" ;
cold_A = regADeg "fred" ;
-- come_V = verbV (venir_117 "venir") ;
computer_N = regMN "ordinador" ;
country_N = regMN "país" ; -- masc
cousin_N = regMN "cosí" ;
cow_N = regFN "vaca" ;
-- die_V = verbV (morir_71 "morir") ;
dirty_A = regADeg "brut" ;
distance_N3 = mkN3 (regFN "distància") genitive dative ;
doctor_N = regMN "metge" ; -- médica
dog_N = regMN "gos" ; -- perra
door_N = regFN "porta" ;
-- drink_V2 = dirV2 (regV "tomar") ; -- beber
-- easy_A2V = mkA2V (regA "fácil") dative genitive ;
eat_V2 = dirV2 (regV "menjar") ;
empty_A = compADeg (mkA "buit" "buida" "buits" "buides" "buidament") ;
enemy_N = regMN "enemic" ; -- enemiga
factory_N = regFN "fàbrica" ;
father_N2 = deN2 (regMN "pare") ;
-- fear_VS = mkVS (regV "temer") ;
find_V2 = dirV2 (regV "trobar") ;
fish_N = regMN "peix" ;
floor_N = regMN "terra" ; -- piso
forget_V2 = dirV2 (regV "oblidar") ;
fridge_N = regFN "nevera" ;
friend_N = regMN "amic" ; -- amiga
fruit_N = regFN "fruita" ;
-- fun_AV = mkAV (regA "divertido") genitive ; -- entretenido
garden_N = regMN "jardí" ;
girl_N = regFN "noia" ;
glove_N = regMN "guant" ;
gold_N = regMN "or" ;
good_A = mkADeg (mkA "bó" "bona" "bons" "bones" "bonament") (regA "millor") ; ---- adv?
-- go_V = (verbV (anar_4 "anar")) ;
green_A = regADeg "verd" ;
harbour_N = regMN "port" ;
hate_V2 = dirV2 (regV "odiar") ;
hat_N = regMN "barret" ;
-- have_V2 = dirV2 (verbV (tenir_108 "tenir")) ;
hear_V2 = mkV2 (regV "escoltar") dative ;
hill_N = regMN "turó" ;
hope_VS = mkVS (regV "esperar") ;
horse_N = regMN "cavall" ;
hot_A = regADeg "calent" ;
house_N = regFN "casa" ;
important_A = regADeg "important" ;
industry_N = regFN "indústria" ;
iron_N = regMN "ferro" ;
king_N = regMN "rei" ;
know_V2 = dirV2 (regV "saber") ;
lake_N = regMN "llac" ;
lamp_N = regFN "làmpada" ;
learn_V2 = dirV2 (regV "aprendre") ;
leather_N = regMN "cuiro" ;
leave_V2 = dirV2 (regV "partir") ;
-- like_V2 = dirV2 (regV "agradar") ;
listen_V2 = dirV2 (regV "escoltar") ;
live_V = verbV (viure_119 "viure") ;
long_A = regADeg "llarg" ;
-- lose_V2 = dirV2 (verbV "perdre") ;
love_N = regMN "amor" ;
love_V2 = dirV2 (regV "estimar") ;
man_N = regMN "home" ; -- masc
-- married_A2 = mkA2 (regA "casado") dative ;
meat_N = regFN "carn" ;
milk_N = regFN "llet" ;
moon_N = regFN "lluna" ;
mother_N2 = deN2 (regFN "mare") ; -- fem
mountain_N = regFN "muntanya" ;
music_N = regFN "música" ;
narrow_A = regADeg "estret" ;
new_A = compADeg (mkA "nou" "nova" "nous" "noves" "novament") ;
newspaper_N = regMN "diari" ; -- periòdic
oil_N = regMN "oli" ;
old_A = regADeg "vell" ;
-- open_V2 = dirV2 (special_ppV (regV "abrir") "abierto") ;
-- paint_V2A = mkV2A (regV "pintar") accusative (mkPreposition "en") ;
paper_N = regMN "paper" ;
paris_PN = mkPN "Paris" masculine ;
peace_N = regFN "pau" ;
pen_N = regMN "llapis" ;
planet_N = regMN "planeta" ;
plastic_N = regMN "plàstic" ;
play_V2 = dirV2 (regV "jugar") ;
policeman_N = regMN "policia" ; -- fem refers to the institution
priest_N = regMN "capellà" ; -- masc
probable_AS = mkAS (regA "probable") ;
queen_N = regN "reina" ;
radio_N = regFN "ràdio" ;
-- rain_V0 = mkV0 (verbV (moure_72 "ploure")) ;
-- read_V2 = dirV2 (verbV (servir_101 "llegir")) ;
red_A = regADeg "vermell" ;
religion_N = mkN "religió" "religions" feminine ;
restaurant_N = regMN "restaurant" ;
river_N = regMN "riu" ;
rock_N = regFN "roca" ;
roof_N = regFN "teulada" ;
rubber_N = regFN "goma" ;
-- run_V = regV (verbV (córrer_30 "córrer")) ;
-- say_VS = mkVS (verbV (dir_41 "dir")) ;
school_N = regFN "escola" ;
science_N = regFN "ciència" ;
sea_N = regMN "mar" ; -- masc & fem
-- seek_V2 = dirV2 (regV (trencar_112 "buscar")) ;
-- see_V2 = dirV2 (verbV (veure_118 "veure")) ;
-- sell_V3 = dirV3 (regV (vendre_116 "vendre")) dative ;
send_V3 = dirV3 (regV "enviar") dative ;
sheep_N = regFN "ovella" ; -- xai
ship_N = regMN "vaixell" ;
shirt_N = regFN "camisa" ;
shoe_N = regFN "sabata" ;
shop_N = regFN "botiga" ;
short_A = regADeg "curt" ; --- breu
silver_N = regFN "plata" ;
sister_N = regFN "germana" ;
-- sleep_V = verbV (dormir_44 "dormir") ;
small_A = prefA (regADeg "petit") ;
snake_N = regFN "serp" ; -- fem
sock_N = regMN "mitjó" ;
-- speak_V2 = dirV2 (regV "parlar") ;
star_N = regFN "estrella" ;
steel_N = regMN "acer" ;
stone_N = regFN "pedra" ;
stove_N = regMN "forn" ;
student_N = regN "estudiant" ; -- used both for fem & masc
stupid_A = regADeg "estúpid" ;
sun_N = regMN "sol" ;
-- switch8off_V2 = dirV2 (regV (pregar_86 "apagar")) ;
-- switch8on_V2 = dirV2 (regV (atendre_8 "encendre")) ;
table_N = regFN "taula" ;
-- talk_V3 = mkV3 (regV "parlar") dative genitive ;
teacher_N = regMN "mestre" ; -- mestra
-- teach_V2 = dirV2 (regV "ensenyar") ;
television_N = mkN "televisió" "televisions" feminine ; -- televisor masc
thick_A = compADeg (mkA "gruixut" "gruixuda" "gruixuts" "gruixudes" "gruixudament") ;
thin_A = compADeg (mkA "fi" "fina" "fins" "fines" "finament") ;
train_N = regMN "tren" ;
-- travel_V = regV (envejar_48 "viajar") ;
tree_N = regMN "arbre" ;
--- trousers_N = regN "pantalón" ; -- masc
ugly_A = compADeg (mkA "lleig" "lletja" "lletjos" "lletges" "lletjament") ;
-- understand_V2 = dirV2 (regV (atendre_8 "entendre")) ;
university_N = regFN "universitat" ;
village_N = regMN "poble" ;
-- wait_V2 = mkV2 (regV "esperar") dative ;
-- walk_V = regV "caminar" ;
warm_A = regADeg "tebi" ;
war_N = regFN "guerra" ;
watch_V2 = dirV2 (regV "mirar") ;
water_N = regFN "aigua" ;
white_A = compADeg (mkA "blanc" "blanca" "blancs" "blanques" "blancament") ;
window_N = regFN "finestra" ;
wine_N = regMN "vi" ;
-- win_V2 = dirV2 (regV "guanyar") ;
woman_N = regFN "dona" ;
-- wonder_VQ = mkVQ (reflV (regV "preguntar")) ;
wood_N = regFN "fusta" ;
-- write_V2 = dirV2 (special_ppV (regV (escriure_50 "escriure")) "escrito") ;
yellow_A = compADeg (mkA "groc" "groga" "grocs" "grogues" "grogament") ;
young_A = compADeg (mkA "jove" "jove" "joves" "joves" "jovement") ;
--
-- do_V2 = dirV2 (verbV (fer_56 "fer")) ;
now_Adv = mkAdv "ara" ;
already_Adv = mkAdv "ja" ;
song_N = mkN "cançó" "cançons" feminine ;
add_V3 = dirV3 (regV "sumar") dative ;
number_N = regMN "número" ;
-- put_V2 = dirV2 (verbV "posar") ;
-- stop_V = regV "parar" ;
-- jump_V = regV "saltar" ;
--
-- left_Ord = mkOrd (regA "izquierda") ;
-- right_Ord = mkOrd (regA "derecha") ;
-- far_Adv = mkAdv "lejos" ; ----?
correct_A = regA "correcte" ;
dry_A = regA "sec" ;
dull_A = regA "balb" ;
full_A = regA "ple" ;
heavy_A = regA "pesat" ;
near_A = regA "proper" ;
rotten_A = regA "podrit" ;
round_A = regA "rodó" ;
sharp_A = regA "esmolat" ; -- punxegut
smooth_A = regA "llis" ;
straight_A = regA "directe" ;
wet_A = regA "moll" ;
wide_A = regA "extens" ;
animal_N = regMN "animal" ; -- masc (sometimes fem when adj)
ashes_N = regMN "cendra" ;
back_N = regFN "esquena" ;
bark_N = regFN "escorça" ;
belly_N = regFN "panxa" ;
blood_N = regFN "sang" ;
bone_N = regMN "os" ;
breast_N = regFN "sina" ; -- pit
cloud_N = regMN "núvol" ;
day_N = regMN "dia" ;
dust_N = regFN "pols" ;
ear_N = regFN "orella" ;
earth_N = regFN "terra" ;
egg_N = regMN "ou" ;
eye_N = regMN "ull" ;
fat_N = regMN "greix" ;
feather_N = regFN "pluma" ;
fingernail_N = regFN "ungla" ;
fire_N = regMN "foc" ;
flower_N = regFN "flor" ;
fog_N = regFN "boira" ;
foot_N = regMN "peu" ;
forest_N = regMN "bosc" ;
grass_N = regFN "herba" ;
guts_N = regMN "budell" ;
hair_N = regMN "cabell" ;
hand_N = regFN "mà" ;
head_N = regMN "cap" ;
heart_N = regMN "cor" ;
horn_N = regFN "banya" ;
husband_N = regMN "marit" ; -- espòs
ice_N = regMN "gel" ;
knee_N = regMN "genoll" ;
leaf_N = regFN "fulla" ;
leg_N = regFN "cama" ;
liver_N = regMN "fetge" ;
louse_N = regMN "poll" ;
mouth_N = regFN "boca" ;
name_N = regMN "nom" ;
neck_N = regMN "coll" ;
night_N = regFN "nit" ;
nose_N = regMN "nas" ;
person_N = regFN "persona" ;
rain_N = regFN "pluja" ;
road_N = regMN "carrer" ;
root_N = regFN "arrel" ;
rope_N = regN "corda" ;
salt_N = regFN "sal" ;
sand_N = regFN "sorra" ;
seed_N = regFN "llavor" ;
skin_N = regFN "pell" ; -- fem
sky_N = regMN "cel" ;
smoke_N = regMN "fum" ;
snow_N = regFN "neu" ; -- fem
stick_N = regMN "bastó" ;
tail_N = regFN "cua" ;
tongue_N = regFN "llengua" ;
tooth_N = regFN "dent" ;
wife_N = regFN "esposa" ;
wind_N = regMN "vent" ;
wing_N = regFN "ala" ;
worm_N = regMN "cuc" ;
year_N = regMN "any" ;
bite_V2 = dirV2 (regV "mossegar") ;
blow_V = regV "bufar" ;
burn_V = regV "cremar" ;
count_V2 = dirV2 (regV "comptar") ;
cut_V2 = dirV2 (regV "tallar") ;
dig_V = regV "cavar" ;
fall_V = verbV (caure_18 "caure") ;
fear_V2 = dirV2 (verbV (témer_107 "témer")) ;
fight_V2 = dirV2 (regV "lluitar") ;
float_V = regV "surar" ;
flow_V = regV "circular" ;
fly_V = regV "volar" ;
freeze_V = regV "congelar" ;
give_V3 = dirdirV3 (verbV (donar_43 "donar")) ;
hit_V2 = dirV2 (regV "picar") ;
hold_V2 = dirV2 (verbV (obtenir_78 "sostenir")) ;
hunt_V2 = dirV2 (regV "caçar") ;
kill_V2 = dirV2 (regV "matar") ;
laugh_V = verbV (riure_96 "riure") ;
-- lie_V = reflV (regV "estirar") ;
play_V = verbV (pregar_86 "jugar") ;
pull_V2 = dirV2 (regV "tibar") ;
push_V2 = dirV2 (verbV (atènyer_59 "empènyer")) ;
rub_V2 = dirV2 (verbV (pregar_86 "refregar")) ;
scratch_V2 = dirV2 (regV "gratar") ;
sew_V = regV "cosir" ;
sing_V = regV "cantar" ;
-- sit_V = reflV (regV "sentar") ;
smell_V = verbV (cantar_15 "ensumar") ;
spit_V = verbV (escopir_49 "escopir") ;
-- split_V2 = dirV2 (regV "separar") ; -- dividir,) ;
-- squeeze_V2 = dirV2 (regV "exprimir") ;
-- stab_V2 = dirV2 (regV "apuñalar") ;
-- stand_V = verbV (estar_2 "estar") ; ---- "estar de pie" ;
suck_V2 = dirV2 (regV "xuclar") ;
swell_V = regV "inflar" ;
swim_V = regV "nedar" ;
think_V = regV "pensar" ;
throw_V2 = dirV2 (verbV (començar_22 "llençar")) ;
tie_V2 = dirV2 (verbV (pregar_86 "lligar")) ;
turn_V = verbV (pregar_86 "doblegar") ;
vomit_V = verbV (envejar_48 "vomitar") ;
wash_V2 = dirV2 (regV "rentar") ;
wipe_V2 = dirV2 (verbV (pregar_86 "eixugar")) ;
breathe_V = regV "respirar" ;
--
} ;

View File

@@ -0,0 +1,130 @@
--# -path=.:../romance:../common:../../prelude
----1 A Simple Catalan 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 $ParadigmsCat$, which
---- gives a higher-level access to this module.
--
resource MorphoCat = CommonRomance, ResCat **
open PhonoCat, 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 = \vi, vins ->
table {Sg => vi ; Pl => vins} ;
-- For example:
nomHome : Str -> Number => Str = \home ->
numForms home (home + "s") ;
nomDona : Str -> Number => Str = \dona ->
numForms dona (init dona + "es") ;
nomDisc : Str -> Number => Str = \disc ->
numForms disc (variants {disc + "s"; disc + "os"}) ;
-- 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 = \noinois,gen ->
{s = noinois ; g = gen} ;
mkNounIrreg : Str -> Str -> Gender -> Noun = \vi,vins ->
mkNoun (numForms vi vins) ;
mkNomReg : Str -> Noun = \noi ->
case last noi of {
"o" | "e" => mkNoun (nomHome noi) Masc ;
"a" => mkNoun (nomDona noi) Fem ;
"c" => mkNoun (nomDisc noi) Masc ;
--- "u" => mkNounIrreg mec (init mec + "ces") Fem ;
_ => mkNoun (nomHome noi) 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 = \petit,petita,petits,petites,petitament ->
{s = table {
AF Masc n => numForms petit petits ! n ;
AF Fem n => numForms petita petites ! n ;
AA => petitament
}
} ;
---- Then the regular and invariant patterns.
--
-- adjfort : Str -> Adj = \solo ->
-- let
-- sol = Predef.tk 1 solo
-- in
-- mkAdj solo (sol + "a") (sol + "os") (sol + "as") (sol + "amente") ;
--
adjFort : Str -> Adj = \fort ->
mkAdj fort (fort + "a") (fort + "s") (fort + "es") (fort + "ament") ;
--
-- adjBlu : Str -> Adj = \blu ->
-- mkAdj blu blu blu blu blu ; ---
--
mkAdjReg : Str -> Adj = \fort -> adjFort fort ;
{-
case last solo of {
"o" => adjSolo solo ;
--- "e" => adjUtil solo (solo + "s") ;
"a" =>
_ => adjUtil solo (solo + "es")
} ;
-}
--
----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 ;
--
}

View File

@@ -0,0 +1,2 @@
concrete NounCat of Noun = CatCat ** NounRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,169 @@
concrete NumeralCat of Numeral = CatCat **
open CommonRomance, ResRomance, MorphoCat, Prelude in {
--
-- gcc M3.5.1, M3.5.2
--
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} ;
-- Auxiliaries
oper
-- Use cardinal for big ordinals [M3.5.2]
cent : Number => CardOrd => Str = \\n,co => case n of {
Pl => case co of {
NCard Masc => "-cents" ;
NCard Fem => "-centes" ;
_ => variants {} } ;
Sg => "cent"
} ;
cardOrd1 : CardOrd -> (_,_,_:Str) -> Str = \co,dos,dues,segon -> case co of {
NCard Masc => dos ;
NCard Fem => dues ;
NOrd Masc Sg => segon ;
NOrd Fem Sg => segon + "a" ;
NOrd Masc Pl => segon + "s" ;
NOrd Fem Pl => segon + "es"
} ;
cardOrdReg : CardOrd -> Str -> Str -> Str = \co,sis,si -> case co of {
NCard _ => sis ;
NOrd Masc Sg => si + "è" ;
NOrd Fem Sg => si + "ena" ;
NOrd Masc Pl => si + "ens" ;
NOrd Fem Pl => si + "enes"
} ;
cardOrd2 : CardOrd -> Str -> Str = \co,sis -> let si = init sis in
case (last sis) of {
"e" => cardOrdReg co sis si ;
"a" => cardOrdReg co sis si ;
"u" => cardOrdReg co sis (si + "v") ;
_ => cardOrdReg co sis sis
} ;
cardOrd3 : CardOrd -> (m,f:Str) -> Str = \co,dos,dues -> case co of {
NCard Masc => dos ;
NCard Fem => dues ;
NOrd Masc Sg => dos + "è" ;
NOrd Fem Sg => dos + "ena" ;
NOrd Masc Pl => dos + "ens" ;
NOrd Fem Pl => dos + "enes"
} ;
digitPl1 : (u,t,d,dp:Str) -> (fem,ord:Str) -> {s: DForm => CardOrd => Str} = \dos,dotze,vint,vinti,dues,segon -> {
s = \\df,co =>
case df of {
unit => cardOrd1 co dos dues segon ;
teen => cardOrd2 co dotze ;
ten => cardOrd2 co vint ;
tenplus => cardOrd2 co vinti ;
_ => cardOrd3 co dos dues
}
} ;
digitPl2 : (u,t,d,dp:Str) -> {s: DForm => CardOrd => Str} = \sis,setze,seixanta,seixantai -> {
s = \\df,co => case df of {
unit => cardOrd2 co sis;
teen => cardOrd2 co setze ;
ten => cardOrd2 co seixanta ;
tenplus => cardOrd2 co seixantai ;
_ => cardOrd2 co sis
}
} ;
lin
num x = x ;
n2 = digitPl1 "dos" "dotze" "vint" "vint-i-" "dues" "segon" ;
n3 = digitPl1 "tres" "tretze" "trenta" "trenta-" "tres" "tercer" ;
n4 = digitPl1 "quatre" "catorze" "quaranta" "quaranta-" "quatre" "quart" ;
n5 = digitPl1 "cinc" "quinze" "cinquanta" "cinquanta-" "cinc" "quint" ;
n6 = digitPl2 "sis" "setze" "seixanta" "seixanta-" ;
n7 = digitPl2 "set" "disset" "setanta" "setanta-" ;
n8 = digitPl2 "vuit" "divuit" "vuitanta" "vuitanta-" ;
n9 = digitPl2 "nou" "dinou" "noranta" "noranta-" ;
pot01 = {s= \\df,co =>
case df of {
unit => cardOrd1 co "un" "una" "primer" ;
teen => cardOrd2 co "onze" ;
ten => cardOrd2 co "deu" ;
tenplus => variants {} ;
OrdF => cardOrd2 co "un" ;
Aunit => []
};
n= Sg} ;
pot0 d = d ** {n= Pl} ;
pot110 = {s= \\co => cardOrdReg co "deu" "des"; n= Pl} ;
pot111 = {s= \\co => cardOrd2 co "onze"; n= Pl} ;
pot1to19 d = {s= \\co => d.s ! teen ! co ; n= Pl} ;
pot0as1 n = {s= n.s ! unit; n= n.n} ;
pot1 d = {s= \\co => d.s ! ten ! co; n= Pl} ;
pot1plus d e =
{s= \\co => ((d.s ! tenplus ! (NCard Masc)) ++ (e.s ! OrdF ! co)); n= Pl} ;
pot1as2 n = n ;
pot2 d = {s= \\co => (d.s ! Aunit ! co) ++ (cent ! (d.n) ! co); n= Pl} ;
pot2plus d n = {
s= \\co => (d.s ! Aunit ! co) ++ (cent ! (d.n) ! co) ++ (n.s ! co);
n= Pl} ;
pot2as3 n = n ;
pot3 n = {s= \\co => (table {Sg => []; Pl => (n.s ! co) } ! n.n) ++ "mil"; n= Pl} ;
pot3plus n m =
{s= \\co => (table {Sg => []; Pl => (n.s ! co)} ! n.n) ++ "mil" ++ (m.s !co);
n= Pl} ;
param
DForm = unit | teen | ten | tenplus | Aunit | OrdF ;
-- 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
} ;
}

View File

@@ -0,0 +1,391 @@
--# -path=.:../romance:../common:../abstract:../../prelude
----1 Catalan Lexical Paradigms
----
---- Aarne Ranta 2003
----
---- This is an API to 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 $MorphoCat.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$.
--
resource ParadigmsCat =
open
(Predef=Predef),
Prelude,
CommonRomance,
ResCat,
MorphoCat,
BeschCat,
CatCat 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").
Preposition : Type ;
accusative : Preposition ;
genitive : Preposition ;
dative : 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. "número de telèfon".
-- 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 ("filla 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 ; s'usa ?
-- Three-place relational nouns ("la connexió de 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 ; -- Joan
-- To form a noun phrase that can also be plural,
-- you can use the worst-case function.
makeNP : 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 : (fort,forta,forts,fortes, fortament : 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 -> A ;
--
-- If comparison is formed by "més", as usual in Catalan,
-- the following pattern is used:
compADeg : A -> A ;
---- The regular pattern is the same as $regA$ for plain adjectives,
---- with comparison by "mas".
--
regADeg : Str -> A ;
--
--
----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 "cantar", "servir"/"dormir", or "perdre"/"treure".
-- The regular verb function is the first conjugation ("ar") recognizes
-- the variations corresponding to the patterns
-- "actuar, cazar, guiar, pagar, sacar". The module $BeschCat$ gives
-- the complete set of "Bescherelle" conjugations.
regV : Str -> V ;
---- The module $BeschCat$ gives all the patterns of the "Bescherelle"
---- book. To use them in the category $V$, wrap them with the function
verbV : 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). 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 ; -- parlar, a, de
dirV3 : V -> Preposition -> V3 ; -- donar,_,a
dirdirV3 : V -> V3 ; -- donar,_,_
----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 -> Preposition -> V2A ;
mkVQ : V -> VQ ;
-- mkV2Q : V -> Preposition -> V2Q ;
--
mkAS : A -> AS ;
-- mkA2S : A -> Preposition -> A2S ;
-- mkAV : A -> Preposition -> AV ;
-- mkA2V : A -> Preposition -> Preposition -> A2V ;
--
---- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
---- just as synonyms of $V2$, and the second argument is given
---- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$.
---- $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 = MorphoCat.Gender ;
Number = MorphoCat.Number ;
masculine = Masc ;
feminine = Fem ;
singular = Sg ;
plural = Pl ;
Preposition = Compl ;
accusative = complAcc ;
genitive = complGen ;
dative = complDat ;
mkPreposition p = {s = p ; c = Acc ; isDir = False} ;
--
--
mkN 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 ; -- s'usa ?
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
mkPN x g = {s = x ; g = g} ** {lock_PN = <>} ;
makeNP x g n = {s = (pn2np (mkPN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ;
--
mkA 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 = -- cantar
let
ar = Predef.dp 2 x ;
z = Predef.dp 1 (Predef.tk 2 x) ;
verb = case ar of {
"re" => viure_119 x ;
"ir" => patir_81 x ;
_ => cantar_15 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 = <>} ;
verbV ve = verbBesch ve ** {vtyp = VHabere ; lock_V = <>} ;
special_ppV ve pa = {
s = table {
VPart g n => (adjFort pa).s ! AF g n ;
p => ve.s ! p
} ;
lock_V = <> ;
vtyp = VHabere
} ;
mkV2 v p = {s = v.s ; vtyp = v.vtyp ; c2 = p ; lock_V2 = <>} ;
dirV2 v = mkV2 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 = mkV2 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 = mkV2 v p ** {c3 = t.p1 ; s3 = p.p2 ; 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 = mkV2 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 = <>} ;
--
} ;

View File

@@ -0,0 +1,41 @@
--# -path=../common:prelude
resource PhonoCat = open Prelude in {
--3 Elision
--
-- The phonological rule of *elision* can be defined as follows in GF.
-- In Catalan it includes both vowels and 'h'.
---TODO: L'elisi— depŽn de la tonicitat.
oper
vocal : Strs = strs {
"a" ; "ˆ" ;
"e" ; "<22>" ; "Ž" ; "o" ; "˜" ; "—" ;
"i" ; "" ; "•" ; "u" ; "œ" ; "Ÿ" ; "h"
} ;
vocalForta : Strs = strs {
"a" ; "ˆ" ; "ha" ; "hˆ" ;
"e" ; "<22>" ; "Ž" ; "he" ; "h<>" ; "hŽ" ;
"o" ; "˜" ; "—" ; "ho" ; "h˜" ; "h—" ;
"" ; "œ" ; "h" ; "hœ" ;
} ;
vocalFeble : Strs = strs {
"i" ; "•" ; "u" ; "Ÿ" ;
"hi" ; "h•" ; "hu" ; "hŸ" ;
} ;
elisDe = pre { "de" ; "d'" / vocal };
elisEl = pre { "el" ; "l'" / vocal } ;
elisLa = pre { "la" ; "l'" / vocalForta } ;
elisEm = pre { "em" ; "m'" / vocal } ;
elisEt = pre { "et" ; "t'" / vocal } ;
elisEs = pre {
pre { "es" ; "s'" / vocal} ;
"se" / strs { "s" } } ;
}

View File

@@ -0,0 +1,2 @@
concrete PhraseCat of Phrase = CatCat ** PhraseRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,2 @@
concrete QuestionCat of Question = CatCat ** QuestionRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,2 @@
concrete RelativeCat of Relative = CatCat ** RelativeRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,13 @@
--1 Catalan 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 ResCat of ResRomance = DiffCat ** open CommonRomance, Prelude in {
flags optimize=noexpand ;
} ;

View File

@@ -0,0 +1,2 @@
concrete SentenceCat of Sentence = CatCat ** SentenceRomance with
(ResRomance = ResCat) ;

View File

@@ -0,0 +1,154 @@
concrete StructuralCat of Structural = CatCat **
open PhonoCat, MorphoCat, ParadigmsCat, BeschCat, Prelude in {
flags optimize=all ;
lin
above_Prep = mkPreposition "sobre" ;
after_Prep = {s = ["desprŽs"] ; c = MorphoCat.genitive ; isDir = False} ;
all_Predet = {
s = \\a,c => prepCase c ++ aagrForms "tot" "tota" "tots" "totes" ! a ;
c = Nom
} ;
almost_AdA, almost_AdN = ss (variants {"quasi"; "gairebè"}) ;
always_AdV = ss "sempre" ;
although_Subj = ss "benché" ** {m = Conjunct} ;
and_Conj = {s1 = [] ; s2 = etConj.s ; n = Pl} ;
because_Subj = ss "perque" ** {m = Indic} ;
before_Prep = {s = "abans" ; c = MorphoCat.genitive ; isDir = False} ;
behind_Prep = {s = "darrera" ; c = MorphoCat.genitive ; isDir = False} ;
between_Prep = mkPreposition "entre" ;
both7and_DConj = {s1,s2 = etConj.s ; n = Pl} ;
but_PConj = ss "per˜" ;
by8agent_Prep = mkPreposition "per" ;
by8means_Prep = mkPreposition "mitjançant" ;
-- can8know_VV = mkVV (verbV (saber_71 "saber")) ;
-- can_VV = mkVV (verbV (poder_58 "poder")) ;
during_Prep = mkPreposition "durant" ; ----
either7or_DConj = {s1,s2 = "o" ; n = Sg} ;
everybody_NP = makeNP ["tothom"] Masc Sg ;
every_Det = {s = \\_,_ => "cada" ; n = Sg} ;
everything_NP = pn2np (mkPN ["tot"] Masc) ;
everywhere_Adv = ss ["a tot arreu"] ;
few_Det = {s = \\g,c => prepCase c ++ genForms "pocs" "poques" ! g ; n = Pl} ;
--- first_Ord = {s = \\ag => (regA "primer").s ! Posit ! AF ag.g ag.n} ;
from_Prep = complGen ; ---
he_Pron =
mkPronoun
"ell" "lo" "el" "ell"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
Masc Sg P3 ;
here_Adv = mkAdv "aquí" ; -- ací
here7to_Adv = mkAdv ["cap aquí"] ;
here7from_Adv = mkAdv ["de aquí"] ;
how_IAdv = ss "com" ;
how8many_IDet =
{s = \\g,c => prepCase c ++ genForms "quants" "quantes" ! g ; n = Pl} ;
if_Subj = ss "si" ** {m = Indic} ;
in8front_Prep = {s = "davant" ; c = MorphoCat.genitive ; isDir = False} ;
i_Pron =
mkPronoun
"jo" "em" "em" "mi"
["el meu"] ["la meva"] ["els meus"] ["les meves"]
Fem Sg P1 ;
in_Prep = mkPreposition "en" ;
it_Pron =
mkPronoun
"ell" "lo" "el" "ell"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
Masc Sg P3 ;
less_CAdv = ss "menys" ; ----
many_Det = {s = \\g,c => prepCase c ++ genForms "molts" "moltes" ! g ; n = Pl} ;
more_CAdv = ss "més" ;
most_Predet = {s = \\_,c => prepCase c ++ ["la majoria"] ; c = CPrep P_de} ;
much_Det = {s = \\g,c => prepCase c ++ genForms "molt" "molta" ! g ; n = Sg} ;
-- must_VV = mkVV (verbV (deber_6 "deber")) ;
no_Utt = ss "no" ;
on_Prep = mkPreposition "sobre" ;
--- one_Quant = {s = \\g,c => prepCase c ++ genForms "un" "una" ! g} ;
only_Predet = {s = \\_,c => prepCase c ++ "només" ; c = Nom} ;
or_Conj = {s1 = [] ; s2 = "o" ; n = Sg} ;
otherwise_PConj = ss "altrament" ;
part_Prep = complGen ;
please_Voc = ss "sisplau" ;
possess_Prep = complGen ;
quite_Adv = ss "bastant" ;
she_Pron =
mkPronoun
"ella" "la" "la" "ella"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
Fem Sg P3 ;
so_AdA = ss "tan" ;
somebody_NP = pn2np (mkPN ["algú"] Masc) ;
somePl_Det = {s = \\g,c => prepCase c ++ genForms "alguns" "algunes" ! g ; n = Pl} ;
someSg_Det = {s = \\g,c => prepCase c ++ genForms "algun" "alguna" ! g ; n = Sg} ;
something_NP = pn2np (mkPN ["quelcom"] Masc) ;
somewhere_Adv = ss ["a algun lloc"] ;
that_Quant = {
s = table {
Sg => \\g,c => prepCase c ++ genForms "aquell" "aquella" ! g ;
Pl => \\g,c => prepCase c ++ genForms "aquells" "aquelles" ! g
}
} ;
there_Adv = mkAdv "allà" ; -- allá
there7to_Adv = mkAdv ["cap a allà"] ;
there7from_Adv = mkAdv ["d'allà"] ;
therefore_PConj = ss ["per tant"] ;
they_Pron = mkPronoun
"elles" "les" "les" "elles"
["el seu"] ["la seva"] ["llurs"] ["llurs"]
Fem Pl P3 ;
this_Quant = {
s = table {
Sg => \\g,c => prepCase c ++ genForms "aquest" "aquesta" ! g ;
Pl => \\g,c => prepCase c ++ genForms "aquests" "aquestes" ! g
}
} ;
through_Prep = mkPreposition "mitjançant" ;
too_AdA = ss "massa" ;
to_Prep = complDat ;
under_Prep = mkPreposition "sota" ;
very_AdA = ss "molt" ;
-- want_VV = mkVV (verbV (querer_64 "querer")) ;
we_Pron =
mkPronoun
"nosaltres" "nos" "nos" "nosaltres"
["el nostre"] ["la nostra"] ["els nostres"] ["les nostres"]
Fem 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 "quan" ;
when_Subj = ss "quan" ** {m = Indic} ;
where_IAdv = ss "on" ;
which_IQuant = {s = table {
Sg => \\g,c => prepCase c ++ "quin" ; --per fer: femení quina
Pl => \\g,c => prepCase c ++ "quins"
}
} ; --per fer: femení quines
whoPl_IP = {s = \\c => prepCase c ++ "qui" ; a = aagr Fem Pl} ;
whoSg_IP = {s = \\c => prepCase c ++ "qui" ; a = aagr Fem Sg} ;
why_IAdv = ss ["per què"] ;
without_Prep = mkPreposition "sense" ;
with_Prep = mkPreposition "amb" ;
yes_Utt = ss "sí" ;
youSg_Pron = mkPronoun
"tu" "et" "et" "tu"
["el teu"] ["la teva"] ["els teus"] ["les teves"]
Fem Sg P2 ;
youPl_Pron =
mkPronoun
"vosaltres" "us" "us" "vosaltres"
["el vostre"] ["la vostra"] ["els vostres"] ["les vostres"]
Fem Pl P2 ;
youPol_Pron =
mkPronoun
"vostè" "li" "li" "vostè"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
Fem Pl P2 ;
oper
etConj : {s : Str ; n : MorphoCat.Number} = {s = "i" } ** {n = Pl} ;
}

View File

@@ -0,0 +1,2 @@
concrete VerbCat of Verb = CatCat ** VerbRomance with
(ResRomance = ResCat) ;