1
0
forked from GitHub/gf-core

resource = resource-1.0

This commit is contained in:
aarne
2006-06-22 22:25:55 +00:00
parent 7e5584b1ab
commit 251bc4c738
881 changed files with 31130 additions and 31130 deletions

View File

@@ -0,0 +1,231 @@
--# -path=.:../romance:../abstract:../../prelude
concrete BasicIta of Basic = CategoriesIta ** open ParadigmsIta, BeschIta in {
flags
startcat=Phr ; lexer=textlit ; unlexer=text ;
optimize=values ;
lin
airplane_N = regN "aereo" ;
answer_V2S = mkV2S (verboV (rispondere_76 "rispondere")) dative ;
apartment_N = regN "apartamento" ;
apple_N = regN "mela" ;
art_N = femN (regN "arte") ;
ask_V2Q = mkV2Q (verboV (rispondere_76 "chiedere")) dative ;
baby_N = regN "bambino" ;
bad_ADeg = prefADeg (mkADeg (regA "cattivo") (regA "peggio")) ;
bank_N = regN "banca" ;
beautiful_ADeg = prefADeg (regADeg "bello") ;
become_VA = essereV (regV "diventare") ;
beer_N = regN "birra" ;
beg_V2V = mkV2V (regV "pregare") accusative dative ;
big_ADeg = prefADeg (regADeg "grande") ;
bike_N = regN "bicicletta" ;
bird_N = regN "uccello" ;
black_ADeg = regADeg "nero" ;
blue_ADeg = regADeg "blù" ;
boat_N = regN "batello" ;
book_N = regN "libro" ;
boot_N = regN "stivale" ;
boss_N = regN "capo" ;
boy_N = regN "ragazzo" ;
bread_N = regN "pane" ;
break_V2 = dirV2 (verboV (rompere_77 "rompere")) ;
broad_ADeg = regADeg "largo" ;
brother_N2 = diN2 (regN "fratello") ;
brown_ADeg = regADeg "marrone" ;
butter_N = regN "burro" ;
buy_V2 = dirV2 (regV "comprare") ;
camera_N = mkN ["macchina fotografica"]["macchine fotografiche"] feminine ; ---
cap_N = regN "berretta" ;
car_N = regN "macchina" ;
carpet_N = regN "tappeto" ;
cat_N = regN "gatto" ;
ceiling_N = regN "soffitto" ;
chair_N = regN "sedia" ;
cheese_N = regN "formaggio" ;
child_N = regN "bambino" ;
church_N = regN "chiesa" ;
city_N = regN "città" ;
clean_ADeg = regADeg "proprio" ;
clever_ADeg = regADeg "saggio" ;
close_V2 = dirV2 (verboV (chiudere_30 "chiudere")) ;
coat_N = regN "cappotto" ;
cold_ADeg = regADeg "freddo" ;
come_V = essereV (verboV (venire_110 "venire")) ;
computer_N = regN "computer" ;
country_N = regN "paese" ;
cousin_N = regN "cugino" ; --- cousine
cow_N = regN "vacca" ;
die_V = verboV (morire_105 "morire") ;
dirty_ADeg = regADeg "sporco" ;
distance_N3 = mkN3 (regN "distanza") genitive dative ;
doctor_N = mkN "medico" "medici" masculine ;
dog_N = regN "cane" ;
door_N = regN "porta" ;
drink_V2 = dirV2 (verboV (bere_27 "bere")) ;
easy_A2V = mkA2V (regA "facile") dative genitive ;
eat_V2 = dirV2 (regV "mangiare") ;
empty_ADeg = regADeg "vuoto" ;
enemy_N = regN "nemico" ;
factory_N = regN "stabilimento" ;
father_N2 = diN2 (regN "padre") ;
fear_VS = mkVS (verboV (temere_20 "temere")) ;
find_V2 = dirV2 (regV "trovare") ;
fish_N = regN "pesca" ;
floor_N = regN "pavimento" ;
forget_V2 = dirV2 (regV "dimenticare") ;
fridge_N = regN "frigorifero" ;
friend_N = regN "amico" ;
fruit_N = regN "frutta" ;
fun_AV = mkAV (regA "divertente") genitive ;
garden_N = regN "giardino" ;
girl_N = regN "ragazza" ;
glove_N = regN "guanto" ;
gold_N = regN "oro" ;
good_ADeg = prefADeg (mkADeg (regA "buono")
(mkA "migliore" "migliore" "migliori" "migliori" "meglio")) ;
go_V = essereV (verboV (andare_14 "andare")) ;
green_ADeg = regADeg "verde" ;
harbour_N = regN "porto" ;
hate_V2 = dirV2 (regV "odiare") ;
hat_N = regN "capello" ;
have_V2 = dirV2 (verboV (avere_2 "avere")) ;
hear_V2 = dirV2 (verboV (sentire_99 "sentire")) ;
hill_N = regN "collina" ;
hope_VS = mkVS (regV "sperare") ;
horse_N = regN "cavallo" ;
hot_ADeg = regADeg "caldo" ;
house_N = regN "casa" ;
important_ADeg = regADeg "importante" ;
industry_N = regN "industria" ;
iron_N = regN "ferro" ;
king_N = regN "ré" ;
know_V2 = dirV2 (verboV (conoscere_37 "conoscere")) ; --- savoir_V2 : VS
lake_N = regN "lago" ;
lamp_N = regN "lampa" ;
learn_V2 = dirV2 (regV "imparare") ;
leather_N = regN "cuoio" ;
leave_V2 = dirV2 (regV "lasciare") ;
like_V2 = dirV2 (regV "amare") ;
listen_V2 = dirV2 (regV "ascoltare") ;
live_V = verboV (vivere_95 "vivere") ;
long_ADeg = regADeg "lungo" ;
lose_V2 = dirV2 (verboV (perdere_62 "perdere")) ;
love_N = regN "amore" ;
love_V2 = dirV2 (regV "amare") ;
man_N = regN "uomo" ;
married_A2 = mkA2 (regA "sposato") dative ;
meat_N = femN (regN "carne") ;
milk_N = regN "latte" ;
moon_N = regN "luna" ;
mother_N2 = diN2 (femN (regN "madre")) ;
mountain_N = regN "montagna" ;
music_N = regN "musica" ;
narrow_ADeg = regADeg "stretto" ;
new_ADeg = prefADeg (regADeg "nuovo") ;
newspaper_N = regN "giornale" ;
oil_N = regN "olio" ;
old_ADeg = prefADeg (regADeg "vecchio") ;
open_V2 = dirV2 (verboV (aprire_102 "aprire")) ;
paint_V2A = mkV2A (verboV (cingere_31 "pingere")) accusative ;
paper_N = regN "carta" ;
peace_N = femN (regN "pace") ;
pen_N = regN "penna" ;
planet_N = regN "pianeta" ;
plastic_N = regN "plastica" ;
play_V2 = dirV2 (regV "giocare") ;
policeman_N = regN "carabiniere" ;
priest_N = regN "prete" ;
probable_AS = mkAS (regA "probabile") ;
queen_N = regN "regina" ;
radio_N = mkN "radio" "radio" feminine ;
rain_V0 = mkV0 (verboV (piovere_66 "piovere")) ;
read_V2 = dirV2 (verboV (leggere_56 "leggere")) ;
red_ADeg = regADeg "rosso" ;
religion_N = femN (regN "religione") ;
restaurant_N = regN "ristorante" ;
river_N = regN "fiume" ;
rock_N = regN "roccia" ;
roof_N = regN "tetto" ;
rubber_N = regN "gomma" ;
run_V = verboV (correre_38 "correre") ;
say_VS = mkVS (verboV (dire_41 "dire")) ;
school_N = regN "scuola" ;
science_N = regN "scienza" ;
sea_N = regN "mare" ;
seek_V2 = dirV2 (regV "cercare") ;
see_V2 = dirV2 (verboV (vedere_93 "vedere")) ;
sell_V3 = dirV3 (verboV (scendere_80 "vendere")) dative ; ---- except some forms
send_V3 = dirV3 (regV "mandare") dative ;
sheep_N = regN "agnello" ;
ship_N = femN (regN "nave") ;
shirt_N = regN "camicia" ;
shoe_N = regN "scarpa" ;
shop_N = regN "magazzino" ;
short_ADeg = regADeg "corto" ; --- breve
silver_N = regN "argento" ;
sister_N = regN "sorella" ;
sleep_V = verboV (dormire_99b "dormire") ;
small_ADeg = prefADeg (regADeg "piccolo") ;
snake_N = regN "serpente" ;
sock_N = regN "calza" ;
speak_V2 = dirV2 (regV "parlare") ;
star_N = regN "stella" ;
steel_N = regN "acciaio" ;
stone_N = regN "sasso" ;
stove_N = regN "forno" ;
student_N = regN "studente" ;
stupid_ADeg = regADeg "stupido" ;
sun_N = regN "sole" ;
switch8off_V2 = dirV2 (verboV (cingere_31 "spingere")) ;
switch8on_V2 = dirV2 (regV "allumare") ; ----
table_N = regN "tavola" ; --- tavolo
talk_V3 = mkV3 (regV "parlare") dative genitive ;
teacher_N = regN "professore" ;
teach_V2 = dirV2 (regV "insegnare") ;
television_N = femN (regN "televisione") ;
thick_ADeg = regADeg "grosso" ;
thin_ADeg = regADeg "sottile" ;
train_N = regN "treno" ;
travel_V = regV "viaggare" ;
tree_N = regN "albero" ;
--- trousers_N = regN "pantalon" ;
ugly_ADeg = regADeg "brutto" ;
understand_V2 = dirV2 (regV "capire") ;
university_N = regN "università" ;
village_N = regN "paese" ;
wait_V2 = mkV2 (regV "aspettare") dative ;
walk_V = regV "camminare" ;
warm_ADeg = regADeg "caldo" ;
war_N = regN "guerra" ;
watch_V2 = dirV2 (regV "guardare") ;
water_N = regN "acqua" ;
white_ADeg = compADeg (regA "bianco") ;
window_N = regN "finestra" ;
wine_N = regN "vino" ;
win_V2 = dirV2 (verboV (vincere_94 "vincere")) ;
woman_N = regN "donna" ;
wonder_VQ = mkVQ (regV "domandare") ; ---- domandarsi
wood_N = regN "legno" ;
write_V2 = dirV2 (verboV (scrivere_82 "scrivere")) ;
yellow_ADeg = regADeg "giallo" ;
young_ADeg = prefADeg (regADeg "giovane") ;
do_V2 = dirV2 (verboV (fare_52 "fare")) ;
now_Adv = mkAdv "adesso" ;
already_Adv = mkAdv "già" ;
song_N = femN (regN "canzone") ;
add_V3 = dirV3 (verboV (giungere_55 "aggiungere")) dative ;
number_N = regN "numero" ;
put_V2 = dirV2 (verboV (mettere_57 "mettere")) ;
stop_V = regV "fermare" ; ---- fermarsi
jump_V = regV "saltare" ;
here_Adv = mkAdv "quì" ;
here7to_Adv = mkAdv "quì" ;
here7from_Adv = mkAdv ["da quì"] ;
there_Adv = mkAdv "lì" ;
there7to_Adv = mkAdv "lì" ;
there7from_Adv = mkAdv ["da lì"] ;
} ;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete CategoriesIta of Categories =
CategoriesRomance with (SyntaxRomance=SyntaxIta) ;

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete ClauseIta of Clause = CategoriesIta **
ClauseRomance with (SyntaxRomance=SyntaxIta) ;

