resource = resource-1.0

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

View File

@@ -0,0 +1,247 @@
--# -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ä" ;
} ;

View File

@@ -0,0 +1,107 @@
--# -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} ;
} ;

View File

@@ -0,0 +1,290 @@
--# -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 ;
-}
}

View File

@@ -0,0 +1,27 @@
--# -path=.:../abstract:../../prelude
concrete LangFin of Lang =
RulesFin,
ClauseFin,
StructuralFin,
BasicFin,
---- TimeEng,
---- CountryEng
MathFin
** open Prelude, ParadigmsFin in {
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 ;
-}
}

View File

@@ -0,0 +1,45 @@
--# -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} ;
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,62 @@
--# -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
} ;
}

View File

@@ -0,0 +1,563 @@
--# -path=.:../abstract:../../prelude
--1 Finnish Lexical Paradigms
--
-- 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.
--
-- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API, $Structural$.
--
-- The low-level definitions of inflectional patterns are in
-- $MorphoFin$. The main difference with that module is that here 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.
--
resource ParadigmsFin =
open (Predef=Predef), Prelude, SyntaxFin, CategoriesFin 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$.
oper
Gender : Type;
human : Gender ;
nonhuman : Gender ;
Number : Type ;
singular : Number ;
plural : Number ;
Case : Type ;
nominative : Case ;
genitive : Case ;
partitive : Case ;
translative : Case ;
inessive : Case ;
elative : Case ;
illative : Case ;
adessive : Case ;
ablative : Case ;
allative : Case ;
-- The following type is used for defining *rection*, i.e. complements
-- 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 ;
--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
-- stems, vowel alternation, and vowel harmony.
oper
mkN : (talo, talon, talona, taloa, taloon,
taloina,taloissa,talojen,taloja,taloihin : Str) -> Gender -> N ;
-- The regular noun heuristic takes just one form (singular
-- nominative) and analyses it to pick the correct paradigm.
-- It does automatic grade alternation, and is hence not usable
-- for words like "auto" (whose genitive would become "audon").
regN : (talo : Str) -> N ;
-- If $regN$ does not give the correct result, one can try and give
-- two or three forms as follows. Examples of the use of these
-- functions are given in $BasicFin$. Most notably, $reg2N$ is used
-- for nouns like "kivi - kiviä", which would otherwise become like
-- "rivi - rivejä". $regN3$ is used e.g. for
-- "sydän - sydämen - sydämiä", which would otherwise become
-- "sydän - sytämen".
reg2N : (savi,savia : Str) -> N ;
reg3N : (vesi,veden,vesiä : Str) -> N ;
-- Some nouns have an unexpected singular partitive, e.g. "meri", "lumi".
sgpartN : (meri : N) -> (merta : Str) -> N ;
nMeri : (meri : Str) -> N ;
-- The rest of the noun paradigms are mostly covered by the three
-- heuristics.
--
-- 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".
nTalo : (talo : Str) -> N ;
-- Another special case are nouns where the last two consonants
-- undergo regular weak-grade alternation:
-- "kukko - kukon", "rutto - ruton", "hyppy - hypyn", "sampo - sammon",
-- "kunto - kunnon", "sisältö - sisällön", .
nLukko : (lukko : Str) -> N ;
-- "arpi - arven", "sappi - sapen", "kampi - kammen";"sylki - syljen"
nArpi : (arpi : Str) -> N ;
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
-- 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.)
nLinux : (linuxia : Str) -> N ;
-- Nouns of at least 3 syllables ending with "a" or "ä", like "peruna", "tavara",
-- "rytinä".
nPeruna : (peruna : Str) -> N ;
-- The following paradigm covers both nouns ending in an aspirated "e", such as
-- "rae", "perhe", "savuke", and also many ones ending in a consonant
-- ("rengas", "kätkyt"). The singular nominative and essive are given.
nRae : (rae, rakeena : Str) -> N ;
-- 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.
nSusi : (susi,suden,sutta : Str) -> N ;
-- Nouns ending with a long vowel, such as "puu", "pää", "pii", "leikkuu",
-- are inflected according to the following.
nPuu : (puu : Str) -> N ;
-- One-syllable diphthong nouns, such as "suo", "tie", "työ", are inflected by
-- the following.
nSuo : (suo : Str) -> N ;
-- Many adjectives but also nouns have the nominative ending "nen" which in other
-- cases becomes "s": "nainen", "ihminen", "keltainen".
-- To capture the vowel harmony, we use the partitive form as the argument.
nNainen : (naista : Str) -> N ;
-- The following covers some nouns ending with a consonant, e.g.
-- "tilaus", "kaulin", "paimen", "laidun".
nTilaus : (tilaus,tilauksena : Str) -> N ;
-- Special case:
nKulaus : (kulaus : Str) -> N ;
-- The following covers nouns like "nauris" and adjectives like "kallis", "tyyris".
-- The partitive form is taken to get the vowel harmony.
nNauris : (naurista : Str) -> N ;
-- Separately-written compound nouns, like "sambal oelek", "Urho Kekkonen",
-- have only their last part inflected.
nComp : 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 ;
mkN3 : N -> Case -> Case -> N3 ;
-- Proper names can be formed by using declensions for nouns.
-- The plural forms are filtered away by the compiler.
mkPN : N -> PN ;
--2 Adjectives
-- Non-comparison one-place adjectives are just like nouns.
mkA : N -> A ;
-- Two-place adjectives need a case for the second argument.
mkA2 : A -> PPosition -> 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 ;
-- The regular adjectives are based on $regN$ in the positive.
regADeg : (punainen : Str) -> ADeg ;
--2 Verbs
--
-- The grammar does not cover the potential mood and some nominal
-- forms. One way to see the coverage is to linearize a verb to
-- a table.
-- The worst case needs twelve forms, as shown in the following.
mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan,
tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ;
-- The following heuristics cover more and more verbs.
regV : (soutaa : Str) -> V ;
reg2V : (soutaa,souti : Str) -> V ;
reg3V : (soutaa,soudan,souti : Str) -> 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.
vValua : (valua : Str) -> V ;
-- With two forms, the following function covers a variety of verbs, such as
-- "ottaa", "käyttää", "löytää", "huoltaa", "hiihtää", "siirtää".
vKattaa : (kattaa, katan : Str) -> V ;
-- When grade alternation is not present, just a one-form special case is needed
-- ("poistaa", "ryystää").
vOstaa : (ostaa : Str) -> V ;
-- The following covers
-- "juosta", "piestä", "nousta", "rangaista", "kävellä", "surra", "panna".
vNousta : (nousta, nousen : Str) -> V ;
-- This is for one-syllable diphthong verbs like "juoda", "syödä".
vTuoda : (tuoda : Str) -> V ;
-- All the patterns above have $nominative$ as subject case.
-- If another case is wanted, use the following.
caseV : Case -> V -> V ;
-- The verbs "be" and the negative auxiliary are special.
vOlla : V ;
vEi : V ;
-- Two-place verbs need a case, and can have a pre- or postposition.
mkV2 : V -> PPosition -> V2 ;
-- If the complement needs just a case, the following special function can be used.
caseV2 : V -> Case -> V2 ;
-- 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$.
dirV2 : V -> V2 ;
--3 Three-place verbs
--
-- 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
--3 Other complement patterns
--
-- Verbs and adjectives can take complements such as sentences,
-- questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
mkV2S : V2 -> V2S ;
mkVV : V -> VV ;
mkV2V : V2 -> V2V ;
mkVA : V -> Case -> VA ;
mkV2A : V2 -> Case -> V2A ;
mkVQ : V -> VQ ;
mkV2Q : V2 -> V2Q ;
mkAS : A -> AS ;
mkA2S : A2 -> A2S ;
mkAV : A -> AV ;
mkA2V : A2 -> A2V ;
-- 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 ;
singular = Sg ;
plural = Pl ;
human = Human ;
nonhuman = NonHuman ;
nominative = Nom ;
genitive = Gen ;
partitive = Part ;
translative = Transl ;
inessive = Iness ;
elative = Elat ;
illative = Illat ;
adessive = Adess ;
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} ;
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 = <>} ;
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 ;
ve = init ves ;
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)
}
}
}
) ** {g = NonHuman ; lock_N = <>} ;
reg2N : (savi,savia : Str) -> N = \savi,savia ->
---- nhn (reg2NounH savi savia)
let
savit = regN 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"> => 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) ;
_ => savit
}
** {g = NonHuman ; 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ä)
in
case si of {
"us" | "ys" =>
ifTok CommonNoun (Predef.dp 3 veden) "den"
(nhn (sRakkaus vesi))
(nhn (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))) ;
"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 = <>} ;
nKukko = \a,b,c -> nhn (sKukko a b c) ** {g = nonhuman ; 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 = <>} ;
nKulaus = \a -> nTilaus a (init a + "ksen" + getHarmony (last
(init a))) ;
nNauris = \a -> nhn (sNauris a) ** {g = nonhuman ; lock_N = <>} ;
sgpartN noun part = {
s = table {
NCase Sg Part => part ;
c => noun.s ! c
} ;
g = noun.g ;
lock_N = noun.lock_N
} ;
nMeri meri =
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 = <>} ;
mkA = \x -> noun2adj x ** {lock_A = <>} ;
mkA2 = \x,c -> x ** {s3 = c.s3 ; p = c.p ; c = c.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 = <>} ;
regADeg 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 = <>} ;
regV soutaa = v2v (regVerbH soutaa) ** {sc = Nom ; lock_V = <>} ;
reg2V : (soutaa,souti : Str) -> V = \soutaa,souti ->
v2v (reg2VerbH soutaa souti) ** {sc = Nom ; lock_V = <>} ;
reg3V soutaa soudan souti =
v2v (reg3VerbH soutaa soudan souti) ** {sc = 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 = <>} ;
vOlla = verbOlla ** {sc = Nom ; lock_V = <>} ;
vEi = verbEi ** {sc = 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 = <>} ;
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) ;
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 = <>} ;
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 = <>} ;
-- inf_illative
-- infinitive
-- V3 = TransVerb ** {s5, s6 : Str ; c2 : ComplCase} ;
-- Verb ** {s3, s4 : Str ; c : ComplCase} ;
-- mkN3 n c1 c2
-- {c : NPForm} ;
-- N3 = Function ** {c2 : NPForm} ;
} ;

View File

@@ -0,0 +1,3 @@
--# -path=.:../abstract:../../prelude
concrete ResourceFin of Resource = RulesFin, ClauseFin, StructuralFin ** {} ;

View File

@@ -0,0 +1,214 @@
--# -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)
) ;
} ;

View File

@@ -0,0 +1,114 @@
--# -path=.:../abstract:../../prelude
--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
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" ;
although_Subj = ss "vaikka" ;
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
} ;
everywhere_Adv = ss "kaikkialla" ;
from_Prep = prepCase Elat ; --- ablat
he_NP = pronNounPhrase pronHan ;
how_IAdv = ss "kuinka" ;
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
} ;
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
} ;
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" ;
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 ;
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 ;
}

View File

@@ -0,0 +1,250 @@
--# -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

View File

@@ -0,0 +1,145 @@
--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} ;
} ;