mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-28 12:18:54 -06:00
resource = resource-1.0
This commit is contained in:
40
lib/resource/finnish/AdjectiveFin.gf
Normal file
40
lib/resource/finnish/AdjectiveFin.gf
Normal file
@@ -0,0 +1,40 @@
|
||||
concrete AdjectiveFin of Adjective = CatFin ** open ResFin, Prelude in {
|
||||
|
||||
flags optimize=all_subs ; -- gfc size from 2864336 to 6786 - i.e. factor 422
|
||||
|
||||
lin
|
||||
|
||||
PositA a = {
|
||||
s = \\_ => a.s ! Posit
|
||||
} ;
|
||||
ComparA a np = {
|
||||
s = \\isMod,af => case isMod of {
|
||||
True => np.s ! NPCase Part ++ a.s ! Compar ! af ; -- minua isompi
|
||||
_ => a.s ! Compar ! af ++ "kuin" ++ np.s ! NPCase Nom -- isompi kuin minä
|
||||
}
|
||||
} ;
|
||||
|
||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||
|
||||
ComplA2 adj np = {
|
||||
s = \\isMod,af =>
|
||||
preOrPost isMod (appCompl True Pos adj.c2 np) (adj.s ! Posit ! af)
|
||||
} ;
|
||||
|
||||
ReflA2 adj = {
|
||||
s = \\isMod,af =>
|
||||
preOrPost isMod
|
||||
(appCompl True Pos adj.c2 (reflPron (agrP3 Sg))) (adj.s ! Posit ! af)
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
s = \\b,a => ap.s ! b ! a ++ sc.s
|
||||
} ;
|
||||
|
||||
AdAP ada ap = {
|
||||
s = \\b,af => ada.s ++ ap.s ! b ! af
|
||||
} ;
|
||||
|
||||
UseA2 a = a ;
|
||||
|
||||
}
|
||||
21
lib/resource/finnish/AdverbFin.gf
Normal file
21
lib/resource/finnish/AdverbFin.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
concrete AdverbFin of Adverb = CatFin ** open ResFin, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = a.s ! Posit ! AAdv} ;
|
||||
ComparAdvAdj cadv a np = {
|
||||
s = cadv.s ++ a.s ! Posit ! AAdv ++ "kuin" ++ np.s ! NPCase Nom
|
||||
} ;
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = cadv.s ++ a.s ! Posit ! AAdv ++ "kuin" ++ s.s
|
||||
} ;
|
||||
|
||||
PrepNP prep np = {s = preOrPost prep.isPre prep.s (np.s ! prep.c)} ;
|
||||
|
||||
AdAdv = cc2 ;
|
||||
|
||||
SubjS = cc2 ;
|
||||
AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
|
||||
|
||||
AdnCAdv cadv = {s = cadv.s ++ "kuin"} ;
|
||||
|
||||
}
|
||||
@@ -1,247 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -val
|
||||
|
||||
concrete BasicFin of Basic = CategoriesFin ** open ParadigmsFin in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
|
||||
airplane_N = regN "lentokone" ;
|
||||
answer_V2S = mkV2S (caseV2 (regV "vastata") allative) ;
|
||||
apartment_N = regN "asunto" ;
|
||||
apple_N = nLukko "omena" ; --- omenia, not omenoita
|
||||
art_N = regN "taide" ;
|
||||
ask_V2Q = mkV2Q (caseV2 (regV "kysyä") ablative) ;
|
||||
baby_N = nLukko "vauva" ;
|
||||
bad_ADeg = mkADeg (nLukko "paha") "pahempi" "pahin" ;
|
||||
bank_N = regN "pankki" ;
|
||||
beautiful_ADeg = mkADeg (regN "kaunis") "kauniimpi" "kaunein" ;
|
||||
become_VA = mkVA (regV "tulla") translative ;
|
||||
beer_N = regN "olut" ;
|
||||
beg_V2V = mkV2V (caseV2 (reg2V "pyytää" "pyysi") partitive) ;
|
||||
big_ADeg = mkADeg (sgpartN (nArpi "suuri") "suurta") "suurempi" "suurin" ;
|
||||
bike_N = nLukko "polkupyörä" ; --- for correct vowel harmony
|
||||
bird_N = nLukko "lintu" ;
|
||||
black_ADeg = mkADeg (nLukko "musta") "mustempi" "mustin" ;
|
||||
blue_ADeg = mkADeg (regN "sininen") "sinisempi" "sinisin" ;
|
||||
boat_N = regN "vene" ;
|
||||
book_N = nLukko "kirja" ;
|
||||
boot_N = regN "saapas" ;
|
||||
boss_N = nLukko "pomo" ;
|
||||
boy_N = nKukko "poika" "pojan" "poikia" ;
|
||||
bread_N = nLukko "leipä" ;
|
||||
break_V2 = dirV2 (regV "rikkoa") ;
|
||||
broad_ADeg = mkADeg (regN "leveä") "leveämpi" "levein" ;
|
||||
brother_N2 = genN2 (
|
||||
mkN "veli" "veljen" "veljenä" "veljeä" "veljeen"
|
||||
"veljinä" "veljissä" "veljien" "veljiä" "veljiin" human) ;
|
||||
brown_ADeg = mkADeg (regN "ruskea") "ruskeampi" "ruskein" ;
|
||||
butter_N = reg3N "voi" "voin" "voita" ; ---- errors in Part
|
||||
buy_V2 = dirV2 (regV "ostaa") ;
|
||||
camera_N = nLukko "kamera" ;
|
||||
cap_N = regN "lakki" ;
|
||||
car_N = reg3N "auto" "auton" "autoja" ; -- regN: audon
|
||||
carpet_N = nLukko "matto" ;
|
||||
cat_N = nLukko "kissa" ;
|
||||
ceiling_N = nLukko "katto" ;
|
||||
chair_N = regN "tuoli" ;
|
||||
cheese_N = nLukko "juusto" ;
|
||||
child_N = mkN "lapsi" "lapsen" "lapsena" "lasta" "lapseen"
|
||||
"lapsina" "lapsissa" "lasten" "lapsia" "lapsiin" human ;
|
||||
church_N = nLukko "kirkko" ;
|
||||
city_N = regN "kaupunki" ;
|
||||
clean_ADeg = regADeg "puhdas" ;
|
||||
clever_ADeg = regADeg "viisas" ;
|
||||
close_V2 = dirV2 (regV "sulkea") ;
|
||||
coat_N = regN "takki" ;
|
||||
cold_ADeg = mkADeg (nLukko "kylmä") "kylmempi" "kylmin" ;
|
||||
come_V = regV "tulla" ;
|
||||
computer_N = regN "tietokone" ;
|
||||
country_N = regN "maa" ;
|
||||
cousin_N = nLukko "serkku" ;
|
||||
cow_N = nLukko "lehmä" ;
|
||||
die_V = regV "kuolla" ;
|
||||
dirty_ADeg = mkADeg (regN "likainen") "likaisempi" "likaisin" ;
|
||||
distance_N3 = mkN3 (regN "etäisyys") elative illative ;
|
||||
doctor_N = reg2N "tohtori" "tohtoreita" ;
|
||||
dog_N = nLukko "koira" ;
|
||||
door_N = nArpi "ovi" ;
|
||||
drink_V2 = dirV2 (regV "juoda") ;
|
||||
easy_A2V = mkA2V (mkA2 (mkA (nLukko "helppo")) (caseP allative)) ;
|
||||
eat_V2 = dirV2 (regV "syödä") ;
|
||||
empty_ADeg = mkADeg (nLukko "tyhjä") "tyhjempi" "tyhjin" ;
|
||||
enemy_N = regN "vihollinen" ;
|
||||
factory_N = regN "tehdas" ;
|
||||
father_N2 = genN2 (nLukko "isä") ;
|
||||
fear_VS = mkVS (reg2V "pelätä" "pelkäsi") ;
|
||||
find_V2 = dirV2 (reg2V "löytää" "löysi") ;
|
||||
fish_N = nLukko "kala" ;
|
||||
floor_N = reg2N "lattia" "lattioita" ;
|
||||
forget_V2 = dirV2 (regV "unohtaa") ;
|
||||
fridge_N = regN "jääkaappi" ;
|
||||
friend_N = nLukko "ystävä" ;
|
||||
fruit_N = nLukko "hedelmä" ;
|
||||
fun_AV = mkAV (mkA (nLukko "hauska")) ;
|
||||
garden_N = nKukko "puutarha" "puutarhan" "puutarhoja" ;
|
||||
girl_N = nLukko "tyttö" ;
|
||||
glove_N = regN "käsine" ;
|
||||
gold_N = nLukko "kulta" ;
|
||||
good_ADeg = mkADeg (nLukko "hyvä") "parempi" "parhain" ; --- paras
|
||||
go_V = regV "mennä" ;
|
||||
green_ADeg = mkADeg (regN "vihreä") "vihreämpi" "vihrein" ;
|
||||
harbour_N = nKukko "satama" "sataman" "satamia" ;
|
||||
hate_V2 = dirV2 (regV "vihata") ;
|
||||
hat_N = nLukko "hattu" ;
|
||||
have_V2 = caseV2 (caseV adessive vOlla) nominative ;
|
||||
hear_V2 = dirV2 (regV "kuulla") ;
|
||||
hill_N = nLukko "kukkula" ;
|
||||
hope_VS = mkVS (regV "toivoa") ;
|
||||
horse_N = regN "hevonen" ;
|
||||
hot_ADeg = mkADeg (nLukko "kuuma") "kuumempi" "kuumin" ;
|
||||
house_N = nLukko "talo" ;
|
||||
important_ADeg = mkADeg (regN "tärkeä") "tärkeämpi" "tärkein" ;
|
||||
industry_N = regN "teollisuus" ;
|
||||
iron_N = nLukko "rauta" ;
|
||||
king_N = regN "kuningas" ;
|
||||
know_V2 = dirV2 (reg2V "tietää" "tiesi") ; --- tuntea; gives tietänyt
|
||||
lake_N = nSylki "järvi" ;
|
||||
lamp_N = nLukko "lamppu" ;
|
||||
learn_V2 =
|
||||
dirV2 (mkV "oppia" "oppii" "opin" "oppivat" "oppikaa" "opitaan"
|
||||
"oppi" "opin" "oppisi" "oppinut" "opittu" "opitun") ;
|
||||
leather_N = nLukko "nahka" ; --- nahan
|
||||
leave_V2 = dirV2 (regV "jättää") ;
|
||||
like_V2 = caseV2 (regV "pitää") elative ;
|
||||
listen_V2 = caseV2 (reg3V "kuunnella" "kuuntelen" "kuunteli") partitive ;
|
||||
live_V = regV "elää" ;
|
||||
long_ADeg = mkADeg (nLukko "pitkä") "pitempi" "pisin" ;
|
||||
lose_V2 = dirV2 (regV "hävitä") ; --- hukata
|
||||
love_N = reg3N "rakkaus" "rakkauden" "rakkauksia" ;
|
||||
love_V2 = caseV2 (regV "rakastaa") partitive ;
|
||||
man_N = mkN "mies" "miehen" "miehenä" "miestä" "mieheen"
|
||||
"miehinä" "miehissä" "miesten" "miehiä" "miehiin" human ;
|
||||
married_A2 = mkA2 (mkA (nRae "avioitunut" "avioituneena")) (postpP genitive "kanssa") ;
|
||||
meat_N = nLukko "liha" ;
|
||||
milk_N = nLukko "maito" ;
|
||||
moon_N = regN "kuu" ;
|
||||
mother_N2 = genN2 (regN "äiti") ;
|
||||
mountain_N = nArpi "vuori" ;
|
||||
music_N = regN "musiikki" ;
|
||||
narrow_ADeg = mkADeg (regN "kapea") "kapeampi" "kapein" ;
|
||||
new_ADeg = mkADeg (reg3N "uusi" "uuden" "uusia") "uudempi" "uusin" ;
|
||||
newspaper_N = nSylki "sanomalehti" ; --- for correct vowel harmony
|
||||
oil_N = nLukko "öljy" ;
|
||||
old_ADeg = mkADeg (nLukko "vanha") "vanhempi" "vanhin" ;
|
||||
open_V2 = dirV2 (regV "avata") ;
|
||||
paint_V2A = mkV2A (dirV2 (regV "maalata")) translative ;
|
||||
paper_N = reg2N "paperi" "papereita" ;
|
||||
peace_N = nLukko "rauha" ;
|
||||
pen_N = nLukko "kynä" ;
|
||||
planet_N = nLukko "planeetta" ;
|
||||
plastic_N = regN "muovi" ;
|
||||
play_V2 = dirV2 (regV "pelata") ; --- leikkiä, soittaa
|
||||
policeman_N = regN "poliisi" ;
|
||||
priest_N = regN "pappi" ;
|
||||
probable_AS = mkAS (mkA (nNainen "todennäköistä")) ; --- for vowel harmony
|
||||
queen_N = regN "kuningatar" ;
|
||||
radio_N = reg2N "radio" "radioita" ;
|
||||
rain_V0 = mkV0 (reg2V "sataa" "satoi") ;
|
||||
read_V2 = dirV2 (regV "lukea") ;
|
||||
red_ADeg = regADeg "punainen" ;
|
||||
religion_N = nLukko "uskonto" ;
|
||||
restaurant_N = nLukko "ravintola" ;
|
||||
river_N = nArpi "joki" ;
|
||||
rock_N = reg2N "kallio" "kallioita" ;
|
||||
roof_N = nLukko "katto" ;
|
||||
rubber_N = regN "kumi" ;
|
||||
run_V = reg2V "juosta" "juoksi" ;
|
||||
say_VS = mkVS (regV "sanoa") ;
|
||||
school_N = nLukko "koulu" ;
|
||||
science_N = regN "tiede" ;
|
||||
sea_N = nMeri "meri" ;
|
||||
seek_V2 = dirV2 (regV "etsiä") ;
|
||||
see_V2 = dirV2 (
|
||||
mkV "nähdä" "näkee" "näen" "näkevät" "nähkää" "nähdään"
|
||||
"näki" "näin" "näkisi" "nähnyt" "nähty" "nähdyn") ;
|
||||
sell_V3 = dirV3 (regV "myydä") allative ;
|
||||
send_V3 = dirV3 (regV "lähettää") allative ;
|
||||
sheep_N = regN "lammas" ;
|
||||
ship_N = nLukko "laiva" ;
|
||||
shirt_N = nLukko "paita" ;
|
||||
shoe_N = nLukko "kenkä" ;
|
||||
shop_N = nLukko "kauppa" ;
|
||||
short_ADeg = regADeg "lyhyt" ;
|
||||
silver_N = regN "hopea" ;
|
||||
sister_N = nLukko "sisko" ;
|
||||
sleep_V = regV "nukkua" ;
|
||||
small_ADeg = mkADeg (reg2N "pieni" "pieniä") "pienempi" "pienin" ;
|
||||
snake_N = regN "käärme" ;
|
||||
sock_N = nLukko "sukka" ;
|
||||
speak_V2 = dirV2 (regV "puhua") ;
|
||||
star_N = nSylki "tähti" ;
|
||||
steel_N = regN "teräs" ;
|
||||
stone_N = nSylki "kivi" ;
|
||||
stove_N = reg3N "liesi" "lieden" "liesiä" ;
|
||||
student_N = reg2N "opiskelija" "opiskelijoita" ;
|
||||
stupid_ADeg = regADeg "tyhmä" ;
|
||||
sun_N = nLukko "aurinko" ;
|
||||
switch8off_V2 = dirV2 (regV "sammuttaa") ; ---
|
||||
switch8on_V2 = dirV2 (regV "sytyttää") ; ---
|
||||
table_N = nLukko "pöytä" ;
|
||||
talk_V3 = mkV3 (regV "puhua") (caseP allative) (caseP elative) ;
|
||||
teacher_N = nLukko "opettaja" ;
|
||||
teach_V2 = dirV2 (regV "opettaa") ;
|
||||
television_N = reg2N "televisio" "televisioita" ;
|
||||
thick_ADeg = regADeg "paksu" ;
|
||||
thin_ADeg = regADeg "ohut" ;
|
||||
train_N = nLukko "juna" ;
|
||||
travel_V = regV "matkustaa" ;
|
||||
tree_N = regN "puu" ;
|
||||
---- trousers_N = regN "trousers" ;
|
||||
ugly_ADeg = mkADeg (nLukko "ruma") "rumempi" "rumin" ;
|
||||
understand_V2 = dirV2 (reg3V "ymmärtää" "ymmärrän" "ymmärsi") ;
|
||||
university_N = nLukko "yliopisto" ;
|
||||
village_N = nLukko "kylä" ;
|
||||
wait_V2 = caseV2 (regV "odottaa") partitive ;
|
||||
walk_V = regV "kävellä" ;
|
||||
warm_ADeg = mkADeg
|
||||
(mkN "lämmin" "lämpimän" "lämpimänä" "lämmintä" "lämpimään"
|
||||
"lämpiminä" "lämpimissä" "lämpimien" "lämpimiä" "lämpimiin"
|
||||
nonhuman)
|
||||
"lämpimämpi" "lämpimin" ;
|
||||
war_N = nLukko "sota" ;
|
||||
watch_V2 = dirV2 (regV "katsella") ;
|
||||
water_N = reg3N "vesi" "veden" "vesiä" ;
|
||||
white_ADeg = regADeg "valkoinen" ;
|
||||
window_N = reg2N "ikkuna" "ikkunoita" ;
|
||||
wine_N = regN "viini" ;
|
||||
win_V2 = dirV2 (regV "voittaa") ;
|
||||
woman_N = regN "nainen" ;
|
||||
wonder_VQ = mkVQ (regV "ihmetellä") ;
|
||||
wood_N = regN "puu" ;
|
||||
write_V2 = dirV2 (regV "kirjoittaa") ;
|
||||
yellow_ADeg = regADeg "keltainen" ;
|
||||
young_ADeg = mkADeg (nArpi "nuori") "nuorempi" "nuorin" ;
|
||||
|
||||
do_V2 = dirV2 (
|
||||
mkV "tehdä" "tekee" "teen" "tekevät" "tehkää" "tehdään"
|
||||
"teki" "tein" "tekisi" "tehnyt" "tehty" "tehdyn") ;
|
||||
|
||||
now_Adv = mkAdv "nyt" ;
|
||||
already_Adv = mkAdv "jo" ;
|
||||
song_N = nLukko "laulu" ;
|
||||
add_V3 = dirV3 (regV "lisätä") illative ;
|
||||
number_N = reg2N "numero" "numeroita" ;
|
||||
put_V2 = dirV2 (regV "panna") ;
|
||||
stop_V = regV "pysähtyä" ;
|
||||
jump_V = regV "hypätä" ;
|
||||
here_Adv = mkAdv "täällä" ;
|
||||
here7to_Adv = mkAdv "tänne" ;
|
||||
here7from_Adv = mkAdv "täältä" ;
|
||||
there_Adv = mkAdv "siellä" ; --- tuolla
|
||||
there7to_Adv = mkAdv "sinne" ;
|
||||
there7from_Adv = mkAdv "sieltä" ;
|
||||
|
||||
} ;
|
||||
93
lib/resource/finnish/CatFin.gf
Normal file
93
lib/resource/finnish/CatFin.gf
Normal file
@@ -0,0 +1,93 @@
|
||||
concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
-- Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : Str} ;
|
||||
RS = {s : Agr => Str ; c : NPForm} ;
|
||||
|
||||
-- Sentence
|
||||
|
||||
Cl = {s : Tense => Anteriority => Polarity => SType => Str} ;
|
||||
Slash = {s : Tense => Anteriority => Polarity => Str ; c2 : Compl} ;
|
||||
Imp = {s : Polarity => Number => Str} ;
|
||||
|
||||
-- Question
|
||||
|
||||
QCl = {s : Tense => Anteriority => Polarity => Str} ;
|
||||
IP = {s : NPForm => Str ; n : Number} ;
|
||||
IComp = {s : Agr => Str} ;
|
||||
IDet = {s : Case => Str ; n : Number} ;
|
||||
|
||||
-- Relative
|
||||
|
||||
RCl = {s : Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ;
|
||||
RP = {s : Number => NPForm => Str ; a : RAgr} ;
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = ResFin.VP ;
|
||||
Comp = {s : Agr => Str} ;
|
||||
|
||||
-- Adjective
|
||||
|
||||
-- The $Bool$ tells whether usage is modifying (as opposed to
|
||||
-- predicative), e.g. "x on suurempi kuin y" vs. "y:tä suurempi luku".
|
||||
|
||||
AP = {s : Bool => AForm => Str} ;
|
||||
|
||||
-- Noun
|
||||
|
||||
-- The $Bool$ tells if a possessive suffix is attached, which affects the case.
|
||||
|
||||
CN = {s : NForm => Str} ;
|
||||
Pron = {s : NPForm => Str ; a : Agr} ;
|
||||
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
|
||||
Det = {
|
||||
s1 : Case => Str ; -- minun kolme
|
||||
s2 : Str ; -- -ni
|
||||
n : Number ; -- Pl (agreement feature for verb)
|
||||
isNum : Bool ; -- True (a numeral is present)
|
||||
isPoss : Bool ; -- True (a possessive suffix is present)
|
||||
isDef : Bool -- True (verb agrees in Pl, Nom is not Part)
|
||||
} ;
|
||||
QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
||||
Ord = {s : Number => Case => Str} ;
|
||||
Predet = {s : Number => NPForm => Str} ;
|
||||
Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
||||
Num = {s : Number => Case => Str ; isNum : Bool} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
Conj = {s : Str ; n : Number} ;
|
||||
DConj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = Compl ;
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ;
|
||||
V2, VA = Verb1 ** {c2 : Compl} ;
|
||||
V2A = Verb1 ** {c2, c3 : Compl} ;
|
||||
VV = Verb1 ; ---- infinitive form
|
||||
V3 = Verb1 ** {c2, c3 : Compl} ;
|
||||
|
||||
A = {s : Degree => AForm => Str} ;
|
||||
A2 = {s : Degree => AForm => Str ; c2 : Compl} ;
|
||||
|
||||
N = {s : NForm => Str} ;
|
||||
N2 = {s : NForm => Str} ** {c2 : Compl} ;
|
||||
N3 = {s : NForm => Str} ** {c2,c3 : Compl} ;
|
||||
PN = {s : Case => Str} ;
|
||||
|
||||
oper Verb1 = {s : VForm => Str ; sc : NPForm} ;
|
||||
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level Finnish Resource Grammar: Linearization Types
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
concrete CategoriesFin of Categories = PredefCnc ** open Prelude, SyntaxFin in {
|
||||
|
||||
lincat
|
||||
N = CommNoun ;
|
||||
-- = {s : NForm => Str ; g : Gender}
|
||||
CN = CommNounPhrase ;
|
||||
NP = {s : NPForm => Str ; n : Number ; p : NPPerson} ;
|
||||
PN = {s : Case => Str} ;
|
||||
Det = {s : Gender => Case => Str ; n : Number ; isNum : Bool} ;
|
||||
NDet = {s : Gender => Case => Str ; isNum : Bool} ;
|
||||
N2 = Function ;
|
||||
-- = CommNounPhrase ** {c : NPForm} ;
|
||||
N3 = Function ** {c2 : NPForm} ;
|
||||
Num = {s : NPForm => Str ; isNum : Bool ; n : Number} ;
|
||||
Prep = {s : Str ; c : Case ; isPrep : Bool} ;
|
||||
|
||||
A = Adjective ;
|
||||
-- = CommonNoun ;
|
||||
A2 = Adjective ** {s3 : Str ; p : Bool ; c : ComplCase} ;
|
||||
ADeg = {s : Degree => AForm => Str} ;
|
||||
AP = {s : AdjPos => AForm => Str} ;
|
||||
AS = Adjective ; --- "more difficult for him to come than..."
|
||||
A2S = Adjective ** {s3 : Str ; p : Bool ; c : ComplCase} ;
|
||||
AV = Adjective ;
|
||||
A2V = Adjective ** {s3 : Str ; p : Bool ; c : ComplCase} ;
|
||||
|
||||
V = Verb1 ;
|
||||
-- = {s : VForm => Str}
|
||||
VPI = {s : VIForm => Number => Str ; sc : Case} ;
|
||||
VCl = {s : Bool => Anteriority => VIForm => Number => Str ; sc : Case} ;
|
||||
----- VP = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
||||
---- VG = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
||||
V2 = TransVerb ;
|
||||
-- = Verb ** {s3 : Str ; p : Bool ; c : ComplCase} ;
|
||||
V3 = TransVerb ** {s5 : Str ; p2 : Bool ; c2 : ComplCase} ;
|
||||
VS = Verb1 ;
|
||||
VV = Verb1 ** {i : VIForm} ;
|
||||
VQ = Verb1 ;
|
||||
VA = Verb1 ** {c : Case} ;
|
||||
|
||||
V2S = TransVerb ;
|
||||
V2Q = TransVerb ;
|
||||
V2V = TransVerb ; ----
|
||||
V2A = TransVerb ** {c2 : Case} ;
|
||||
V0 = Verb ;
|
||||
|
||||
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
||||
Tense = {s : Str ; t : Tense} ;
|
||||
Pol = {s : Str ; p : Bool} ;
|
||||
Ant = {s : Str ; a : Anteriority} ;
|
||||
|
||||
PP = {s : Str} ;
|
||||
Adv = {s : Str} ;
|
||||
AdV = {s : Str} ;
|
||||
AdA = {s : Str} ;
|
||||
AdC = {s : Str} ;
|
||||
|
||||
S = {s : Str} ;
|
||||
Cl = Clause ;
|
||||
-- = {s : SType => Bool => SForm => Str} ;
|
||||
|
||||
Slash = QuestClause ** {s2 : Str ; c : ComplCase} ;
|
||||
|
||||
RP = {s : Number => Case => Str} ;
|
||||
RCl = {s : Bool => SForm => Number => Str} ;
|
||||
RS = {s : Number => Str} ;
|
||||
|
||||
IP = {s : NPForm => Str ; n : Number} ;
|
||||
IDet = {s : Gender => Case => Str ; n : Number} ;
|
||||
IAdv = {s : Str} ;
|
||||
QCl = {s : Bool * SForm => Str} ;
|
||||
QS = {s : Str} ;
|
||||
Imp = {s : Number => Str} ;
|
||||
Phr = {s : Str} ;
|
||||
Text = {s : Str} ;
|
||||
|
||||
Subj = {s : Str} ;
|
||||
Conj = {s : Str ; n : Number} ;
|
||||
ConjD = {s1 : Str ; s2 : Str ; n : Number} ;
|
||||
|
||||
ListS = {s1 : Str ; s2 : Str} ;
|
||||
ListAP = {s1,s2 : AdjPos => AForm => Str} ;
|
||||
ListNP = {s1,s2 : NPForm => Str ; n : Number ; p : NPPerson} ;
|
||||
ListAdv = {s1 : Str ; s2 : Str} ;
|
||||
|
||||
} ;
|
||||
@@ -1,290 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete ClauseFin of Clause = CategoriesFin **
|
||||
open Prelude, SyntaxFin in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
SPredV np v =
|
||||
sats2clause (mkSats np v) ;
|
||||
---- SPredPassV subj v =
|
||||
---- sats2clause (mkSatsCopula subj (v.s ! VPart (pgen2gen subj.g) subj.n)) ;
|
||||
SPredV2 np v y =
|
||||
sats2clause (mkSatsObject np v y) ;
|
||||
SPredV3 subj verb obj1 obj2 =
|
||||
sats2clause (
|
||||
insertObject (mkSatsObject subj verb obj1) verb.c2 verb.s5 verb.p obj2) ;
|
||||
---- SPredReflV2 subj verb =
|
||||
---- sats2clause (
|
||||
---- mkSatsObject subj
|
||||
---- {s = verb.s ; s2 = [] ; c = accusative ; aux = AEsse}
|
||||
---- (reflPronNounPhrase (pgen2gen subj.g) subj.n subj.p)) ;
|
||||
SPredVS subj verb sent =
|
||||
sats2clause (
|
||||
insertComplement (mkSats subj verb) (embedConj ++ sent.s)) ;
|
||||
SPredVQ subj verb quest =
|
||||
sats2clause (
|
||||
insertComplement (mkSats subj verb) quest.s) ;
|
||||
SPredV2S subj verb obj sent =
|
||||
sats2clause (
|
||||
insertComplement
|
||||
(mkSatsObject subj verb obj)
|
||||
(embedConj ++ sent.s)
|
||||
) ;
|
||||
SPredV2Q subj verb obj quest =
|
||||
sats2clause (
|
||||
insertComplement
|
||||
(mkSatsObject subj verb obj)
|
||||
quest.s
|
||||
) ;
|
||||
SPredVA subj verb adj =
|
||||
sats2clause (
|
||||
insertComplement (mkSats subj verb) (adj.s ! APred ! AN (NCase subj.n verb.c))) ;
|
||||
SPredV2A subj verb obj adj =
|
||||
sats2clause (
|
||||
insertComplement
|
||||
(mkSatsObject subj verb obj)
|
||||
(adj.s ! APred ! AN (NCase subj.n verb.c2))
|
||||
) ;
|
||||
SPredVV subj verb vp =
|
||||
sats2clause (
|
||||
insertComplement
|
||||
(mkSats subj verb)
|
||||
(vp.s ! VIInfinit ! subj.n)
|
||||
) ;
|
||||
SPredObjV2V subj verb obj vp =
|
||||
sats2clause (
|
||||
insertComplement
|
||||
(mkSatsObject subj verb obj)
|
||||
(vp.s ! VIInfinit ! subj.n)
|
||||
) ;
|
||||
SPredSubjV2V subj verb obj vp =
|
||||
sats2clause (
|
||||
insertComplement
|
||||
(mkSatsObject subj verb obj)
|
||||
(vp.s ! VIInfinit ! subj.n)
|
||||
) ;
|
||||
|
||||
----- SPredProgVP np vp = sats2clause (progressiveSats np vp) ;
|
||||
|
||||
SPredAP subj adj =
|
||||
sats2clause (mkSatsCopula subj (complAdjPhrase subj.n adj)) ;
|
||||
SPredCN subj cn =
|
||||
sats2clause (mkSatsCopula subj (complCommNoun subj.n cn)) ;
|
||||
SPredNP subj np =
|
||||
sats2clause (mkSatsCopula subj (np.s ! NPCase Nom)) ;
|
||||
SPredAdv subj adv =
|
||||
sats2clause (mkSatsCopula subj adv.s) ;
|
||||
|
||||
|
||||
QPredV np v =
|
||||
sats2quest (mkSats (intNounPhrase np) v) ;
|
||||
QPredV2 np v y =
|
||||
sats2quest (mkSatsObject (intNounPhrase np) v y) ;
|
||||
|
||||
--------
|
||||
{-
|
||||
QPredV np v =
|
||||
sats2quest (mkSats (intNounPhrase np) v) ;
|
||||
QPredPassV subj v =
|
||||
sats2quest (mkSatsCopula (intNounPhrase subj) (v.s ! VPart subj.g subj.n)) ;
|
||||
QPredV2 np v y =
|
||||
sats2quest (mkSatsObject (intNounPhrase np) v y) ;
|
||||
QPredV3 subj verb obj1 obj2 =
|
||||
sats2quest (
|
||||
insertObject (mkSatsObject (intNounPhrase subj) verb obj1) verb.c3 verb.s3 obj2
|
||||
) ;
|
||||
QPredReflV2 subj verb =
|
||||
sats2quest (
|
||||
mkSatsObject (intNounPhrase subj)
|
||||
{s = verb.s ; s2 = [] ; c = accusative ; aux = AEsse}
|
||||
(reflPronNounPhrase subj.g subj.n P3)) ;
|
||||
QPredVS subj verb sent =
|
||||
sats2quest (
|
||||
insertExtrapos (mkSats (intNounPhrase subj) verb)
|
||||
(\\b => embedConj ++ sent.s ! subordMode verb b)) ; ---- mn
|
||||
QPredVQ subj verb quest =
|
||||
sats2quest (
|
||||
insertExtrapos (mkSats (intNounPhrase subj) verb) (\\_ => quest.s ! IndirQ)) ;
|
||||
QPredV2S subj verb obj sent =
|
||||
sats2quest (
|
||||
insertExtrapos
|
||||
(mkSatsObject (intNounPhrase subj) verb obj)
|
||||
(\\b => embedConj ++ sent.s ! subordMode verb b)
|
||||
) ; ---- mn ;
|
||||
QPredV2Q subj verb obj quest =
|
||||
sats2quest (
|
||||
insertExtrapos
|
||||
(mkSatsObject (intNounPhrase subj) verb obj)
|
||||
(\\_ => quest.s ! IndirQ)) ;
|
||||
QPredVA subj verb adj =
|
||||
sats2quest (
|
||||
insertExtrapos (mkSats (intNounPhrase subj) verb)
|
||||
(\\_ => adj.s ! AF subj.g subj.n)) ;
|
||||
QPredV2A subj verb obj adj =
|
||||
sats2quest (
|
||||
insertExtrapos
|
||||
(mkSatsObject (intNounPhrase subj) verb obj)
|
||||
(\\_ => adj.s ! AF (pgen2gen obj.g) obj.n)) ;
|
||||
QPredVV subj verb vp =
|
||||
sats2quest (
|
||||
insertExtrapos
|
||||
(mkSats (intNounPhrase subj) verb)
|
||||
(\\_ => prepCase verb.c ++
|
||||
vp.s ! VIInfinit ! subj.g ! (intNounPhrase subj).n ! P3)
|
||||
) ;
|
||||
QPredObjV2V subj verb obj vp =
|
||||
sats2quest (
|
||||
insertExtrapos
|
||||
(mkSatsObject (intNounPhrase subj) verb obj)
|
||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen obj.g ! obj.n ! obj.p)
|
||||
) ;
|
||||
QPredSubjV2V subj verb obj vp =
|
||||
sats2quest (
|
||||
insertExtrapos
|
||||
(mkSatsObject (intNounPhrase subj) verb obj)
|
||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! subj.g ! subj.n ! P3)
|
||||
) ;
|
||||
|
||||
-- QPredProgVP
|
||||
-}
|
||||
QPredAP subj adj =
|
||||
sats2quest (mkSatsCopula (intNounPhrase subj) (complAdjPhrase subj.n adj)) ;
|
||||
QPredCN subj cn =
|
||||
sats2quest (mkSatsCopula (intNounPhrase subj) (complCommNoun subj.n cn)) ;
|
||||
QPredNP subj np =
|
||||
sats2quest (mkSatsCopula (intNounPhrase subj) (np.s ! NPCase Nom)) ;
|
||||
QPredAdv subj adv =
|
||||
sats2quest (mkSatsCopula (intNounPhrase subj) adv.s) ;
|
||||
|
||||
{-
|
||||
|
||||
QPredProgVP np vp = sats2quest (progressiveSats (intNounPhrase np) vp) ;
|
||||
-}
|
||||
|
||||
|
||||
RPredV np v =
|
||||
sats2rel (mkSatsRel np v) ;
|
||||
RPredV2 np v y =
|
||||
sats2rel (mkSatsObjectRel np v y) ;
|
||||
|
||||
RPredAP subj adj =
|
||||
sats2rel (\num -> mkSatsCopulaRel subj (complAdjPhrase num adj) num) ;
|
||||
RPredCN subj cn =
|
||||
sats2rel (\num -> mkSatsCopulaRel subj (complCommNoun num cn) num) ;
|
||||
RPredNP subj np =
|
||||
sats2rel (mkSatsCopulaRel subj (np.s ! NPCase Nom)) ;
|
||||
RPredAdv subj adv =
|
||||
sats2rel (mkSatsCopulaRel subj adv.s) ;
|
||||
|
||||
IPredV v =
|
||||
mkClauseInf v ;
|
||||
IPredV2 verb y =
|
||||
insertObjectInf (mkClauseInf verb) verb.c verb.s3 verb.p y ;
|
||||
IPredV3 verb y z =
|
||||
insertObjectInf
|
||||
(insertObjectInf (mkClauseInf verb) verb.c verb.s3 verb.p y)
|
||||
verb.c2 verb.s5 verb.p2 z ;
|
||||
IPredVS verb sent =
|
||||
insertComplementInf (mkClauseInf verb) (embedConj ++ sent.s) ;
|
||||
IPredVQ verb quest =
|
||||
insertComplementInf (mkClauseInf verb) quest.s ;
|
||||
|
||||
{-
|
||||
IPredV2 a v y =
|
||||
sats2verbPhrase a (mkSatsObject pronImpers v y) ;
|
||||
IPredAP a adj =
|
||||
sats2verbPhrase a (mkSatsCopula pronImpers (complAdjPhrase Sg adj)) ; ---
|
||||
IPredV3 a verb obj1 obj2 =
|
||||
sats2verbPhrase a (insertObject (mkSatsObject pronImpers verb obj1) verb.c2 verb.s5 verb.p obj2) ;
|
||||
|
||||
|
||||
IPredPassV a v =
|
||||
sats2verbPhrase a (mkSatsCopula pronImpers (v.s ! VPart (pgen2gen
|
||||
pronImpers.g) pronImpers.n)) ;
|
||||
IPredReflV2 a verb =
|
||||
sats2verbPhrase a (
|
||||
mkSatsObject pronImpers
|
||||
{s = verb.s ; s2 = [] ; c = accusative ; aux = AEsse}
|
||||
---- {s = verb.s ; s2 = verb.s2 ; c = verb.c ; aux = AEsse}
|
||||
---- this produces huge cf - find out why! AR 16/3/2005
|
||||
(reflPronNounPhrase (pgen2gen pronImpers.g) pronImpers.n pronImpers.p)) ;
|
||||
IPredVS a verb sent =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos (mkSats pronImpers verb)
|
||||
(\\b => embedConj ++ sent.s ! subordMode verb b)) ; ---- mn
|
||||
IPredVQ a verb quest =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos (mkSats pronImpers verb) (\\_ => quest.s ! IndirQ)) ;
|
||||
IPredV2S a verb obj sent =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos
|
||||
(mkSatsObject pronImpers verb obj)
|
||||
(\\b => embedConj ++ sent.s ! subordMode verb b)
|
||||
) ; ---- mn ;
|
||||
IPredV2Q a verb obj quest =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos
|
||||
(mkSatsObject pronImpers verb obj)
|
||||
(\\_ => quest.s ! IndirQ)) ;
|
||||
IPredVA a verb adj =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos (mkSats pronImpers verb) (\\_ => adj.s ! AF (pgen2gen pronImpers.g) pronImpers.n)) ;
|
||||
IPredV2A a verb obj adj =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos
|
||||
(mkSatsObject pronImpers verb obj)
|
||||
(\\_ => adj.s ! AF (pgen2gen obj.g) obj.n)) ;
|
||||
IPredVV a verb vp =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos
|
||||
(mkSats pronImpers verb)
|
||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen pronImpers.g ! pronImpers.n ! pronImpers.p)
|
||||
) ;
|
||||
|
||||
IPredObjV2V a verb obj vp =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos
|
||||
(mkSatsObject pronImpers verb obj)
|
||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen obj.g ! obj.n ! obj.p)
|
||||
) ;
|
||||
IPredSubjV2V a verb obj vp =
|
||||
sats2verbPhrase a (
|
||||
insertExtrapos
|
||||
(mkSatsObject pronImpers verb obj)
|
||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen pronImpers.g ! pronImpers.n ! pronImpers.p)
|
||||
) ;
|
||||
|
||||
|
||||
IPredCN a cn =
|
||||
sats2verbPhrase a (mkSatsCopula pronImpers (indefNoun pronImpers.n cn)) ;
|
||||
IPredNP a np =
|
||||
sats2verbPhrase a (mkSatsCopula pronImpers (np.s ! stressed nominative)) ;
|
||||
IPredAdv a adv =
|
||||
sats2verbPhrase a (mkSatsCopula pronImpers adv.s) ;
|
||||
|
||||
IPredProgVP a vp = sats2verbPhrase a (progressiveSats pronImpers vp) ;
|
||||
|
||||
-}
|
||||
|
||||
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
|
||||
|
||||
}
|
||||
43
lib/resource/finnish/ConjunctionFin.gf
Normal file
43
lib/resource/finnish/ConjunctionFin.gf
Normal file
@@ -0,0 +1,43 @@
|
||||
concrete ConjunctionFin of Conjunction =
|
||||
CatFin ** open ResFin, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
ConjS = conjunctSS ;
|
||||
DConjS = conjunctDistrSS ;
|
||||
|
||||
ConjAdv = conjunctSS ;
|
||||
DConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjNP conj ss = conjunctTable NPForm conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
|
||||
isPron = False
|
||||
} ;
|
||||
DConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctTable2 Bool AForm conj ss ;
|
||||
DConjAP conj ss = conjunctDistrTable2 Bool AForm conj ss ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ;
|
||||
ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
BaseAP x y = twoTable2 Bool AForm x y ;
|
||||
ConsAP xs x = consrTable2 Bool AForm comma xs x ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||
[AP] = {s1,s2 : Bool => AForm => Str} ;
|
||||
|
||||
}
|
||||
20
lib/resource/finnish/ExtraFin.gf
Normal file
20
lib/resource/finnish/ExtraFin.gf
Normal file
@@ -0,0 +1,20 @@
|
||||
concrete ExtraFin of ExtraFinAbs = CatFin ** open ResFin, Prelude in {
|
||||
|
||||
lin
|
||||
GenNP np = {
|
||||
s1 = \\_,_ => np.s ! NPCase Gen ;
|
||||
s2 = [] ;
|
||||
isNum = False ;
|
||||
isPoss = False ;
|
||||
isDef = True --- "Jussin kolme autoa ovat" ; thus "...on" is missing
|
||||
} ;
|
||||
|
||||
AdvExistNP adv np =
|
||||
mkClause (\_ -> adv.s) np.a (insertObj
|
||||
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlla ** {sc = NPCase Nom}))) ;
|
||||
|
||||
AdvPredNP adv v np =
|
||||
mkClause (\_ -> adv.s) np.a (insertObj
|
||||
(\\_,b,_ => np.s ! NPCase Nom) (predV v)) ;
|
||||
|
||||
}
|
||||
7
lib/resource/finnish/ExtraFinAbs.gf
Normal file
7
lib/resource/finnish/ExtraFinAbs.gf
Normal file
@@ -0,0 +1,7 @@
|
||||
abstract ExtraFinAbs = Extra [GenNP] ** {
|
||||
|
||||
fun
|
||||
AdvExistNP : Adv -> NP -> Cl ; -- kuvassa olemme me
|
||||
AdvPredNP : Adv -> V -> NP -> Cl ; -- kuvassa hymyilee Veikko
|
||||
|
||||
}
|
||||
6
lib/resource/finnish/Finnish.gf
Normal file
6
lib/resource/finnish/Finnish.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete Finnish of FinnishAbs =
|
||||
LangFin,
|
||||
ExtraFin
|
||||
** {} ;
|
||||
4
lib/resource/finnish/FinnishAbs.gf
Normal file
4
lib/resource/finnish/FinnishAbs.gf
Normal file
@@ -0,0 +1,4 @@
|
||||
abstract FinnishAbs =
|
||||
Lang,
|
||||
ExtraFinAbs
|
||||
** {} ;
|
||||
21
lib/resource/finnish/GrammarFin.gf
Normal file
21
lib/resource/finnish/GrammarFin.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarFin of Grammar =
|
||||
NounFin,
|
||||
VerbFin,
|
||||
AdjectiveFin,
|
||||
AdverbFin,
|
||||
NumeralFin,
|
||||
SentenceFin,
|
||||
QuestionFin,
|
||||
RelativeFin,
|
||||
ConjunctionFin,
|
||||
PhraseFin,
|
||||
TextX,
|
||||
IdiomFin,
|
||||
StructuralFin
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = finnish ; lexer = text ;
|
||||
|
||||
} ;
|
||||
73
lib/resource/finnish/IdiomFin.gf
Normal file
73
lib/resource/finnish/IdiomFin.gf
Normal file
@@ -0,0 +1,73 @@
|
||||
concrete IdiomFin of Idiom = CatFin **
|
||||
open MorphoFin, ParadigmsFin, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ExistNP np =
|
||||
let
|
||||
cas : Polarity -> NPForm = \p -> case p of {
|
||||
Pos => NPCase Nom ; -- on olemassa luku
|
||||
Neg => NPCase Part -- ei ole olemassa lukua
|
||||
}
|
||||
in
|
||||
mkClause noSubj (agrP3 Sg) (insertObj
|
||||
(\\_,b,_ => "olemassa" ++ np.s ! cas b) (predV olla)) ;
|
||||
|
||||
ExistIP ip =
|
||||
let
|
||||
cas : NPForm = NPCase Part ; --- dep on num, pol?
|
||||
vp = insertObj (\\_,b,_ => "olemassa") (predV olla) ;
|
||||
cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 Sg}) cas) (agrP3 Sg) vp
|
||||
in {
|
||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
||||
} ;
|
||||
|
||||
-- Notice the nominative in the cleft $NP$: "se on Matti josta Liisa pitää"
|
||||
|
||||
CleftNP np rs = mkClause (\_ -> "se") (agrP3 Sg)
|
||||
(insertExtrapos (rs.s ! np.a)
|
||||
(insertObj (\\_,_,_ => np.s ! NPCase Nom) (predV olla))) ;
|
||||
|
||||
-- This gives the almost forbidden "se on Porissa kun Matti asuu".
|
||||
|
||||
CleftAdv ad s = mkClause (\_ -> "se") (agrP3 Sg)
|
||||
(insertExtrapos ("kun" ++ s.s)
|
||||
(insertObj (\\_,_,_ => ad.s) (predV olla))) ;
|
||||
|
||||
ImpersCl vp = mkClause noSubj (agrP3 Sg) vp ;
|
||||
|
||||
GenericCl vp = mkClause noSubj (agrP3 Sg) {
|
||||
s = \\_ => vp.s ! VIPass ;
|
||||
s2 = vp.s2 ;
|
||||
ext = vp.ext ;
|
||||
sc = vp.sc
|
||||
} ;
|
||||
|
||||
ProgrVP vp =
|
||||
let
|
||||
inf = (vp.s ! VIInf Inf3Iness ! Simul ! Pos ! agrP3 Sg).fin ;
|
||||
on = predV olla
|
||||
in {
|
||||
s = on.s ;
|
||||
s2 = \\b,p,a => inf ++ vp.s2 ! b ! p ! a ;
|
||||
ext = vp.ext ;
|
||||
sc = vp.sc
|
||||
} ;
|
||||
|
||||
-- This gives "otetaan oluet" instead of "ottakaamme oluet".
|
||||
-- The imperative is not available in a $VP$.
|
||||
|
||||
ImpPl1 vp =
|
||||
let vps = vp.s ! VIPass ! Simul ! Pos ! {n = Pl ; p = P1}
|
||||
in
|
||||
{s = vps.fin ++ vps.inf ++
|
||||
vp.s2 ! True ! Pos ! {n = Pl ; p = P1} ++ vp.ext
|
||||
} ;
|
||||
|
||||
oper
|
||||
olla = verbOlla ** {sc = NPCase Nom} ;
|
||||
|
||||
noSubj : Polarity -> Str = \_ -> [] ;
|
||||
}
|
||||
|
||||
@@ -1,27 +1,10 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete LangFin of Lang =
|
||||
RulesFin,
|
||||
ClauseFin,
|
||||
StructuralFin,
|
||||
BasicFin,
|
||||
---- TimeEng,
|
||||
---- CountryEng
|
||||
MathFin
|
||||
GrammarFin,
|
||||
LexiconFin
|
||||
** {
|
||||
|
||||
** open Prelude, ParadigmsFin in {
|
||||
flags startcat = Phr ; unlexer = text ; lexer = finnish ;
|
||||
|
||||
flags unlexer=finnish ;
|
||||
|
||||
{-
|
||||
lin
|
||||
AdvDate d = prefixSS "on" d ;
|
||||
AdvTime t = prefixSS "at" t ;
|
||||
NWeekday w = w ;
|
||||
PNWeekday w = nounPN w ;
|
||||
|
||||
PNCountry x = x ;
|
||||
ANationality x = x ;
|
||||
NLanguage x = x ;
|
||||
-}
|
||||
}
|
||||
} ;
|
||||
|
||||
378
lib/resource/finnish/LexiconFin.gf
Normal file
378
lib/resource/finnish/LexiconFin.gf
Normal file
@@ -0,0 +1,378 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconFin of Lexicon = CatFin ** open MorphoFin, ParadigmsFin in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
|
||||
lin
|
||||
airplane_N = regN "lentokone" ;
|
||||
answer_V2S = mkV2S (regV "vastata") (casePrep allative) ;
|
||||
apartment_N = regN "asunto" ;
|
||||
apple_N = nLukko "omena" ; --- omenia, not omenoita
|
||||
art_N = regN "taide" ;
|
||||
ask_V2Q = mkV2Q (regV "kysyä") (casePrep ablative) ;
|
||||
baby_N = nLukko "vauva" ;
|
||||
bad_A = mkADeg (nLukko "paha") "pahempi" "pahin" ;
|
||||
bank_N = regN "pankki" ;
|
||||
beautiful_A = mkADeg (regN "kaunis") "kauniimpi" "kaunein" ;
|
||||
become_VA = mkVA (regV "tulla") (casePrep translative) ;
|
||||
beer_N = regN "olut" ;
|
||||
beg_V2V = mkV2V (reg2V "pyytää" "pyysi") (casePrep partitive) ;
|
||||
big_A = mkADeg (sgpartN (nArpi "suuri") "suurta") "suurempi" "suurin" ;
|
||||
bike_N = nLukko "polkupyörä" ; --- for correct vowel harmony
|
||||
bird_N = nLukko "lintu" ;
|
||||
black_A = mkADeg (nLukko "musta") "mustempi" "mustin" ;
|
||||
blue_A = mkADeg (regN "sininen") "sinisempi" "sinisin" ;
|
||||
boat_N = regN "vene" ;
|
||||
book_N = nLukko "kirja" ;
|
||||
boot_N = regN "saapas" ;
|
||||
boss_N = nLukko "pomo" ;
|
||||
boy_N = nKukko "poika" "pojan" "poikia" ;
|
||||
bread_N = nLukko "leipä" ;
|
||||
break_V2 = dirV2 (regV "rikkoa") ;
|
||||
broad_A = mkADeg (regN "leveä") "leveämpi" "levein" ;
|
||||
brother_N2 = genN2 (
|
||||
mkN "veli" "veljen" "veljenä" "veljeä" "veljeen"
|
||||
"veljinä" "veljissä" "veljien" "veljiä" "veljiin") ;
|
||||
brown_A = mkADeg (regN "ruskea") "ruskeampi" "ruskein" ;
|
||||
butter_N = reg3N "voi" "voin" "voita" ; ---- errors in Part
|
||||
buy_V2 = dirV2 (regV "ostaa") ;
|
||||
camera_N = nLukko "kamera" ;
|
||||
cap_N = regN "lakki" ;
|
||||
car_N = reg3N "auto" "auton" "autoja" ; -- regN: audon
|
||||
carpet_N = nLukko "matto" ;
|
||||
cat_N = nLukko "kissa" ;
|
||||
ceiling_N = nLukko "katto" ;
|
||||
chair_N = regN "tuoli" ;
|
||||
cheese_N = nLukko "juusto" ;
|
||||
child_N = mkN "lapsi" "lapsen" "lapsena" "lasta" "lapseen"
|
||||
"lapsina" "lapsissa" "lasten" "lapsia" "lapsiin" ;
|
||||
church_N = nLukko "kirkko" ;
|
||||
city_N = regN "kaupunki" ;
|
||||
clean_A = regA "puhdas" ;
|
||||
clever_A = regA "viisas" ;
|
||||
close_V2 = dirV2 (regV "sulkea") ;
|
||||
coat_N = regN "takki" ;
|
||||
cold_A = mkADeg (nLukko "kylmä") "kylmempi" "kylmin" ;
|
||||
come_V = regV "tulla" ;
|
||||
computer_N = regN "tietokone" ;
|
||||
country_N = regN "maa" ;
|
||||
cousin_N = nLukko "serkku" ;
|
||||
cow_N = nLukko "lehmä" ;
|
||||
die_V = regV "kuolla" ;
|
||||
dirty_A = mkADeg (regN "likainen") "likaisempi" "likaisin" ;
|
||||
distance_N3 = mkN3 (regN "etäisyys") (casePrep elative) (casePrep illative) ;
|
||||
doctor_N = reg2N "tohtori" "tohtoreita" ;
|
||||
dog_N = nLukko "koira" ;
|
||||
door_N = nArpi "ovi" ;
|
||||
drink_V2 = dirV2 (regV "juoda") ;
|
||||
easy_A2V = mkA2V (mkA (nLukko "helppo")) (casePrep allative) ;
|
||||
eat_V2 = dirV2 (regV "syödä") ;
|
||||
empty_A = mkADeg (nLukko "tyhjä") "tyhjempi" "tyhjin" ;
|
||||
enemy_N = regN "vihollinen" ;
|
||||
factory_N = regN "tehdas" ;
|
||||
father_N2 = genN2 (nLukko "isä") ;
|
||||
fear_VS = mkVS (reg2V "pelätä" "pelkäsi") ;
|
||||
find_V2 = dirV2 (reg2V "löytää" "löysi") ;
|
||||
fish_N = nLukko "kala" ;
|
||||
floor_N = reg2N "lattia" "lattioita" ;
|
||||
forget_V2 = dirV2 (regV "unohtaa") ;
|
||||
fridge_N = regN "jääkaappi" ;
|
||||
friend_N = nLukko "ystävä" ;
|
||||
fruit_N = nLukko "hedelmä" ;
|
||||
fun_AV = mkAV (mkA (nLukko "hauska")) ;
|
||||
garden_N = nKukko "puutarha" "puutarhan" "puutarhoja" ;
|
||||
girl_N = nLukko "tyttö" ;
|
||||
glove_N = regN "käsine" ;
|
||||
gold_N = nLukko "kulta" ;
|
||||
good_A = mkADeg (nLukko "hyvä") "parempi" "parhain" ; --- paras
|
||||
go_V = regV "mennä" ;
|
||||
green_A = mkADeg (regN "vihreä") "vihreämpi" "vihrein" ;
|
||||
harbour_N = nKukko "satama" "sataman" "satamia" ;
|
||||
hate_V2 = dirV2 (regV "vihata") ;
|
||||
hat_N = nLukko "hattu" ;
|
||||
have_V2 = dirV2 (caseV adessive vOlla) ;
|
||||
hear_V2 = dirV2 (regV "kuulla") ;
|
||||
hill_N = nLukko "kukkula" ;
|
||||
hope_VS = mkVS (regV "toivoa") ;
|
||||
horse_N = regN "hevonen" ;
|
||||
hot_A = mkADeg (nLukko "kuuma") "kuumempi" "kuumin" ;
|
||||
house_N = nLukko "talo" ;
|
||||
important_A = mkADeg (regN "tärkeä") "tärkeämpi" "tärkein" ;
|
||||
industry_N = regN "teollisuus" ;
|
||||
iron_N = nLukko "rauta" ;
|
||||
king_N = regN "kuningas" ;
|
||||
know_V2 = dirV2 (reg2V "tietää" "tiesi") ; --- tuntea; gives tietänyt
|
||||
lake_N = nSylki "järvi" ;
|
||||
lamp_N = nLukko "lamppu" ;
|
||||
learn_V2 =
|
||||
dirV2 (mkV "oppia" "oppii" "opin" "oppivat" "oppikaa" "opitaan"
|
||||
"oppi" "opin" "oppisi" "oppinut" "opittu" "opitun") ;
|
||||
leather_N = nLukko "nahka" ; --- nahan
|
||||
leave_V2 = dirV2 (regV "jättää") ;
|
||||
like_V2 = caseV2 (regV "pitää") elative ;
|
||||
listen_V2 = caseV2 (reg3V "kuunnella" "kuuntelen" "kuunteli") partitive ;
|
||||
live_V = regV "elää" ;
|
||||
long_A = mkADeg (nLukko "pitkä") "pitempi" "pisin" ;
|
||||
lose_V2 = dirV2 (regV "hävitä") ; --- hukata
|
||||
love_N = reg3N "rakkaus" "rakkauden" "rakkauksia" ;
|
||||
love_V2 = caseV2 (regV "rakastaa") partitive ;
|
||||
man_N = mkN "mies" "miehen" "miehenä" "miestä" "mieheen"
|
||||
"miehinä" "miehissä" "miesten" "miehiä" "miehiin" ;
|
||||
married_A2 =
|
||||
mkA2 (mkA (nRae "avioitunut" "avioituneena")) (postPrep genitive "kanssa") ;
|
||||
meat_N = nLukko "liha" ;
|
||||
milk_N = nLukko "maito" ;
|
||||
moon_N = regN "kuu" ;
|
||||
mother_N2 = genN2 (regN "äiti") ;
|
||||
mountain_N = nArpi "vuori" ;
|
||||
music_N = regN "musiikki" ;
|
||||
narrow_A = mkADeg (regN "kapea") "kapeampi" "kapein" ;
|
||||
new_A = mkADeg (reg3N "uusi" "uuden" "uusia") "uudempi" "uusin" ;
|
||||
newspaper_N = nSylki "sanomalehti" ; --- for correct vowel harmony
|
||||
oil_N = nLukko "öljy" ;
|
||||
old_A = mkADeg (nLukko "vanha") "vanhempi" "vanhin" ;
|
||||
open_V2 = dirV2 (regV "avata") ;
|
||||
paint_V2A = mkV2A (regV "maalata") accPrep (casePrep translative) ;
|
||||
paper_N = reg2N "paperi" "papereita" ;
|
||||
paris_PN = mkPN (regN "Pariisi") ;
|
||||
peace_N = nLukko "rauha" ;
|
||||
pen_N = nLukko "kynä" ;
|
||||
planet_N = nLukko "planeetta" ;
|
||||
plastic_N = regN "muovi" ;
|
||||
play_V2 = dirV2 (regV "pelata") ; --- leikkiä, soittaa
|
||||
policeman_N = regN "poliisi" ;
|
||||
priest_N = regN "pappi" ;
|
||||
probable_AS = mkAS (mkA (nNainen "todennäköistä")) ; --- for vowel harmony
|
||||
queen_N = regN "kuningatar" ;
|
||||
radio_N = reg2N "radio" "radioita" ;
|
||||
rain_V0 = mkV0 (reg2V "sataa" "satoi") ;
|
||||
read_V2 = dirV2 (regV "lukea") ;
|
||||
red_A = regA "punainen" ;
|
||||
religion_N = nLukko "uskonto" ;
|
||||
restaurant_N = nLukko "ravintola" ;
|
||||
river_N = nArpi "joki" ;
|
||||
rock_N = reg2N "kallio" "kallioita" ;
|
||||
roof_N = nLukko "katto" ;
|
||||
rubber_N = regN "kumi" ;
|
||||
run_V = reg2V "juosta" "juoksi" ;
|
||||
say_VS = mkVS (regV "sanoa") ;
|
||||
school_N = nLukko "koulu" ;
|
||||
science_N = regN "tiede" ;
|
||||
sea_N = nMeri "meri" ;
|
||||
seek_V2 = dirV2 (regV "etsiä") ;
|
||||
see_V2 = dirV2 (
|
||||
mkV "nähdä" "näkee" "näen" "näkevät" "nähkää" "nähdään"
|
||||
"näki" "näin" "näkisi" "nähnyt" "nähty" "nähdyn") ;
|
||||
sell_V3 = dirV3 (regV "myydä") allative ;
|
||||
send_V3 = dirV3 (regV "lähettää") allative ;
|
||||
sheep_N = regN "lammas" ;
|
||||
ship_N = nLukko "laiva" ;
|
||||
shirt_N = nLukko "paita" ;
|
||||
shoe_N = nLukko "kenkä" ;
|
||||
shop_N = nLukko "kauppa" ;
|
||||
short_A = regA "lyhyt" ;
|
||||
silver_N = regN "hopea" ;
|
||||
sister_N = nLukko "sisko" ;
|
||||
sleep_V = regV "nukkua" ;
|
||||
small_A = mkADeg (reg2N "pieni" "pieniä") "pienempi" "pienin" ;
|
||||
snake_N = regN "käärme" ;
|
||||
sock_N = nLukko "sukka" ;
|
||||
speak_V2 = dirV2 (regV "puhua") ;
|
||||
star_N = nSylki "tähti" ;
|
||||
steel_N = regN "teräs" ;
|
||||
stone_N = nSylki "kivi" ;
|
||||
stove_N = reg3N "liesi" "lieden" "liesiä" ;
|
||||
student_N = reg2N "opiskelija" "opiskelijoita" ;
|
||||
stupid_A = regA "tyhmä" ;
|
||||
sun_N = nLukko "aurinko" ;
|
||||
switch8off_V2 = dirV2 (regV "sammuttaa") ; ---
|
||||
switch8on_V2 = dirV2 (regV "sytyttää") ; ---
|
||||
table_N = nLukko "pöytä" ;
|
||||
talk_V3 = mkV3 (regV "puhua") (casePrep allative) (casePrep elative) ;
|
||||
teacher_N = nLukko "opettaja" ;
|
||||
teach_V2 = dirV2 (regV "opettaa") ;
|
||||
television_N = reg2N "televisio" "televisioita" ;
|
||||
thick_A = regA "paksu" ;
|
||||
thin_A = regA "ohut" ;
|
||||
train_N = nLukko "juna" ;
|
||||
travel_V = regV "matkustaa" ;
|
||||
tree_N = regN "puu" ;
|
||||
---- trousers_N = regN "trousers" ;
|
||||
ugly_A = mkADeg (nLukko "ruma") "rumempi" "rumin" ;
|
||||
understand_V2 = dirV2 (reg3V "ymmärtää" "ymmärrän" "ymmärsi") ;
|
||||
university_N = nLukko "yliopisto" ;
|
||||
village_N = nLukko "kylä" ;
|
||||
wait_V2 = caseV2 (regV "odottaa") partitive ;
|
||||
walk_V = regV "kävellä" ;
|
||||
warm_A = mkADeg
|
||||
(mkN "lämmin" "lämpimän" "lämpimänä" "lämmintä" "lämpimään"
|
||||
"lämpiminä" "lämpimissä" "lämpimien" "lämpimiä" "lämpimiin"
|
||||
)
|
||||
"lämpimämpi" "lämpimin" ;
|
||||
war_N = nLukko "sota" ;
|
||||
watch_V2 = dirV2 (regV "katsella") ;
|
||||
water_N = reg3N "vesi" "veden" "vesiä" ;
|
||||
white_A = regA "valkoinen" ;
|
||||
window_N = reg2N "ikkuna" "ikkunoita" ;
|
||||
wine_N = regN "viini" ;
|
||||
win_V2 = dirV2 (regV "voittaa") ;
|
||||
woman_N = regN "nainen" ;
|
||||
wonder_VQ = mkVQ (regV "ihmetellä") ;
|
||||
wood_N = regN "puu" ;
|
||||
write_V2 = dirV2 (regV "kirjoittaa") ;
|
||||
yellow_A = regA "keltainen" ;
|
||||
young_A = mkADeg (nArpi "nuori") "nuorempi" "nuorin" ;
|
||||
|
||||
do_V2 = dirV2 (
|
||||
mkV "tehdä" "tekee" "teen" "tekevät" "tehkää" "tehdään"
|
||||
"teki" "tein" "tekisi" "tehnyt" "tehty" "tehdyn") ;
|
||||
|
||||
now_Adv = mkAdv "nyt" ;
|
||||
already_Adv = mkAdv "jo" ;
|
||||
song_N = nLukko "laulu" ;
|
||||
add_V3 = dirV3 (regV "lisätä") illative ;
|
||||
number_N = reg2N "numero" "numeroita" ;
|
||||
put_V2 = dirV2 (regV "panna") ;
|
||||
stop_V = regV "pysähtyä" ;
|
||||
jump_V = regV "hypätä" ;
|
||||
left_Ord = mkOrd (regN "vasen") ;
|
||||
right_Ord = mkOrd (regN "oikea") ;
|
||||
far_Adv = mkAdv "kaukana" ;
|
||||
correct_A = regA "oikea" ;
|
||||
dry_A = mkADeg (regN "kuiva") "kuivempi" "kuivin" ;
|
||||
dull_A = mkADeg (regN "tylsä") "tylsempi" "tylsin" ;
|
||||
full_A = mkADeg (reg3N "täysi" "täyden" "täysiä") "täydempi" "täysin" ;
|
||||
heavy_A = regA "raskas" ;
|
||||
near_A = regA "läheinen" ;
|
||||
rotten_A = regA "mätä" ;
|
||||
round_A = regA "pyöreä" ;
|
||||
sharp_A = regA "terävä" ;
|
||||
smooth_A = regA "sileä" ;
|
||||
straight_A = mkADeg (regN "suora") "suorempi" "suorin" ;
|
||||
wet_A = mkADeg (regN "märkä") "märempi" "märin" ;
|
||||
wide_A = regA "leveä" ;
|
||||
animal_N = reg3N "eläin" "eläimen" "eläimiä" ;
|
||||
ashes_N = regN "tuhka" ;
|
||||
back_N = regN "selkä" ;
|
||||
bark_N = regN "kaarna" ;
|
||||
belly_N = regN "vatsa" ;
|
||||
blood_N = nMeri "veri" ;
|
||||
bone_N = regN "luu" ;
|
||||
breast_N = regN "rinta" ;
|
||||
cloud_N = reg2N "pilvi" "pilviä" ;
|
||||
day_N = regN "päivä" ;
|
||||
dust_N = regN "pöly" ;
|
||||
ear_N = regN "korva" ;
|
||||
earth_N = regN "maa" ;
|
||||
egg_N = regN "muna" ;
|
||||
eye_N = regN "silmä" ;
|
||||
fat_N = regN "rasva" ;
|
||||
feather_N = reg3N "höyhen" "höyhenen" "höyheniä" ;
|
||||
fingernail_N = reg3N "kynsi" "kynnen" "kynsiä" ;
|
||||
fire_N = reg2N "tuli" "tulia" ;
|
||||
flower_N = regN "kukka" ;
|
||||
fog_N = regN "sumu" ;
|
||||
foot_N = regN "jalka" ;
|
||||
forest_N = regN "metsä" ;
|
||||
grass_N = regN "ruoho" ;
|
||||
guts_N = regN "sisälmys" ; --- suoli
|
||||
hair_N = regN "hius" ;
|
||||
hand_N = reg3N "käsi" "käden" "käsiä" ;
|
||||
head_N = regN "pää" ;
|
||||
heart_N = reg3N "sydän" "sydämen" "sydämiä" ;
|
||||
horn_N = reg2N "sarvi" "sarvia" ;
|
||||
husband_N = mkN "mies" "miehen" "miehenä" "miestä" "mieheen"
|
||||
"miehinä" "miehissä" "miesten" "miehiä" "miehiin" ;
|
||||
ice_N = regN "jää" ;
|
||||
knee_N = reg2N "polvi" "polvia" ;
|
||||
leaf_N = reg2N "lehti" "lehtiä" ;
|
||||
leg_N = regN "jalka" ; --- sääri
|
||||
liver_N = regN "maksa" ;
|
||||
louse_N = regN "lude" ;
|
||||
mouth_N = regN "suu" ;
|
||||
name_N = reg2N "nimi" "nimiä" ;
|
||||
neck_N = regN "niska" ;
|
||||
night_N = regN "yö" ;
|
||||
nose_N = regN "nenä" ;
|
||||
person_N = regN "henkilö" ;
|
||||
rain_N = regN "sade" ;
|
||||
road_N = regN "tie" ;
|
||||
root_N = reg2N "juuri" "juuria" ;
|
||||
rope_N = reg3N "köysi" "köyden" "köysiä" ;
|
||||
salt_N = regN "suola" ;
|
||||
sand_N = regN "hiekka" ;
|
||||
seed_N = regN "siemen" ;
|
||||
skin_N = regN "nahka" ;
|
||||
sky_N = reg3N "taivas" "taivaan" "taivaita" ;
|
||||
smoke_N = regN "savu" ;
|
||||
snow_N = sgpartN (nMeri "lumi") "lunta" ;
|
||||
stick_N = regN "keppi" ;
|
||||
tail_N = regN "häntä" ;
|
||||
tongue_N = reg2N "kieli" "kieliä" ;
|
||||
tooth_N = regN "hammas" ;
|
||||
wife_N = regN "vaimo" ;
|
||||
wind_N = reg2N "tuuli" "tuulia" ;
|
||||
wing_N = reg2N "siipi" "siipiä" ;
|
||||
worm_N = regN "mato" ;
|
||||
year_N = reg3N "vuosi" "vuoden" "vuosia" ;
|
||||
bite_V2 = dirV2 (regV "purra") ;
|
||||
blow_V = regV "puhaltaa" ;
|
||||
burn_V = regV "palaa" ;
|
||||
count_V2 = dirV2 (regV "laskea") ;
|
||||
cut_V2 = dirV2 (reg2V "leikata" "leikkasi") ;
|
||||
dig_V = regV "kaivaa" ;
|
||||
fall_V = reg3V "pudota" "putoan" "putosi" ;
|
||||
fear_V2 = dirV2 (reg3V "pelätä" "pelkään" "pelkäsi") ;
|
||||
fight_V2 = dirV2 (regV "taistella") ;
|
||||
float_V = regV "kellua" ;
|
||||
flow_V = reg3V "virrata" "virtaan" "virtasi" ;
|
||||
fly_V = regV "lentää" ;
|
||||
freeze_V = regV "jäätyä" ;
|
||||
give_V3 = dirdirV3 (reg3V "antaa" "annan" "antoi") ;
|
||||
hit_V2 = dirV2 (regV "lyödä") ;
|
||||
hold_V2 = dirV2 (regV "pitää") ;
|
||||
hunt_V2 = dirV2 (regV "metsästää") ;
|
||||
kill_V2 = dirV2 (regV "tappaa") ;
|
||||
laugh_V = reg3V "nauraa" "nauran" "nauroi" ;
|
||||
lie_V = reg3V "maata" "makaan" "makasi" ;
|
||||
play_V = regV "pelata" ;
|
||||
pull_V2 = dirV2 (regV "vetää") ;
|
||||
push_V2 = dirV2 (regV "työntää") ;
|
||||
rub_V2 = dirV2 (regV "hieroa") ;
|
||||
scratch_V2 = dirV2 (regV "raapia") ;
|
||||
sew_V = regV "kylvää" ;
|
||||
sing_V = regV "laulaa" ;
|
||||
sit_V = regV "istua" ;
|
||||
smell_V = reg2V "haistaa" "haistoi" ;
|
||||
spit_V = regV "sylkeä" ;
|
||||
split_V2 = dirV2 (reg2V "halkaista" "halkaisi") ;
|
||||
squeeze_V2 = dirV2 (regV "puristaa") ;
|
||||
stab_V2 = dirV2 (regV "pistää") ;
|
||||
stand_V = mkV "seistä" "seisoo" "seison" "seisovat" "seiskää" "seistään"
|
||||
"seisoi" "seisoin" "seisoisi" "seissyt" "seisty" "seistyn" ; --- *seisoivät
|
||||
suck_V2 = dirV2 (regV "imeä") ;
|
||||
swell_V = mkV "turvota" "turpoaa" "turpoan" "turpoavat" "turvotkaa" "turvotaan"
|
||||
"turposi" "turposin" "turpoaisi" "turvonnut" "turvottu" "turvotun" ;
|
||||
swim_V = reg3V "uida" "uin" "ui" ;
|
||||
think_V = reg3V "ajatella" "ajattelen" "ajatteli" ;
|
||||
throw_V2 = dirV2 (regV "heittää") ;
|
||||
tie_V2 = dirV2 (regV "sitoa") ;
|
||||
turn_V = regV "kääntyä" ;
|
||||
vomit_V = regV "oksentaa" ;
|
||||
wash_V2 = dirV2 (regV "pestä") ;
|
||||
wipe_V2 = dirV2 (regV "pyyhkiä") ;
|
||||
|
||||
breathe_V = regV "hengittää" ;
|
||||
|
||||
grammar_N = regN "kielioppi" ;
|
||||
language_N = reg2N "kieli" "kieliä" ;
|
||||
rule_N = regN "sääntö" ;
|
||||
|
||||
oper
|
||||
mkOrd : N -> Ord ;
|
||||
mkOrd x = {s = \\n,c => x.s ! NCase n c; lock_Ord = <> } ;
|
||||
|
||||
} ;
|
||||
@@ -1,45 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete MathFin of Math = CategoriesFin ** open Prelude, SyntaxFin, ParadigmsFin in {
|
||||
|
||||
lin
|
||||
SymbPN i = symbProperName i.s ; --- case ending not always correct
|
||||
IntPN i = symbProperName i.s ; --- case ending not always correct
|
||||
IntNP cn i = nameNounPhrase { -- here the CN gets the (correct) ending
|
||||
s = \\c => cn.s ! False ! Sg ! c ++ i.s
|
||||
} ;
|
||||
|
||||
IndefSymbNumNP nu cn xs =
|
||||
addSymbNounPhrase (nounPhraseNum False nu cn) xs.s ;
|
||||
DefSymbNumNP nu cn xs =
|
||||
addSymbNounPhrase (nounPhraseNum True nu cn) xs.s ;
|
||||
NDetSymbNP det nu cn xs =
|
||||
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||
|
||||
lincat
|
||||
SymbList = SS ;
|
||||
|
||||
lin
|
||||
SymbTwo = infixSS "ja" ;
|
||||
SymbMore = infixSS "," ;
|
||||
|
||||
LetImp x np = {
|
||||
s = \\_ =>
|
||||
verbOlla.s ! ImperP3 x.n ++ x.s ! NPCase Nom ++ np.s ! NPCase Nom
|
||||
} ;
|
||||
|
||||
ExistNP np =
|
||||
sats2clause (
|
||||
mkSatsCopula impersNounPhrase ("olemassa" ++ np.s ! NPCase Nom)
|
||||
) ;
|
||||
|
||||
-- Moved from $RulesFin$.
|
||||
|
||||
SymbCN cn s =
|
||||
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
||||
g = cn.g} ;
|
||||
IntCN cn s =
|
||||
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
||||
g = cn.g} ;
|
||||
|
||||
}
|
||||
@@ -2,14 +2,15 @@
|
||||
|
||||
--1 A Simple Finnish Resource Morphology
|
||||
--
|
||||
-- Aarne Ranta 2002
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. It moreover contains the most usual inflectional patterns.
|
||||
--
|
||||
-- We use the parameter types and word classes defined in $TypesFin.gf$.
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsFin$, which
|
||||
-- gives a higher-level access to this module.
|
||||
|
||||
resource MorphoFin = TypesFin ** open Prelude in {
|
||||
resource MorphoFin = ResFin ** open Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--- flags optimize=noexpand ;
|
||||
|
||||
@@ -18,79 +19,6 @@ resource MorphoFin = TypesFin ** open Prelude in {
|
||||
|
||||
oper
|
||||
|
||||
NounH : Type = {
|
||||
a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin : Str
|
||||
} ;
|
||||
|
||||
-- worst-case macro
|
||||
|
||||
mkSubst : Str -> (_,_,_,_,_,_,_,_,_,_ : Str) -> NounH =
|
||||
\a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin ->
|
||||
{a = a ;
|
||||
vesi = vesi ;
|
||||
vede = vede ;
|
||||
vete = vete ;
|
||||
vetta = vetta ;
|
||||
veteen = veteen ;
|
||||
vetii = vetii ;
|
||||
vesii = vesii ;
|
||||
vesien = vesien ;
|
||||
vesia = vesia ;
|
||||
vesiin = vesiin
|
||||
} ;
|
||||
|
||||
nhn : NounH -> CommonNoun = \nh ->
|
||||
let
|
||||
a = nh.a ;
|
||||
vesi = nh.vesi ;
|
||||
vede = nh.vede ;
|
||||
vete = nh.vete ;
|
||||
vetta = nh.vetta ;
|
||||
veteen = nh.veteen ;
|
||||
vetii = nh.vetii ;
|
||||
vesii = nh.vesii ;
|
||||
vesien = nh.vesien ;
|
||||
vesia = nh.vesia ;
|
||||
vesiin = nh.vesiin
|
||||
in
|
||||
{s = table {
|
||||
NCase Sg Nom => vesi ;
|
||||
NCase Sg Gen => vede + "n" ;
|
||||
NCase Sg Part => vetta ;
|
||||
NCase Sg Transl => vede + "ksi" ;
|
||||
NCase Sg Ess => vete + ("n" + a) ;
|
||||
NCase Sg Iness => vede + ("ss" + a) ;
|
||||
NCase Sg Elat => vede + ("st" + a) ;
|
||||
NCase Sg Illat => veteen ;
|
||||
NCase Sg Adess => vede + ("ll" + a) ;
|
||||
NCase Sg Ablat => vede + ("lt" + a) ;
|
||||
NCase Sg Allat => vede + "lle" ;
|
||||
NCase Sg Abess => vede + ("tt" + a) ;
|
||||
|
||||
NCase Pl Nom => vede + "t" ;
|
||||
NCase Pl Gen => vesien ;
|
||||
NCase Pl Part => vesia ;
|
||||
NCase Pl Transl => vesii + "ksi" ;
|
||||
NCase Pl Ess => vetii + ("n" + a) ;
|
||||
NCase Pl Iness => vesii + ("ss" + a) ;
|
||||
NCase Pl Elat => vesii + ("st" + a) ;
|
||||
NCase Pl Illat => vesiin ;
|
||||
NCase Pl Adess => vesii + ("ll" + a) ;
|
||||
NCase Pl Ablat => vesii + ("lt" + a) ;
|
||||
NCase Pl Allat => vesii + "lle" ;
|
||||
NCase Pl Abess => vesii + ("tt" + a) ;
|
||||
|
||||
NComit => vetii + "ne" ;
|
||||
NInstruct => vesii + "n" ;
|
||||
|
||||
NPossNom => vete ;
|
||||
NPossGenPl => Predef.tk 1 vesien ;
|
||||
NPossTransl Sg => vede + "kse" ;
|
||||
NPossTransl Pl => vesii + "kse" ;
|
||||
NPossIllat Sg => Predef.tk 1 veteen ;
|
||||
NPossIllat Pl => Predef.tk 1 vesiin
|
||||
}
|
||||
} ;
|
||||
|
||||
-- A user-friendly variant takes existing forms and infers the vowel harmony.
|
||||
|
||||
@@ -100,97 +28,9 @@ oper
|
||||
talo (Predef.tk 1 talon) (Predef.tk 2 talona) taloa taloon
|
||||
(Predef.tk 2 taloina) (Predef.tk 3 taloissa) talojen taloja taloihin) ;
|
||||
|
||||
-- Regular heuristics.
|
||||
|
||||
{-
|
||||
regNounH : Str -> NounH = \vesi ->
|
||||
let
|
||||
esi = Predef.dp 3 vesi ; -- analysis: suffixes
|
||||
si = Predef.dp 2 esi ;
|
||||
i = last si ;
|
||||
s = init si ;
|
||||
a = if_then_Str (pbool2bool (Predef.occurs "aou" vesi)) "a" "ä" ;
|
||||
ves = init vesi ; -- synthesis: prefixes
|
||||
vet = strongGrade ves ;
|
||||
ve = init ves ;
|
||||
in
|
||||
case esi of {
|
||||
"uus" | "yys" => sRakkaus vesi ;
|
||||
"nen" => sNainen (Predef.tk 3 vesi + ("st" + a)) ;
|
||||
|
||||
_ => case si of {
|
||||
"aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö" => sPuu vesi ;
|
||||
"ie" | "uo" | "yö" => sSuo vesi ;
|
||||
"ea" | "eä" =>
|
||||
mkSubst
|
||||
a
|
||||
vesi (vesi) (vesi) (vesi + a) (vesi + a+"n")
|
||||
(ves + "i") (ves + "i") (ves + "iden") (ves + "it"+a)
|
||||
(ves + "isiin") ;
|
||||
"is" => sNauris (vesi + ("t" + a)) ;
|
||||
"ut" | "yt" => sRae vesi (ves + ("en" + a)) ;
|
||||
"as" | "äs" => sRae vesi (vet + (a + "n" + a)) ;
|
||||
"ar" | "är" => sRae vesi (vet + ("ren" + a)) ;
|
||||
_ => case i of {
|
||||
"n" => sLiitin vesi (vet + "men") ;
|
||||
"s" => sTilaus vesi (ves + ("ksen" + a)) ;
|
||||
"i" => sBaari (vesi + a) ;
|
||||
"e" => sRae vesi (strongGrade vesi + "en" + a) ;
|
||||
"a" | "o" | "u" | "y" | "ä" | "ö" => sLukko vesi ;
|
||||
_ => sLinux (vesi + "i" + a)
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
reg2NounH : (savi,savia : Str) -> NounH = \savi,savia ->
|
||||
let
|
||||
savit = regNounH savi ;
|
||||
ia = Predef.dp 2 savia ;
|
||||
i = init ia ;
|
||||
a = last ia ;
|
||||
o = last savi ;
|
||||
savin = weakGrade savi + "n" ;
|
||||
in
|
||||
case <o,ia> of {
|
||||
<"i","ia"> => sArpi savi ;
|
||||
<"i","iä"> => sSylki savi ;
|
||||
<"i","ta"> | <"i","tä"> => sTohtori (savi + a) ;
|
||||
<"o","ta"> | <"ö","tä"> => sRadio savi ;
|
||||
<"a","ta"> | <"ä","tä"> => sPeruna savi ;
|
||||
<"a","ia"> | <"a","ja"> => sKukko savi savin savia ;
|
||||
_ => savit
|
||||
} ;
|
||||
-}
|
||||
|
||||
-- Here some useful special cases; more will be given in $paradigms.Fin.gf$.
|
||||
-- Here some useful special cases; more are given in $ParadigmsFin.gf$.
|
||||
--
|
||||
-- Nouns with partitive "a"/"ä" ;
|
||||
-- to account for grade and vowel alternation, three forms are usually enough
|
||||
-- Examples: "talo", "kukko", "huippu", "koira", "kukka", "syylä",...
|
||||
|
||||
sKukko : (_,_,_ : Str) -> NounH = \kukko,kukon,kukkoja ->
|
||||
let {
|
||||
o = Predef.dp 1 kukko ;
|
||||
a = Predef.dp 1 kukkoja ;
|
||||
kukkoj = Predef.tk 1 kukkoja ;
|
||||
i = Predef.dp 1 kukkoj ;
|
||||
ifi = ifTok Str i "i" ;
|
||||
kukkoi = ifi kukkoj (Predef.tk 1 kukkoj) ;
|
||||
e = Predef.dp 1 kukkoi ;
|
||||
kukoi = Predef.tk 2 kukon + Predef.dp 1 kukkoi
|
||||
}
|
||||
in
|
||||
mkSubst a
|
||||
kukko
|
||||
(Predef.tk 1 kukon)
|
||||
kukko
|
||||
(kukko + a)
|
||||
(kukko + o + "n")
|
||||
(kukkoi + ifi "" "i")
|
||||
(kukoi + ifi "" "i")
|
||||
(ifTok Str e "e" (Predef.tk 1 kukkoi + "ien") (kukkoi + ifi "en" "jen"))
|
||||
kukkoja
|
||||
(kukkoi + ifi "in" "ihin") ;
|
||||
|
||||
sLukko : Str -> NounH = \lukko ->
|
||||
let
|
||||
@@ -333,28 +173,6 @@ oper
|
||||
(radioi + "t" + a)
|
||||
(radioi + "hin") ;
|
||||
|
||||
-- Surpraisingly, making the test for the partitive, this not only covers
|
||||
-- "rae", "perhe", "savuke", but also "rengas", "lyhyt" (except $Sg Illat$), etc.
|
||||
|
||||
sRae : (_,_ : Str) -> NounH = \rae,rakeena ->
|
||||
let {
|
||||
a = Predef.dp 1 rakeena ;
|
||||
rakee = Predef.tk 2 rakeena ;
|
||||
rakei = Predef.tk 1 rakee + "i" ;
|
||||
raet = rae + (ifTok Str (Predef.dp 1 rae) "e" "t" [])
|
||||
}
|
||||
in
|
||||
mkSubst a
|
||||
rae
|
||||
rakee
|
||||
rakee
|
||||
(raet + ("t" + a))
|
||||
(rakee + "seen")
|
||||
rakei
|
||||
rakei
|
||||
(rakei + "den")
|
||||
(rakei + ("t" + a))
|
||||
(rakei + "siin") ;
|
||||
|
||||
sSusi : (_,_,_ : Str) -> NounH = \susi,suden,sutena ->
|
||||
let
|
||||
@@ -671,6 +489,8 @@ vowelHarmony : Str -> Str = \liitin ->
|
||||
--
|
||||
-- Proper names are similar to common nouns in the singular.
|
||||
|
||||
ProperName = {s : Case => Str} ;
|
||||
|
||||
mkProperName : CommonNoun -> ProperName = \jussi ->
|
||||
{s = \\c => jussi.s ! NCase Sg c} ;
|
||||
|
||||
@@ -705,87 +525,78 @@ vowelHarmony : Str -> Str = \liitin ->
|
||||
--
|
||||
-- Here we define personal and relative pronouns.
|
||||
|
||||
mkPronoun : (_,_,_,_,_ : Str) -> Number -> Person -> Pronoun =
|
||||
mkPronoun : (_,_,_,_,_ : Str) -> Number -> Person ->
|
||||
{s : NPForm => Str ; a : Agr} =
|
||||
\mina, minun, minua, minuna, minuun, n, p ->
|
||||
let {
|
||||
minu = Predef.tk 2 minuna ;
|
||||
a = Predef.dp 1 minuna
|
||||
} in
|
||||
{s = table {
|
||||
PCase Nom => mina ;
|
||||
PCase Gen => minun ;
|
||||
PCase Part => minua ;
|
||||
PCase Transl => minu + "ksi" ;
|
||||
PCase Ess => minuna ;
|
||||
PCase Iness => minu + ("ss" + a) ;
|
||||
PCase Elat => minu + ("st" + a) ;
|
||||
PCase Illat => minuun ;
|
||||
PCase Adess => minu + ("ll" + a) ;
|
||||
PCase Ablat => minu + ("lt" + a) ;
|
||||
PCase Allat => minu + "lle" ;
|
||||
PCase Abess => minu + ("tt" + a) ;
|
||||
PAcc => Predef.tk 1 minun + "t"
|
||||
NPCase Nom => mina ;
|
||||
NPCase Gen => minun ;
|
||||
NPCase Part => minua ;
|
||||
NPCase Transl => minu + "ksi" ;
|
||||
NPCase Ess => minuna ;
|
||||
NPCase Iness => minu + ("ss" + a) ;
|
||||
NPCase Elat => minu + ("st" + a) ;
|
||||
NPCase Illat => minuun ;
|
||||
NPCase Adess => minu + ("ll" + a) ;
|
||||
NPCase Ablat => minu + ("lt" + a) ;
|
||||
NPCase Allat => minu + "lle" ;
|
||||
NPCase Abess => minu + ("tt" + a) ;
|
||||
NPAcc => Predef.tk 1 minun + "t"
|
||||
} ;
|
||||
n = n ; p = p} ;
|
||||
a = {n = n ; p = p}
|
||||
} ;
|
||||
|
||||
pronMina = mkPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
|
||||
pronSina = mkPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ;
|
||||
pronHan = mkPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
|
||||
pronMe = mkPronoun "me" "meidän" "meitä" "meinä" "meihin" Pl P1 ;
|
||||
pronTe = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ;
|
||||
pronHe = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ;
|
||||
pronNe = mkPronoun "ne" "niiden" "niitä" "niinä" "niihin" Pl P3 ;
|
||||
|
||||
pronTama = mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3 ;
|
||||
pronNama = mkPronoun "nämä" "näiden" "näitä" "näinä" "näihin" Pl P3 ;
|
||||
pronTuo = mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3 ;
|
||||
pronNuo = mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Pl P3 ;
|
||||
|
||||
-- The non-human pronoun "se" ('it') is even more irregular,
|
||||
-- Its accusative cases do not
|
||||
-- have a special form with "t", but have the normal genitive/nominative variation.
|
||||
-- We use the type $ProperName$ for "se", because of the accusative but also
|
||||
-- because the person and number are as for proper names.
|
||||
|
||||
pronSe : ProperName = {
|
||||
s = table {
|
||||
Nom => "se" ;
|
||||
Gen => "sen" ;
|
||||
Part => "sitä" ;
|
||||
Transl => "siksi" ;
|
||||
Ess => "sinä" ;
|
||||
Iness => "siinä" ;
|
||||
Elat => "siitä" ;
|
||||
Illat => "siihen" ;
|
||||
Adess => "sillä" ;
|
||||
Ablat => "siltä" ;
|
||||
Allat => "sille" ;
|
||||
Abess => "sittä"
|
||||
mkDemPronoun : (_,_,_,_,_ : Str) -> Number ->
|
||||
{s : NPForm => Str ; a : Agr} =
|
||||
\tuo, tuon, tuota, tuona, tuohon, n ->
|
||||
let pro = mkPronoun tuo tuon tuota tuona tuohon n P3
|
||||
in {
|
||||
s = table {
|
||||
NPAcc => tuo ;
|
||||
c => pro.s ! c
|
||||
} ;
|
||||
a = pro.a
|
||||
} ;
|
||||
|
||||
-- Determiners
|
||||
|
||||
mkDet : Number -> CommonNoun -> {
|
||||
s1 : Case => Str ; -- minun kolme
|
||||
s2 : Str ; -- -ni
|
||||
n : Number ; -- Pl (agreement feature for verb)
|
||||
isNum : Bool ; -- True (a numeral is present)
|
||||
isPoss : Bool ; -- True (a possessive suffix is present)
|
||||
isDef : Bool -- True (verb agrees in Pl, Nom is not Part)
|
||||
} = \n, noun -> {
|
||||
s1 = \\c => noun.s ! NCase n c ;
|
||||
s2 = [] ;
|
||||
n = n ;
|
||||
isNum, isPoss = False ;
|
||||
isDef = True --- does this hold for all new dets?
|
||||
} ;
|
||||
|
||||
-- The possessive suffixes will be needed in syntax. It will show up
|
||||
-- as a separate word ("auto &+ ni"), which needs unlexing. Unlexing also
|
||||
-- has to fix the vowel harmony in cases like "äiti &+ nsä".
|
||||
|
||||
suff : Str -> Str = \ni -> ni ;
|
||||
|
||||
possSuffix : Number => Person => Str = \\n,p =>
|
||||
suff (case <n,p> of {
|
||||
<Sg,P1> => "ni" ;
|
||||
<Sg,P2> => "si" ;
|
||||
<Sg,P3> => "nsa" ;
|
||||
<Pl,P1> => "mme" ;
|
||||
<Pl,P2> => "nne" ;
|
||||
<Pl,P3> => "nsa"
|
||||
} ) ;
|
||||
mkQuant : CommonNoun -> {
|
||||
s1 : Number => Case => Str ;
|
||||
s2 : Str ;
|
||||
isPoss, isDef : Bool
|
||||
} = \noun -> {
|
||||
s1 = \\n,c => noun.s ! NCase n c ;
|
||||
s2 = [] ;
|
||||
isPoss = False ;
|
||||
isDef = True --- does this hold for all new dets?
|
||||
} ;
|
||||
|
||||
-- The relative pronoun, "joka", is inflected in case and number,
|
||||
-- like common nouns, but it does not take possessive suffixes.
|
||||
-- The inflextion shows a surprising similarity with "suo".
|
||||
|
||||
relPron : RelPron =
|
||||
let {jo = nhn (sSuo "jo")} in {s =
|
||||
oper
|
||||
relPron : Number => Case => Str =
|
||||
let {jo = nhn (sSuo "jo")} in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "joka" ;
|
||||
@@ -796,258 +607,37 @@ vowelHarmony : Str -> Str = \liitin ->
|
||||
Nom => "jotka" ;
|
||||
c => "j" + (jo.s ! NCase Pl c)
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
mikaInt : Number => Case => Str =
|
||||
let {
|
||||
mi = nhn (sSuo "mi")
|
||||
} in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "mikä" ;
|
||||
Gen => "minkä" ;
|
||||
c => mi.s ! NCase Sg c
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "mitkä" ;
|
||||
Gen => "mittenkä" ;
|
||||
c => mi.s ! NCase Sg c
|
||||
}
|
||||
} ;
|
||||
|
||||
kukaInt : Number => Case => Str =
|
||||
let {
|
||||
ku = nhn (sRae "kuka" "kenenä") ;
|
||||
ket = nhn (sRae "kuka" "keinä")} in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "kuka" ;
|
||||
Part => "ketä" ;
|
||||
Illat => "keneen" ;
|
||||
c => ku.s ! NCase Sg c
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "ketkä" ;
|
||||
Illat => "keihin" ;
|
||||
c => ket.s ! NCase Pl c
|
||||
}
|
||||
} ;
|
||||
|
||||
mikaanPron : Number => Case => Str = \\n,c =>
|
||||
case <n,c> of {
|
||||
<Sg,Nom> => "mikään" ;
|
||||
<_,Part> => "mitään" ;
|
||||
<Sg,Gen> => "minkään" ;
|
||||
<Pl,Nom> => "mitkään" ;
|
||||
<Pl,Gen> => "mittenkään" ;
|
||||
<_,Ess> => "minään" ;
|
||||
<_,Iness> => "missään" ;
|
||||
<_,Elat> => "mistään" ;
|
||||
<_,Adess> => "millään" ;
|
||||
<_,Ablat> => "miltään" ;
|
||||
_ => mikaInt ! n ! c + "kään"
|
||||
} ;
|
||||
|
||||
kukaanPron : Number => Case => Str =
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "kukaan" ;
|
||||
Part => "ketään" ;
|
||||
Ess => "kenään" ;
|
||||
Iness => "kessään" ;
|
||||
Elat => "kestään" ;
|
||||
Illat => "kehenkään" ;
|
||||
Adess => "kellään" ;
|
||||
Ablat => "keltään" ;
|
||||
c => kukaInt ! Sg ! c + "kään"
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "ketkään" ;
|
||||
Part => "keitään" ;
|
||||
Ess => "keinään" ;
|
||||
Iness => "keissään" ;
|
||||
Elat => "keistään" ;
|
||||
Adess => "keillään" ;
|
||||
Ablat => "keiltään" ;
|
||||
c => kukaInt ! Pl ! c + "kään"
|
||||
}
|
||||
} ;
|
||||
|
||||
jokuPron : Number => Case => Str =
|
||||
let
|
||||
ku = nhn (sPuu "ku") ;
|
||||
kui = nhn (sPuu "kuu")
|
||||
in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "joku" ;
|
||||
Gen => "jonkun" ;
|
||||
c => relPron.s ! Sg ! c + ku.s ! NCase Sg c
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "jotkut" ;
|
||||
c => relPron.s ! Pl ! c + kui.s ! NCase Pl c
|
||||
}
|
||||
} ;
|
||||
|
||||
jokinPron : Number => Case => Str =
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "jokin" ;
|
||||
Gen => "jonkin" ;
|
||||
c => relPron.s ! Sg ! c + "kin"
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "jotkin" ;
|
||||
c => relPron.s ! Pl ! c + "kin"
|
||||
}
|
||||
} ;
|
||||
|
||||
moniPron : Case => Str = caseTable singular (nhn (sSusi "moni" "monen" "monena")) ;
|
||||
|
||||
caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
||||
\\c => cn.s ! NCase n c ;
|
||||
|
||||
|
||||
--2 Adjectives
|
||||
--
|
||||
-- To form an adjective, it is usually enough to give a noun declension: the
|
||||
-- adverbial form is regular.
|
||||
|
||||
noun2adj : CommonNoun -> Adjective = noun2adjComp True ;
|
||||
|
||||
noun2adjComp : Bool -> CommonNoun -> Adjective = \isPos,tuore ->
|
||||
let
|
||||
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
|
||||
tuoreemmin = Predef.tk 2 (tuore.s ! NCase Sg Gen) + "in"
|
||||
in {s = table {
|
||||
AN f => tuore.s ! f ;
|
||||
AAdv => if_then_Str isPos tuoreesti tuoreemmin
|
||||
}
|
||||
} ;
|
||||
|
||||
-- For the comparison of adjectives, three noun declensions
|
||||
-- are needed in the worst case.
|
||||
|
||||
mkAdjDegr : (_,_,_ : Adjective) -> AdjDegr = \hyva,parempi,paras ->
|
||||
mkAdjective : (_,_,_ : Adj) -> Adjective = \hyva,parempi,paras ->
|
||||
{s = table {
|
||||
Pos => hyva.s ;
|
||||
Comp => parempi.s ;
|
||||
Sup => paras.s
|
||||
Posit => hyva.s ;
|
||||
Compar => parempi.s ;
|
||||
Superl => paras.s
|
||||
}
|
||||
} ;
|
||||
|
||||
-- However, it is usually enough to give the positive declension and
|
||||
-- the characteristic forms of comparative and superlative.
|
||||
|
||||
regAdjDegr : CommonNoun -> Str -> Str -> AdjDegr = \kiva, kivempaa, kivinta ->
|
||||
mkAdjDegr
|
||||
regAdjective : CommonNoun -> Str -> Str -> Adjective = \kiva, kivempaa, kivinta ->
|
||||
mkAdjective
|
||||
(noun2adj kiva)
|
||||
(noun2adjComp False (nhn (sSuurempi kivempaa)))
|
||||
(noun2adjComp False (nhn (sSuurin kivinta))) ;
|
||||
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- The present, past, conditional. and infinitive stems, acc. to Koskenniemi.
|
||||
-- Unfortunately not enough (without complicated processes).
|
||||
-- We moreover give grade alternation forms as arguments, since it does not
|
||||
-- happen automatically.
|
||||
--- A problem remains with the verb "seistä", where the infinitive
|
||||
--- stem has vowel harmony "ä" but the others "a", thus "seisoivat" but "seiskää".
|
||||
|
||||
|
||||
mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun ->
|
||||
v2v (mkVerbH
|
||||
tulla tulee tulen tulevat tulkaa tullaan tuli tulin tulisi tullut tultu tullun
|
||||
) ;
|
||||
|
||||
v2v : VerbH -> Verb = \vh ->
|
||||
let
|
||||
tulla = vh.tulla ;
|
||||
tulee = vh.tulee ;
|
||||
tulen = vh.tulen ;
|
||||
tulevat = vh.tulevat ;
|
||||
tulkaa = vh.tulkaa ;
|
||||
tullaan = vh.tullaan ;
|
||||
tuli = vh.tuli ;
|
||||
tulin = vh.tulin ;
|
||||
tulisi = vh.tulisi ;
|
||||
tullut = vh.tullut ;
|
||||
tultu = vh.tultu ;
|
||||
tultu = vh.tultu ;
|
||||
tullun = vh.tullun ;
|
||||
tuje = init tulen ;
|
||||
tuji = init tulin ;
|
||||
a = Predef.dp 1 tulkaa ;
|
||||
tulko = Predef.tk 2 tulkaa + (ifTok Str a "a" "o" "ö") ;
|
||||
o = last tulko ;
|
||||
tulleena = Predef.tk 2 tullut + ("een" + a) ;
|
||||
tulleen = (noun2adj (nhn (sRae tullut tulleena))).s ;
|
||||
tullun = (noun2adj (nhn (sKukko tultu tullun (tultu + ("j"+a))))).s ;
|
||||
tulema = tuje + "m" + a ;
|
||||
vat = "v" + a + "t"
|
||||
in
|
||||
{s = table {
|
||||
Inf => tulla ;
|
||||
Pres Sg P1 => tuje + "n" ;
|
||||
Pres Sg P2 => tuje + "t" ;
|
||||
Pres Sg P3 => tulee ;
|
||||
Pres Pl P1 => tuje + "mme" ;
|
||||
Pres Pl P2 => tuje + "tte" ;
|
||||
Pres Pl P3 => tulevat ;
|
||||
Impf Sg P1 => tuji + "n" ;
|
||||
Impf Sg P2 => tuji + "t" ;
|
||||
Impf Sg P3 => tuli ;
|
||||
Impf Pl P1 => tuji + "mme" ;
|
||||
Impf Pl P2 => tuji + "tte" ;
|
||||
Impf Pl P3 => tuli + vat ;
|
||||
Cond Sg P1 => tulisi + "n" ;
|
||||
Cond Sg P2 => tulisi + "t" ;
|
||||
Cond Sg P3 => tulisi ;
|
||||
Cond Pl P1 => tulisi + "mme" ;
|
||||
Cond Pl P2 => tulisi + "tte" ;
|
||||
Cond Pl P3 => tulisi + vat ;
|
||||
Imper Sg => tuje ;
|
||||
Imper Pl => tulkaa ;
|
||||
ImperP3 Sg => tulko + o + "n" ;
|
||||
ImperP3 Pl => tulko + o + "t" ;
|
||||
ImperP1Pl => tulkaa + "mme" ;
|
||||
ImpNegPl => tulko ;
|
||||
Pass True => tullaan ;
|
||||
Pass False => Predef.tk 2 tullaan ;
|
||||
PastPartAct n => tulleen ! n ;
|
||||
PastPartPass n => tullun ! n ;
|
||||
Inf3Iness => tulema + "ss" + a ;
|
||||
Inf3Elat => tulema + "st" + a ;
|
||||
Inf3Illat => tulema + a + "n" ;
|
||||
Inf3Adess => tulema + "ll" + a ;
|
||||
Inf3Abess => tulema + "tt" + a
|
||||
}
|
||||
} ;
|
||||
|
||||
VerbH : Type = {
|
||||
tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun
|
||||
: Str
|
||||
} ;
|
||||
|
||||
mkVerbH : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> VerbH =
|
||||
\tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun ->
|
||||
{tulla = tulla ;
|
||||
tulee = tulee ;
|
||||
tulen = tulen ;
|
||||
tulevat = tulevat ;
|
||||
tulkaa = tulkaa ;
|
||||
tullaan = tullaan ;
|
||||
tuli = tuli ;
|
||||
tulin = tulin ;
|
||||
tulisi = tulisi ;
|
||||
tullut = tullut ;
|
||||
tultu = tultu ;
|
||||
tullun = tullun
|
||||
} ;
|
||||
|
||||
regVerbH : Str -> VerbH = \soutaa ->
|
||||
let
|
||||
@@ -1062,7 +652,8 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
||||
in
|
||||
case taa of {
|
||||
"it" + _ => vHarkita soutaa ;
|
||||
("st" | "nn" | "rr" | "ll") + _ => vJuosta soutaa soudan (juo + o+u+"t") (juo + "t"+u) ;
|
||||
("st" | "nn" | "rr" | "ll") + _ =>
|
||||
vJuosta soutaa soudan (juo + o+u+"t") (juo + "t"+u) ;
|
||||
_ + ("aa" | "ää") => vOttaa soutaa (souda + "n") ;
|
||||
("o" | "u" | "y" | "ö") + ("da" | "dä") => vJuoda soutaa joi ;
|
||||
("ata" | "ätä") => vOsata soutaa ;
|
||||
@@ -1071,7 +662,6 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
||||
|
||||
reg2VerbH : (soutaa,souti : Str) -> VerbH = \soutaa,souti ->
|
||||
let
|
||||
soudat = regVerbH soutaa ;
|
||||
soudan = weakGrade (init soutaa) + "n" ;
|
||||
soudin = weakGrade souti + "n" ;
|
||||
souden = init souti + "en" ;
|
||||
@@ -1083,8 +673,10 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
||||
case taa of {
|
||||
"taa" | "tää" => vHuoltaa soutaa soudan souti soudin ;
|
||||
"ata" | "ätä" => vPalkata soutaa souti ;
|
||||
"ota" | "ötä" => vPudota soutaa souti ;
|
||||
"sta" | "stä" => vJuosta soutaa souden (juo + o+u+"t") (juo + "t"+u) ;
|
||||
_ => soudat
|
||||
_ + ("da" | "dä") => vJuoda soutaa souti ;
|
||||
_ => regVerbH soutaa
|
||||
} ;
|
||||
|
||||
reg3VerbH : (_,_,_ : Str) -> VerbH = \soutaa,soudan,souti ->
|
||||
@@ -1095,14 +687,11 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
||||
o = last juo ;
|
||||
a = last taa ;
|
||||
u = ifTok Str a "a" "u" "y" ;
|
||||
soudin = weakGrade souti + "n" ;
|
||||
soudat = reg2VerbH soutaa souti ;
|
||||
soudin = weakGrade (init souti) + "in" ;
|
||||
in case taa of {
|
||||
"lla" | "llä" => vJuosta soutaa soudan (juo + o+u+"t") (juo + "t"+u) ;
|
||||
"ota" | "ötä" => vPudota soutaa souti ;
|
||||
"taa" | "tää" => vHuoltaa soutaa soudan souti soudin ;
|
||||
_ + ("da" | "dä") => vJuoda soutaa souti ;
|
||||
_ => soudat
|
||||
_ => reg2VerbH soutaa souti
|
||||
} ;
|
||||
|
||||
-- For "harppoa", "hukkua", "löytyä", with grade alternation.
|
||||
@@ -1305,91 +894,7 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
|
||||
(juo + "t" + u)
|
||||
(juo + "d" + u + "n") ;
|
||||
|
||||
verbOlla : Verb =
|
||||
mkVerb
|
||||
"olla" "on" "olen" "ovat" "olkaa" "ollaan"
|
||||
"oli" "olin" "olisi" "ollut" "oltu" "ollun" ;
|
||||
|
||||
-- The negating operator "ei" is actually a verb, which has present
|
||||
-- active indicative and imperative forms, but no infinitive.
|
||||
|
||||
verbEi : Verb =
|
||||
let ei =
|
||||
mkVerb
|
||||
"ei" "ei" "en" "eivät" "älkää"
|
||||
"ei" "e" "en" "e" "ei" "ei" "ei"
|
||||
in
|
||||
{s = table {
|
||||
Imper Sg => "älä" ;
|
||||
-- Impf n p | Cond n p => ei.s ! Pres n p ;
|
||||
Impf n p => ei.s ! Pres n p ;
|
||||
Cond n p => ei.s ! Pres n p ;
|
||||
v => ei.s ! v
|
||||
}
|
||||
} ;
|
||||
|
||||
--2 Some structural words
|
||||
|
||||
kuinConj = "kuin" ;
|
||||
|
||||
conjEtta = "että" ;
|
||||
advSiten = "siten" ;
|
||||
|
||||
mikakukaInt : Gender => Number => Case => Str =
|
||||
table {
|
||||
NonHuman => mikaInt ;
|
||||
Human => kukaInt
|
||||
} ;
|
||||
|
||||
kaikkiPron : Number -> Case => Str = \n ->
|
||||
let {kaiket = caseTable n (nhn (sKorpi "kaikki" "kaiken" "kaikkena"))} in
|
||||
table {
|
||||
Nom => "kaikki" ;
|
||||
c => kaiket ! c
|
||||
} ;
|
||||
|
||||
stopPunct = "." ;
|
||||
commaPunct = "," ;
|
||||
questPunct = "?" ;
|
||||
exclPunct = "!" ;
|
||||
|
||||
koPart = suff "ko" ;
|
||||
|
||||
-- For $NumeralsFin$.
|
||||
|
||||
param NumPlace = NumIndep | NumAttr ;
|
||||
|
||||
oper
|
||||
yksiN = nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
|
||||
"yksien" "yksiä" "yksiin") ;
|
||||
kymmenenN = nhn (mkSubst "ä" "kymmenen" "kymmene" "kymmene" "kymmentä"
|
||||
"kymmeneen" "kymmeni" "kymmeni" "kymmenien" "kymmeniä"
|
||||
"kymmeniin") ;
|
||||
sataN = nhn (sLukko "sata") ;
|
||||
|
||||
tuhatN = nhn (mkSubst "a" "tuhat" "tuhanne" "tuhante" "tuhatta" "tuhanteen"
|
||||
"tuhansi" "tuhansi" "tuhansien" "tuhansia" "tuhansiin") ;
|
||||
|
||||
kymmentaN = {s = table {
|
||||
NCase Sg Nom => "kymmentä" ;
|
||||
c => kymmenenN.s ! c
|
||||
}
|
||||
} ;
|
||||
|
||||
sataaN = {s = table {
|
||||
Sg => sataN.s ;
|
||||
Pl => table {
|
||||
NCase Sg Nom => "sataa" ;
|
||||
c => sataN.s ! c
|
||||
}
|
||||
}
|
||||
} ;
|
||||
tuhattaN = {s = table {
|
||||
Sg => tuhatN.s ;
|
||||
Pl => table {
|
||||
NCase Sg Nom => "tuhatta" ;
|
||||
c => tuhatN.s ! c
|
||||
}
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
168
lib/resource/finnish/NounFin.gf
Normal file
168
lib/resource/finnish/NounFin.gf
Normal file
@@ -0,0 +1,168 @@
|
||||
concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
-- The $Number$ is subtle: "nuo autot", "nuo kolme autoa" are both plural
|
||||
-- for verb agreement, but the noun form is singular in the latter.
|
||||
|
||||
DetCN det cn =
|
||||
let
|
||||
n : Number = case det.isNum of {
|
||||
True => Sg ;
|
||||
_ => det.n
|
||||
} ;
|
||||
ncase : Case -> NForm = \c ->
|
||||
case <n,c,det.isNum,det.isPoss, det.isDef> of {
|
||||
<_, Nom, True,_,_> => NCase Sg Part ; -- kolme kytkintä(ni)
|
||||
<_, _, True,False,_> => NCase Sg c ; -- kolmeksi kytkimeksi
|
||||
<Pl,Nom, _,_,False> => NCase Pl Part ; -- kytkimiä
|
||||
<_, Nom,_,True,_> => NPossNom n ; -- kytkime+ni on/ovat...
|
||||
<_, Gen,_,True,_> => NPossNom n ; -- kytkime+ni vika
|
||||
<_, Transl,_,True,_> => NPossTransl n ; -- kytkim(e|i)kse+ni
|
||||
<_, Illat,_,True,_> => NPossIllat n ; -- kytkim(ee|ii)+ni
|
||||
|
||||
_ => NCase n c -- kytkin, kytkimen,...
|
||||
}
|
||||
in {
|
||||
s = \\c => let k = npform2case n c in
|
||||
det.s1 ! k ++ cn.s ! ncase k ++ det.s2 ;
|
||||
a = agrP3 (case det.isDef of {
|
||||
False => Sg ; -- autoja menee; kolme autoa menee
|
||||
_ => det.n
|
||||
}) ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
UsePN pn = {
|
||||
s = \\c => pn.s ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
UsePron p = p ** {isPron = True} ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ! np.a.n ! c ++ np.s ! c ;
|
||||
a = np.a ;
|
||||
isPron = np.isPron -- kaikki minun - ni
|
||||
} ;
|
||||
|
||||
PPartNP np v2 = {
|
||||
s = \\c => np.s ! c ++ v2.s ! PastPartPass (AN (NCase np.a.n Ess)) ;
|
||||
a = np.a ;
|
||||
isPron = np.isPron -- minun täällä - ni
|
||||
} ;
|
||||
|
||||
AdvNP np adv = {
|
||||
s = \\c => np.s ! c ++ adv.s ;
|
||||
a = np.a ;
|
||||
isPron = np.isPron -- minun täällä - ni
|
||||
} ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s1 = \\c => quant.s1 ! c ++ ord.s ! Sg ! c ;
|
||||
s2 = quant.s2 ;
|
||||
n = Sg ;
|
||||
isNum = False ;
|
||||
isPoss = quant.isPoss ;
|
||||
isDef = False -- doesn't matter with Sg
|
||||
} ;
|
||||
|
||||
DetPl quant num ord = {
|
||||
s1 = \\c => quant.s1 ! c ++ num.s ! Sg ! c ++ ord.s ! Pl ! c ;
|
||||
s2 = quant.s2 ;
|
||||
n = Pl ;
|
||||
isNum = num.isNum ;
|
||||
isPoss = quant.isPoss ;
|
||||
isDef = quant.isDef
|
||||
} ;
|
||||
|
||||
SgQuant quant = {
|
||||
s1 = quant.s1 ! Sg ;
|
||||
s2 = quant.s2 ;
|
||||
isNum = quant.isNum ;
|
||||
isPoss = quant.isPoss ;
|
||||
isDef = quant.isDef -- doesn't matter with Sg
|
||||
} ;
|
||||
PlQuant quant = {
|
||||
s1 = quant.s1 ! Pl ;
|
||||
s2 = quant.s2 ;
|
||||
isNum = quant.isNum ;
|
||||
isPoss = quant.isPoss ;
|
||||
isDef = quant.isDef
|
||||
} ;
|
||||
|
||||
PossPron p = {
|
||||
s1 = \\_,_ => p.s ! NPCase Gen ;
|
||||
s2 = BIND ++ possSuffix p.a ;
|
||||
isNum = False ;
|
||||
isPoss = True ;
|
||||
isDef = True --- "minun kolme autoani ovat" ; thus "...on" is missing
|
||||
} ;
|
||||
|
||||
NoNum = {s = \\_,_ => [] ; isNum = False} ;
|
||||
NoOrd = {s = \\_,_ => []} ;
|
||||
|
||||
NumInt n = {s = \\_,_ => n.s ; isNum = True} ;
|
||||
OrdInt n = {s = \\_,_ => n.s ++ "."} ;
|
||||
|
||||
NumNumeral numeral = {s = \\n,c => numeral.s ! NCard (NCase n c) ; isNum = True} ;
|
||||
OrdNumeral numeral = {s = \\n,c => numeral.s ! NOrd (NCase n c)} ;
|
||||
|
||||
AdNum adn num = {s = \\n,c => adn.s ++ num.s ! n ! c ; isNum = num.isNum} ;
|
||||
|
||||
OrdSuperl a = {s = \\n,c => a.s ! Superl ! AN (NCase n c)} ;
|
||||
|
||||
DefArt = {
|
||||
s1 = \\_,_ => [] ;
|
||||
s2 = [] ;
|
||||
isNum,isPoss = False ;
|
||||
isDef = True -- autot ovat
|
||||
} ;
|
||||
|
||||
IndefArt = {
|
||||
s1 = \\_,_ => [] ; -- Nom is Part in Pl: use isDef in DetCN
|
||||
s2 = [] ;
|
||||
isNum,isPoss,isDef = False -- autoja on
|
||||
} ;
|
||||
|
||||
MassDet = {
|
||||
s1 = \\_ => [] ; --- Nom is Part ?
|
||||
s2 = [] ;
|
||||
isNum,isPoss,isDef = False
|
||||
} ;
|
||||
|
||||
UseN n = n ;
|
||||
|
||||
UseN2 n = n ;
|
||||
UseN3 n = n ;
|
||||
|
||||
--- If a possessive suffix is added here it goes after the complements...
|
||||
|
||||
ComplN2 f x = {
|
||||
s = \\nf => appCompl True Pos f.c2 x ++ f.s ! nf
|
||||
} ;
|
||||
ComplN3 f x = {
|
||||
s = \\nf => appCompl True Pos f.c2 x ++ f.s ! nf ;
|
||||
c2 = f.c3
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\nf => ap.s ! True ! AN (n2nform nf) ++ cn.s ! nf
|
||||
} ;
|
||||
|
||||
RelCN cn rs = {s = \\nf => cn.s ! nf ++ rs.s ! agrP3 (numN nf)} ;
|
||||
AdvCN cn ad = {s = \\nf => cn.s ! nf ++ ad.s} ;
|
||||
|
||||
SentCN cn sc = {s = \\nf=> cn.s ! nf ++ sc.s} ;
|
||||
|
||||
ApposCN cn np = {s = \\nf=> cn.s ! nf ++ np.s ! NPCase Nom} ; --- luvun x
|
||||
|
||||
oper
|
||||
numN : NForm -> Number = \nf -> case nf of {
|
||||
NCase n _ => n ;
|
||||
_ => Sg ---
|
||||
} ;
|
||||
|
||||
}
|
||||
142
lib/resource/finnish/NumeralFin.gf
Normal file
142
lib/resource/finnish/NumeralFin.gf
Normal file
@@ -0,0 +1,142 @@
|
||||
concrete NumeralFin of Numeral = CatFin ** open Prelude, ParadigmsFin, MorphoFin in {
|
||||
|
||||
-- Notice: possessive forms are not used. They get wrong, since every
|
||||
-- part is made to agree in them.
|
||||
|
||||
flags optimize = all_subs ;
|
||||
|
||||
lincat
|
||||
Sub1000000 = {s : CardOrd => Str ; n : Number} ;
|
||||
Digit = {s : CardOrd => Str} ;
|
||||
Sub10, Sub100, Sub1000 = {s : NumPlace => CardOrd => Str ; n : Number} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
n2 = co
|
||||
(nhn (mkSubst "a" "kaksi" "kahde" "kahte" "kahta" "kahteen" "kaksi" "kaksi"
|
||||
"kaksien" "kaksia" "kaksiin"))
|
||||
(ordN "a" "kahdes") ; --- toinen
|
||||
n3 = co
|
||||
(nhn (mkSubst "a" "kolme" "kolme" "kolme" "kolmea" "kolmeen" "kolmi" "kolmi"
|
||||
"kolmien" "kolmia" "kolmiin"))
|
||||
(ordN "a" "kolmas") ;
|
||||
n4 = co (regN "neljä") (ordN "ä" "neljäs") ;
|
||||
n5 = co (reg3N "viisi" "viiden" "viisiä") (ordN "ä" "viides") ;
|
||||
n6 = co (reg3N "kuusi" "kuuden" "kuusia") (ordN "a" "kuudes") ;
|
||||
n7 = co
|
||||
(nhn (mkSubst "ä" "seitsemän" "seitsemä" "seitsemä" "seitsemää"
|
||||
"seitsemään" "seitsemi" "seitsemi" "seitsemien" "seitsemiä"
|
||||
"seitsemiin"))
|
||||
(ordN "ä" "seitsemäs") ;
|
||||
n8 = co
|
||||
(nhn (mkSubst "a" "kahdeksan" "kahdeksa" "kahdeksa" "kahdeksaa"
|
||||
"kahdeksaan" "kahdeksi" "kahdeksi" "kahdeksien" "kahdeksia"
|
||||
"kahdeksiin"))
|
||||
(ordN "a" "kahdeksas") ;
|
||||
n9 = co
|
||||
(nhn (mkSubst "ä" "yhdeksän" "yhdeksä" "yhdeksä" "yhdeksää"
|
||||
"yhdeksään" "yhdeksi" "yhdeksi" "yhdeksien" "yhdeksiä" "yhdeksiin"))
|
||||
(ordN "ä" "yhdeksäs") ;
|
||||
|
||||
pot01 =
|
||||
{s = table {
|
||||
NumAttr => \\_ => [] ;
|
||||
NumIndep => yksiN.s
|
||||
} ;
|
||||
n = Sg
|
||||
} ;
|
||||
pot0 d = {n = Pl ; s = \\_ => d.s} ;
|
||||
pot110 =
|
||||
{s = \\_ => kymmenenN.s ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
pot111 = {n = Pl ; s = \\_,c => yksiN.s ! c ++"toista"} ; ---- yhdes
|
||||
pot1to19 d = {n = Pl ; s = \\_,c => d.s ! c ++"toista"} ;
|
||||
pot0as1 n = n ;
|
||||
|
||||
pot1 d = {n = Pl ; s = \\_,c => d.s ! c ++ kymmentaN.s ! c} ;
|
||||
pot1plus d e = {
|
||||
n = Pl ;
|
||||
s = \\_,c => d.s ! c ++ kymmentaN.s ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = {n = Pl ; s = \\_,c => d.s ! NumAttr ! c ++ sataaN.s ! d.n ! c} ; ----
|
||||
pot2plus d e = {
|
||||
n = Pl ;
|
||||
s = \\_,c => d.s ! NumAttr ! c ++ sataaN.s ! d.n ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
pot2as3 n = {n = n.n ; s = n.s ! NumIndep} ;
|
||||
pot3 d = {n = Pl ; s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c} ; ----
|
||||
pot3plus d e = {
|
||||
n = Pl ;
|
||||
s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
|
||||
oper
|
||||
co : (c,o : {s : NForm => Str}) -> {s : CardOrd => Str} = \c,o -> {
|
||||
s = table {
|
||||
NCard nf => c.s ! nf ;
|
||||
NOrd nf => o.s ! nf
|
||||
}
|
||||
} ;
|
||||
|
||||
-- Too much trouble to infer vowel, cf. "kuudes" vs. "viides".
|
||||
|
||||
ordN : Str -> Str -> {s : NForm => Str} = \a,sadas ->
|
||||
let
|
||||
sada = init sadas
|
||||
in
|
||||
mkN
|
||||
sadas (sada + "nnen") (sada + "nten" + a) (sada + "tt" + a) (sada + "nteen")
|
||||
(sada + "nsin" + a) (sada + "nsiss" + a) (sada + "nsien")
|
||||
(sada + "nsi" + a) (sada + "nsiin") ;
|
||||
|
||||
param
|
||||
NumPlace = NumIndep | NumAttr ;
|
||||
|
||||
oper
|
||||
yksiN = co
|
||||
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
|
||||
"yksien" "yksiä" "yksiin"))
|
||||
(ordN "ä" "yhdes") ; ---- ensimmäinen
|
||||
kymmenenN = co
|
||||
(nhn (mkSubst "ä" "kymmenen" "kymmene" "kymmene" "kymmentä"
|
||||
"kymmeneen" "kymmeni" "kymmeni" "kymmenien" "kymmeniä" "kymmeniin"))
|
||||
(ordN "ä" "kymmenes") ;
|
||||
sataN = co
|
||||
(nhn (sLukko "sata"))
|
||||
(ordN "a" "sadas") ;
|
||||
|
||||
tuhatN = co
|
||||
(nhn (mkSubst "a" "tuhat" "tuhanne" "tuhante" "tuhatta" "tuhanteen"
|
||||
"tuhansi" "tuhansi" "tuhansien" "tuhansia" "tuhansiin"))
|
||||
(ordN "a" "tuhannes") ;
|
||||
|
||||
kymmentaN =
|
||||
{s = table {
|
||||
NCard (NCase Sg Nom) => "kymmentä" ;
|
||||
k => kymmenenN.s ! k
|
||||
}
|
||||
} ;
|
||||
|
||||
sataaN : {s : Number => CardOrd => Str} = {s = table {
|
||||
Sg => sataN.s ;
|
||||
Pl => table {
|
||||
NCard (NCase Sg Nom) => "sataa" ;
|
||||
k => sataN.s ! k
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
tuhattaN = {s = table {
|
||||
Sg => tuhatN.s ;
|
||||
Pl => table {
|
||||
NCard (NCase Sg Nom) => "tuhatta" ;
|
||||
k => tuhatN.s ! k
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete NumeralsFin of Numerals = open TypesFin, MorphoFin, ParadigmsFin in {
|
||||
|
||||
lincat
|
||||
Numeral, Sub1000000 = {s : NForm => Str ; n : Number} ;
|
||||
Digit = {s : NForm => Str} ;
|
||||
Sub10, Sub100, Sub1000 = {s : NumPlace => NForm => Str ; n : Number} ;
|
||||
|
||||
lin
|
||||
num x = x ;
|
||||
n2 = nhn (mkSubst "a" "kaksi" "kahde" "kahte" "kahta" "kahteen" "kaksi" "kaksi"
|
||||
"kaksien" "kaksia" "kaksiin") ;
|
||||
n3 = nhn (mkSubst "a" "kolme" "kolme" "kolme" "kolmea" "kolmeen" "kolmi" "kolmi"
|
||||
"kolmien" "kolmia" "kolmiin") ;
|
||||
n4 = regN "neljä" ;
|
||||
n5 = reg3N "viisi" "viiden" "viisiä" ;
|
||||
n6 = reg3N "kuusi" "kuuden" "kuusia" ;
|
||||
n7 = nhn (mkSubst "ä" "seitsemän" "seitsemä" "seitsemä" "seitsemää"
|
||||
"seitsemään" "seitsemi" "seitsemi" "seitsemien" "seitsemiä"
|
||||
"seitsemiin") ;
|
||||
n8 = nhn (mkSubst "a" "kahdeksan" "kahdeksa" "kahdeksa" "kahdeksaa"
|
||||
"kahdeksaan" "kahdeksi" "kahdeksi" "kahdeksien" "kahdeksia"
|
||||
"kahdeksiin") ;
|
||||
n9 = nhn (mkSubst "ä" "yhdeksän" "yhdeksä" "yhdeksä" "yhdeksää"
|
||||
"yhdeksään" "yhdeksi" "yhdeksi" "yhdeksien" "yhdeksiä" "yhdeksiin") ;
|
||||
|
||||
pot01 =
|
||||
{s = table {
|
||||
NumAttr => \\_ => [] ;
|
||||
NumIndep => yksiN.s
|
||||
} ;
|
||||
n = Sg
|
||||
} ;
|
||||
pot0 d = {n = Pl ; s = \\_ => d.s} ;
|
||||
pot110 =
|
||||
{s = \\_ => kymmenenN.s ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
pot111 = {n = Pl ; s = \\_,c => yksiN.s ! c ++"toista"} ;
|
||||
pot1to19 d = {n = Pl ; s = \\_,c => d.s ! c ++"toista"} ;
|
||||
pot0as1 n = n ;
|
||||
|
||||
pot1 d = {n = Pl ; s = \\_,c => d.s ! c ++ kymmentaN.s ! c} ;
|
||||
pot1plus d e = {
|
||||
n = Pl ;
|
||||
s = \\_,c => d.s ! c ++ kymmentaN.s ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = {n = Pl ; s = \\_,c => d.s ! NumAttr ! c ++ sataaN.s ! d.n ! c} ; ----
|
||||
pot2plus d e = {
|
||||
n = Pl ;
|
||||
s = \\_,c => d.s ! NumAttr ! c ++ sataaN.s ! d.n ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
pot2as3 n = {n = n.n ; s = n.s ! NumIndep} ;
|
||||
pot3 d = {n = Pl ; s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c} ; ----
|
||||
pot3plus d e = {
|
||||
n = Pl ;
|
||||
s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
}
|
||||
@@ -1,42 +1,44 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
--1 Finnish Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2003-2005
|
||||
-- Aarne Ranta 2003--2005
|
||||
--
|
||||
-- This is an API to the user of the resource grammar
|
||||
-- for adding lexical items. It give shortcuts for forming
|
||||
-- expressions of basic categories: nouns, adjectives, verbs.
|
||||
-- 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$.
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The low-level definitions of inflectional patterns are in
|
||||
-- $MorphoFin$. The main difference with that module is that here the types
|
||||
-- The main difference with $MorphoFin.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, not
|
||||
-- stems, as string arguments of the paradigms, not stems.
|
||||
-- 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.
|
||||
|
||||
resource ParadigmsFin =
|
||||
open (Predef=Predef), Prelude, SyntaxFin, CategoriesFin in {
|
||||
resource ParadigmsFin = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoFin,
|
||||
CatFin
|
||||
in {
|
||||
|
||||
-- flags optimize=values ;
|
||||
flags optimize=noexpand ;
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender, number, and (some) case names,
|
||||
-- we define the following identifiers. The application programmer
|
||||
-- should always use these constants instead of their definitions
|
||||
-- in $TypesInf$.
|
||||
-- should always use these constants instead of the constructors
|
||||
-- defined in $ResFin$.
|
||||
|
||||
oper
|
||||
Gender : Type;
|
||||
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
@@ -58,22 +60,20 @@ oper
|
||||
-- of many-place verbs and adjective. A complement can be defined by
|
||||
-- just a case, or a pre/postposition and a case.
|
||||
|
||||
PPosition : Type ;
|
||||
|
||||
prepP : Case -> Str -> PPosition ;
|
||||
postpP : Case -> Str -> PPosition ;
|
||||
caseP : Case -> PPosition ;
|
||||
accusative : PPosition ;
|
||||
prePrep : Case -> Str -> Prep ; -- ilman, partitive
|
||||
postPrep : Case -> Str -> Prep ; -- takana, genitive
|
||||
postGenPrep : Str -> Prep ; -- takana
|
||||
casePrep : Case -> Prep ; -- adessive
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- The worst case gives ten forms and the semantic gender.
|
||||
-- In practice just a couple of forms are needed, to define the different
|
||||
-- The worst case gives ten forms.
|
||||
-- In practice just a couple of forms are needed to define the different
|
||||
-- stems, vowel alternation, and vowel harmony.
|
||||
|
||||
oper
|
||||
mkN : (talo, talon, talona, taloa, taloon,
|
||||
taloina,taloissa,talojen,taloja,taloihin : Str) -> Gender -> N ;
|
||||
taloina,taloissa,talojen,taloja,taloihin : Str) -> N ;
|
||||
|
||||
-- The regular noun heuristic takes just one form (singular
|
||||
-- nominative) and analyses it to pick the correct paradigm.
|
||||
@@ -101,18 +101,13 @@ oper
|
||||
-- The rest of the noun paradigms are mostly covered by the three
|
||||
-- heuristics.
|
||||
--
|
||||
-- Nouns with partitive "a"/"ä" are a large group.
|
||||
-- Nouns with partitive "a","ä" are a large group.
|
||||
-- To determine for grade and vowel alternation, three forms are usually needed:
|
||||
-- singular nominative and genitive, and plural partitive.
|
||||
-- Examples: "talo", "kukko", "huippu", "koira", "kukka", "syylä", "särki"...
|
||||
|
||||
nKukko : (kukko,kukon,kukkoja : Str) -> N ;
|
||||
|
||||
-- For convenience, we define 1-argument paradigms as producing the
|
||||
-- nonhuman gender; the following function changes this:
|
||||
|
||||
humanN : N -> N ;
|
||||
|
||||
-- A special case are nouns with no alternations:
|
||||
-- the vowel harmony is inferred from the last letter,
|
||||
-- which must be one of "o", "u", "ö", "y".
|
||||
@@ -132,11 +127,12 @@ oper
|
||||
nSylki : (sylki : Str) -> N ;
|
||||
|
||||
-- Foreign words ending in consonants are actually similar to words like
|
||||
-- "malli"/"mallin"/"malleja", with the exception that the "i" is not attached
|
||||
-- "malli"-"mallin"-"malleja", with the exception that the "i" is not attached
|
||||
-- to the singular nominative. Examples: "linux", "savett", "screen".
|
||||
-- The singular partitive form is used to get the vowel harmony. (N.B. more than
|
||||
-- 1-syllabic words ending in "n" would have variant plural genitive and
|
||||
-- partitive forms, like "sultanien"/"sultaneiden", which are not covered.)
|
||||
-- The singular partitive form is used to get the vowel harmony.
|
||||
-- (N.B. more than 1-syllabic words ending in "n" would have variant
|
||||
-- plural genitive and partitive forms, like
|
||||
-- "sultanien", "sultaneiden", which are not covered.)
|
||||
|
||||
nLinux : (linuxia : Str) -> N ;
|
||||
|
||||
@@ -151,7 +147,7 @@ oper
|
||||
|
||||
nRae : (rae, rakeena : Str) -> N ;
|
||||
|
||||
-- The following covers nouns with partitive "ta"/"tä", such as
|
||||
-- The following covers nouns with partitive "ta","tä", such as
|
||||
-- "susi", "vesi", "pieni". To get all stems and the vowel harmony, it takes
|
||||
-- the singular nominative, genitive, and essive.
|
||||
|
||||
@@ -190,21 +186,22 @@ oper
|
||||
-- Separately-written compound nouns, like "sambal oelek", "Urho Kekkonen",
|
||||
-- have only their last part inflected.
|
||||
|
||||
nComp : Str -> N -> N ;
|
||||
compN : Str -> N -> N ;
|
||||
|
||||
-- Nouns used as functions need a case, of which by far the commonest is
|
||||
-- the genitive.
|
||||
|
||||
mkN2 : N -> Case -> N2 ;
|
||||
genN2 : N -> N2 ;
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
genN2 : N -> N2 ;
|
||||
|
||||
mkN3 : N -> Case -> Case -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
|
||||
-- Proper names can be formed by using declensions for nouns.
|
||||
-- The plural forms are filtered away by the compiler.
|
||||
|
||||
regPN : Str -> PN ;
|
||||
mkPN : N -> PN ;
|
||||
|
||||
mkNP : N -> Number -> NP ;
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
@@ -214,17 +211,17 @@ oper
|
||||
|
||||
-- Two-place adjectives need a case for the second argument.
|
||||
|
||||
mkA2 : A -> PPosition -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
|
||||
-- Comparison adjectives have three forms. The comparative and the superlative
|
||||
-- are always inflected in the same way, so the nominative of them is actually
|
||||
-- enough (except for the superlative "paras" of "hyvä").
|
||||
|
||||
mkADeg : (kiva : N) -> (kivempaa,kivinta : Str) -> ADeg ;
|
||||
mkADeg : (kiva : N) -> (kivempaa,kivinta : Str) -> A ;
|
||||
|
||||
-- The regular adjectives are based on $regN$ in the positive.
|
||||
|
||||
regADeg : (punainen : Str) -> ADeg ;
|
||||
regA : (punainen : Str) -> A ;
|
||||
|
||||
|
||||
--2 Verbs
|
||||
@@ -243,6 +240,10 @@ oper
|
||||
reg2V : (soutaa,souti : Str) -> V ;
|
||||
reg3V : (soutaa,soudan,souti : Str) -> V ;
|
||||
|
||||
-- The subject case of verbs is by default nominative. This dunction can change it.
|
||||
|
||||
subjcaseV : V -> Case -> V ;
|
||||
|
||||
-- The rest of the paradigms are special cases mostly covered by the heuristics.
|
||||
-- A simple special case is the one with just one stem and without grade alternation.
|
||||
|
||||
@@ -272,14 +273,15 @@ oper
|
||||
|
||||
caseV : Case -> V -> V ;
|
||||
|
||||
-- The verbs "be" and the negative auxiliary are special.
|
||||
-- The verbs "be" is special.
|
||||
|
||||
vOlla : V ;
|
||||
vEi : V ;
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a case, and can have a pre- or postposition.
|
||||
|
||||
mkV2 : V -> PPosition -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
|
||||
-- If the complement needs just a case, the following special function can be used.
|
||||
|
||||
@@ -287,7 +289,7 @@ oper
|
||||
|
||||
-- Verbs with a direct (accusative) object
|
||||
-- are special, since their complement case is finally decided in syntax.
|
||||
-- But this is taken care of by $ClauseFin$.
|
||||
-- But this is taken care of in $VerbFin$.
|
||||
|
||||
dirV2 : V -> V2 ;
|
||||
|
||||
@@ -297,9 +299,9 @@ oper
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : V -> PPosition -> PPosition -> V3 ; -- speak, with, about
|
||||
dirV3 : V -> Case -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- acc, allat
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- puhua, allative, elative
|
||||
dirV3 : V -> Case -> V3 ; -- siirtää, (accusative), illative
|
||||
dirdirV3 : V -> V3 ; -- antaa, (accusative), (allative)
|
||||
|
||||
|
||||
--3 Other complement patterns
|
||||
@@ -307,34 +309,39 @@ oper
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V2 -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V2 -> V2V ;
|
||||
mkVA : V -> Case -> VA ;
|
||||
mkV2A : V2 -> Case -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V2 -> V2Q ;
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Prep -> V2V ;
|
||||
mkVA : V -> Prep -> VA ;
|
||||
mkV2A : V -> Prep -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A2 -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A2 -> A2V ;
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Prep -> 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, V2S, V2V, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
|
||||
--.
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
--.
|
||||
Gender = SyntaxFin.Gender ;
|
||||
Case = SyntaxFin.Case ;
|
||||
Number = SyntaxFin.Number ;
|
||||
|
||||
Case = MorphoFin.Case ;
|
||||
Number = MorphoFin.Number ;
|
||||
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
human = Human ;
|
||||
nonhuman = NonHuman ;
|
||||
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
partitive = Part ;
|
||||
@@ -346,25 +353,21 @@ oper
|
||||
ablative = Ablat ;
|
||||
allative = Allat ;
|
||||
|
||||
PPosition : Type = {c : ComplCase ; s3 : Str ; p : Bool} ;
|
||||
prepP : Case -> Str -> PPosition =
|
||||
\c,p -> {c = CCase c ; s3 = p ; p = True} ;
|
||||
postpP : Case -> Str -> PPosition =
|
||||
\c,p -> {c = CCase c ; s3 = p ; p = False} ;
|
||||
caseP : Case -> PPosition =
|
||||
\c -> {c = CCase c ; s3 = [] ; p = True} ;
|
||||
accusative = {c = CAcc ; s3 = [] ; p = True} ;
|
||||
prePrep : Case -> Str -> Prep =
|
||||
\c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ;
|
||||
postPrep : Case -> Str -> Prep =
|
||||
\c,p -> {c = NPCase c ; s = p ; isPre = False ; lock_Prep = <>} ;
|
||||
postGenPrep p = {c = NPCase genitive ; s = p ; isPre = False ; lock_Prep = <>} ;
|
||||
casePrep : Case -> Prep =
|
||||
\c -> {c = NPCase c ; s = [] ; isPre = True ; lock_Prep = <>} ;
|
||||
accPrep = {c = NPAcc ; s = [] ; isPre = True ; lock_Prep = <>} ;
|
||||
|
||||
mkN = \a,b,c,d,e,f,g,h,i,j,k ->
|
||||
mkNoun a b c d e f g h i j ** {g = k ; lock_N = <>} ;
|
||||
mkN = \a,b,c,d,e,f,g,h,i,j ->
|
||||
mkNoun a b c d e f g h i j ** {lock_N = <>} ;
|
||||
|
||||
regN = \vesi ->
|
||||
---- nhn (regNounH vesi) ** {g = NonHuman ; lock_N = <>} ;
|
||||
let
|
||||
esi = Predef.dp 3 vesi ; -- analysis: suffixes
|
||||
si = Predef.dp 2 esi ;
|
||||
i = last si ;
|
||||
s = init si ;
|
||||
a = if_then_Str (pbool2bool (Predef.occurs "aou" vesi)) "a" "ä" ;
|
||||
ves = init vesi ; -- synthesis: prefixes
|
||||
vet = strongGrade ves ;
|
||||
@@ -372,35 +375,29 @@ oper
|
||||
in nhn (
|
||||
case esi of {
|
||||
"uus" | "yys" => sRakkaus vesi ;
|
||||
"nen" => sNainen (Predef.tk 3 vesi + ("st" + a)) ;
|
||||
|
||||
_ => case si of {
|
||||
"aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö" => sPuu vesi ;
|
||||
"ie" | "uo" | "yö" => sSuo vesi ;
|
||||
"ea" | "eä" =>
|
||||
mkSubst
|
||||
a
|
||||
vesi (vesi) (vesi) (vesi + a) (vesi + a+"n")
|
||||
(ves + "i") (ves + "i") (ves + "iden") (ves + "it"+a)
|
||||
(ves + "isiin") ;
|
||||
"is" => sNauris (vesi + ("t" + a)) ;
|
||||
"ut" | "yt" => sRae vesi (ves + ("en" + a)) ;
|
||||
"as" | "äs" => sRae vesi (vet + (a + "n" + a)) ;
|
||||
"ar" | "är" => sRae vesi (vet + ("ren" + a)) ;
|
||||
_ => case i of {
|
||||
"n" => sLiitin vesi (vet + "men") ;
|
||||
"s" => sTilaus vesi (ves + ("ksen" + a)) ;
|
||||
"i" => sBaari (vesi + a) ;
|
||||
"e" => sRae vesi (strongGrade vesi + "en" + a) ;
|
||||
"a" | "o" | "u" | "y" | "ä" | "ö" => sLukko vesi ;
|
||||
_ => sLinux (vesi + "i" + a)
|
||||
_ + "nen" => sNainen (Predef.tk 3 vesi + ("st" + a)) ;
|
||||
_ + ("aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö") => sPuu vesi ;
|
||||
_ + ("ie" | "uo" | "yö") => sSuo vesi ;
|
||||
_ + ("ea" | "eä") =>
|
||||
mkSubst
|
||||
a
|
||||
vesi (vesi) (vesi) (vesi + a) (vesi + a+"n")
|
||||
(ves + "i") (ves + "i") (ves + "iden") (ves + "it"+a)
|
||||
(ves + "isiin") ;
|
||||
_ + "is" => sNauris (vesi + ("t" + a)) ;
|
||||
_ + ("ut" | "yt") => sRae vesi (ves + ("en" + a)) ;
|
||||
_ + ("as" | "äs") => sRae vesi (vet + (a + "n" + a)) ;
|
||||
_ + ("ar" | "är") => sRae vesi (vet + ("ren" + a)) ;
|
||||
_ + "n" => sLiitin vesi (vet + "men") ;
|
||||
_ + "s" => sTilaus vesi (ves + ("ksen" + a)) ;
|
||||
_ + "i" => sBaari (vesi + a) ;
|
||||
_ + "e" => sRae vesi (strongGrade vesi + "en" + a) ;
|
||||
_ + ("a" | "o" | "u" | "y" | "ä" | "ö") => sLukko vesi ;
|
||||
_ => sLinux (vesi + "i" + a)
|
||||
}
|
||||
}
|
||||
}
|
||||
) ** {g = NonHuman ; lock_N = <>} ;
|
||||
) ** {lock_N = <>} ;
|
||||
|
||||
reg2N : (savi,savia : Str) -> N = \savi,savia ->
|
||||
---- nhn (reg2NounH savi savia)
|
||||
let
|
||||
savit = regN savi ;
|
||||
ia = Predef.dp 2 savia ;
|
||||
@@ -412,57 +409,51 @@ oper
|
||||
case <o,ia> of {
|
||||
<"i","ia"> => nhn (sArpi savi) ;
|
||||
<"i","iä"> => nhn (sSylki savi) ;
|
||||
<"i","ta"> | <"i","tä"> => nhn (sTohtori (savi + a)) ;
|
||||
<"o","ta"> | <"ö","tä"> => nhn (sRadio savi) ;
|
||||
<"a","ta"> | <"ä","tä"> => nhn (sPeruna savi) ;
|
||||
<"a","ia"> | <"a","ja"> => nhn (sKukko savi savin savia) ;
|
||||
<"i","ta"> | <"i","tä"> => nhn (sTohtori (savi + a)) ; -- from 10 to 90 ms
|
||||
-- <"a","ia"> | <"a","ja"> => nhn (sKukko savi savin savia) ; ---needless?
|
||||
_ => savit
|
||||
}
|
||||
** {g = NonHuman ; lock_N = <>} ;
|
||||
** {lock_N = <>} ;
|
||||
|
||||
reg3N = \vesi,veden,vesiä ->
|
||||
let
|
||||
vesit = reg2N vesi vesiä ;
|
||||
si = Predef.dp 2 vesi ;
|
||||
i = last si ;
|
||||
a = last vesiä ;
|
||||
s = last (Predef.tk 2 vesiä)
|
||||
a = last vesiä
|
||||
in
|
||||
case si of {
|
||||
"us" | "ys" =>
|
||||
ifTok CommonNoun (Predef.dp 3 veden) "den"
|
||||
(nhn (sRakkaus vesi))
|
||||
(nhn (sTilaus vesi (veden + a))) ;
|
||||
nhn (case Predef.dp 3 veden of {
|
||||
"den" => sRakkaus vesi ;
|
||||
_ => sTilaus vesi (veden + a)
|
||||
}) ;
|
||||
"as" | "äs" => nhn (sRae vesi (veden + a)) ;
|
||||
"li" | "ni" | "ri" => nhn (sSusi vesi veden (Predef.tk 1 vesi + ("en" + a))) ;
|
||||
"si" => nhn (sSusi vesi veden (Predef.tk 2 vesi + ("ten" + a))) ;
|
||||
"li" | "ni" | "ri" => nhn (sSusi vesi veden (init vesi + ("en" + a))) ;
|
||||
"si" => nhn (sSusi vesi veden (Predef.tk 2 vesi + ("ten" + a))) ;
|
||||
"in" | "en" | "än" => nhn (sLiitin vesi veden) ;
|
||||
_ => case i of {
|
||||
"a" | "o" | "u" | "y" | "ä" | "ö" => nhn (sKukko vesi veden vesiä) ;
|
||||
"i" => nhn (sKorpi vesi veden (init veden + "n" + a)) ;
|
||||
_ => vesit
|
||||
}
|
||||
} ** {g = NonHuman ; lock_N = <>} ;
|
||||
_ + ("a" | "o" | "u" | "y" | "ä" | "ö") => nhn (sKukko vesi veden vesiä) ;
|
||||
_ {- + "i" -} => nhn (sKorpi vesi veden (init veden + "n" + a))
|
||||
}
|
||||
** {lock_N = <>} ;
|
||||
|
||||
nKukko = \a,b,c -> nhn (sKukko a b c) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nKukko = \a,b,c -> nhn (sKukko a b c) ** {lock_N = <>} ;
|
||||
|
||||
humanN = \n -> {s = n.s ; lock_N = n.lock_N ; g = human} ;
|
||||
|
||||
nLukko = \a -> nhn (sLukko a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nTalo = \a -> nhn (sTalo a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nArpi = \a -> nhn (sArpi a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nSylki = \a -> nhn (sSylki a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nLinux = \a -> nhn (sLinux a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nPeruna = \a -> nhn (sPeruna a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nRae = \a,b -> nhn (sRae a b) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nSusi = \a,b,c -> nhn (sSusi a b c) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nPuu = \a -> nhn (sPuu a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nSuo = \a -> nhn (sSuo a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nNainen = \a -> nhn (sNainen a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nTilaus = \a,b -> nhn (sTilaus a b) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nLukko = \a -> nhn (sLukko a) ** {lock_N = <>} ;
|
||||
nTalo = \a -> nhn (sTalo a) ** {lock_N = <>} ;
|
||||
nArpi = \a -> nhn (sArpi a) ** {lock_N = <>} ;
|
||||
nSylki = \a -> nhn (sSylki a) ** {lock_N = <>} ;
|
||||
nLinux = \a -> nhn (sLinux a) ** {lock_N = <>} ;
|
||||
nPeruna = \a -> nhn (sPeruna a) ** {lock_N = <>} ;
|
||||
nRae = \a,b -> nhn (sRae a b) ** {lock_N = <>} ;
|
||||
nSusi = \a,b,c -> nhn (sSusi a b c) ** {lock_N = <>} ;
|
||||
nPuu = \a -> nhn (sPuu a) ** {lock_N = <>} ;
|
||||
nSuo = \a -> nhn (sSuo a) ** {lock_N = <>} ;
|
||||
nNainen = \a -> nhn (sNainen a) ** {lock_N = <>} ;
|
||||
nTilaus = \a,b -> nhn (sTilaus a b) ** {lock_N = <>} ;
|
||||
nKulaus = \a -> nTilaus a (init a + "ksen" + getHarmony (last
|
||||
(init a))) ;
|
||||
nNauris = \a -> nhn (sNauris a) ** {g = nonhuman ; lock_N = <>} ;
|
||||
nNauris = \a -> nhn (sNauris a) ** {lock_N = <>} ;
|
||||
sgpartN noun part = {
|
||||
s = table {
|
||||
NCase Sg Part => part ;
|
||||
@@ -475,89 +466,96 @@ reg3N = \vesi,veden,vesi
|
||||
let a = vowelHarmony meri in
|
||||
sgpartN (reg2N meri (meri + a)) (init meri + "ta") ;
|
||||
|
||||
nComp = \s,n -> {s = \\c => s ++ n.s ! c ; g = n.g ; lock_N = <>} ;
|
||||
mkN2 = \n,c -> n2n n ** {c = NPCase c ; lock_N2 = <>} ;
|
||||
mkN3 = \n,c,e -> n2n n ** {c = NPCase c ; c2 = NPCase e ; lock_N3 = <>} ;
|
||||
genN2 = \n -> mkN2 n genitive ;
|
||||
mkPN n = mkProperName n ** {lock_PN = <>} ;
|
||||
compN = \s,n -> {s = \\c => s ++ n.s ! c ; g = n.g ; lock_N = <>} ;
|
||||
|
||||
mkA = \x -> noun2adj x ** {lock_A = <>} ;
|
||||
mkA2 = \x,c -> x ** {s3 = c.s3 ; p = c.p ; c = c.c ; lock_A2 = <>} ;
|
||||
mkN2 = \n,c -> n ** {c2 = c ; lock_N2 = <>} ;
|
||||
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ; lock_N3 = <>} ;
|
||||
genN2 = \n -> mkN2 n (casePrep genitive) ;
|
||||
regPN m = mkPN (regN m) ;
|
||||
mkPN n = mkProperName n ** {lock_PN = <>} ;
|
||||
mkNP noun num = {
|
||||
s = \\c => noun.s ! NCase num (npform2case num c) ;
|
||||
a = agrP3 num ;
|
||||
isPron = False ;
|
||||
lock_NP = <>
|
||||
} ;
|
||||
|
||||
mkA = \x -> {s = \\_ => (noun2adj x).s ; lock_A = <>} ;
|
||||
mkA2 = \x,c -> x ** {c2 = c ; lock_A2 = <>} ;
|
||||
mkADeg x kivempi kivin =
|
||||
let
|
||||
a = last (x.s ! ((NCase Sg Part))) ; ---- gives "kivinta"
|
||||
kivempaa = init kivempi + a + a ;
|
||||
kivinta = kivin + "t" + a
|
||||
in
|
||||
regAdjDegr x kivempaa kivinta ** {lock_ADeg = <>} ;
|
||||
regAdjective x kivempaa kivinta ** {lock_A = <>} ;
|
||||
|
||||
regADeg suuri =
|
||||
regA suuri =
|
||||
let suur = regN suuri in
|
||||
mkADeg
|
||||
suur
|
||||
(init (suur.s ! NCase Sg Gen) + "mpi")
|
||||
(init (suur.s ! NCase Pl Ess)) ;
|
||||
|
||||
mkV a b c d e f g h i j k l = mkVerb a b c d e f g h i j k l **
|
||||
{sc = Nom ; lock_V = <>} ;
|
||||
regADeg = regA ; -- for bw compat
|
||||
|
||||
regV soutaa = v2v (regVerbH soutaa) ** {sc = Nom ; lock_V = <>} ;
|
||||
mkV a b c d e f g h i j k l = mkVerb a b c d e f g h i j k l **
|
||||
{sc = NPCase Nom ; lock_V = <>} ;
|
||||
|
||||
regV soutaa = v2v (regVerbH soutaa) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
|
||||
reg2V : (soutaa,souti : Str) -> V = \soutaa,souti ->
|
||||
v2v (reg2VerbH soutaa souti) ** {sc = Nom ; lock_V = <>} ;
|
||||
v2v (reg2VerbH soutaa souti) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
|
||||
reg3V soutaa soudan souti =
|
||||
v2v (reg3VerbH soutaa soudan souti) ** {sc = Nom ; lock_V = <>} ;
|
||||
v2v (reg3VerbH soutaa soudan souti) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
|
||||
vValua v = v2v (vSanoa v) ** {sc = Nom ; lock_V = <>} ;
|
||||
vKattaa v u = v2v (vOttaa v u) ** {sc = Nom ; lock_V = <>} ;
|
||||
vOstaa v = v2v (vPoistaa v) ** {sc = Nom ; lock_V = <>} ;
|
||||
vNousta v u = v2v (vJuosta v u [] []) ** {sc = Nom ; lock_V = <>} ; -----
|
||||
vTuoda v = v2v (vJuoda v []) ** {sc = Nom ; lock_V = <>} ; -----
|
||||
caseV c v = {s = v.s ; sc = c ; lock_V = <>} ;
|
||||
subjcaseV v c = {s = v.s ; sc = NPCase c ; lock_V = v.lock_V} ;
|
||||
|
||||
vOlla = verbOlla ** {sc = Nom ; lock_V = <>} ;
|
||||
vEi = verbEi ** {sc = Nom ; lock_V = <>} ;
|
||||
vValua v = v2v (vSanoa v) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
vKattaa v u = v2v (vOttaa v u) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
vOstaa v = v2v (vPoistaa v) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
vNousta v u = v2v (vJuosta v u [] []) ** {sc = NPCase Nom ; lock_V = <>} ; -----
|
||||
vTuoda v = v2v (vJuoda v []) ** {sc = NPCase Nom ; lock_V = <>} ; -----
|
||||
caseV c v = {s = v.s ; sc = NPCase c ; lock_V = <>} ;
|
||||
|
||||
vOlla = verbOlla ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
|
||||
vHuoltaa : (_,_,_,_ : Str) -> Verb = \ottaa,otan,otti,otin ->
|
||||
v2v (SyntaxFin.vHuoltaa ottaa otan otti otin) ** {sc = Nom ; lock_V = <>} ;
|
||||
mkV2 = \v,c -> v ** {s3 = c.s3 ; p = c.p ; c = c.c ; lock_V2 = <>} ;
|
||||
caseV2 = \v,c -> mkV2 v (caseP c) ;
|
||||
dirV2 v = mkTransVerbDir v ** {lock_V2 = <>} ;
|
||||
v2v (MorphoFin.vHuoltaa ottaa otan otti otin) ** {sc = NPCase Nom ; lock_V = <>} ;
|
||||
|
||||
|
||||
mkV2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ;
|
||||
caseV2 = \v,c -> mkV2 v (casePrep c) ;
|
||||
dirV2 v = mkV2 v accPrep ;
|
||||
|
||||
mkAdv : Str -> Adv = \s -> {s = s ; lock_Adv = <>} ;
|
||||
|
||||
|
||||
mkV3 v p q = v **
|
||||
{s3 = p.s3 ; p = p.p ; c = p.c ; s5 = q.s3 ; p2 = q.p ; c2 = q.c ;
|
||||
lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v accusative (caseP p) ;
|
||||
mkV3 v p q = v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v accPrep (casePrep p) ;
|
||||
dirdirV3 v = dirV3 v allative ;
|
||||
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
mkVS v = v ** {lock_VS = <>} ;
|
||||
mkV2S v = v ** {lock_V2S = <>} ;
|
||||
-- mkVV v = v ** {lock_VV = <>} ;
|
||||
mkV2V v = v ** {lock_V2V = <>} ;
|
||||
mkVA v c = v ** {c = c ; lock_VA = <>} ;
|
||||
mkV2A v c = v ** {c2 = c ; lock_V2A = <>} ;
|
||||
mkVV v = v ** {lock_VV = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
mkV2Q v = v ** {lock_V2Q = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_AS = <>} ;
|
||||
mkA2S v = v ** {lock_A2S = <>} ;
|
||||
mkAV v = v ** {lock_AV = <>} ;
|
||||
mkA2V v = v ** {lock_A2V = <>} ;
|
||||
V0 : Type = V ;
|
||||
V2S, V2V, V2Q : Type = V2 ;
|
||||
AS, A2S, AV : Type = A ;
|
||||
A2V : Type = A2 ;
|
||||
|
||||
-- inf_illative
|
||||
-- infinitive
|
||||
mkV0 v = v ** {lock_V = <>} ;
|
||||
mkV2S v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
mkV2V v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
mkVA v p = v ** {c2 = p ; lock_VA = <>} ;
|
||||
mkV2A v p q = v ** {c2 = p ; c3 = q ; lock_V2A = <>} ;
|
||||
mkV2Q v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_A = <>} ;
|
||||
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
||||
mkAV v = v ** {lock_A = <>} ;
|
||||
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
||||
|
||||
-- V3 = TransVerb ** {s5, s6 : Str ; c2 : ComplCase} ;
|
||||
-- Verb ** {s3, s4 : Str ; c : ComplCase} ;
|
||||
-- mkN3 n c1 c2
|
||||
-- {c : NPForm} ;
|
||||
-- N3 = Function ** {c2 : NPForm} ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
23
lib/resource/finnish/PhraseFin.gf
Normal file
23
lib/resource/finnish/PhraseFin.gf
Normal file
@@ -0,0 +1,23 @@
|
||||
concrete PhraseFin of Phrase = CatFin ** open ResFin in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = s ;
|
||||
UttQS qs = {s = qs.s} ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ;
|
||||
|
||||
UttIP ip = {s = ip.s ! NPCase Nom} ;
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = np.s ! NPCase Nom} ;
|
||||
UttVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp} ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = conj ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = "," ++ np.s ! NPCase Nom} ;
|
||||
|
||||
}
|
||||
68
lib/resource/finnish/QuestionFin.gf
Normal file
68
lib/resource/finnish/QuestionFin.gf
Normal file
@@ -0,0 +1,68 @@
|
||||
concrete QuestionFin of Question = CatFin ** open ResFin, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = \\t,a,p => cl.s ! t ! a ! p ! SQuest
|
||||
} ;
|
||||
|
||||
QuestVP ip vp =
|
||||
let
|
||||
cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) vp.sc) (agrP3 ip.n) vp
|
||||
in {
|
||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
|
||||
} ;
|
||||
|
||||
QuestSlash ip slash = {
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
cls = slash.s ! t ! a ! p ;
|
||||
who = appCompl True p slash.c2 (ip ** {a = agrP3 ip.n ; isPron = False})
|
||||
in
|
||||
who ++ cls
|
||||
} ;
|
||||
|
||||
QuestIAdv iadv cl = {
|
||||
s = \\t,a,p => iadv.s ++ cl.s ! t ! a ! p ! SDecl
|
||||
} ;
|
||||
|
||||
QuestIComp icomp np = {
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
vp = predV (verbOlla ** {sc = NPCase Nom}) ;
|
||||
cl = mkClause (subjForm np vp.sc) np.a vp ;
|
||||
in
|
||||
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
|
||||
} ;
|
||||
|
||||
PrepIP p ip = {s =
|
||||
appCompl True Pos p (ip ** {a = agrP3 ip.n ; isPron = False})} ;
|
||||
|
||||
AdvIP ip adv = {
|
||||
s = \\c => ip.s ! c ++ adv.s ;
|
||||
n = ip.n
|
||||
} ;
|
||||
|
||||
-- The computation of $ncase$ is a special case of that in $NounFin.DetCN$,
|
||||
-- since we don't have possessive suffixes or definiteness.
|
||||
--- It could still be nice to have a common oper...
|
||||
|
||||
IDetCN idet num ord cn = let n = idet.n in {
|
||||
s = \\c =>
|
||||
let
|
||||
k = npform2case n c ;
|
||||
ncase = case <k,num.isNum> of {
|
||||
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
|
||||
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
|
||||
_ => NCase n k -- mitkä kytkimet
|
||||
}
|
||||
in
|
||||
idet.s ! k ++ num.s ! Sg ! k ++ ord.s ! n ! k ++ cn.s ! ncase ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
CompIAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
}
|
||||
53
lib/resource/finnish/RelativeFin.gf
Normal file
53
lib/resource/finnish/RelativeFin.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
RelCl cl = {
|
||||
s = \\t,a,p,_ => "siten" ++ "että" ++ cl.s ! t ! a ! p ! SDecl ;
|
||||
---- sellainen
|
||||
c = NPCase Nom
|
||||
} ;
|
||||
|
||||
RelVP rp vp = {
|
||||
s = \\t,ant,b,ag =>
|
||||
let
|
||||
agr = case rp.a of {
|
||||
RNoAg => ag ;
|
||||
RAg a => a
|
||||
} ;
|
||||
cl = mkClause (subjForm {s = rp.s ! agr.n ; a = agr ; isPron = False} vp.sc) agr vp
|
||||
in
|
||||
cl.s ! t ! ant ! b ! SDecl ;
|
||||
c = NPCase Nom
|
||||
} ;
|
||||
|
||||
RelSlash rp slash = {
|
||||
s = \\t,a,p,ag =>
|
||||
let
|
||||
cls = slash.s ! t ! a ! p ;
|
||||
who = appCompl True p slash.c2 (rp2np ag.n rp)
|
||||
in
|
||||
who ++ cls ;
|
||||
c = slash.c2.c
|
||||
} ;
|
||||
|
||||
FunRP p np rp = {
|
||||
s = \\n,c => appCompl True Pos p (rp2np n rp) ++ np.s ! c ; --- is c OK?
|
||||
a = RAg np.a
|
||||
} ;
|
||||
|
||||
IdRP = {
|
||||
s = \\n,c => relPron ! n ! npform2case n c ;
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
oper
|
||||
rp2np : Number -> {s : Number => NPForm => Str ; a : RAgr} -> NP = \n,rp -> {
|
||||
s = rp.s ! n ;
|
||||
a = agrP3 Sg ; -- does not matter (--- at least in Slash)
|
||||
isPron = False -- has no special accusative
|
||||
} ;
|
||||
|
||||
}
|
||||
566
lib/resource/finnish/ResFin.gf
Normal file
566
lib/resource/finnish/ResFin.gf
Normal file
@@ -0,0 +1,566 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
--1 Finnish 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$.
|
||||
|
||||
resource ResFin = ParamX ** open Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
|
||||
--2 Parameterd for $Noun$
|
||||
|
||||
-- This is the $Case$ as needed for both nouns and $NP$s.
|
||||
|
||||
param
|
||||
Case = Nom | Gen | Part | Transl | Ess
|
||||
| Iness | Elat | Illat | Adess | Ablat | Allat
|
||||
| Abess ; -- Comit, Instruct in NForm
|
||||
|
||||
NForm = NCase Number Case
|
||||
| NComit | NInstruct -- no number dist
|
||||
| NPossNom Number | NPossGen Number --- number needed for syntax of AdjCN
|
||||
| NPossTransl Number | NPossIllat Number ;
|
||||
|
||||
-- Agreement of $NP$ is a record. We'll add $Gender$ later.
|
||||
|
||||
oper
|
||||
Agr = {n : Number ; p : Person} ;
|
||||
|
||||
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
|
||||
|
||||
--
|
||||
--2 Adjectives
|
||||
--
|
||||
-- The major division is between the comparison degrees. A degree fixed,
|
||||
-- an adjective is like common nouns, except for the adverbial form.
|
||||
|
||||
param
|
||||
AForm = AN NForm | AAdv ;
|
||||
|
||||
oper
|
||||
Adjective : Type = {s : Degree => AForm => Str} ;
|
||||
|
||||
--2 Noun phrases
|
||||
--
|
||||
-- Two forms of *virtual accusative* are needed for nouns in singular,
|
||||
-- the nominative and the genitive one ("ostan talon"/"osta talo").
|
||||
-- For nouns in plural, only a nominative accusative exist. Pronouns
|
||||
-- have a uniform, special accusative form ("minut", etc).
|
||||
|
||||
param
|
||||
NPForm = NPCase Case | NPAcc ;
|
||||
|
||||
oper
|
||||
npform2case : Number -> NPForm -> Case = \n,f -> case <f,n> of {
|
||||
<NPCase c,_> => c ;
|
||||
<NPAcc,Sg> => Gen ;-- appCompl does the job
|
||||
<NPAcc,Pl> => Nom
|
||||
} ;
|
||||
|
||||
n2nform : NForm -> NForm = \nf -> case nf of {
|
||||
NPossNom n => NCase n Nom ; ----
|
||||
NPossGen n => NCase n Gen ;
|
||||
NPossTransl n => NCase n Transl ;
|
||||
NPossIllat n => NCase n Illat ;
|
||||
_ => nf
|
||||
} ;
|
||||
|
||||
|
||||
--2 For $Verb$
|
||||
|
||||
-- A special form is needed for the negated plural imperative.
|
||||
|
||||
param
|
||||
VForm =
|
||||
Inf InfForm
|
||||
| Presn Number Person
|
||||
| Impf Number Person --# notpresent
|
||||
| Condit Number Person --# notpresent
|
||||
| Imper Number
|
||||
| ImperP3 Number
|
||||
| ImperP1Pl
|
||||
| ImpNegPl
|
||||
| Pass Bool
|
||||
| PastPartAct AForm
|
||||
| PastPartPass AForm
|
||||
;
|
||||
|
||||
InfForm =
|
||||
Inf1
|
||||
| Inf3Iness -- 5 forms acc. to Karlsson
|
||||
| Inf3Elat
|
||||
| Inf3Illat
|
||||
| Inf3Adess
|
||||
| Inf3Abess
|
||||
;
|
||||
|
||||
SType = SDecl | SQuest ;
|
||||
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
||||
|
||||
--2 For $Numeral$
|
||||
|
||||
CardOrd = NCard NForm | NOrd NForm ;
|
||||
|
||||
--2 Transformations between parameter types
|
||||
|
||||
oper
|
||||
agrP3 : Number -> Agr = \n ->
|
||||
{n = n ; p = P3} ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
||||
n = conjNumber a.n b.n ;
|
||||
p = conjPerson a.p b.p
|
||||
} ;
|
||||
|
||||
---
|
||||
|
||||
Compl : Type = {s : Str ; c : NPForm ; isPre : Bool} ;
|
||||
|
||||
appCompl : Bool -> Polarity -> Compl -> NP -> Str = \isFin,b,co,np ->
|
||||
let
|
||||
c = case <isFin, b, co.c, np.isPron,np.a.n> of {
|
||||
<_, Neg, NPAcc,_,_> => NPCase Part ; -- en näe taloa/sinua
|
||||
<_, Pos, NPAcc,True,_> => NPAcc ; -- näen/täytyy sinut
|
||||
<True, Pos, NPAcc,False,Sg> => NPCase Gen ; -- näen talon
|
||||
<False,Pos, NPAcc,_,_> => NPCase Nom ; -- täytyy talo/sinut; näen talot
|
||||
<_,_,coc,_,_> => coc
|
||||
} ;
|
||||
nps = np.s ! c
|
||||
in
|
||||
preOrPost co.isPre co.s nps ;
|
||||
|
||||
-- For $Verb$.
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str
|
||||
} ;
|
||||
|
||||
param
|
||||
VIForm =
|
||||
VIFin Tense
|
||||
| VIInf InfForm
|
||||
| VIPass
|
||||
| VIImper
|
||||
;
|
||||
|
||||
oper
|
||||
VP = {
|
||||
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
|
||||
s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa
|
||||
ext : Str ;
|
||||
sc : NPForm
|
||||
} ;
|
||||
|
||||
predV : (Verb ** {sc : NPForm}) -> VP = \verb -> {
|
||||
s = \\vi,ant,b,agr =>
|
||||
let
|
||||
|
||||
verbs = verb.s ;
|
||||
part : Str = case vi of {
|
||||
VIPass => verbs ! PastPartPass (AN (NCase agr.n Nom)) ;
|
||||
_ => verbs ! PastPartAct (AN (NCase agr.n Nom))
|
||||
} ;
|
||||
|
||||
eiv : Str = case agr of {
|
||||
{n = Sg ; p = P1} => "en" ;
|
||||
{n = Sg ; p = P2} => "et" ;
|
||||
{n = Sg ; p = P3} => "ei" ;
|
||||
{n = Pl ; p = P1} => "emme" ;
|
||||
{n = Pl ; p = P2} => "ette" ;
|
||||
{n = Pl ; p = P3} => "eivät"
|
||||
} ;
|
||||
|
||||
einegole : Str * Str * Str = case <vi,agr.n> of {
|
||||
<VIFin Pres,_> => <eiv, verbs ! Imper Sg, "ole"> ;
|
||||
<VIFin Fut,_> => <eiv, verbs ! Imper Sg, "ole"> ; --# notpresent
|
||||
<VIFin Cond, _> => <eiv, verbs ! Condit Sg P3, "olisi"> ; --# notpresent
|
||||
<VIFin Past, Sg> => <eiv, part, "ollut"> ; --# notpresent
|
||||
<VIFin Past, Pl> => <eiv, part, "olleet"> ; --# notpresent
|
||||
<VIImper, Sg> => <"älä", verbs ! Imper Sg, "ole"> ;
|
||||
<VIImper, Pl> => <"älkää", verbs ! ImpNegPl, "olko"> ;
|
||||
<VIPass, _> => <"ei", verbs ! Pass False, "ole"> ;
|
||||
<VIInf i, _> => <"ei", verbs ! Inf i, "olla"> ----
|
||||
} ;
|
||||
|
||||
ei : Str = einegole.p1 ;
|
||||
neg : Str = einegole.p2 ;
|
||||
ole : Str = einegole.p3 ;
|
||||
|
||||
olla : VForm => Str = verbOlla.s ;
|
||||
|
||||
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
|
||||
{fin = x ; inf = y} ;
|
||||
mkvf : VForm -> {fin, inf : Str} = \p -> case <ant,b> of {
|
||||
<Simul,Pos> => vf (verbs ! p) [] ;
|
||||
<Anter,Pos> => vf (olla ! p) part ; --# notpresent
|
||||
<Anter,Neg> => vf ei (ole ++ part) ; --# notpresent
|
||||
<Simul,Neg> => vf ei neg
|
||||
}
|
||||
in
|
||||
case vi of {
|
||||
VIFin Past => mkvf (Impf agr.n agr.p) ; --# notpresent
|
||||
VIFin Cond => mkvf (Condit agr.n agr.p) ; --# notpresent
|
||||
VIFin Fut => mkvf (Presn agr.n agr.p) ; --# notpresent
|
||||
VIFin Pres => mkvf (Presn agr.n agr.p) ;
|
||||
VIImper => mkvf (Imper agr.n) ;
|
||||
VIPass => mkvf (Pass True) ;
|
||||
VIInf i => mkvf (Inf i)
|
||||
} ;
|
||||
|
||||
s2 = \\_,_,_ => [] ;
|
||||
ext = [] ;
|
||||
sc = verb.sc
|
||||
} ;
|
||||
|
||||
|
||||
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
s2 = \\fin,b,a => vp.s2 ! fin ! b ! a ++ obj ! fin ! b ! a ;
|
||||
ext = vp.ext ;
|
||||
sc = vp.sc
|
||||
} ;
|
||||
|
||||
insertExtrapos : Str -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
s2 = vp.s2 ;
|
||||
ext = vp.ext ++ obj ;
|
||||
sc = vp.sc
|
||||
} ;
|
||||
|
||||
-- For $Sentence$.
|
||||
|
||||
Clause : Type = {
|
||||
s : Tense => Anteriority => Polarity => SType => Str
|
||||
} ;
|
||||
|
||||
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause =
|
||||
\sub,agr,vp -> {
|
||||
s = \\t,a,b,o =>
|
||||
let
|
||||
subj = sub b ;
|
||||
agrfin = case vp.sc of {
|
||||
NPCase Nom => <agr,True> ;
|
||||
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
|
||||
} ;
|
||||
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
|
||||
compl = vp.s2 ! agrfin.p2 ! b ! agr ++ vp.ext
|
||||
in
|
||||
case o of {
|
||||
SDecl => subj ++ verb.fin ++ verb.inf ++ compl ;
|
||||
SQuest => questPart verb.fin ++ subj ++ verb.inf ++ compl
|
||||
}
|
||||
} ;
|
||||
|
||||
-- This is used for subjects of passives: therefore isFin in False.
|
||||
|
||||
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
|
||||
appCompl False b {s = [] ; c = sc ; isPre = True} np ;
|
||||
|
||||
questPart : Str -> Str = \on -> on ++ BIND ++ "ko" ; ----
|
||||
|
||||
infVP : NPForm -> Polarity -> Agr -> VP -> Str =
|
||||
\sc,pol,agr,vp ->
|
||||
let
|
||||
fin = case sc of { -- subject case
|
||||
NPCase Nom => True ; -- minä tahdon nähdä auton
|
||||
_ => False -- minun täytyy nähdä auto
|
||||
} ;
|
||||
verb = vp.s ! VIInf Inf1 ! Simul ! Pos ! agr ; -- no "ei"
|
||||
compl = vp.s2 ! fin ! pol ! agr ++ vp.ext -- but compl. case propagated
|
||||
in
|
||||
verb.fin ++ verb.inf ++ compl ;
|
||||
|
||||
-- The definitions below were moved here from $MorphoFin$ so that we the
|
||||
-- auxiliary of predication can be defined.
|
||||
|
||||
verbOlla : Verb =
|
||||
let olla = mkVerb
|
||||
"olla" "on" "olen" "ovat" "olkaa" "ollaan"
|
||||
"oli" "olin" "olisi" "ollut" "oltu" "ollun" ;
|
||||
in {s = table {
|
||||
Inf Inf3Iness => "olemassa" ;
|
||||
Inf Inf3Elat => "olemasta" ;
|
||||
Inf Inf3Illat => "olemaan" ;
|
||||
Inf Inf3Adess => "olemalla" ;
|
||||
Inf Inf3Abess => "olematta" ;
|
||||
v => olla.s ! v
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- The present, past, conditional. and infinitive stems, acc. to Koskenniemi.
|
||||
-- Unfortunately not enough (without complicated processes).
|
||||
-- We moreover give grade alternation forms as arguments, since it does not
|
||||
-- happen automatically.
|
||||
--- A problem remains with the verb "seistä", where the infinitive
|
||||
--- stem has vowel harmony "ä" but the others "a", thus "seisoivat" but "seiskää".
|
||||
|
||||
|
||||
mkVerb : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Verb =
|
||||
\tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun ->
|
||||
v2v (mkVerbH
|
||||
tulla tulee tulen tulevat tulkaa tullaan tuli tulin tulisi tullut tultu tullun
|
||||
) ;
|
||||
|
||||
v2v : VerbH -> Verb = \vh ->
|
||||
let
|
||||
tulla = vh.tulla ;
|
||||
tulee = vh.tulee ;
|
||||
tulen = vh.tulen ;
|
||||
tulevat = vh.tulevat ;
|
||||
tulkaa = vh.tulkaa ;
|
||||
tullaan = vh.tullaan ;
|
||||
tuli = vh.tuli ;
|
||||
tulin = vh.tulin ;
|
||||
tulisi = vh.tulisi ;
|
||||
tullut = vh.tullut ;
|
||||
tultu = vh.tultu ;
|
||||
tultu = vh.tultu ;
|
||||
tullun = vh.tullun ;
|
||||
tuje = init tulen ;
|
||||
tuji = init tulin ;
|
||||
a = Predef.dp 1 tulkaa ;
|
||||
tulko = Predef.tk 2 tulkaa + (ifTok Str a "a" "o" "ö") ;
|
||||
o = last tulko ;
|
||||
tulleena = Predef.tk 2 tullut + ("een" + a) ;
|
||||
tulleen = (noun2adj (nhn (sRae tullut tulleena))).s ;
|
||||
tullun = (noun2adj (nhn (sKukko tultu tullun (tultu + ("j"+a))))).s ;
|
||||
tulema = Predef.tk 3 tulevat + "m" + a ;
|
||||
---- tulema = tuje + "m" + a ;
|
||||
vat = "v" + a + "t"
|
||||
in
|
||||
{s = table {
|
||||
Inf Inf1 => tulla ;
|
||||
Presn Sg P1 => tuje + "n" ;
|
||||
Presn Sg P2 => tuje + "t" ;
|
||||
Presn Sg P3 => tulee ;
|
||||
Presn Pl P1 => tuje + "mme" ;
|
||||
Presn Pl P2 => tuje + "tte" ;
|
||||
Presn Pl P3 => tulevat ;
|
||||
Impf Sg P1 => tuji + "n" ; --# notpresent
|
||||
Impf Sg P2 => tuji + "t" ; --# notpresent
|
||||
Impf Sg P3 => tuli ; --# notpresent
|
||||
Impf Pl P1 => tuji + "mme" ; --# notpresent
|
||||
Impf Pl P2 => tuji + "tte" ; --# notpresent
|
||||
Impf Pl P3 => tuli + vat ; --# notpresent
|
||||
Condit Sg P1 => tulisi + "n" ; --# notpresent
|
||||
Condit Sg P2 => tulisi + "t" ; --# notpresent
|
||||
Condit Sg P3 => tulisi ; --# notpresent
|
||||
Condit Pl P1 => tulisi + "mme" ; --# notpresent
|
||||
Condit Pl P2 => tulisi + "tte" ; --# notpresent
|
||||
Condit Pl P3 => tulisi + vat ; --# notpresent
|
||||
Imper Sg => tuje ;
|
||||
Imper Pl => tulkaa ;
|
||||
ImperP3 Sg => tulko + o + "n" ;
|
||||
ImperP3 Pl => tulko + o + "t" ;
|
||||
ImperP1Pl => tulkaa + "mme" ;
|
||||
ImpNegPl => tulko ;
|
||||
Pass True => tullaan ;
|
||||
Pass False => Predef.tk 2 tullaan ;
|
||||
PastPartAct n => tulleen ! n ;
|
||||
PastPartPass n => tullun ! n ;
|
||||
Inf Inf3Iness => tulema + "ss" + a ;
|
||||
Inf Inf3Elat => tulema + "st" + a ;
|
||||
Inf Inf3Illat => tulema + a + "n" ;
|
||||
Inf Inf3Adess => tulema + "ll" + a ;
|
||||
Inf Inf3Abess => tulema + "tt" + a
|
||||
}
|
||||
} ;
|
||||
|
||||
VerbH : Type = {
|
||||
tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun
|
||||
: Str
|
||||
} ;
|
||||
|
||||
mkVerbH : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> VerbH =
|
||||
\tulla,tulee,tulen,tulevat,tulkaa,tullaan,tuli,tulin,tulisi,tullut,tultu,tullun ->
|
||||
{tulla = tulla ;
|
||||
tulee = tulee ;
|
||||
tulen = tulen ;
|
||||
tulevat = tulevat ;
|
||||
tulkaa = tulkaa ;
|
||||
tullaan = tullaan ;
|
||||
tuli = tuli ;
|
||||
tulin = tulin ;
|
||||
tulisi = tulisi ;
|
||||
tullut = tullut ;
|
||||
tultu = tultu ;
|
||||
tullun = tullun
|
||||
} ;
|
||||
|
||||
noun2adj : CommonNoun -> Adj = noun2adjComp True ;
|
||||
|
||||
noun2adjComp : Bool -> CommonNoun -> Adj = \isPos,tuore ->
|
||||
let
|
||||
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
|
||||
tuoreemmin = Predef.tk 2 (tuore.s ! NCase Sg Gen) + "in"
|
||||
in {s = table {
|
||||
AN f => tuore.s ! f ;
|
||||
AAdv => if_then_Str isPos tuoreesti tuoreemmin
|
||||
}
|
||||
} ;
|
||||
|
||||
CommonNoun = {s : NForm => Str} ;
|
||||
|
||||
-- To form an adjective, it is usually enough to give a noun declension: the
|
||||
-- adverbial form is regular.
|
||||
|
||||
Adj : Type = {s : AForm => Str} ;
|
||||
|
||||
NounH : Type = {
|
||||
a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin : Str
|
||||
} ;
|
||||
|
||||
-- worst-case macro
|
||||
|
||||
mkSubst : Str -> (_,_,_,_,_,_,_,_,_,_ : Str) -> NounH =
|
||||
\a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin ->
|
||||
{a = a ;
|
||||
vesi = vesi ;
|
||||
vede = vede ;
|
||||
vete = vete ;
|
||||
vetta = vetta ;
|
||||
veteen = veteen ;
|
||||
vetii = vetii ;
|
||||
vesii = vesii ;
|
||||
vesien = vesien ;
|
||||
vesia = vesia ;
|
||||
vesiin = vesiin
|
||||
} ;
|
||||
|
||||
nhn : NounH -> CommonNoun = \nh ->
|
||||
let
|
||||
a = nh.a ;
|
||||
vesi = nh.vesi ;
|
||||
vede = nh.vede ;
|
||||
vete = nh.vete ;
|
||||
vetta = nh.vetta ;
|
||||
veteen = nh.veteen ;
|
||||
vetii = nh.vetii ;
|
||||
vesii = nh.vesii ;
|
||||
vesien = nh.vesien ;
|
||||
vesia = nh.vesia ;
|
||||
vesiin = nh.vesiin
|
||||
in
|
||||
{s = table {
|
||||
NCase Sg Nom => vesi ;
|
||||
NCase Sg Gen => vede + "n" ;
|
||||
NCase Sg Part => vetta ;
|
||||
NCase Sg Transl => vede + "ksi" ;
|
||||
NCase Sg Ess => vete + ("n" + a) ;
|
||||
NCase Sg Iness => vede + ("ss" + a) ;
|
||||
NCase Sg Elat => vede + ("st" + a) ;
|
||||
NCase Sg Illat => veteen ;
|
||||
NCase Sg Adess => vede + ("ll" + a) ;
|
||||
NCase Sg Ablat => vede + ("lt" + a) ;
|
||||
NCase Sg Allat => vede + "lle" ;
|
||||
NCase Sg Abess => vede + ("tt" + a) ;
|
||||
|
||||
NCase Pl Nom => vede + "t" ;
|
||||
NCase Pl Gen => vesien ;
|
||||
NCase Pl Part => vesia ;
|
||||
NCase Pl Transl => vesii + "ksi" ;
|
||||
NCase Pl Ess => vetii + ("n" + a) ;
|
||||
NCase Pl Iness => vesii + ("ss" + a) ;
|
||||
NCase Pl Elat => vesii + ("st" + a) ;
|
||||
NCase Pl Illat => vesiin ;
|
||||
NCase Pl Adess => vesii + ("ll" + a) ;
|
||||
NCase Pl Ablat => vesii + ("lt" + a) ;
|
||||
NCase Pl Allat => vesii + "lle" ;
|
||||
NCase Pl Abess => vesii + ("tt" + a) ;
|
||||
|
||||
NComit => vetii + "ne" ;
|
||||
NInstruct => vesii + "n" ;
|
||||
|
||||
NPossNom _ => vete ;
|
||||
NPossGen Sg => vete ;
|
||||
NPossGen Pl => Predef.tk 1 vesien ;
|
||||
NPossTransl Sg => vede + "kse" ;
|
||||
NPossTransl Pl => vesii + "kse" ;
|
||||
NPossIllat Sg => Predef.tk 1 veteen ;
|
||||
NPossIllat Pl => Predef.tk 1 vesiin
|
||||
}
|
||||
} ;
|
||||
-- Surpraisingly, making the test for the partitive, this not only covers
|
||||
-- "rae", "perhe", "savuke", but also "rengas", "lyhyt" (except $Sg Illat$), etc.
|
||||
|
||||
sRae : (_,_ : Str) -> NounH = \rae,rakeena ->
|
||||
let {
|
||||
a = Predef.dp 1 rakeena ;
|
||||
rakee = Predef.tk 2 rakeena ;
|
||||
rakei = Predef.tk 1 rakee + "i" ;
|
||||
raet = rae + (ifTok Str (Predef.dp 1 rae) "e" "t" [])
|
||||
}
|
||||
in
|
||||
mkSubst a
|
||||
rae
|
||||
rakee
|
||||
rakee
|
||||
(raet + ("t" + a))
|
||||
(rakee + "seen")
|
||||
rakei
|
||||
rakei
|
||||
(rakei + "den")
|
||||
(rakei + ("t" + a))
|
||||
(rakei + "siin") ;
|
||||
-- Nouns with partitive "a"/"ä" ;
|
||||
-- to account for grade and vowel alternation, three forms are usually enough
|
||||
-- Examples: "talo", "kukko", "huippu", "koira", "kukka", "syylä",...
|
||||
|
||||
sKukko : (_,_,_ : Str) -> NounH = \kukko,kukon,kukkoja ->
|
||||
let {
|
||||
o = Predef.dp 1 kukko ;
|
||||
a = Predef.dp 1 kukkoja ;
|
||||
kukkoj = Predef.tk 1 kukkoja ;
|
||||
i = Predef.dp 1 kukkoj ;
|
||||
ifi = ifTok Str i "i" ;
|
||||
kukkoi = ifi kukkoj (Predef.tk 1 kukkoj) ;
|
||||
e = Predef.dp 1 kukkoi ;
|
||||
kukoi = Predef.tk 2 kukon + Predef.dp 1 kukkoi
|
||||
}
|
||||
in
|
||||
mkSubst a
|
||||
kukko
|
||||
(Predef.tk 1 kukon)
|
||||
kukko
|
||||
(kukko + a)
|
||||
(kukko + o + "n")
|
||||
(kukkoi + ifi "" "i")
|
||||
(kukoi + ifi "" "i")
|
||||
(ifTok Str e "e" (Predef.tk 1 kukkoi + "ien") (kukkoi + ifi "en" "jen"))
|
||||
kukkoja
|
||||
(kukkoi + ifi "in" "ihin") ;
|
||||
|
||||
-- Reflexive pronoun.
|
||||
--- Possessive could be shared with the more general $NounFin.DetCN$.
|
||||
|
||||
oper
|
||||
reflPron : Agr -> NP = \agr ->
|
||||
let
|
||||
itse = (nhn (sKukko "itse" "itsen" "itsejä")).s ;
|
||||
nsa = possSuffix agr
|
||||
in {
|
||||
s = table {
|
||||
NPCase (Nom | Gen) | NPAcc => itse ! NPossNom Sg + nsa ;
|
||||
NPCase Transl => itse ! NPossTransl Sg + nsa ;
|
||||
NPCase Illat => itse ! NPossIllat Sg + nsa ;
|
||||
NPCase c => itse ! NCase Sg c + nsa
|
||||
} ;
|
||||
a = agr ;
|
||||
isPron = False -- no special acc form
|
||||
} ;
|
||||
|
||||
possSuffix : Agr -> Str = \agr ->
|
||||
table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa"] ! agr ;
|
||||
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete ResourceFin of Resource = RulesFin, ClauseFin, StructuralFin ** {} ;
|
||||
@@ -1,214 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level Finnish Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the Finnish concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $SyntaxFin.gf$.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $Rules.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the rules are
|
||||
-- implemented. The parameter types are defined in $TypesFin.gf$. For
|
||||
-- parameter values, access through $ParadigmFin$ is recommended.
|
||||
|
||||
concrete RulesFin of Rules = CategoriesFin ** open Prelude, SyntaxFin in {
|
||||
|
||||
flags
|
||||
optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseN = noun2CommNounPhrase ;
|
||||
UsePN = nameNounPhrase ;
|
||||
|
||||
IndefOneNP = indefNounPhrase singular ;
|
||||
IndefNumNP = nounPhraseNum False ;
|
||||
DefOneNP = defNounPhrase singular ;
|
||||
DefNumNP = nounPhraseNum True ;
|
||||
|
||||
DetNP = detNounPhrase ;
|
||||
NDetNP = numDetNounPhrase ;
|
||||
NDetNum d n = numDetNounPhrase d n emptyCommNounPhrase ;
|
||||
MassNP = partNounPhrase singular ;
|
||||
|
||||
AppN2 = appFunComm ;
|
||||
AppN3 = appFun2 ;
|
||||
UseN2 = funAsCommNounPhrase ;
|
||||
|
||||
ModAP = modCommNounPhrase ;
|
||||
CNthatS = nounThatSentence ;
|
||||
|
||||
ModGenOne = npGenDet singular ;
|
||||
ModGenNum = npGenDetNum ;
|
||||
|
||||
UseInt i = {s = \\_ => i.s ; isNum = True ; n = Pl} ; --- case endings; Sg for 1
|
||||
NoNum = noNum ;
|
||||
|
||||
UseA = adj2adjPhrase ;
|
||||
ComplA2 = complAdj ;
|
||||
|
||||
---- ComplAV av vpi = {s = \\_,a => av.s ! a ++ vpi.s ! VIInfinit} ;
|
||||
---- ComplObjA2V av obj vpi = {s = \\_,a => av.s ! a ++ obj.s ! complCase
|
||||
---- True av.c (SVI VIInf3Iness) ++ vpi.s ! VIInfinit} ;
|
||||
|
||||
PositADeg = positAdjPhrase ;
|
||||
ComparADeg = comparAdjPhrase ;
|
||||
SuperlADeg = superlAdjPhrase ;
|
||||
|
||||
-- verbs and verb prases
|
||||
|
||||
PredAS adj sent = sats2clause (
|
||||
insertComplement
|
||||
(mkSats impersNounPhrase (vNom verbOlla))
|
||||
((adj2adjPhrase adj).s ! APred ! AN (NCase Sg Part) ++ embedConj ++ sent.s)
|
||||
) ;
|
||||
PredV0 rain = sats2clause (mkSats impersNounPhrase (vNom rain)) ;
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 v = v ;
|
||||
|
||||
---- ComplA2S = predAdjSent2 ;
|
||||
|
||||
AdjPart verb = {s = \\a => verb.s ! PastPartPass a} ;
|
||||
|
||||
---- UseV2V x = verb2aux x ** {isAux = False} ;
|
||||
|
||||
UseV2S x = x ;
|
||||
UseV2Q x = x ;
|
||||
UseA2S x = x ;
|
||||
UseA2V x = x ;
|
||||
|
||||
UseCl tp cl = {s =
|
||||
tp.s ++ cl.s ! <SDecl,tp.b,VFinite tp.t tp.a>
|
||||
} ;
|
||||
UseQCl tp cl = {s =
|
||||
tp.s ++ cl.s ! <tp.b,VFinite tp.t tp.a>
|
||||
} ;
|
||||
UseRCl tp cl = {s = \\n => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! n} ;
|
||||
|
||||
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
||||
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;
|
||||
|
||||
TPresent = {s = [] ; t = Present} ;
|
||||
TPast = {s = [] ; t = Past} ;
|
||||
TFuture = {s = [] ; t = Future} ;
|
||||
TConditional = {s = [] ; t = Conditional} ;
|
||||
PPos = {s = [] ; p = True} ;
|
||||
PNeg = {s = [] ; p = False} ;
|
||||
|
||||
|
||||
ASimul = {s = [] ; a = Simul} ;
|
||||
AAnter = {s = [] ; a = Anter} ;
|
||||
|
||||
-- Adverbs.
|
||||
|
||||
AdjAdv a = ss (a.s ! AAdv) ; --- also APred?
|
||||
AdvPP p = p ;
|
||||
PrepNP = prepPhrase ;
|
||||
AdvCN = advCommNounPhrase ;
|
||||
AdvAP = advAdjPhrase ;
|
||||
AdvAdv = cc2 ;
|
||||
AdvNP pn pp = {s = \\c => pn.s ! c ++ pp.s ; n = pn.n ; p = pn.p} ;
|
||||
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
SlashV2 = slashTransVerbCl ;
|
||||
---- SlashVV2 = slashVerbVerb ;
|
||||
---- SlashAdv cl p = slashAdverb cl p.s ;
|
||||
|
||||
IdRP = identRelPron ;
|
||||
FunRP = funRelPron ;
|
||||
RelSlash = relSlash ;
|
||||
ModRS = modRelClause ;
|
||||
RelCl = relSuch ;
|
||||
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
|
||||
---- IDetCN d n = nounPhraseInt (detNounPhrase d n) ;
|
||||
FunIP = funIntPron ;
|
||||
|
||||
QuestCl cl = {s = \\bsf => cl.s ! <SQuest,bsf.p1,bsf.p2>} ;
|
||||
IntSlash = intSlash ;
|
||||
QuestAdv = questAdverbial ;
|
||||
|
||||
PosImpVP = imperVerbPhrase True ;
|
||||
NegImpVP = imperVerbPhrase False ;
|
||||
|
||||
IndicPhrase = indicUtt ;
|
||||
QuestPhrase = interrogUtt ;
|
||||
ImperOne = imperUtterance singular ;
|
||||
ImperMany = imperUtterance plural ;
|
||||
|
||||
AdvCl cl adv = insertComplement cl adv.s ;
|
||||
---- AdvVPI = advVerbPhrase ;
|
||||
|
||||
AdCPhr = advSentence ;
|
||||
AdvPhr = advSentence ;
|
||||
|
||||
|
||||
--!
|
||||
--3 Coordination
|
||||
--
|
||||
|
||||
TwoS = twoSentence ;
|
||||
ConsS = consSentence ;
|
||||
ConjS = conjunctSentence ;
|
||||
ConjDS = conjunctDistrSentence ;
|
||||
|
||||
TwoAP = twoAdjPhrase ;
|
||||
ConsAP = consAdjPhrase ;
|
||||
ConjAP = conjunctAdjPhrase ;
|
||||
ConjDAP = conjunctDistrAdjPhrase ;
|
||||
|
||||
TwoNP = twoNounPhrase ;
|
||||
ConsNP = consNounPhrase ;
|
||||
ConjNP = conjunctNounPhrase ;
|
||||
ConjDNP = conjunctDistrNounPhrase ;
|
||||
|
||||
TwoAdv = twoSentence ;
|
||||
ConsAdv = consSentence ;
|
||||
ConjAdv = conjunctSentence ;
|
||||
ConjDAdv = conjunctDistrSentence ;
|
||||
|
||||
SubjS = subjunctSentence ;
|
||||
SubjImper = subjunctImperative ;
|
||||
SubjQS = subjunctQuestion ;
|
||||
AdvSubj if A = ss (if.s ++ A.s) ;
|
||||
|
||||
PhrNP = useNounPhrase ;
|
||||
PhrOneCN = useCommonNounPhrase singular ;
|
||||
PhrManyCN = useCommonNounPhrase plural ;
|
||||
PhrIP ip = ip ;
|
||||
PhrIAdv ia = ia ;
|
||||
---- PhrVPI = verbUtterance ;
|
||||
|
||||
OnePhr p = p ;
|
||||
ConsPhr = cc2 ;
|
||||
|
||||
-----------------------
|
||||
-- special constructions
|
||||
|
||||
---- OneNP = nameNounPhrase (nameReg "one" human) ;
|
||||
|
||||
--- should be partitive in negative forms: "ei ole olemassa puista autoa"
|
||||
|
||||
ExistCN cn =
|
||||
sats2clause (
|
||||
mkSatsCopula impersNounPhrase ("olemassa" ++ (singularNounPhrase cn).s ! NPCase Nom)
|
||||
) ;
|
||||
|
||||
ExistNumCN nu cn =
|
||||
sats2clause (
|
||||
mkSatsCopula impersNounPhrase (
|
||||
"olemassa" ++ (nounPhraseNum False nu cn).s ! NPCase Nom)
|
||||
) ;
|
||||
|
||||
} ;
|
||||
67
lib/resource/finnish/SentenceFin.gf
Normal file
67
lib/resource/finnish/SentenceFin.gf
Normal file
@@ -0,0 +1,67 @@
|
||||
concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
PredVP np vp = mkClause (subjForm np vp.sc) np.a vp ;
|
||||
|
||||
PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\pol,n =>
|
||||
let
|
||||
agr = {n = n ; p = P2} ;
|
||||
verb = vp.s ! VIImper ! Simul ! pol ! agr ;
|
||||
compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto)
|
||||
in
|
||||
verb.fin ++ verb.inf ++ compl ;
|
||||
} ;
|
||||
|
||||
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
|
||||
|
||||
SlashV2 np v2 = {
|
||||
s = \\t,a,p => (mkClause (subjForm np v2.sc) np.a (predV v2)).s ! t ! a ! p ! SDecl ;
|
||||
c2 = v2.c2
|
||||
} ;
|
||||
|
||||
SlashVVV2 np vv v2 =
|
||||
let
|
||||
sc = case v2.sc of {
|
||||
NPCase Nom => vv.sc ; -- joka minun täytyy pestä
|
||||
c => c -- joka minulla täytyy olla
|
||||
}
|
||||
in
|
||||
{s = \\t,ag,p =>
|
||||
(mkClause
|
||||
(subjForm np sc) np.a
|
||||
(insertObj
|
||||
(\\_,b,a => infVP vv.sc b a (predV v2))
|
||||
(predV vv)
|
||||
)
|
||||
).s ! t ! ag ! p ! SDecl ;
|
||||
c2 = v2.c2
|
||||
} ;
|
||||
|
||||
AdvSlash slash adv = {
|
||||
s = \\t,a,b => slash.s ! t ! a ! b ++ adv.s ;
|
||||
c2 = slash.c2
|
||||
} ;
|
||||
|
||||
SlashPrep cl prep = {
|
||||
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl ;
|
||||
c2 = prep
|
||||
} ;
|
||||
|
||||
EmbedS s = {s = "että" ++ s.s} ;
|
||||
EmbedQS qs = {s = qs.s} ;
|
||||
EmbedVP vp = {s = infVP (NPCase Nom) Pos (agrP3 Sg) vp} ; --- case,pol,agr
|
||||
|
||||
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! SDecl} ;
|
||||
UseQCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p} ;
|
||||
UseRCl t a p cl = {
|
||||
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ;
|
||||
c = cl.c
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -1,114 +1,306 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
concrete StructuralFin of Structural = CatFin **
|
||||
open MorphoFin, ParadigmsFin, Prelude in {
|
||||
|
||||
--1 The Top-Level Finnish Resource Grammar: Structural Words
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
--
|
||||
concrete StructuralFin of Structural =
|
||||
CategoriesFin, NumeralsFin ** open Prelude, SyntaxFin in {
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
above_Prep = postGenPrep "yläpuolella" ;
|
||||
after_Prep = postGenPrep "jälkeen" ;
|
||||
|
||||
UseNumeral i = {s = \\np => i.s ! NCase Sg (npForm2Case Sg np) ; n = i.n ; isNum = True} ;
|
||||
|
||||
above_Prep = prepPostpGen "yläpuolella" ;
|
||||
after_Prep = prepPostpGen "jälkeen" ;
|
||||
all8mass_Det = mkDeterminer singular (kaikkiPron Sg) ;
|
||||
all_NDet = mkDeterminerNum (kaikkiPron Pl) ;
|
||||
almost_Adv = ss "melkein" ;
|
||||
although_Subj = ss "vaikka" ;
|
||||
all_Predet = {s = \\n,c =>
|
||||
let
|
||||
kaiket = caseTable n (nhn (sKorpi "kaikki" "kaiken" "kaikkena"))
|
||||
in
|
||||
case npform2case n c of {
|
||||
Nom => "kaikki" ;
|
||||
k => kaiket ! k
|
||||
}
|
||||
} ;
|
||||
almost_AdA, almost_AdN = ss "melkein" ;
|
||||
although_Subj = ss "vaikka" ;
|
||||
always_AdV = ss "aina" ;
|
||||
and_Conj = ss "ja" ** {n = Pl} ;
|
||||
because_Subj = ss "koska" ;
|
||||
before_Prep = prepPrep "ennen" Part ;
|
||||
behind_Prep = prepPostpGen "takana" ;
|
||||
between_Prep = prepPostpGen "välissä" ;
|
||||
both_AndConjD = sd2 "sekä" "että" ** {n = Pl} ;
|
||||
by8agent_Prep = prepPostpGen "toimesta" ;
|
||||
by8means_Prep = prepPostpGen "avulla" ;
|
||||
---- can8know_VV = nomVerbVerb (vOsata "osata") ;
|
||||
---- can_VV = nomVerbVerb (vJuoda "voida" "voi") ;
|
||||
during_Prep = prepPostpGen "aikana" ;
|
||||
either8or_ConjD = sd2 "joko" "tai" ** {n = Sg} ;
|
||||
everybody_NP = {
|
||||
s = \\f => kaikkiPron Pl ! (npForm2Case Pl f) ; -- näin kaikki
|
||||
n = Pl ;
|
||||
p = NP3
|
||||
} ;
|
||||
every_Det = jokainenDet ;
|
||||
everything_NP = {
|
||||
s = \\f => kaikkiPron Sg ! (npForm2Case Sg f) ; -- näin kaiken
|
||||
n = Sg ;
|
||||
p = NP3
|
||||
} ;
|
||||
before_Prep = prePrep partitive "ennen" ;
|
||||
behind_Prep = postGenPrep "takana" ;
|
||||
between_Prep = postGenPrep "välissä" ;
|
||||
both7and_DConj = sd2 "sekä" "että" ** {n = Pl} ;
|
||||
but_PConj = ss "mutta" ;
|
||||
by8agent_Prep = postGenPrep "toimesta" ;
|
||||
by8means_Prep = casePrep adessive ;
|
||||
can8know_VV = reg2V "osata" "osasi" ;
|
||||
can_VV = reg2V "voida" "voi" ;
|
||||
during_Prep = postGenPrep "aikana" ;
|
||||
either7or_DConj = sd2 "joko" "tai" ** {n = Sg} ;
|
||||
everybody_NP = mkNP (regN "jokainen") Sg ;
|
||||
every_Det = mkDet Sg (regN "jokainen") ;
|
||||
everything_NP = mkNP ((nhn (sKorpi "kaikki" "kaiken" "kaikkena")) **
|
||||
{lock_N = <>}) Sg ;
|
||||
everywhere_Adv = ss "kaikkialla" ;
|
||||
from_Prep = prepCase Elat ; --- ablat
|
||||
he_NP = pronNounPhrase pronHan ;
|
||||
how_IAdv = ss "kuinka" ;
|
||||
few_Det = mkDet Sg (regN "harva") ;
|
||||
first_Ord = {s = \\n,c => (regN "ensimmäinen").s ! NCase n c} ;
|
||||
from_Prep = casePrep elative ;
|
||||
he_Pron = mkPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
|
||||
here_Adv = ss "täällä" ;
|
||||
here7to_Adv = ss "tänne" ;
|
||||
here7from_Adv = ss "täältä" ;
|
||||
how_IAdv = ss "miten" ;
|
||||
how8many_IDet =
|
||||
{s = \\c => "kuinka" ++ (reg2N "moni" "monia").s ! NCase Sg c ; n = Sg} ;
|
||||
if_Subj = ss "jos" ;
|
||||
in8front_Prep = prepPostpGen "edessä" ;
|
||||
i_NP = pronNounPhrase pronMina ;
|
||||
in_Prep = prepCase Iness ;
|
||||
it_NP = nameNounPhrase pronSe ;
|
||||
many_Det = mkDeterminer singular moniPron ;
|
||||
most8many_Det = useimmatDet ;
|
||||
most_Det = mkDeterminer singular (caseTable singular (nhn (sSuurin "enintä"))) ;
|
||||
much_Det = mkDeterminer singular (caseTable singular (nhn (sNauris "runsasta"))) ;
|
||||
---- must_VV = vHukkua "täytyä" "täydy" ** {c = CCase Gen} ;
|
||||
no_Phr = ss ("Ei" ++ stopPunct) ;
|
||||
on_Prep = prepCase Adess ;
|
||||
or_Conj = ss "tai" ** {n = Sg} ;
|
||||
otherwise_Adv = ss "muuten" ;
|
||||
part_Prep = prepCase Part ;
|
||||
possess_Prep = prepCase Gen ;
|
||||
quite_Adv = ss "aika" ;
|
||||
she_NP = pronNounPhrase pronHan ;
|
||||
so_Adv = ss "niin" ;
|
||||
somebody_NP = {
|
||||
s = \\f => jokuPron ! Sg ! (npForm2Case Sg f) ;
|
||||
n = Sg ;
|
||||
p = NP3
|
||||
in8front_Prep = postGenPrep "edessä" ;
|
||||
i_Pron = mkPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
|
||||
in_Prep = casePrep inessive ;
|
||||
it_Pron = {
|
||||
s = \\c => pronSe.s ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
less_CAdv = ss "vähemmän" ;
|
||||
many_Det = mkDet Sg (reg2N "moni" "monia") ;
|
||||
more_CAdv = ss "enemmän" ;
|
||||
most_Predet = {s = \\n,c => (nhn (sSuurin "useinta")).s ! NCase n (npform2case n c)} ;
|
||||
much_Det = mkDet Sg {s = \\_ => "paljon"} ;
|
||||
must_VV = subjcaseV (regV "täytyä") genitive ;
|
||||
no_Phr = ss "ei" ;
|
||||
on_Prep = casePrep adessive ;
|
||||
one_Quant = mkDet Sg
|
||||
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
|
||||
"yksien" "yksiä" "yksiin")) ;
|
||||
only_Predet = {s = \\_,_ => "vain"} ;
|
||||
or_Conj = ss "tai" ** {n = Sg} ;
|
||||
otherwise_PConj = ss "muuten" ;
|
||||
part_Prep = casePrep partitive ;
|
||||
please_Voc = ss ["ole hyvä"] ; --- number
|
||||
possess_Prep = casePrep genitive ;
|
||||
quite_Adv = ss "melko" ;
|
||||
she_Pron = mkPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
|
||||
so_AdA = ss "niin" ;
|
||||
somebody_NP = {
|
||||
s = \\c => jokuPron ! Sg ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
someSg_Det = {
|
||||
s1 = jokuPron ! Sg ;
|
||||
s2 = [] ;
|
||||
isNum,isPoss = False ; isDef = True ; n = Sg
|
||||
} ;
|
||||
somePl_Det = {
|
||||
s1 = jokuPron ! Pl ;
|
||||
s2 = [] ; isNum,isPoss = False ; isDef = True ;
|
||||
n = Pl
|
||||
} ;
|
||||
some_Det = mkDeterminerGen Sg (jokinPron ! Sg) (jokuPron ! Sg) ;
|
||||
some_NDet = mkDeterminerGenNum (jokinPron ! Pl) (jokuPron ! Pl) ;
|
||||
something_NP = {
|
||||
s = \\f => jokinPron ! Sg ! (npForm2Case Sg f) ; -- näin kaiken
|
||||
n = Sg ;
|
||||
p = NP3
|
||||
s = \\c => jokinPron ! Sg ! npform2case Sg c ;
|
||||
a = agrP3 Sg ;
|
||||
isPron = False
|
||||
} ;
|
||||
somewhere_Adv = ss "jossain" ;
|
||||
that_Det = mkDeterminer Sg (\\c => pronTuo.s ! PCase c) ;
|
||||
that_NP = pronNounPhraseNP pronTuo ;
|
||||
therefore_Adv = ss "siksi" ;
|
||||
these_NDet = mkDeterminerNum (\\c => pronNama.s ! PCase c) ;
|
||||
they_NP = pronNounPhrase pronHe ; --- ne
|
||||
this_Det = mkDeterminer Sg (\\c => pronTama.s ! PCase c) ;
|
||||
this_NP = pronNounPhraseNP pronTama ;
|
||||
those_NDet = mkDeterminerNum (\\c => pronNuo.s ! PCase c) ;
|
||||
thou_NP = pronNounPhrase pronSina ;
|
||||
through_Prep = prepPostpGen "kautta" ;
|
||||
too_Adv = ss "liian" ;
|
||||
to_Prep = prepCase Illat ; --- allat
|
||||
under_Prep = prepPostpGen "alla" ;
|
||||
very_Adv = ss "hyvin" ;
|
||||
---- want_VV = nomVerbVerb (vOsata "haluta") ;
|
||||
we_NP = pronNounPhrase pronMe ;
|
||||
what8many_IP = intPronWhat Pl ;
|
||||
what8one_IP = intPronWhat Sg ;
|
||||
when_IAdv = ss "koska" ;
|
||||
that_Quant = {
|
||||
s1 = table Number [
|
||||
table Case {
|
||||
c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
|
||||
} ;
|
||||
table Case {
|
||||
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
|
||||
}
|
||||
] ;
|
||||
s2 = [] ; isNum,isPoss = False ; isDef = True ;
|
||||
} ;
|
||||
that_NP =
|
||||
mkDemPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg **
|
||||
{isPron = False} ;
|
||||
there_Adv = ss "siellä" ; --- tuolla
|
||||
there7to_Adv = ss "sinne" ;
|
||||
there7from_Adv = ss "sieltä" ;
|
||||
therefore_PConj = ss "siksi" ;
|
||||
these_NP =
|
||||
mkDemPronoun "nämä" "näiden" "näitä" "näinä" "näihin" Pl **
|
||||
{isPron = False} ;
|
||||
they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
|
||||
this_Quant = {
|
||||
s1 = table Number [
|
||||
table Case {
|
||||
c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
|
||||
} ;
|
||||
table Case {
|
||||
c => (mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
|
||||
}
|
||||
] ;
|
||||
s2 = [] ; isNum,isPoss = False ; isDef = True ;
|
||||
} ;
|
||||
this_NP =
|
||||
mkDemPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg **
|
||||
{isPron = False} ;
|
||||
those_NP =
|
||||
mkDemPronoun "nuo" "noiden" "noita" "noina" "noihin" Pl **
|
||||
{isPron = False} ;
|
||||
through_Prep = postGenPrep "kautta" ;
|
||||
too_AdA = ss "liian" ;
|
||||
to_Prep = casePrep illative ; --- allative
|
||||
under_Prep = postGenPrep "alla" ;
|
||||
very_AdA = ss "erittäin" ;
|
||||
want_VV = regV "tahtoa" ;
|
||||
we_Pron = mkPronoun "me" "meidän" "meitä" "meinä" "meihin" Pl P1 ;
|
||||
whatPl_IP = {
|
||||
s = table {NPAcc => "mitkä" ; c => mikaInt ! Pl ! npform2case Pl c} ;
|
||||
n = Pl
|
||||
} ;
|
||||
whatSg_IP = {
|
||||
s = \\c => mikaInt ! Sg ! npform2case Sg c ;
|
||||
n = Sg
|
||||
} ;
|
||||
when_IAdv = ss "milloin" ;
|
||||
when_Subj = ss "kun" ;
|
||||
where_IAdv = ss "missä" ;
|
||||
which8one_IDet = mikaDet ;
|
||||
---- which8many_IDet n = mkDeterminerGenNum n (mikaInt ! Pl) (kukaInt ! Pl) ;
|
||||
who8many_IP = intPronWho Pl ;
|
||||
who8one_IP = intPronWho Sg ;
|
||||
|
||||
whichPl_IDet = {
|
||||
s = mikaInt ! Pl ;
|
||||
n = Pl
|
||||
} ;
|
||||
whichSg_IDet = {
|
||||
s = mikaInt ! Sg ;
|
||||
n = Sg
|
||||
} ;
|
||||
whoSg_IP = {
|
||||
s = table {NPAcc => "kenet" ; c => kukaInt ! Sg ! npform2case Sg c} ;
|
||||
n = Sg
|
||||
} ;
|
||||
whoPl_IP = {
|
||||
s = table {NPAcc => "ketkä" ; c => kukaInt ! Pl ! npform2case Pl c} ;
|
||||
n = Pl
|
||||
} ;
|
||||
why_IAdv = ss "miksi" ;
|
||||
without_Prep = prepPrep "ilman" Part ;
|
||||
with_Prep = prepPostpGen "kanssa" ;
|
||||
ye_NP = pronNounPhrase pronTe ;
|
||||
yes_Phr = ss ("Kyllä" ++ stopPunct) ;
|
||||
you_NP = pronNounPhrase pronTe ;
|
||||
without_Prep = prePrep partitive "ilman" ;
|
||||
with_Prep = postGenPrep "kanssa" ;
|
||||
yes_Phr = ss "kyllä" ;
|
||||
youSg_Pron = mkPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ;
|
||||
youPl_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ;
|
||||
youPol_Pron = mkPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ; --- Sg
|
||||
|
||||
|
||||
oper
|
||||
jokuPron : Number => Case => Str =
|
||||
let
|
||||
ku = nhn (sPuu "ku") ;
|
||||
kui = nhn (sPuu "kuu")
|
||||
in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "joku" ;
|
||||
Gen => "jonkun" ;
|
||||
c => relPron ! Sg ! c + ku.s ! NCase Sg c
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "jotkut" ;
|
||||
c => relPron ! Pl ! c + kui.s ! NCase Pl c
|
||||
}
|
||||
} ;
|
||||
|
||||
jokinPron : Number => Case => Str =
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "jokin" ;
|
||||
Gen => "jonkin" ;
|
||||
c => relPron ! Sg ! c + "kin"
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "jotkin" ;
|
||||
c => relPron ! Pl ! c + "kin"
|
||||
}
|
||||
} ;
|
||||
|
||||
mikaInt : Number => Case => Str =
|
||||
let {
|
||||
mi = nhn (sSuo "mi")
|
||||
} in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "mikä" ;
|
||||
Gen => "minkä" ;
|
||||
c => mi.s ! NCase Sg c
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "mitkä" ;
|
||||
Gen => "mittenkä" ;
|
||||
c => mi.s ! NCase Sg c
|
||||
}
|
||||
} ;
|
||||
|
||||
kukaInt : Number => Case => Str =
|
||||
let {
|
||||
ku = nhn (sRae "kuka" "kenenä") ;
|
||||
ket = nhn (sRae "kuka" "keinä")} in
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "kuka" ;
|
||||
Part => "ketä" ;
|
||||
Illat => "keneen" ;
|
||||
c => ku.s ! NCase Sg c
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "ketkä" ;
|
||||
Illat => "keihin" ;
|
||||
c => ket.s ! NCase Pl c
|
||||
}
|
||||
} ;
|
||||
mikaanPron : Number => Case => Str = \\n,c =>
|
||||
case <n,c> of {
|
||||
<Sg,Nom> => "mikään" ;
|
||||
<_,Part> => "mitään" ;
|
||||
<Sg,Gen> => "minkään" ;
|
||||
<Pl,Nom> => "mitkään" ;
|
||||
<Pl,Gen> => "mittenkään" ;
|
||||
<_,Ess> => "minään" ;
|
||||
<_,Iness> => "missään" ;
|
||||
<_,Elat> => "mistään" ;
|
||||
<_,Adess> => "millään" ;
|
||||
<_,Ablat> => "miltään" ;
|
||||
_ => mikaInt ! n ! c + "kään"
|
||||
} ;
|
||||
|
||||
kukaanPron : Number => Case => Str =
|
||||
table {
|
||||
Sg => table {
|
||||
Nom => "kukaan" ;
|
||||
Part => "ketään" ;
|
||||
Ess => "kenään" ;
|
||||
Iness => "kessään" ;
|
||||
Elat => "kestään" ;
|
||||
Illat => "kehenkään" ;
|
||||
Adess => "kellään" ;
|
||||
Ablat => "keltään" ;
|
||||
c => kukaInt ! Sg ! c + "kään"
|
||||
} ;
|
||||
Pl => table {
|
||||
Nom => "ketkään" ;
|
||||
Part => "keitään" ;
|
||||
Ess => "keinään" ;
|
||||
Iness => "keissään" ;
|
||||
Elat => "keistään" ;
|
||||
Adess => "keillään" ;
|
||||
Ablat => "keiltään" ;
|
||||
c => kukaInt ! Pl ! c + "kään"
|
||||
}
|
||||
} ;
|
||||
|
||||
pronSe : ProperName = {
|
||||
s = table {
|
||||
Nom => "se" ;
|
||||
Gen => "sen" ;
|
||||
Part => "sitä" ;
|
||||
Transl => "siksi" ;
|
||||
Ess => "sinä" ;
|
||||
Iness => "siinä" ;
|
||||
Elat => "siitä" ;
|
||||
Illat => "siihen" ;
|
||||
Adess => "sillä" ;
|
||||
Ablat => "siltä" ;
|
||||
Allat => "sille" ;
|
||||
Abess => "sittä"
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,250 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete SwadeshLexFin of SwadeshLex = CategoriesFin
|
||||
** open ResourceFin, SyntaxFin, ParadigmsFin,
|
||||
BasicFin, Prelude in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
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 = ResourceFin.all_NDet ;
|
||||
many_Det = many_Det ;
|
||||
some_Det = some_Det ;
|
||||
few_Det = mkDeterminer Pl (\\c => (nhn (sTalo "muutama")).s ! NCase Pl c) ;
|
||||
other_Det = mkDeterminer Pl (\\c => (nhn (sPuu "muu")).s ! NCase Pl c) ;
|
||||
|
||||
|
||||
-- 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 = prepCase Adess ;
|
||||
in_Prep = prepCase Iness ;
|
||||
with_Prep = prepPostpGen "kanssa" ;
|
||||
|
||||
-- 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 "oikea" ;
|
||||
dirty_ADeg = dirty_ADeg ;
|
||||
dry_ADeg = mkADeg (regN "kuiva") "kuivempi" "kuivin" ;
|
||||
dull_ADeg = mkADeg (regN "tylsä") "tylsempi" "tylsin" ;
|
||||
far_ADeg = regADeg "kaukainen" ;
|
||||
full_ADeg = mkADeg (reg3N "täysi" "täyden" "täysiä") "täydempi" "täysin" ;
|
||||
good_ADeg = good_ADeg ;
|
||||
green_ADeg = green_ADeg ;
|
||||
heavy_ADeg = regADeg "raskas" ;
|
||||
long_ADeg = long_ADeg ;
|
||||
narrow_ADeg = narrow_ADeg ;
|
||||
near_ADeg = regADeg "läheinen" ;
|
||||
new_ADeg = new_ADeg ;
|
||||
old_ADeg = old_ADeg ;
|
||||
red_ADeg = red_ADeg ;
|
||||
rotten_ADeg = regADeg "mätä" ;
|
||||
round_ADeg = regADeg "pyöreä" ;
|
||||
sharp_ADeg = regADeg "terävä" ;
|
||||
short_ADeg = short_ADeg ;
|
||||
small_ADeg = small_ADeg ;
|
||||
smooth_ADeg = regADeg "sileä" ;
|
||||
straight_ADeg = mkADeg (regN "suora") "suorempi" "suorin" ;
|
||||
thick_ADeg = thick_ADeg ;
|
||||
thin_ADeg = thin_ADeg ;
|
||||
warm_ADeg = warm_ADeg ;
|
||||
wet_ADeg = mkADeg (regN "märkä") "märempi" "märin" ;
|
||||
white_ADeg = white_ADeg ;
|
||||
wide_ADeg = regADeg "leveä" ;
|
||||
yellow_ADeg = yellow_ADeg ;
|
||||
|
||||
left_A = mkA (regN "vasen") ; ----
|
||||
right_A = mkA (regN "oikea") ;
|
||||
|
||||
-- Nouns
|
||||
|
||||
animal_N = reg3N "eläin" "eläimen" "eläimiä" ;
|
||||
ashes_N = regN "tuhka" ;
|
||||
back_N = regN "selkä" ;
|
||||
bark_N = regN "kaarna" ;
|
||||
belly_N = regN "vatsa" ;
|
||||
bird_N = bird_N;
|
||||
blood_N = nMeri "veri" ;
|
||||
bone_N = regN "luu" ;
|
||||
breast_N = regN "rinta" ;
|
||||
child_N = child_N ;
|
||||
cloud_N = reg2N "pilvi" "pilviä" ;
|
||||
day_N = regN "päivä" ;
|
||||
dog_N = dog_N ;
|
||||
dust_N = regN "pöly" ;
|
||||
ear_N = regN "korva" ;
|
||||
earth_N = regN "maa" ;
|
||||
egg_N = regN "muna" ;
|
||||
eye_N = regN "silmä" ;
|
||||
fat_N = regN "rasva" ;
|
||||
father_N = regN "isä" ;
|
||||
feather_N = reg3N "höyhen" "höyhenen" "höyheniä" ;
|
||||
fingernail_N = reg3N "kynsi" "kynnen" "kynsiä" ;
|
||||
fire_N = reg2N "tuli" "tulia" ;
|
||||
fish_N = fish_N ;
|
||||
flower_N = regN "kukka" ;
|
||||
fog_N = regN "sumu" ;
|
||||
foot_N = regN "jalka" ;
|
||||
forest_N = regN "metsä" ;
|
||||
fruit_N = fruit_N ;
|
||||
grass_N = regN "ruoho" ;
|
||||
guts_N = regN "sisälmys" ; --- suoli
|
||||
hair_N = regN "hius" ;
|
||||
hand_N = reg3N "käsi" "käden" "käsiä" ;
|
||||
head_N = regN "pää" ;
|
||||
heart_N = reg3N "sydän" "sydämen" "sydämiä" ;
|
||||
horn_N = reg2N "sarvi" "sarvia" ;
|
||||
husband_N = man_N ; --- aviomies
|
||||
ice_N = regN "jää" ;
|
||||
knee_N = reg2N "polvi" "polvia" ;
|
||||
lake_N = lake_N ;
|
||||
leaf_N = reg2N "lehti" "lehtiä" ;
|
||||
leg_N = regN "jalka" ; --- sääri
|
||||
liver_N = regN "maksa" ;
|
||||
louse_N = regN "lude" ;
|
||||
man_N = man_N ;
|
||||
meat_N = meat_N ;
|
||||
moon_N = moon_N ;
|
||||
mother_N = regN "äiti" ;
|
||||
mountain_N = mountain_N ;
|
||||
mouth_N = regN "suu" ;
|
||||
name_N = reg2N "nimi" "nimiä" ;
|
||||
neck_N = regN "niska" ;
|
||||
night_N = regN "yö" ;
|
||||
nose_N = regN "nenä" ;
|
||||
person_N = regN "henkilö" ;
|
||||
rain_N = regN "sade" ;
|
||||
river_N = river_N ;
|
||||
road_N = regN "tie" ;
|
||||
root_N = reg2N "juuri" "juuria" ;
|
||||
rope_N = reg3N "köysi" "köyden" "köysiä" ;
|
||||
salt_N = regN "suola" ;
|
||||
sand_N = regN "hiekka" ;
|
||||
sea_N = sea_N ;
|
||||
seed_N = regN "siemen" ;
|
||||
skin_N = regN "nahka" ;
|
||||
sky_N = reg3N "taivas" "taivaan" "taivaita" ;
|
||||
smoke_N = regN "savu" ;
|
||||
snake_N = snake_N ;
|
||||
snow_N = sgpartN (nMeri "lumi") "lunta" ;
|
||||
star_N = star_N ;
|
||||
stick_N = regN "keppi" ;
|
||||
stone_N = stone_N ;
|
||||
sun_N = sun_N ;
|
||||
tail_N = regN "häntä" ;
|
||||
tongue_N = reg2N "kieli" "kieliä" ;
|
||||
tooth_N = regN "hammas" ;
|
||||
tree_N = tree_N ;
|
||||
water_N = water_N ;
|
||||
wife_N = regN "vaimo" ;
|
||||
wind_N = reg2N "tuuli" "tuulia" ;
|
||||
wing_N = reg2N "siipi" "siipiä" ;
|
||||
woman_N = woman_N ;
|
||||
worm_N = regN "mato" ;
|
||||
year_N = reg3N "vuosi" "vuoden" "vuosia" ;
|
||||
|
||||
-- Verbs
|
||||
|
||||
bite_V = regV "purra" ;
|
||||
blow_V = regV "puhaltaa" ;
|
||||
breathe_V = regV "hengittää" ;
|
||||
burn_V = regV "palaa" ;
|
||||
come_V = BasicFin.come_V ;
|
||||
count_V = regV "laskea" ;
|
||||
cut_V = reg3V "leikata" "leikkaan" "leikkasi" ;
|
||||
die_V = regV "kuolla";
|
||||
dig_V = regV "kaivaa" ;
|
||||
drink_V = UseV2 drink_V2 ;
|
||||
eat_V = UseV2 eat_V2 ;
|
||||
fall_V = reg3V "pudota" "putoan" "putosi" ;
|
||||
fear_V = reg3V "pelätä" "pelkään" "pelkäsi" ;
|
||||
fight_V = regV "taistella" ;
|
||||
float_V = regV "kellua" ;
|
||||
flow_V = reg3V "virrata" "virtaan" "virtasi" ;
|
||||
fly_V = regV "lentää" ;
|
||||
freeze_V = regV "jäätyä" ;
|
||||
give_V = regV "antaa" ;
|
||||
hear_V = UseV2 hear_V2 ;
|
||||
hit_V = regV "lyödä" ;
|
||||
hold_V = regV "pitää" ;
|
||||
hunt_V = regV "metsästää" ;
|
||||
kill_V = regV "tappaa" ;
|
||||
know_V =reg2V "tietää" "tiesin" ;
|
||||
laugh_V = reg3V "nauraa" "nauran" "nauroi" ;
|
||||
lie_V = reg3V "maata" "makaan" "makasi" ;
|
||||
live_V = live_V ;
|
||||
play_V = UseV2 play_V2 ;
|
||||
pull_V = regV "vetää" ;
|
||||
push_V = regV "työntää" ;
|
||||
rub_V = regV "hieroa" ;
|
||||
say_V = regV "sanoa" ;
|
||||
scratch_V = regV "raapia" ;
|
||||
see_V = UseV2 see_V2 ;
|
||||
sew_V = regV "kylvää" ;
|
||||
sing_V = regV "laulaa" ;
|
||||
sit_V = regV "istua" ;
|
||||
sleep_V = sleep_V ;
|
||||
smell_V = reg2V "haistaa" "haistoi" ;
|
||||
spit_V = regV "sylkeä" ;
|
||||
split_V = reg2V "halkaista" "halkaisi" ;
|
||||
squeeze_V = regV "puristaa" ;
|
||||
stab_V = regV "pistää" ;
|
||||
stand_V = mkV "seistä" "seisoo" "seison" "seisovat" "seiskää" "seistään"
|
||||
"seisoi" "seisoin" "seisoisi" "seissyt" "seisty" "seistyn" ; --- *seisoivät
|
||||
suck_V = regV "imeä" ;
|
||||
swell_V = mkV "turvota" "turpoaa" "turpoan" "turpoavat" "turvotkaa" "turvotaan"
|
||||
"turposi" "turposin" "turpoaisi" "turvonnut" "turvottu" "turvotun" ;
|
||||
swim_V = reg3V "uida" "uin" "ui" ;
|
||||
think_V = reg3V "ajatella" "ajattelen" "ajatteli" ;
|
||||
throw_V = regV "heittää" ;
|
||||
tie_V = regV "sitoa" ;
|
||||
turn_V = regV "kääntyä" ;
|
||||
vomit_V = regV "oksentaa" ;
|
||||
walk_V = walk_V ;
|
||||
wash_V = regV "pestä" ;
|
||||
wipe_V = regV "pyyhkiä" ;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,145 +0,0 @@
|
||||
--1 Finnish Word Classes and Morphological Parameters
|
||||
--
|
||||
-- This is a resource module for Finnish morphology, defining the
|
||||
-- morphological parameters and word classes of Finnish. It is aimed
|
||||
-- to be complete w.r.t. the description of word forms.
|
||||
-- However, it only includes those parameters that are needed for
|
||||
-- analysing individual words: such parameters are defined in syntax modules.
|
||||
--
|
||||
-- We use the language-independent prelude.
|
||||
|
||||
resource TypesFin = open Prelude in {
|
||||
|
||||
--
|
||||
--2 Enumerated parameter types
|
||||
--
|
||||
-- These types are the ones found in school grammars.
|
||||
-- Their parameter values are atomic. The accusative cases are only
|
||||
-- defined in syntax; in morphology, there is a special accusative for
|
||||
-- pronouns.
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Case = Nom | Gen | Part | Transl | Ess
|
||||
| Iness | Elat | Illat | Adess | Ablat | Allat
|
||||
| Abess ; -- Comit, Instruct in NForm
|
||||
Person = P1 | P2 | P3 ;
|
||||
Degree = Pos | Comp | Sup ;
|
||||
Gender = NonHuman | Human ;
|
||||
|
||||
-- For data abstraction, we define
|
||||
|
||||
oper
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
--2 Word classes and hierarchical parameter types
|
||||
--
|
||||
-- Real parameter types (i.e. ones on which words and phrases depend)
|
||||
-- are often hierarchical. The alternative would be cross-products of
|
||||
-- simple parameters, but this would usually overgenerate.
|
||||
--
|
||||
|
||||
--3 Common nouns
|
||||
--
|
||||
-- Common nouns are inflected in number and noun case. In noun case, we include
|
||||
-- forms used in connection with possessive suffixes.
|
||||
|
||||
param
|
||||
NForm = NCase Number Case
|
||||
| NComit | NInstruct -- no number dist
|
||||
| NPossNom | NPossGenPl | NPossTransl Number | NPossIllat Number ;
|
||||
|
||||
oper
|
||||
CommonNoun : Type = {s : NForm => Str} ;
|
||||
|
||||
useNForm : NForm -> (Number => Case => Str) -> Str = \nf,f -> case nf of {
|
||||
NCase n c => f ! n ! c ;
|
||||
NPossNom => f ! Sg ! Nom ; ---- "iso autoni"; also "isot autoni" etc
|
||||
NPossGenPl => f ! Pl ! Gen ;
|
||||
NPossTransl n => f ! n ! Transl ;
|
||||
NPossIllat n => f ! n ! Illat ;
|
||||
_ => f ! Sg ! Nom --- NComit, NInstruct ; should not happen
|
||||
} ;
|
||||
|
||||
|
||||
--
|
||||
--3 Adjectives
|
||||
--
|
||||
-- The major division is between the comparison degrees, but it
|
||||
-- is also good to leave room for adjectives that cannon be compared.
|
||||
-- Such adjectives are like common nouns, except for the adverbial form.
|
||||
|
||||
param
|
||||
AForm = AN NForm | AAdv ;
|
||||
|
||||
oper
|
||||
Adjective : Type = {s : AForm => Str} ;
|
||||
AdjDegr : Type = {s : Degree => AForm => Str} ;
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- We limit the grammar so far to verbs in the infinitive, second-person
|
||||
-- imperative, and present tense indicative active and passive.
|
||||
-- A special form is needed for
|
||||
-- the negated plural imperative.
|
||||
|
||||
param
|
||||
VForm =
|
||||
Inf
|
||||
| Pres Number Person
|
||||
| Impf Number Person
|
||||
| Cond Number Person
|
||||
| Imper Number
|
||||
| ImperP3 Number
|
||||
| ImperP1Pl
|
||||
| ImpNegPl
|
||||
| Pass Bool
|
||||
| PastPartAct AForm
|
||||
| PastPartPass AForm
|
||||
| Inf3Iness -- 5 forms acc. to Karlsson
|
||||
| Inf3Elat
|
||||
| Inf3Illat
|
||||
| Inf3Adess
|
||||
| Inf3Abess
|
||||
|
||||
;
|
||||
|
||||
oper
|
||||
Verb : Type = SS1 VForm ;
|
||||
|
||||
vFormNeg = Imper Sg ;
|
||||
|
||||
vform2number : VForm -> Number = \v -> case v of {
|
||||
Pres n _ => n ;
|
||||
Impf n _ => n ;
|
||||
Imper n => n ;
|
||||
ImpNegPl => Pl ;
|
||||
_ => Sg ---
|
||||
} ;
|
||||
|
||||
--
|
||||
--3 Pronouns
|
||||
--
|
||||
-- For pronouns, we need the noun case forms, plus an accusative.
|
||||
|
||||
param
|
||||
PForm = PCase Case | PAcc ;
|
||||
|
||||
oper
|
||||
Pronoun : Type = {s : PForm => Str ; n : Number ; p : Person} ;
|
||||
|
||||
--3 Proper names
|
||||
--
|
||||
-- Proper names only need case forms.
|
||||
|
||||
ProperName : Type = SS1 Case ;
|
||||
|
||||
|
||||
--3 Relative pronouns
|
||||
--
|
||||
-- Relative pronouns are inflected like nouns, except for possessive suffixes.
|
||||
|
||||
RelPron : Type = {s : Number => Case => Str} ;
|
||||
|
||||
} ;
|
||||
92
lib/resource/finnish/VerbFin.gf
Normal file
92
lib/resource/finnish/VerbFin.gf
Normal file
@@ -0,0 +1,92 @@
|
||||
--1 Verb Phrases in Finnish
|
||||
|
||||
concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predV ;
|
||||
|
||||
ComplV2 v np = insertObj (\\fin,b,_ => appCompl fin b v.c2 np) (predV v) ;
|
||||
|
||||
ComplV3 v np np2 =
|
||||
insertObj
|
||||
(\\fin,b,_ => appCompl fin b v.c2 np ++ appCompl fin b v.c3 np2) (predV v) ;
|
||||
|
||||
ComplVV v vp =
|
||||
insertObj
|
||||
(\\_,b,a => infVP v.sc b a vp)
|
||||
(predV {s = v.s ;
|
||||
sc = case vp.sc of {
|
||||
NPCase Nom => v.sc ; -- minun täytyy pestä auto
|
||||
c => c -- minulla täytyy olla auto
|
||||
}
|
||||
}
|
||||
) ;
|
||||
|
||||
ComplVS v s = insertExtrapos ("että" ++ s.s) (predV v) ;
|
||||
ComplVQ v q = insertExtrapos ( q.s) (predV v) ;
|
||||
|
||||
ComplVA v ap =
|
||||
insertObj
|
||||
(\\_,b,agr =>
|
||||
ap.s ! False ! AN (NCase agr.n (npform2case agr.n v.c2.c))) --- v.cs.s ignored
|
||||
(predV v) ;
|
||||
ComplV2A v np ap =
|
||||
insertObj
|
||||
(\\fin,b,_ => appCompl fin b v.c2 np ++
|
||||
ap.s ! False ! AN (NCase np.a.n (npform2case np.a.n v.c3.c))) --agr to obj
|
||||
(predV v) ;
|
||||
|
||||
UseComp comp =
|
||||
insertObj (\\_,_ => comp.s) (predV (verbOlla ** {sc = NPCase Nom})) ;
|
||||
|
||||
AdvVP vp adv = insertObj (\\_,_,_ => adv.s) vp ;
|
||||
|
||||
AdVVP adv vp = insertObj (\\_,_,_ => adv.s) vp ;
|
||||
|
||||
ReflV2 v = insertObj (\\fin,b,agr => appCompl fin b v.c2 (reflPron agr)) (predV v) ;
|
||||
|
||||
PassV2 v = let vp = predV v in {
|
||||
s = \\_ => vp.s ! VIPass ;
|
||||
s2 = \\_,_,_ => [] ;
|
||||
ext = [] ;
|
||||
sc = v.c2.c -- minut valitaan ; minua rakastetaan ; minulle kuiskataan
|
||||
} ; ---- talon valitaan: should be marked like inf.
|
||||
|
||||
UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
|
||||
|
||||
CompAP ap = {
|
||||
s = \\agr =>
|
||||
let
|
||||
n = agr.n ;
|
||||
c = case agr.n of {
|
||||
Sg => Nom ; -- minä olen iso
|
||||
Pl => Part -- me olemme isoja
|
||||
} --- definiteness of NP ?
|
||||
in ap.s ! False ! AN (NCase agr.n c)
|
||||
} ;
|
||||
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
--2 The object case
|
||||
--
|
||||
-- The rules involved are ComplV2 and ComplVV above.
|
||||
-- The work is done jointly in ResFin.infVP and appCompl.
|
||||
-- Cases to test: l -table (to see negated forms)
|
||||
--```
|
||||
-- minun täytyy ostaa auto
|
||||
-- PredVP (UsePron i_Pron) (ComplVV must_VV
|
||||
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
||||
-- minä tahdon ostaa auton
|
||||
-- PredVP (UsePron i_Pron) (ComplVV want_VV
|
||||
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
||||
-- minulla täytyy olla auto
|
||||
-- PredVP (UsePron i_Pron) (ComplVV must_VV
|
||||
-- (ComplV2 have_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
|
||||
--```
|
||||
-- Unfortunately, there is no nice way to say "I want to have a car".
|
||||
-- (Other than the paraphrases "I want a car" or "I want to own a car".)
|
||||
Reference in New Issue
Block a user