View File

@@ -0,0 +1,25 @@
concrete CountryIta of Country = open CategoriesIta, ParadigmsIta in {
lincat
Country = PN ;
Nationality = A ;
Language = N ;
lin
Denmark = mkPN "Danimarca" feminine ;
England = mkPN "Inghilterra" feminine ;
Finland = mkPN "Finlandia" feminine ;
France = mkPN "Francia" feminine ;
Germany = mkPN "Germania" feminine ;
Italy = mkPN "Italia" feminine ;
Norway = mkPN "Norvegia" feminine ;
Russia = mkPN "Russia" feminine ;
Spain = mkPN "Spagna" feminine ;
Sweden = mkPN "Svezia" feminine ;
Danish = regA "danese" ;
English = regA "inglese" ;
DanishLang = regN "danese" ;
EnglishLang = regN "inglese" ;
} ;

View File

@@ -0,0 +1,23 @@
--# -path=.:../romance:../abstract:../../prelude
concrete LangIta of Lang =
RulesIta,
ClauseIta,
StructuralIta,
BasicIta,
TimeIta,
CountryIta,
MathIta
** open Prelude, ParadigmsIta in {
lin
AdvDate d = prefixSS "il" d ;
AdvTime t = prefixSS "alle" t ;
NWeekday w = w ;
PNWeekday w = mkPN (w.s ! singular) w.g ;
PNCountry x = x ;
ANationality x = x ;
NLanguage x = x ;
}

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete MathIta of Math = CategoriesIta **
MathRomance with (SyntaxRomance=SyntaxIta) ;

View File

