mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-22 17:42:51 -06:00
checking name conflicts; some RGs don't work now
This commit is contained in:
@@ -4,8 +4,6 @@ param
|
|||||||
ListSize = TwoElem | ManyElem ;
|
ListSize = TwoElem | ManyElem ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
SS = {s : Str} ; ----
|
|
||||||
|
|
||||||
ListX = {s1,s2 : Str} ;
|
ListX = {s1,s2 : Str} ;
|
||||||
|
|
||||||
twoStr : (x,y : Str) -> ListX = \x,y ->
|
twoStr : (x,y : Str) -> ListX = \x,y ->
|
||||||
|
|||||||
@@ -12,29 +12,29 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = {s : Tense => Anteriority => CPolarity => Order => Str} ;
|
Cl = {s : ResEng.Tense => Anteriority => CPolarity => Order => Str} ;
|
||||||
Slash = {
|
Slash = {
|
||||||
s : Tense => Anteriority => CPolarity => Order => Str ;
|
s : ResEng.Tense => Anteriority => CPolarity => Order => Str ;
|
||||||
c2 : Str
|
c2 : Str
|
||||||
} ;
|
} ;
|
||||||
Imp = {s : CPolarity => ImpForm => Str} ;
|
Imp = {s : CPolarity => ImpForm => Str} ;
|
||||||
|
|
||||||
-- Question
|
-- Question
|
||||||
|
|
||||||
QCl = {s : Tense => Anteriority => CPolarity => QForm => Str} ;
|
QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ;
|
||||||
IP = {s : Case => Str ; n : Number} ;
|
IP = {s : Case => Str ; n : Number} ;
|
||||||
IComp = {s : Str} ;
|
IComp = {s : Str} ;
|
||||||
IDet = {s : Str ; n : Number} ;
|
IDet = {s : Str ; n : Number} ;
|
||||||
|
|
||||||
-- Relative
|
-- Relative
|
||||||
|
|
||||||
RCl = {s : Tense => Anteriority => CPolarity => Agr => Str ; c : Case} ;
|
RCl = {s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; c : Case} ;
|
||||||
RP = {s : RCase => Str ; a : RAgr} ;
|
RP = {s : RCase => Str ; a : RAgr} ;
|
||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|
||||||
VP = {
|
VP = {
|
||||||
s : Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ;
|
s : ResEng.Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ;
|
||||||
prp : Str ; -- present participle
|
prp : Str ; -- present participle
|
||||||
inf : Str ; -- infinitive
|
inf : Str ; -- infinitive
|
||||||
ad : Str ;
|
ad : Str ;
|
||||||
|
|||||||
@@ -302,34 +302,34 @@ lin
|
|||||||
wing_N = regN "wing" ;
|
wing_N = regN "wing" ;
|
||||||
worm_N = regN "worm" ;
|
worm_N = regN "worm" ;
|
||||||
year_N = regN "year" ;
|
year_N = regN "year" ;
|
||||||
blow_V = blow_V ;
|
blow_V = IrregEng.blow_V ;
|
||||||
breathe_V = dirV2 (regV "breathe") ;
|
breathe_V = dirV2 (regV "breathe") ;
|
||||||
burn_V = burn_V ;
|
burn_V = IrregEng.burn_V ;
|
||||||
dig_V = dig_V ;
|
dig_V = IrregEng.dig_V ;
|
||||||
fall_V = fall_V ;
|
fall_V = IrregEng.fall_V ;
|
||||||
float_V = regV "float" ;
|
float_V = regV "float" ;
|
||||||
flow_V = regV "flow" ;
|
flow_V = regV "flow" ;
|
||||||
fly_V = fly_V ;
|
fly_V = IrregEng.fly_V ;
|
||||||
freeze_V = freeze_V ;
|
freeze_V = IrregEng.freeze_V ;
|
||||||
give_V3 = dirV3 give_V toP ;
|
give_V3 = dirV3 give_V toP ;
|
||||||
laugh_V = regV "laugh" ;
|
laugh_V = regV "laugh" ;
|
||||||
lie_V = lie_V ;
|
lie_V = IrregEng.lie_V ;
|
||||||
play_V = regV "play" ;
|
play_V = regV "play" ;
|
||||||
sew_V = sew_V ;
|
sew_V = IrregEng.sew_V ;
|
||||||
sing_V = sing_V ;
|
sing_V = IrregEng.sing_V ;
|
||||||
sit_V = sit_V ;
|
sit_V = IrregEng.sit_V ;
|
||||||
smell_V = regV "smell" ;
|
smell_V = regV "smell" ;
|
||||||
spit_V = spit_V ;
|
spit_V = IrregEng.spit_V ;
|
||||||
stand_V = stand_V ;
|
stand_V = IrregEng.stand_V ;
|
||||||
swell_V = swell_V ;
|
swell_V = IrregEng.swell_V ;
|
||||||
swim_V = swim_V ;
|
swim_V = IrregEng.swim_V ;
|
||||||
think_V = think_V ;
|
think_V = IrregEng.think_V ;
|
||||||
turn_V = regV "turn" ;
|
turn_V = regV "turn" ;
|
||||||
vomit_V = regV "vomit" ;
|
vomit_V = regV "vomit" ;
|
||||||
|
|
||||||
bite_V2 = dirV2 bite_V ;
|
bite_V2 = dirV2 IrregEng.bite_V ;
|
||||||
count_V2 = dirV2 (regV "count") ;
|
count_V2 = dirV2 (regV "count") ;
|
||||||
cut_V2 = dirV2 cut_V ;
|
cut_V2 = dirV2 IrregEng.cut_V ;
|
||||||
fear_V2 = dirV2 (regV "fear") ;
|
fear_V2 = dirV2 (regV "fear") ;
|
||||||
fight_V2 = dirV2 fight_V ;
|
fight_V2 = dirV2 fight_V ;
|
||||||
hit_V2 = dirV2 hit_V ;
|
hit_V2 = dirV2 hit_V ;
|
||||||
|
|||||||
@@ -12,20 +12,20 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
|||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = {s : Tense => Anteriority => Polarity => SType => Str} ;
|
Cl = {s : ResFin.Tense => Anteriority => Polarity => SType => Str} ;
|
||||||
Slash = {s : Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
Slash = {s : ResFin.Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
||||||
Imp = {s : Polarity => Number => Str} ;
|
Imp = {s : Polarity => Number => Str} ;
|
||||||
|
|
||||||
-- Question
|
-- Question
|
||||||
|
|
||||||
QCl = {s : Tense => Anteriority => Polarity => Str} ;
|
QCl = {s : ResFin.Tense => Anteriority => Polarity => Str} ;
|
||||||
IP = {s : NPForm => Str ; n : Number} ;
|
IP = {s : NPForm => Str ; n : Number} ;
|
||||||
IComp = {s : Agr => Str} ;
|
IComp = {s : Agr => Str} ;
|
||||||
IDet = {s : Case => Str ; n : Number} ;
|
IDet = {s : Case => Str ; n : Number} ;
|
||||||
|
|
||||||
-- Relative
|
-- Relative
|
||||||
|
|
||||||
RCl = {s : Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
RCl = {s : ResFin.Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
||||||
RP = {s : Number => NPForm => Str ; a : RAgr} ;
|
RP = {s : Number => NPForm => Str ; a : RAgr} ;
|
||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ concrete NumeralFin of Numeral = CatFin ** open Prelude, ParadigmsFin, MorphoFi
|
|||||||
flags optimize = all_subs ;
|
flags optimize = all_subs ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Sub1000000 = {s : CardOrd => Str ; n : Number} ;
|
Sub1000000 = {s : CardOrd => Str ; n : MorphoFin.Number} ;
|
||||||
Digit = {s : CardOrd => Str} ;
|
Digit = {s : CardOrd => Str} ;
|
||||||
Sub10, Sub100, Sub1000 = {s : NumPlace => CardOrd => Str ; n : Number} ;
|
Sub10, Sub100, Sub1000 = {s : NumPlace => CardOrd => Str ; n : MorphoFin.Number} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
num x = x ;
|
num x = x ;
|
||||||
@@ -120,7 +120,7 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
sataaN : {s : Number => CardOrd => Str} = {s = table {
|
sataaN : {s : MorphoFin.Number => CardOrd => Str} = {s = table {
|
||||||
Sg => sataN.s ;
|
Sg => sataN.s ;
|
||||||
Pl => table {
|
Pl => table {
|
||||||
NCard (NCase Sg Nom) => "sataa" ;
|
NCard (NCase Sg Nom) => "sataa" ;
|
||||||
|
|||||||
@@ -202,7 +202,6 @@ oper
|
|||||||
|
|
||||||
regPN : Str -> PN ;
|
regPN : Str -> PN ;
|
||||||
mkPN : N -> PN ;
|
mkPN : N -> PN ;
|
||||||
mkNP : N -> Number -> NP ;
|
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
|
|
||||||
@@ -475,6 +474,8 @@ reg3N = \vesi,veden,vesi
|
|||||||
genN2 = \n -> mkN2 n (casePrep genitive) ;
|
genN2 = \n -> mkN2 n (casePrep genitive) ;
|
||||||
regPN m = mkPN (regN m) ;
|
regPN m = mkPN (regN m) ;
|
||||||
mkPN n = mkProperName n ** {lock_PN = <>} ;
|
mkPN n = mkProperName n ** {lock_PN = <>} ;
|
||||||
|
|
||||||
|
mkNP : N -> Number -> CatFin.NP ;
|
||||||
mkNP noun num = {
|
mkNP noun num = {
|
||||||
s = \\c => noun.s ! NCase num (npform2case num c) ;
|
s = \\c => noun.s ! NCase num (npform2case num c) ;
|
||||||
a = agrP3 num ;
|
a = agrP3 num ;
|
||||||
|
|||||||
@@ -99,11 +99,11 @@ concrete StructuralFin of Structural = CatFin **
|
|||||||
} ;
|
} ;
|
||||||
somewhere_Adv = ss "jossain" ;
|
somewhere_Adv = ss "jossain" ;
|
||||||
that_Quant = {
|
that_Quant = {
|
||||||
s1 = table Number [
|
s1 = table (MorphoFin.Number) [
|
||||||
table Case {
|
table (MorphoFin.Case) {
|
||||||
c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
|
c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
|
||||||
} ;
|
} ;
|
||||||
table Case {
|
table (MorphoFin.Case) {
|
||||||
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
|
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
|
||||||
}
|
}
|
||||||
] ;
|
] ;
|
||||||
@@ -121,11 +121,11 @@ concrete StructuralFin of Structural = CatFin **
|
|||||||
{isPron = False} ;
|
{isPron = False} ;
|
||||||
they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
|
they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
|
||||||
this_Quant = {
|
this_Quant = {
|
||||||
s1 = table Number [
|
s1 = table (MorphoFin.Number) [
|
||||||
table Case {
|
table (MorphoFin.Case) {
|
||||||
c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
|
c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
|
||||||
} ;
|
} ;
|
||||||
table Case {
|
table (MorphoFin.Case) {
|
||||||
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
|
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
|
||||||
}
|
}
|
||||||
] ;
|
] ;
|
||||||
@@ -181,7 +181,7 @@ concrete StructuralFin of Structural = CatFin **
|
|||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
jokuPron : Number => Case => Str =
|
jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str =
|
||||||
let
|
let
|
||||||
ku = nhn (sPuu "ku") ;
|
ku = nhn (sPuu "ku") ;
|
||||||
kui = nhn (sPuu "kuu")
|
kui = nhn (sPuu "kuu")
|
||||||
@@ -198,7 +198,7 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
jokinPron : Number => Case => Str =
|
jokinPron : MorphoFin.Number => (MorphoFin.Case) => Str =
|
||||||
table {
|
table {
|
||||||
Sg => table {
|
Sg => table {
|
||||||
Nom => "jokin" ;
|
Nom => "jokin" ;
|
||||||
@@ -211,7 +211,7 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mikaInt : Number => Case => Str =
|
mikaInt : MorphoFin.Number => (MorphoFin.Case) => Str =
|
||||||
let {
|
let {
|
||||||
mi = nhn (sSuo "mi")
|
mi = nhn (sSuo "mi")
|
||||||
} in
|
} in
|
||||||
@@ -228,7 +228,7 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
kukaInt : Number => Case => Str =
|
kukaInt : MorphoFin.Number => (MorphoFin.Case) => Str =
|
||||||
let {
|
let {
|
||||||
ku = nhn (sRae "kuka" "kenenä") ;
|
ku = nhn (sRae "kuka" "kenenä") ;
|
||||||
ket = nhn (sRae "kuka" "keinä")} in
|
ket = nhn (sRae "kuka" "keinä")} in
|
||||||
@@ -245,7 +245,7 @@ oper
|
|||||||
c => ket.s ! NCase Pl c
|
c => ket.s ! NCase Pl c
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
mikaanPron : Number => Case => Str = \\n,c =>
|
mikaanPron : MorphoFin.Number => (MorphoFin.Case) => Str = \\n,c =>
|
||||||
case <n,c> of {
|
case <n,c> of {
|
||||||
<Sg,Nom> => "mikään" ;
|
<Sg,Nom> => "mikään" ;
|
||||||
<_,Part> => "mitään" ;
|
<_,Part> => "mitään" ;
|
||||||
@@ -260,7 +260,7 @@ oper
|
|||||||
_ => mikaInt ! n ! c + "kään"
|
_ => mikaInt ! n ! c + "kään"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
kukaanPron : Number => Case => Str =
|
kukaanPron : MorphoFin.Number => (MorphoFin.Case) => Str =
|
||||||
table {
|
table {
|
||||||
Sg => table {
|
Sg => table {
|
||||||
Nom => "kukaan" ;
|
Nom => "kukaan" ;
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ flags
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
airplane_N = regN "aereo" ;
|
airplane_N = regN "aereo" ;
|
||||||
answer_V2S = mkV2S (verboV (rispondere_76 "rispondere")) dative ;
|
answer_V2S = mkV2S (verboV (rispondere_76 "rispondere")) ParadigmsIta.dative ;
|
||||||
apartment_N = regN "apartamento" ;
|
apartment_N = regN "apartamento" ;
|
||||||
apple_N = regN "mela" ;
|
apple_N = regN "mela" ;
|
||||||
art_N = femN (regN "arte") ;
|
art_N = femN (regN "arte") ;
|
||||||
ask_V2Q = mkV2Q (verboV (rispondere_76 "chiedere")) dative ;
|
ask_V2Q = mkV2Q (verboV (rispondere_76 "chiedere")) ParadigmsIta.dative ;
|
||||||
baby_N = regN "bambino" ;
|
baby_N = regN "bambino" ;
|
||||||
bad_A = prefA (mkADeg (regA "cattivo") (regA "peggio")) ;
|
bad_A = prefA (mkADeg (regA "cattivo") (regA "peggio")) ;
|
||||||
bank_N = regN "banca" ;
|
bank_N = regN "banca" ;
|
||||||
beautiful_A = prefA (regADeg "bello") ;
|
beautiful_A = prefA (regADeg "bello") ;
|
||||||
become_VA = essereV (regV "diventare") ;
|
become_VA = essereV (regV "diventare") ;
|
||||||
beer_N = regN "birra" ;
|
beer_N = regN "birra" ;
|
||||||
beg_V2V = mkV2V (regV "pregare") accusative dative ;
|
beg_V2V = mkV2V (regV "pregare") ParadigmsIta.accusative ParadigmsIta.dative ;
|
||||||
big_A = prefA (regADeg "grande") ;
|
big_A = prefA (regADeg "grande") ;
|
||||||
bike_N = regN "bicicletta" ;
|
bike_N = regN "bicicletta" ;
|
||||||
bird_N = regN "uccello" ;
|
bird_N = regN "uccello" ;
|
||||||
@@ -60,12 +60,12 @@ lin
|
|||||||
cow_N = regN "vacca" ;
|
cow_N = regN "vacca" ;
|
||||||
die_V = verboV (morire_105 "morire") ;
|
die_V = verboV (morire_105 "morire") ;
|
||||||
dirty_A = regADeg "sporco" ;
|
dirty_A = regADeg "sporco" ;
|
||||||
distance_N3 = mkN3 (regN "distanza") genitive dative ;
|
distance_N3 = mkN3 (regN "distanza") ParadigmsIta.genitive ParadigmsIta.dative ;
|
||||||
doctor_N = mkN "medico" "medici" masculine ;
|
doctor_N = mkN "medico" "medici" masculine ;
|
||||||
dog_N = regN "cane" ;
|
dog_N = regN "cane" ;
|
||||||
door_N = regN "porta" ;
|
door_N = regN "porta" ;
|
||||||
drink_V2 = dirV2 (verboV (bere_27 "bere")) ;
|
drink_V2 = dirV2 (verboV (bere_27 "bere")) ;
|
||||||
easy_A2V = mkA2V (regA "facile") dative genitive ;
|
easy_A2V = mkA2V (regA "facile") ParadigmsIta.dative ParadigmsIta.genitive ;
|
||||||
eat_V2 = dirV2 (regV "mangiare") ;
|
eat_V2 = dirV2 (regV "mangiare") ;
|
||||||
empty_A = regADeg "vuoto" ;
|
empty_A = regADeg "vuoto" ;
|
||||||
enemy_N = regN "nemico" ;
|
enemy_N = regN "nemico" ;
|
||||||
@@ -79,7 +79,7 @@ lin
|
|||||||
fridge_N = regN "frigorifero" ;
|
fridge_N = regN "frigorifero" ;
|
||||||
friend_N = regN "amico" ;
|
friend_N = regN "amico" ;
|
||||||
fruit_N = regN "frutta" ;
|
fruit_N = regN "frutta" ;
|
||||||
fun_AV = mkAV (regA "divertente") genitive ;
|
fun_AV = mkAV (regA "divertente") ParadigmsIta.genitive ;
|
||||||
garden_N = regN "giardino" ;
|
garden_N = regN "giardino" ;
|
||||||
girl_N = regN "ragazza" ;
|
girl_N = regN "ragazza" ;
|
||||||
glove_N = regN "guanto" ;
|
glove_N = regN "guanto" ;
|
||||||
@@ -116,7 +116,7 @@ lin
|
|||||||
love_N = regN "amore" ;
|
love_N = regN "amore" ;
|
||||||
love_V2 = dirV2 (regV "amare") ;
|
love_V2 = dirV2 (regV "amare") ;
|
||||||
man_N = mkN "uomo" "uomini" masculine ;
|
man_N = mkN "uomo" "uomini" masculine ;
|
||||||
married_A2 = mkA2 (regA "sposato") dative ;
|
married_A2 = mkA2 (regA "sposato") ParadigmsIta.dative ;
|
||||||
meat_N = femN (regN "carne") ;
|
meat_N = femN (regN "carne") ;
|
||||||
milk_N = regN "latte" ;
|
milk_N = regN "latte" ;
|
||||||
moon_N = regN "luna" ;
|
moon_N = regN "luna" ;
|
||||||
@@ -130,7 +130,7 @@ lin
|
|||||||
old_A = prefA (regADeg "vecchio") ;
|
old_A = prefA (regADeg "vecchio") ;
|
||||||
open_V2 = dirV2 (verboV (aprire_102 "aprire")) ;
|
open_V2 = dirV2 (verboV (aprire_102 "aprire")) ;
|
||||||
paint_V2A =
|
paint_V2A =
|
||||||
mkV2A (verboV (cingere_31 "pingere")) accusative (mkPrep "in") ; ----
|
mkV2A (verboV (cingere_31 "pingere")) ParadigmsIta.accusative (mkPrep "in") ; ----
|
||||||
paper_N = regN "carta" ;
|
paper_N = regN "carta" ;
|
||||||
paris_PN = mkPN "Parigi" masculine ;
|
paris_PN = mkPN "Parigi" masculine ;
|
||||||
peace_N = femN (regN "pace") ;
|
peace_N = femN (regN "pace") ;
|
||||||
@@ -159,8 +159,8 @@ lin
|
|||||||
sea_N = regN "mare" ;
|
sea_N = regN "mare" ;
|
||||||
seek_V2 = dirV2 (regV "cercare") ;
|
seek_V2 = dirV2 (regV "cercare") ;
|
||||||
see_V2 = dirV2 (verboV (vedere_93 "vedere")) ;
|
see_V2 = dirV2 (verboV (vedere_93 "vedere")) ;
|
||||||
sell_V3 = dirV3 (verboV (scendere_80 "vendere")) dative ; ---- except some forms
|
sell_V3 = dirV3 (verboV (scendere_80 "vendere")) ParadigmsIta.dative ; ---- except some forms
|
||||||
send_V3 = dirV3 (regV "mandare") dative ;
|
send_V3 = dirV3 (regV "mandare") ParadigmsIta.dative ;
|
||||||
sheep_N = regN "agnello" ;
|
sheep_N = regN "agnello" ;
|
||||||
ship_N = femN (regN "nave") ;
|
ship_N = femN (regN "nave") ;
|
||||||
shirt_N = regN "camicia" ;
|
shirt_N = regN "camicia" ;
|
||||||
@@ -184,7 +184,7 @@ lin
|
|||||||
switch8off_V2 = dirV2 (verboV (cingere_31 "spingere")) ;
|
switch8off_V2 = dirV2 (verboV (cingere_31 "spingere")) ;
|
||||||
switch8on_V2 = dirV2 (regV "allumare") ; ----
|
switch8on_V2 = dirV2 (regV "allumare") ; ----
|
||||||
table_N = regN "tavola" ; --- tavolo
|
table_N = regN "tavola" ; --- tavolo
|
||||||
talk_V3 = mkV3 (regV "parlare") dative genitive ;
|
talk_V3 = mkV3 (regV "parlare") ParadigmsIta.dative ParadigmsIta.genitive ;
|
||||||
teacher_N = regN "professore" ;
|
teacher_N = regN "professore" ;
|
||||||
teach_V2 = dirV2 (regV "insegnare") ;
|
teach_V2 = dirV2 (regV "insegnare") ;
|
||||||
television_N = femN (regN "televisione") ;
|
television_N = femN (regN "televisione") ;
|
||||||
@@ -198,7 +198,7 @@ lin
|
|||||||
understand_V2 = dirV2 (regV "capire") ;
|
understand_V2 = dirV2 (regV "capire") ;
|
||||||
university_N = regN "università" ;
|
university_N = regN "università" ;
|
||||||
village_N = regN "paese" ;
|
village_N = regN "paese" ;
|
||||||
wait_V2 = mkV2 (regV "aspettare") dative ;
|
wait_V2 = mkV2 (regV "aspettare") ParadigmsIta.dative ;
|
||||||
walk_V = regV "camminare" ;
|
walk_V = regV "camminare" ;
|
||||||
warm_A = regADeg "caldo" ;
|
warm_A = regADeg "caldo" ;
|
||||||
war_N = regN "guerra" ;
|
war_N = regN "guerra" ;
|
||||||
@@ -219,7 +219,7 @@ lin
|
|||||||
now_Adv = mkAdv "adesso" ;
|
now_Adv = mkAdv "adesso" ;
|
||||||
already_Adv = mkAdv "già" ;
|
already_Adv = mkAdv "già" ;
|
||||||
song_N = femN (regN "canzone") ;
|
song_N = femN (regN "canzone") ;
|
||||||
add_V3 = dirV3 (verboV (giungere_55 "aggiungere")) dative ;
|
add_V3 = dirV3 (verboV (giungere_55 "aggiungere")) ParadigmsIta.dative ;
|
||||||
number_N = regN "numero" ;
|
number_N = regN "numero" ;
|
||||||
put_V2 = dirV2 (verboV (mettere_57 "mettere")) ;
|
put_V2 = dirV2 (verboV (mettere_57 "mettere")) ;
|
||||||
stop_V = reflV (regV "fermare") ;
|
stop_V = reflV (regV "fermare") ;
|
||||||
|
|||||||
@@ -13,20 +13,20 @@ incomplete concrete CatScand of Cat =
|
|||||||
|
|
||||||
-- Sentence
|
-- Sentence
|
||||||
|
|
||||||
Cl = {s : Tense => Anteriority => Polarity => Order => Str} ;
|
Cl = {s : R.Tense => Anteriority => Polarity => Order => Str} ;
|
||||||
Slash = {s : Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ;
|
Slash = {s : R.Tense => Anteriority => Polarity => Order => Str} ** {c2 : Str} ;
|
||||||
Imp = {s : Polarity => Number => Str} ;
|
Imp = {s : Polarity => Number => Str} ;
|
||||||
|
|
||||||
-- Question
|
-- Question
|
||||||
|
|
||||||
QCl = {s : Tense => Anteriority => Polarity => QForm => Str} ;
|
QCl = {s : R.Tense => Anteriority => Polarity => QForm => Str} ;
|
||||||
IP = {s : NPForm => Str ; gn : GenNum} ;
|
IP = {s : NPForm => Str ; gn : GenNum} ;
|
||||||
IComp = {s : AFormPos => Str} ;
|
IComp = {s : AFormPos => Str} ;
|
||||||
IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
|
IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ;
|
||||||
|
|
||||||
-- Relative; the case $c$ is for "det" clefts.
|
-- Relative; the case $c$ is for "det" clefts.
|
||||||
|
|
||||||
RCl = {s : Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
RCl = {s : R.Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
||||||
RP = {s : GenNum => RCase => Str ; a : RAgr} ;
|
RP = {s : GenNum => RCase => Str ; a : RAgr} ;
|
||||||
|
|
||||||
-- Verb
|
-- Verb
|
||||||
|
|||||||
@@ -3,28 +3,32 @@ concrete IdiomSwe of Idiom = CatSwe **
|
|||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
lin
|
oper
|
||||||
ImpersCl vp = mkClause "det" (agrP3 neutrum Sg) vp ;
|
utr = ParadigmsSwe.utrum ;
|
||||||
GenericCl vp = mkClause "man" (agrP3 utrum Sg) vp ;
|
neutr = ParadigmsSwe.neutrum ;
|
||||||
|
|
||||||
CleftNP np rs = mkClause "det" (agrP3 neutrum Sg)
|
lin
|
||||||
|
ImpersCl vp = mkClause "det" (agrP3 neutr Sg) vp ;
|
||||||
|
GenericCl vp = mkClause "man" (agrP3 utr Sg) vp ;
|
||||||
|
|
||||||
|
CleftNP np rs = mkClause "det" (agrP3 neutr Sg)
|
||||||
(insertObj (\\_ => rs.s ! np.a)
|
(insertObj (\\_ => rs.s ! np.a)
|
||||||
(insertObj (\\_ => np.s ! rs.c) (predV verbBe))) ;
|
(insertObj (\\_ => np.s ! rs.c) (predV verbBe))) ;
|
||||||
|
|
||||||
CleftAdv ad s = mkClause "det" (agrP3 neutrum Sg)
|
CleftAdv ad s = mkClause "det" (agrP3 neutr Sg)
|
||||||
(insertObj (\\_ => "som" ++ s.s ! Sub)
|
(insertObj (\\_ => "som" ++ s.s ! Sub)
|
||||||
(insertObj (\\_ => ad.s) (predV verbBe))) ;
|
(insertObj (\\_ => ad.s) (predV verbBe))) ;
|
||||||
|
|
||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkClause "det" (agrP3 neutrum Sg) (insertObj
|
mkClause "det" (agrP3 neutr Sg) (insertObj
|
||||||
(\\_ => np.s ! accusative) (predV (depV finna_V))) ;
|
(\\_ => np.s ! accusative) (predV (depV finna_V))) ;
|
||||||
|
|
||||||
ExistIP ip = {
|
ExistIP ip = {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
let
|
||||||
cls =
|
cls =
|
||||||
(mkClause "det" (agrP3 neutrum Sg) (predV (depV finna_V))).s ! t ! a ! p ;
|
(mkClause "det" (agrP3 neutr Sg) (predV (depV finna_V))).s ! t ! a ! p ;
|
||||||
who = ip.s ! accusative
|
who = ip.s ! accusative
|
||||||
in table {
|
in table {
|
||||||
QDir => who ++ cls ! Inv ;
|
QDir => who ++ cls ! Inv ;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete NumeralSwe of Numeral = CatSwe ** open ResScand, MorphoSwe in {
|
concrete NumeralSwe of Numeral = CatSwe ** open ResSwe, MorphoSwe in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Digit = {s : DForm => CardOrd => Str} ;
|
Digit = {s : DForm => CardOrd => Str} ;
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import GF.Compile.Extend
|
|||||||
import GF.Data.Operations
|
import GF.Data.Operations
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
import Data.List (nub)
|
||||||
|
|
||||||
renameGrammar :: SourceGrammar -> Err SourceGrammar
|
renameGrammar :: SourceGrammar -> Err SourceGrammar
|
||||||
renameGrammar g = liftM (MGrammar . reverse) $ foldM renameModule [] (modules g)
|
renameGrammar g = liftM (MGrammar . reverse) $ foldM renameModule [] (modules g)
|
||||||
@@ -69,12 +70,22 @@ renameIdentTerm :: Status -> Term -> Err Term
|
|||||||
renameIdentTerm env@(act,imps) t =
|
renameIdentTerm env@(act,imps) t =
|
||||||
errIn ("atomic term" +++ prt t +++ "given" +++ unwords (map (prt . fst) qualifs)) $
|
errIn ("atomic term" +++ prt t +++ "given" +++ unwords (map (prt . fst) qualifs)) $
|
||||||
case t of
|
case t of
|
||||||
Vr c -> do
|
Vr c -> case lookupTree prt c act of
|
||||||
f <- err (predefAbs c) return $ lookupTreeMany prt opens c
|
Ok f -> return $ f c
|
||||||
return $ f c
|
_ -> case lookupTreeManyAll prt opens c of
|
||||||
Cn c -> do
|
[f] -> return $ f c
|
||||||
f <- lookupTreeMany prt opens c
|
[] -> predefAbs c ("constant not found:" +++ prt c)
|
||||||
return $ f c
|
fs -> case nub [f c | f <- fs] of
|
||||||
|
[tr] -> return tr
|
||||||
|
ts -> Bad $ "conflicting imports:" +++ unwords (map prt ts)
|
||||||
|
Cn c -> case lookupTree prt c act of
|
||||||
|
Ok f -> return $ f c
|
||||||
|
_ -> case lookupTreeManyAll prt opens c of
|
||||||
|
[f] -> return $ f c
|
||||||
|
[] -> Bad ("constant not found:" +++ prt c)
|
||||||
|
fs -> case nub [f c | f <- fs] of
|
||||||
|
[tr] -> return tr
|
||||||
|
ts -> Bad $ "conflicting imports:" +++ unwords (map prt ts)
|
||||||
Q m' c | m' == cPredef {- && isInPredefined c -} -> return t
|
Q m' c | m' == cPredef {- && isInPredefined c -} -> return t
|
||||||
Q m' c -> do
|
Q m' c -> do
|
||||||
m <- lookupErr m' qualifs
|
m <- lookupErr m' qualifs
|
||||||
@@ -87,15 +98,15 @@ renameIdentTerm env@(act,imps) t =
|
|||||||
return $ f c
|
return $ f c
|
||||||
_ -> return t
|
_ -> return t
|
||||||
where
|
where
|
||||||
opens = act : [st | (OSimple _ _,st) <- imps]
|
opens = [st | (OSimple _ _,st) <- imps]
|
||||||
qualifs = [(m, st) | (OQualif _ m _, st) <- imps] ++
|
qualifs = [(m, st) | (OQualif _ m _, st) <- imps] ++
|
||||||
[(m, st) | (OSimple _ m, st) <- imps] -- qualif is always possible
|
[(m, st) | (OSimple _ m, st) <- imps] -- qualif is always possible
|
||||||
|
|
||||||
-- this facility is mainly for BWC with GF1: you need not import PredefAbs
|
-- this facility is mainly for BWC with GF1: you need not import PredefAbs
|
||||||
predefAbs c s = case c of
|
predefAbs c s = case c of
|
||||||
IC "Int" -> return $ const $ Q cPredefAbs cInt
|
IC "Int" -> return $ Q cPredefAbs cInt
|
||||||
IC "Float" -> return $ const $ Q cPredefAbs cFloat
|
IC "Float" -> return $ Q cPredefAbs cFloat
|
||||||
IC "String" -> return $ const $ Q cPredefAbs cString
|
IC "String" -> return $ Q cPredefAbs cString
|
||||||
_ -> Bad s
|
_ -> Bad s
|
||||||
|
|
||||||
--- | would it make sense to optimize this by inlining?
|
--- | would it make sense to optimize this by inlining?
|
||||||
@@ -124,7 +135,7 @@ buildStatus :: SourceGrammar -> Ident -> SourceModInfo -> Err Status
|
|||||||
buildStatus gr c mo = let mo' = self2status c mo in case mo of
|
buildStatus gr c mo = let mo' = self2status c mo in case mo of
|
||||||
ModMod m -> do
|
ModMod m -> do
|
||||||
let gr1 = MGrammar $ (c,mo) : modules gr
|
let gr1 = MGrammar $ (c,mo) : modules gr
|
||||||
ops = [OSimple OQNormal e | e <- allExtendsPlus gr1 c] ++ allOpens m
|
ops = [OSimple OQNormal e | e <- allExtends gr1 c] ++ allOpens m
|
||||||
mods <- mapM (lookupModule gr1 . openedModule) ops
|
mods <- mapM (lookupModule gr1 . openedModule) ops
|
||||||
let sts = map modInfo2status $ zip ops mods
|
let sts = map modInfo2status $ zip ops mods
|
||||||
return $ if isModCnc m
|
return $ if isModCnc m
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ module GF.Data.Operations (-- * misc functions
|
|||||||
|
|
||||||
-- * binary search trees; now with FiniteMap
|
-- * binary search trees; now with FiniteMap
|
||||||
BinTree, emptyBinTree, isInBinTree, justLookupTree,
|
BinTree, emptyBinTree, isInBinTree, justLookupTree,
|
||||||
lookupTree, lookupTreeMany, updateTree,
|
lookupTree, lookupTreeMany, lookupTreeManyAll, updateTree,
|
||||||
buildTree, filterBinTree,
|
buildTree, filterBinTree,
|
||||||
sorted2tree, mapTree, mapMTree, tree2list,
|
sorted2tree, mapTree, mapMTree, tree2list,
|
||||||
|
|
||||||
@@ -318,6 +318,12 @@ lookupTreeMany pr (t:ts) x = case lookupTree pr x t of
|
|||||||
_ -> lookupTreeMany pr ts x
|
_ -> lookupTreeMany pr ts x
|
||||||
lookupTreeMany pr [] x = Bad $ "failed to find" +++ pr x
|
lookupTreeMany pr [] x = Bad $ "failed to find" +++ pr x
|
||||||
|
|
||||||
|
lookupTreeManyAll :: Ord a => (a -> String) -> [BinTree a b] -> a -> [b]
|
||||||
|
lookupTreeManyAll pr (t:ts) x = case lookupTree pr x t of
|
||||||
|
Ok v -> v : lookupTreeManyAll pr ts x
|
||||||
|
_ -> lookupTreeManyAll pr ts x
|
||||||
|
lookupTreeManyAll pr [] x = []
|
||||||
|
|
||||||
-- | destructive update
|
-- | destructive update
|
||||||
updateTree :: (Ord a) => (a,b) -> BinTree a b -> BinTree a b
|
updateTree :: (Ord a) => (a,b) -> BinTree a b -> BinTree a b
|
||||||
-- updateTree (a,b) tr = addToFM tr a b
|
-- updateTree (a,b) tr = addToFM tr a b
|
||||||
|
|||||||
Reference in New Issue
Block a user