@@ -0,0 +1,490 @@
--# -path=.:../romance:../../prelude
--1 A Simple Italian 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 $TypesIta.gf$.
resource MorphoIta = open (Predef=Predef), Prelude, TypesIta 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"
} ;
sImpuro : Strs = strs {
"z" ; "sb" ; "sc" ; "sd" ; "sf" ; "sm" ; "sp" ; "sq" ; "sr" ; "st" ; "sv"
} ;
elision : (_,_,_ : Str) -> Str = \il, l', lo ->
pre {il ; l' / vocale ; lo / sImpuro} ;
elisQue = "che" ; --- 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 -> let {vin = Predef.tk 1 vino} in
numForms vino (vin + "i") ;
nomRana : Str -> Number => Str = \rana -> let {ran = Predef.tk 1 rana} in
numForms rana (ran + "e") ;
nomSale : Str -> Number => Str = \sale -> let {sal = Predef.tk 1 sale} in
numForms sale (sal + "i") ;
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 -> {s : Number => Str ; g : Gender} = \vino ->
let
o = last vino ;
vin = init vino ;
n = last vin
in
case o of {
"o" => {s = case n of {
"c" | "g" => numForms vino (vin + "hi") ;
"i" => numForms vino vin ;
_ => numForms vino (vin + "i")
} ; g = Masc} ;
"a" => {s = case n of {
"c" | "g" => numForms vino (vin + "he") ;
_ => numForms vino (vin + "e")
} ; g = Fem} ;
"e" => {s = numForms vino (vin + "i")
; g = Masc} ;
"à" | "ù" => {s = numForms vino vino
; g = Fem} ;
_ => {s = numForms vino vino
; g = 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 + "i") (sol + "e") (sol + "amente") ;
adjTale : Str -> Adj = \tale ->
let
tal = Predef.tk 1 tale ;
tali = tal + "i" ;
tala = if_then_Str (pbool2bool (Predef.occur (Predef.dp 1 tal) "lr")) tal tale
in
mkAdj tale tale tali tali (tala + "mente") ;
adjBlu : Str -> Adj = \blu ->
mkAdj blu blu blu blu blu ; ---
mkAdjReg : Str -> Adj = \solo ->
let
o = last solo ;
sol = init solo ;
l = last sol ;
solamente = (sol + "amente")
in
case o of {
"o" => case l of {
"c" | "g" => mkAdj solo (sol + "a") (sol + "hi") (sol + "he") solamente ;
"i" => mkAdj solo (sol + "a") sol (sol + "e") solamente ;
_ => mkAdj solo (sol + "a") (sol + "i") (sol + "e") solamente
} ;
"e" => mkAdj solo solo (sol + "i") (sol + "i") (case l of {
"l" => sol + "mente" ;
_ => solo + "mente"
}) ;
_ => mkAdj solo solo solo solo (sol + "mente")
} ;
--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_di) => "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
} ;
--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> => "mi" ;
<Sg,P2> => "ti" ;
<_, P3> => "si" ;
<Pl,P1> => "ci" ;
<Pl,P2> => "vi"
} ;
pronJe = mkPronoun
"io" --- (variants {"io" ; []}) etc
"mi"
"mi"
"me"
"mio" "mia" "miei" "mie"
PNoGen -- gender cannot be known from pronoun alone
Sg
P1
Clit1 ;
pronTu = mkPronoun
"tu"
"ti"
"ti"
"te"
"tuo" "tua" "tuoi" "tue"
PNoGen
Sg
P2
Clit1 ;
pronIl = mkPronoun
"lui"
"lo"
"gli"
"lui"
"suo" "sua" "suoi" "sue"
(PGen Masc)
Sg
P3
Clit2 ;
pronElle = mkPronoun
"lei"
"la"
"le"
"lei"
"suo" "sua" "suoi" "sue"
(PGen Fem)
Sg
P3
Clit2 ;
pronNous = mkPronoun
"noi"
"ci"
"ci"
"noi"
"nostro" "nostra" "nostri" "nostre"
PNoGen
Pl
P1
Clit3 ;
pronVous = mkPronoun
"voi"
"vi"
"vi"
"voi"
"vostro" "vostra" "vostri" "vostre"
PNoGen
Pl --- depends!
P2
Clit3 ;
pronIls = mkPronoun
"loro"
"loro"
"li" --- le !
"loro"
"loro" "loro" "loro" "loro"
PNoGen
Pl
P3
Clit1 ;
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
}
} ;
-- used in constructions like "(non) ci sono ..."
pronEmpty : Number -> Pronoun = \n -> mkPronoun
[]
[]
[]
[]
[] [] [] []
(PGen Masc)
n
P3
Clit2 ;
--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 (adjTale "quale") ;
talPron : Gender -> Number -> Str = pronForms (adjTale "tale") ;
tuttoPron : Gender -> Number -> Str = pronForms (adjSolo "tutto") ;
--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 {
<_, _, CPrep P_di> => prepArt g n "de" ;
<_, _, CPrep P_da> => prepArt g n "da" ;
<_, _, CPrep P_a> => prepArt g n "a" ;
<_, _, CPrep P_in> => prepArt g n "ne" ;
<_, _, CPrep P_su> => prepArt g n "su" ;
<_, _, CPrep P_con> => prepArt g n "co" ;
<Masc,Sg, Nom> => elision "il" "l'" "lo" ;
<Masc,Sg, _> => elision "il" "l'" "lo" ;
<Fem ,Sg, _> => elision "la" "l'" "la" ;
<Masc,Pl, _> => elision "i" "gli" "gli" ;
<Fem ,Pl, _> => "le"
} ;
-- This auxiliary expresses the uniform rule.
prepArt : Gender -> Number -> Tok -> Tok = \g,n,de -> case <g,n> of {
<Masc,Sg> => elision (de + "l") (de + "ll'") (de + "llo") ;
<Masc,Pl> => elision (de + "i") (de + "gli") (de + "gli") ;
<Fem, Sg> => elision (de + "lla") (de + "ll'") (de + "lla") ;
<Fem, Pl> => de + "lle"
} ;
--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.
verbEssere = verbPres (essere_5 "essere") AEsse ;
verbAvere = verbPres (avere_6 "avere") AHabere ;
-- machine-generated GF code
oper essere_5 : Str -> Verbum = \essere ->
let x_ = Predef.tk 6 essere in
{s = table {
Inf => x_ + "essere" ;
InfClit => x_ + "r" ;
Indi Pres Sg P1 => x_ + "sono" ;
Indi Pres Sg P2 => x_ + "sei" ;
Indi Pres Sg P3 => x_ + "è" ;
Indi Pres Pl P1 => x_ + "siamo" ;
Indi Pres Pl P2 => x_ + "siete" ;
Indi Pres Pl P3 => x_ + "sono" ;
Indi Imperf Sg P1 => x_ + "ero" ;
Indi Imperf Sg P2 => x_ + "eri" ;
Indi Imperf Sg P3 => x_ + "era" ;
Indi Imperf Pl P1 => x_ + "eravamo" ;
Indi Imperf Pl P2 => x_ + "eravate" ;
Indi Imperf Pl P3 => x_ + "erano" ;
Pass Sg P1 => x_ + "fui" ;
Pass Sg P2 => x_ + "fosti" ;
Pass Sg P3 => x_ + "fu" ;
Pass Pl P1 => x_ + "fummo" ;
Pass Pl P2 => x_ + "foste" ;
Pass Pl P3 => x_ + "furono" ;
Fut Sg P1 => x_ + "sarò" ;
Fut Sg P2 => x_ + "sarai" ;
Fut Sg P3 => x_ + "sarà" ;
Fut Pl P1 => x_ + "saremo" ;
Fut Pl P2 => x_ + "sarete" ;
Fut Pl P3 => x_ + "saranno" ;
Cong Pres Sg P1 => x_ + "sia" ;
Cong Pres Sg P2 => x_ + "sia" ;
Cong Pres Sg P3 => x_ + "sia" ;
Cong Pres Pl P1 => x_ + "siamo" ;
Cong Pres Pl P2 => x_ + "siate" ;
Cong Pres Pl P3 => x_ + "siano" ;
Cong Imperf Sg P1 => x_ + "fossi" ;
Cong Imperf Sg P2 => x_ + "fossi" ;
Cong Imperf Sg P3 => x_ + "fosse" ;
Cong Imperf Pl P1 => x_ + "fossimo" ;
Cong Imperf Pl P2 => x_ + "foste" ;
Cong Imperf Pl P3 => x_ + "fossero" ;
Cond Sg P1 => x_ + "sarei" ;
Cond Sg P2 => x_ + "saresti" ;
Cond Sg P3 => x_ + "sarebbe" ;
Cond Pl P1 => x_ + "saremmo" ;
Cond Pl P2 => x_ + "sareste" ;
Cond Pl P3 => x_ + "sarebbero" ;
Imper SgP2 => x_ + "sii" ;
--Imper IPs3 => x_ + "sia" ;
Imper PlP1 => x_ + "siamo" ;
Imper PlP2 => x_ + "siate" ;
--Imper IPp3 => x_ + "siano" ;
Ger => x_ + "essendo" ;
Part PresP Masc Sg => variants {} ;
Part PresP Masc Pl => variants {} ;
Part PresP Fem Sg => variants {} ;
Part PresP Fem Pl => variants {} ;
Part PassP Masc Sg => x_ + "stato" ;
Part PassP Masc Pl => x_ + "stati" ;
Part PassP Fem Sg => x_ + "stata" ;
Part PassP Fem Pl => x_ + "state"
}
} ;
oper avere_6 : Str -> Verbum = \avere ->
let x_ = Predef.tk 5 avere in
{s = table {
Inf => x_ + "avere" ;
InfClit => x_ + "aver" ;
Indi Pres Sg P1 => x_ + "ho" ;
Indi Pres Sg P2 => x_ + "hai" ;
Indi Pres Sg P3 => x_ + "ha" ;
Indi Pres Pl P1 => x_ + "abbiamo" ;
Indi Pres Pl P2 => x_ + "avete" ;
Indi Pres Pl P3 => x_ + "hanno" ;
Indi Imperf Sg P1 => x_ + "avevo" ;
Indi Imperf Sg P2 => x_ + "avevi" ;
Indi Imperf Sg P3 => x_ + "aveva" ;
Indi Imperf Pl P1 => x_ + "avevamo" ;
Indi Imperf Pl P2 => x_ + "avevate" ;
Indi Imperf Pl P3 => x_ + "avevano" ;
Pass Sg P1 => x_ + "ebbi" ;
Pass Sg P2 => x_ + "avesti" ;
Pass Sg P3 => x_ + "ebbe" ;
Pass Pl P1 => x_ + "avemmo" ;
Pass Pl P2 => x_ + "aveste" ;
Pass Pl P3 => x_ + "ebbero" ;
Fut Sg P1 => x_ + "avrò" ;
Fut Sg P2 => x_ + "avrai" ;
Fut Sg P3 => x_ + "avrà" ;
Fut Pl P1 => x_ + "avremo" ;
Fut Pl P2 => x_ + "avrete" ;
Fut Pl P3 => x_ + "avranno" ;
Cong Pres Sg P1 => x_ + "abbia" ;
Cong Pres Sg P2 => x_ + "abbia" ;
Cong Pres Sg P3 => x_ + "abbia" ;
Cong Pres Pl P1 => x_ + "abbiamo" ;
Cong Pres Pl P2 => x_ + "abbiate" ;
Cong Pres Pl P3 => x_ + "abbiano" ;
Cong Imperf Sg P1 => x_ + "avessi" ;
Cong Imperf Sg P2 => x_ + "avessi" ;
Cong Imperf Sg P3 => x_ + "avesse" ;
Cong Imperf Pl P1 => x_ + "avessimo" ;
Cong Imperf Pl P2 => x_ + "aveste" ;
Cong Imperf Pl P3 => x_ + "avessero" ;
Cond Sg P1 => x_ + "avrei" ;
Cond Sg P2 => x_ + "avresti" ;
Cond Sg P3 => x_ + "avrebbe" ;
Cond Pl P1 => x_ + "avremmo" ;
Cond Pl P2 => x_ + "avreste" ;
Cond Pl P3 => x_ + "avrebbero" ;
Imper SgP2 => x_ + "abbi" ;
--Imper IPs3 => x_ + "abbia" ;
Imper PlP1 => x_ + "abbiamo" ;
Imper PlP2 => x_ + "abbiate" ;
--Imper IPp3 => x_ + "abbiano" ;
Ger => x_ + "avendo" ;
Part PresP Masc Sg => x_ + "avente" ;
Part PresP Masc Pl => x_ + "aventi" ;
Part PresP Fem Sg => x_ + "avente" ;
Part PresP Fem Pl => x_ + "aventi" ;
Part PassP Masc Sg => x_ + "avuto" ;
Part PassP Masc Pl => x_ + "avuti" ;
Part PassP Fem Sg => x_ + "avuta" ;
Part PassP Fem Pl => x_ + "avute"
}
} ;
-- for Numerals
param DForm = ental Pred | ton | tiotal ;
param Pred = pred | indip ;
oper mkTal : Str -> Str -> Str -> {s : DForm => Str} =
\två -> \tolv -> \tjugo ->
{s = table {ental _ => två ; ton => tolv ; tiotal => tjugo}} ;
oper spl : Str -> {s : Gender => Str ; n : Number} = \s -> {s = \\_ =>
s ; n = Pl} ;
oper mille : Number => Str = table {Sg => "mille" ; Pl => "mila"} ;
}

View File

@@ -0,0 +1,40 @@
concrete NumeralsIta of Numerals = open Prelude, TypesIta, MorphoIta, SyntaxIta in {
lincat
Numeral = {s : Gender => Str ; n : Number} ;
Digit = {s : DForm => Str} ;
Sub10 = {s : DForm => Gender => Str ; n : Number} ;
Sub100 = {s : Gender => Str ; n : Number} ;
Sub1000 = {s : Gender => Str ; n : Number} ;
Sub1000000 = {s : Gender => Str ; n : Number} ;
lin num x = x ;
lin n2 = mkTal "due" "dodici" "venti" ;
lin n3 = mkTal "tre" "tredici" "trenta" ;
lin n4 = mkTal "quattro" "quattordici" "quaranta" ;
lin n5 = mkTal "cinque" "quindici" "cinquanta" ;
lin n6 = mkTal "sei" "sedici" "sessanta" ;
lin n7 = mkTal "sette" "diciassette" "settanta" ;
lin n8 = mkTal "otto" "diciotto" "ottanta" ;
lin n9 = mkTal "nove" "diciannove" "novanta" ;
lin pot01 = {s = table {
ental pred => \\_ => [] ; _ => genForms "uno" "una"} ; n = Sg} ;
lin pot0 d = {s =\\f,g => d.s ! f ; n = Pl} ;
lin pot110 = spl "dieci" ;
lin pot111 = spl "undici" ;
lin pot1to19 d = spl (d.s ! ton) ;
lin pot0as1 n = {s = n.s ! ental indip ; n = n.n} ;
lin pot1 d = spl (d.s ! tiotal) ;
lin pot1plus d e = {s = \\g => d.s ! tiotal ++ e.s ! ental indip ! g ; n = Pl} ;
lin pot1as2 n = n ;
lin pot2 d = spl (d.s ! ental pred ! Masc ++ "cento") ;
lin pot2plus d e = {s = \\g => d.s ! ental pred ! Masc ++ "cento" ++ e.s ! g ; n = Pl} ;
lin pot2as3 n = n ;
lin pot3 n = spl (n.s ! Masc ++ mille ! n.n) ;
lin pot3plus n m = {s = \\g => n.s ! Masc ++ mille ! n.n ++ m.s ! g ; n = Pl} ;
}

View File

@@ -0,0 +1,364 @@
--# -path=.:../romance:../abstract:../../prelude
--1 Italian 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 $MorphoFre.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$.
-- However, this function should only seldom be needed: we have a
-- separate module $IrregularEng$, which covers all irregularly inflected
-- words.
--
-- The following modules are presupposed:
resource ParadigmsIta =
open (Predef=Predef), Prelude, TypesIta, MorphoIta, SyntaxIta,
RulesIta, BeschIta in {
--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' "à").
Preposition : Type ;
accusative : Preposition ;
genitive : Preposition ;
dative : Preposition ;
mkPreposition : Str -> Preposition ;
--2 Nouns
-- Worst case: give both two forms and the gender.
mkN : (uomi,uomini : Str) -> Gender -> N ;
-- 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", and masculine for all other words.
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 "di" and the dative "a",
-- with the empty preposition.
diN2 : 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.
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 ("buono"), and the comparative ("migliore").
mkADeg : A -> A -> ADeg ;
-- If comparison is formed by "più", as usual in Italian,
-- the following pattern is used:
compADeg : A -> ADeg ;
-- The regular pattern is the same as $regA$ for plain adjectives,
-- with comparison by "plus".
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. "sempre").
mkAdV : Str -> AdV ;
-- Adverbs modifying adjectives and sentences can also be formed.
mkAdA : Str -> AdA ;
--2 Verbs
--
-- Regular verbs are ones with the infinitive "er" or "ir", the
-- latter with plural present indicative forms as "finissons".
-- The regular verb function is the first conjugation recognizes
-- these endings, as well as the variations among
-- "aimer, céder, placer, peser, jeter, placer, manger, assiéger, payer".
regV : Str -> V ;
-- The module $BeschIta$ gives all the patterns of the "Bescherelle"
-- book. To use them in the category $V$, wrap them with the function
verboV : Verbo -> V ;
-- The function $regV$ gives all verbs the compound auxiliary "avoir".
-- To change it to "être", use the following function.
essereV : V -> 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.
--.
Gender = SyntaxIta.Gender ;
Number = TypesIta.Number ;
masculine = Masc ;
feminine = Fem ;
singular = Sg ;
plural = Pl ;
Preposition = Case * Str ;
accusative = <Acc,[]> ;
genitive = <CPrep P_di,[]> ;
dative = <CPrep P_a,[]> ;
mkPreposition p = <Acc,p> ;
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} ;
diN2 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 => "più" ++ 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 =
let
are = Predef.dp 3 x ;
ci = Predef.dp 2 (Predef.tk 3 x) ;
i = last ci ;
verb = case are of {
"ire" => finire_100 x ;
_ => case i of {
"c" => cercare_7 x ;
"g" => legare_8 x ;
_ => case ci of {
"ci" => cominciare_9 x ;
"gi" => mangiare_10 x ;
_ => amare_6 x
}
}
}
in verbPres verb AHabere ** {aux = AHabere ; lock_V = <>} ;
verboV ve = verbPres ve AHabere ** {lock_V = <>} ;
essereV v = {s = v.s ; aux = AEsse ; lock_V = <>} ;
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 = <>} ;
} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete ResourceIta of Resource = RulesIta, ClauseIta, StructuralIta ** {} ;

View File

@@ -0,0 +1,4 @@
--# -path=.:../romance:../abstract:../../prelude
concrete RulesIta of Rules = CategoriesIta **
RulesRomance with (SyntaxRomance=SyntaxIta) ;

View File

@@ -0,0 +1,92 @@
--# -path=.:../romance:../abstract:../../prelude
concrete StructuralIta of Structural = CategoriesIta, NumeralsIta **
open SyntaxIta, MorphoIta, BeschIta, Prelude in {
lin
UseNumeral n = {s = \\g => n.s !g ; n = n.n ; isNo = False} ;
above_Prep = justPrep "sopra" ;
after_Prep = justPrep "dopo" ;
all8mass_Det = mkDeterminer singular "tutto" "tutta" ;
all_NDet = mkDeterminerNum ["tutti i"] ["tutte le"] ; --- gli
almost_Adv = ss "quasi" ;
although_Subj = ss "benché" ** {m = Con} ;
and_Conj = etConj ;
because_Subj = ss "perché" ** {m = Ind} ;
before_Prep = justPrep "prima" ;
behind_Prep = justPrep "dietro" ;
between_Prep = justPrep "tra" ;
both_AndConjD = etetConj ;
by8agent_Prep = justCase (CPrep P_da) ;
by8means_Prep = justPrep "per" ;
can8know_VV = mkVerbVerbDir (verbPres (sapere_78 "sapere") AHabere) ;
can_VV = mkVerbVerbDir (verbPres (potere_69 "potere") AHabere) ;
during_Prep = justPrep "durante" ;
either8or_ConjD = ououConj ;
everybody_NP = normalNounPhrase (\\c => prepCase c ++ "tutti") Masc Pl ;
every_Det = chaqueDet ;
everything_NP = mkNameNounPhrase ["tutto"] Masc ;
everywhere_Adv = ss "dappertutto" ;
from_Prep = justCase (CPrep P_da) ;
he_NP = pronNounPhrase pronIl ;
how_IAdv = commentAdv ;
how8many_IDet = {s = genForms "quanti" "quante" ; n = Pl} ;
if_Subj = siSubj ;
in8front_Prep = justPrep "davanti" ;
i_NP = pronNounPhrase pronJe ;
in_Prep = justCase (CPrep P_in) ;
it_NP = pronNounPhrase pronIl ;
many_Det = mkDeterminer plural "molti" "molte" ;
most8many_Det = plupartDet ;
most_Det = mkDeterminer1 singular (["la maggior parte"] ++ elisDe) ; --- de
much_Det = mkDeterminer1 singular "molto" ;
must_VV = mkVerbVerbDir (verbPres (dovere_47 "dovere") AHabere) ;
no_Phr = nonPhr ; --- and also Si!
on_Prep = justCase (CPrep P_su) ;
or_Conj = ouConj ;
otherwise_Adv = ss "altramente" ;
part_Prep = justCase genitive ; ---
possess_Prep = justCase genitive ;
quite_Adv = ss "assai" ;
she_NP = pronNounPhrase pronElle ;
so_Adv = ss "così" ;
somebody_NP = mkNameNounPhrase ["qualcuno"] Masc ;
some_Det = mkDeterminer1 singular "qualche" ;
some_NDet = mkDeterminerNum "alcuni" "alcune" ;
something_NP = mkNameNounPhrase ["qualche cosa"] Masc ;
somewhere_Adv = ss ["qualche parte"] ; --- ne - pas
that_Det = mkDeterminer singular "quello" "quella" ;
that_NP = mkNameNounPhrase ["quello"] Masc ;
therefore_Adv = ss "quindi" ;
these_NDet = mkDeterminerNum "questi" "queste" ; --- ci
they_NP = pronNounPhrase pronIls ;
they8fem_NP = pronNounPhrase pronIls ;
this_Det = mkDeterminer singular "questo" "questa" ;
this_NP = mkNameNounPhrase ["questo"] Masc ;
those_NDet = mkDeterminerNum "quelli" "quelle" ; --- quegli
thou_NP = pronNounPhrase pronTu ;
through_Prep = justPrep "per" ;
too_Adv = ss "troppo" ;
to_Prep = justCase dative ; ---
under_Prep = justPrep "sotto" ;
very_Adv = ss "molto" ;
want_VV = mkVerbVerbDir (verbPres (volere_96 "volere") 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 "quali" "quali" ** {n = Pl} ;
which8one_IDet = quelDet ;
who8one_IP = intPronWho singular ;
who8many_IP = intPronWho plural ;
why_IAdv = pourquoiAdv ;
without_Prep = justPrep "senza" ;
with_Prep = justCase (CPrep P_con) ;
ye_NP = pronNounPhrase pronVous ;
yes_Phr = ouiPhr ;
you_NP = pronNounPhrase pronVous ;
}

View File

@@ -0,0 +1,246 @@
--# -path=.:../abstract:../../prelude:../romance
concrete SwadeshLexIta of SwadeshLex = CategoriesIta
** open StructuralIta, RulesIta, SyntaxIta, ParadigmsIta,
BasicIta, BeschIta, Prelude in {
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 "pochi" "poche" ;
other_Det = mkDeterminer Pl "altri" "altre" ;
-- 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 = StructuralIta.in_Prep ;
with_Prep = StructuralIta.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 "corretto" ;
dirty_ADeg = dirty_ADeg ;
dry_ADeg = regADeg "secco" ;
dull_ADeg = regADeg "noioso" ;
far_ADeg = regADeg "lontano" ;
full_ADeg = regADeg "pieno" ;
good_ADeg = good_ADeg ;
green_ADeg = green_ADeg ;
heavy_ADeg = regADeg "pesante" ;
long_ADeg = long_ADeg ;
narrow_ADeg = narrow_ADeg ;
near_ADeg = regADeg "vicino" ;
new_ADeg = new_ADeg ;
old_ADeg = old_ADeg ;
red_ADeg = red_ADeg ;
rotten_ADeg = regADeg "marcio" ;
round_ADeg = regADeg "rotondo" ;
sharp_ADeg = regADeg "aguzzo" ;
short_ADeg = short_ADeg ;
small_ADeg = small_ADeg ;
smooth_ADeg = regADeg "liscio" ;
straight_ADeg = regADeg "diretto" ;
thick_ADeg = thick_ADeg ;
thin_ADeg = thin_ADeg ;
warm_ADeg = warm_ADeg ;
wet_ADeg = regADeg "bagnato" ;
white_ADeg = white_ADeg ;
wide_ADeg = regADeg "largo" ;
yellow_ADeg = yellow_ADeg ;
left_A = regA "sinistro" ;
right_A = regA "destro" ;
-- Nouns
animal_N = regN "animale" ;
ashes_N = regN "cenere" ;
back_N = regN "schiena" ;
bark_N = regN "corteccia" ;
belly_N = regN "pancia" ;
bird_N = bird_N;
blood_N = regN "sangue" ;
bone_N = regN "osso" ;
breast_N = regN "seno" ;
child_N = child_N ;
cloud_N = regN "nuvola" ;
day_N = regN "giorno" ;
dog_N = dog_N ;
dust_N = regN "polvere" ;
ear_N = regN "orecchio" ;
earth_N = regN "terra" ;
egg_N = mkN "uovo" "uova" masculine ; -- fem in Pl
eye_N = regN "occhio" ;
fat_N = regN "grasso" ;
father_N = UseN2 father_N2 ;
feather_N = regN "piuma" ;
fingernail_N = regN "unghia" ;
fire_N = regN "fuoco" ;
fish_N = fish_N ;
flower_N = regN "fiore" ;
fog_N = regN "nebbia" ;
foot_N = regN "piede" ;
forest_N = regN "bosco" ;
fruit_N = fruit_N ;
grass_N = regN "erba" ;
guts_N = regN "intestino" ;
hair_N = regN "capello" ;
hand_N = femN (regN "mano") ;
head_N = regN "testa" ;
heart_N = regN "cuore" ;
horn_N = regN "corno" ;
husband_N = regN "marito" ;
ice_N = regN "ghiaccio" ;
knee_N = regN "ginocchio" ;
lake_N = lake_N ;
leaf_N = regN "foglia" ;
leg_N = regN "gamba" ;
liver_N = regN "fegato" ;
louse_N = regN "pidocchio" ;
man_N = man_N ;
meat_N = meat_N ;
moon_N = moon_N ;
mother_N = UseN2 mother_N2 ;
mountain_N = mountain_N ;
mouth_N = regN "bocca" ;
name_N = regN "nome" ;
neck_N = regN "collo" ;
night_N = femN (regN "notte") ;
nose_N = regN "naso" ;
person_N = regN "persona" ;
rain_N = regN "pioggia" ;
river_N = river_N ;
road_N = regN "strada" ;
root_N = femN (regN "radice") ;
rope_N = regN "corda" ;
salt_N = regN "sale" ;
sand_N = regN "sabbia" ;
sea_N = sea_N ;
seed_N = regN "seme" ;
skin_N = femN (regN "pelle") ;
sky_N = regN "cielo" ;
smoke_N = regN "fumo" ;
snake_N = snake_N ;
snow_N = femN (regN "neve") ;
star_N = star_N ;
stick_N = regN "bastone" ;
stone_N = stone_N ;
sun_N = sun_N ;
tail_N = regN "coda" ;
tongue_N = regN "lingua" ;
tooth_N = regN "dente" ;
tree_N = tree_N ;
water_N = water_N ;
wife_N = regN "donna" ;
wind_N = regN "vento" ;
wing_N = regN "ala" ;
woman_N = woman_N ;
worm_N = regN "verme" ;
year_N = regN "anno" ;
-- Verbs
bite_V = verboV (esplodere_51 "mordere") ;
blow_V = regV "soffiare" ;
breathe_V = regV "respirare" ;
burn_V = regV "bruciare" ;
come_V = BasicIta.come_V ;
count_V = regV "contare" ;
cut_V = regV "tagliare" ;
die_V = BasicIta.die_V ;
dig_V = regV "scavare" ;
drink_V = drink_V2 ;
eat_V = regV "mangiare" ;
fall_V = essereV (verboV (cadere_28 "cadere")) ;
fear_V = fear_VS ;
fight_V = regV "lottare" ;
float_V = regV "galleggiare" ;
flow_V = verboV (finire_100 "fluire") ;
fly_V = regV "volare" ;
freeze_V = regV "gelare" ;
give_V = verboV (dare_15 "dare") ;
hear_V = hear_V2 ;
hit_V = regV "colpire" ;
hold_V = verboV (venire_110 "tenire") ;
hunt_V = regV "cacciare" ;
kill_V = verboV (ridere_74 "uccidere") ;
know_V = know_V2 ;
laugh_V = verboV (ridere_74 "ridere") ;
lie_V = verboV (piacere_64 "giacere") ;
live_V = live_V ;
play_V = regV "giocare" ;
pull_V = regV "tirare" ;
push_V = verboV (cingere_31 "spingere") ;
rub_V = regV "strofinare" ;
say_V = say_VS ;
scratch_V = regV "graffiare" ;
see_V = see_V2 ;
sew_V = verboV (cucire_103 "cucire") ;
sing_V = regV "cantare" ;
sit_V = verboV (sedere_84 "sedere") ; --- refl?
sleep_V = sleep_V ;
smell_V = verboV (sentire_99 "sentire") ;
spit_V = regV "sputare" ;
split_V = verboV (ridere_74 "dividere") ;
squeeze_V = verboV (temere_20 "spremere") ;
stab_V = regV "pugnalare" ;
stand_V = verboV (stare_16 "stare") ; ---- in piedi
suck_V = regV "succhiare" ;
swell_V = regV "gonfiare" ;
swim_V = regV "nuotare" ;
think_V = regV "pensare" ;
throw_V = regV "gettare" ;
tie_V = regV "legare" ;
turn_V = regV "tornare" ;
vomit_V = regV "vomitare" ;
walk_V = regV "camminare" ;
wash_V = regV "lavare" ;
wipe_V = regV "asciugare" ;
}

View File

@@ -0,0 +1,290 @@
--# -path=.:../romance:../../prelude
instance SyntaxIta of SyntaxRomance =
TypesIta ** open Prelude, (CO=Coordination), MorphoIta, BeschIta in {
flags optimize=all ;
oper
nameNounPhrase = \jean ->
normalNounPhrase
(\\c => prepCase c ++ jean.s)
jean.g
Sg ;
nounPhraseOn = mkNameNounPhrase "si" Masc ; --- can be plural dep. on object
pronImpers : NounPhrase = mkNameNounPhrase [] Masc ;
partitiveNounPhrase = \n,vino ->
normalNounPhrase
(table {
CPrep P_di => elisDe ++ vino.s ! n ;
c => prepCase c ++ artDef vino.g n (CPrep P_di) ++ vino.s ! n
}
)
vino.g
n ;
chaqueDet = mkDeterminer1 Sg "ogni" ;
tousDet = mkDeterminer Pl ["tutti i"] ["tutte le"] ; --- gli
plupartDet = mkDeterminer1 Pl ["la maggior parte di"] ; --- dei, degli, delle
unDet = mkDeterminer Sg artUno artUna ;
plDet = mkDeterminer1 Pl [] ; --- dei, degli, delle
quelDet = mkDeterminer1 Sg "quale" ;
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 ci = MorphoIta.pronNous in
sats2clause (
insertObject (mkSatsObject (pronEmpty np.n) (mkTransVerbCas verbEssere dative) ci)
accusative [] np) ;
{- ----
existNounPhrase = \delvino -> {
s = \\m =>
case m of {
Ind => case delvino.n of {Sg => "c'è" ; Pl => ["ci sono"]} ;
Con => case delvino.n of {Sg => ["ci sia"] ; Pl => ["ci siano"]}
} ++ delvino.s ! stressed accusative --- ce ne sono ; have to define "ci"
} ;
-}
---- check this!
reflPron : Number => Person => NPFormA => Str = \\n,p =>
case p of {
P3 => table {
Ton x => prepCase x ++ "sé" ;
Aton _ => "se" ;
Poss Sg Masc => "su" ;
Poss Sg _ => "su" ;
Poss Pl _ => "sus"
} ;
_ => (personPron Masc n p).s
} ;
mkAdjSolo : Str -> Bool -> Adjective = \adj,p ->
mkAdjective (adjSolo adj) p ;
mkAdjTale : Str -> Bool -> Adjective = \adj,p ->
mkAdjective (adjTale adj) p ;
mkAdjDegrSolo : Str -> Bool -> AdjDegr = \adj,p ->
mkAdjDegrLong (adjSolo adj) p ;
mkAdjDegrTale : Str -> Bool -> AdjDegr = \adj,p ->
mkAdjDegrLong (adjTale adj) p ;
comparConj = variants {"di" ; "che"} ;
-- The commonest case for functions is common noun + "di".
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_di => 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 -> "non" ++ va ;
copula = verbEssere ;
isClitCase = \c -> case c of {
Acc => True ;
CPrep P_a => True ; -- dative
_ => False
} ;
auxVerb ve = case ve.aux of {
AHabere => verbAvere ;
AEsse => verbEssere
} ;
-- The negation of a verb.
posNeg = \b,v,c ->
if_then_else Str b
(v ++ c)
("non" ++ v ++ c) ;
embedConj = "che" ;
-- 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
} ;
pronIl = MorphoIta.pronIl ;
-- 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 ++ "chi" ;
g = Masc ; --- can we decide this?
n = num
} ;
intPronWhat = \num -> {
s = table {
c => prepCase c ++ "che" ++ optStr "cosa"
} ;
g = Masc ; --- can we decide this?
n = num
} ;
-- Questions
{- ----
questVerbPhrase = \jean,dort ->
{s = table {
DirQ => (predVerbPhrase jean dort).s ! Ind ;
IndirQ => "se" ++ (predVerbPhrase jean dort).s ! Ind
}
} ;
existNounPhraseQuest = \delvino ->
let cedelvino = (existNounPhrase delvino).s ! Ind
in {
s = \\m => case m of {DirQ => [] ; _ => "se"} ++ cedelvino
} ;
intSlash = \Qui, Tuvois ->
let {qui = Tuvois.s2 ++ Qui.s ! Tuvois.c ; tuvois = Tuvois.s ! Ind} in
{s = table {
DirQ => qui ++ tuvois ;
IndirQ => ifCe Tuvois.c ++ 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 => ifCe Tuvois.c ++ qui ++ tuvois
}
} ;
-- An auxiliary to distinguish between
-- "je ne sais pas" ("ce qui dort" / "ce que tu veux" / "à qui tu penses").
ifCe : Case -> Str = \c -> case c of { ---
Nom => "ciò" ;
Acc => "ciò" ;
_ => []
} ;
{- ----
questAdverbial = \quand, jean, dort ->
let {jeandort = (predVerbPhrase jean dort).s ! Ind} in
{s = table {
DirQ => quand.s ++ jeandort ; --- inversion?
IndirQ => quand.s ++ jeandort
}
} ;
-}
---- 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 = elision "un" "un" "uno" ;
artUna : Str = elision "una" "un'" "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 ;
-- moved from ResIta
commentAdv = ss "comme" ;
quandAdv = ss "quando" ;
ouAdv = ss "dove" ;
pourquoiAdv = ss "perché" ;
etConj = ss "e" ** {n = Pl} ;
ouConj = ss "o" ** {n = Sg} ;
etetConj = sd2 "e" "e" ** {n = Pl} ;
ououConj = sd2 "o" "o" ** {n = Sg} ;
niniConj = sd2 "né" "né" ** {n = Sg} ; --- requires ne !
siSubj = ss "se" ** {m = Ind} ;
quandSubj = ss "quando" ** {m = Ind} ;
ouiPhr = ss ["Sì ."] ;
nonPhr = ss ["No ."] ;
negNe = "non" ; negPas = [] ;
progressiveSats subj vp =
mkSatsObject subj
(mkTransVerbDir (verbPres (stare_16 "stare") AEsse)) --- 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
} ;
}

View File

@@ -0,0 +1,32 @@
concrete TimeIta of Time = NumeralsIta **
open Prelude, MorphoIta, CategoriesIta, ParadigmsIta 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 ++ "alle" ++ time.s) ;
FormalTime h m = ss ("alle" ++ h.s ++ "e" ++ m.s) ;
PastTime h m = ss ("alle" ++ h.s ++ "e" ++ h.s) ;
ToTime h m = ss ("alle" ++ h.s ++ "meno" ++ m.s) ;
ExactTime h = ss (h.s ++ "esattamento") ;
NumHour n = ss (n.s ! feminine) ;
NumMinute n = ss (n.s ! feminine) ;
monday = regN "lunedì" ;
tuesday = regN "martedì" ;
wednesday = regN "mercoledì" ;
thursday = regN "giovedì" ;
friday = regN "venerdì" ;
saturday = regN "sabato" ;
sunday = regN "domenica" ;
} ;

View File

@@ -0,0 +1,159 @@
--1 Italian Word Classes and Morphological Parameters
--
-- This is a resource module for Italian morphology, defining the
-- morphological parameters and word classes of Italian.
-- 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 TypesIta of TypesRomance = {
-- First we give values to the abstract types.
param
Case = Nom | Acc | CPrep Prep ;
Prep = P_di | P_a | P_da | P_in | P_su | P_con ;
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_di => "di" ;
P_a => "a" ;
P_da => "da" ;
P_in => "in" ;
P_su => "su" ;
P_con => "con"
} ;
oper
CaseA = Case ;
NPFormA = NPForm ;
prepositional = accusative ;
nominative = Nom ;
accusative = Acc ;
genitive = CPrep P_di ;
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
-- "più". The definite article needed in the superlative is provided in
-- $syntax.Ita.gf$.
adjCompLong : Adj -> AdjComp = \caro ->
mkAdjComp
caro.s
(\\gn => "più" ++ 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
} ;
oper RelFormA = RelForm ;
--2 Relative pronouns
--
-- The simple (atonic) relative pronoun shows genuine variation in all of the
-- cases.
relPronForms = table {
Nom => "che" ;
Acc => "che" ;
CPrep P_a => "cui" ; --- variant a cui
CPrep p => strPrep p ++ "cui"
} ;
-- Verbs: conversion from full verbs to present-tense verbs.
verbPres = \amare,a -> {s = table {
VInfin => amare.s ! Inf ;
VFin (VPres Ind) n p => amare.s ! Indi Pres n p ;
VFin (VPres Sub) n p => amare.s ! Cong Pres n p ;
VFin (VImperf Ind) n p => amare.s ! Indi Imperf n p ;
VFin (VImperf Sub) n p => amare.s ! Cong Imperf n p ;
VFin VPasse n p => amare.s ! Pass n p ;
VFin VFut n p => amare.s ! Fut n p ;
VFin VCondit n p => amare.s ! Cond n p ;
VImper np => amare.s ! Imper np ;
VPart g n => amare.s ! Part PassP g n ;
VGer => amare.s ! Ger
} ;
aux = a
} ;
-- The full conjunction is a table on $VForm$:
param
Tempo = Pres | Imperf ;
TempoP = PresP | PassP ;
VForm =
Inf
| InfClit
| Indi Tempo Number Person
| Pass Number Person
| Fut Number Person
| Cong Tempo Number Person
| Cond Number Person
| Imper NumPersI
| Ger
| Part TempoP Gender Number ;
-- This is the full verb type.
oper Verbum = {s : VForm => Str} ;
}