From fc945b485bdd3f69cef1b33a878047fa2fae1655 Mon Sep 17 00:00:00 2001
From: aarne
Date: Sun, 5 Feb 2006 19:57:26 +0000
Subject: [PATCH] main problems of Finnish solved
---
lib/resource-1.0/doc/Resource-HOWTO.html | 6 +-
lib/resource-1.0/doc/Resource-HOWTO.txt | 4 +-
lib/resource-1.0/finnish/AdverbFin.gf | 10 +-
lib/resource-1.0/finnish/CatFin.gf | 7 +-
lib/resource-1.0/finnish/ConjunctionFin.gf | 30 +-
lib/resource-1.0/finnish/LangFin.gf | 8 +-
lib/resource-1.0/finnish/LexiconFin.gf | 1 +
lib/resource-1.0/finnish/MorphoFin.gf | 297 +---------------
lib/resource-1.0/finnish/NounFin.gf | 14 +-
lib/resource-1.0/finnish/ParadigmsFin.gf | 14 +-
lib/resource-1.0/finnish/PhraseFin.gf | 10 +-
lib/resource-1.0/finnish/ResFin.gf | 391 ++++++++++++++++++---
lib/resource-1.0/finnish/SentenceFin.gf | 6 +-
lib/resource-1.0/finnish/StructuralFin.gf | 207 ++++++-----
lib/resource-1.0/finnish/VerbFin.gf | 8 +-
15 files changed, 520 insertions(+), 493 deletions(-)
diff --git a/lib/resource-1.0/doc/Resource-HOWTO.html b/lib/resource-1.0/doc/Resource-HOWTO.html
index 960527f09..3b7c93577 100644
--- a/lib/resource-1.0/doc/Resource-HOWTO.html
+++ b/lib/resource-1.0/doc/Resource-HOWTO.html
@@ -7,7 +7,7 @@
Resource grammar writing HOWTO
Author: Aarne Ranta <aarne (at) cs.chalmers.se>
-Last update: Thu Feb 2 00:04:00 2006
+Last update: Sun Feb 5 15:22:34 2006
@@ -336,8 +336,7 @@ API was changed during the actual process to make it more intuitive.)
These modules will be written by you.
-ParamGer: parameter types
-ResGer: auxiliary operations (a resource for the resource grammar!)
+ResGer: parameter types and auxiliary operations (a resource for the resource grammar!)
MorphoGer: complete inflection engine
@@ -561,7 +560,6 @@ are only found in the comments of the modules.
Resource modules
-- ParamGer
- ResGer
- MorphoGer
- ParadigmsGer, ParadigmsGer.gf
diff --git a/lib/resource-1.0/doc/Resource-HOWTO.txt b/lib/resource-1.0/doc/Resource-HOWTO.txt
index 744f7be55..584f2928a 100644
--- a/lib/resource-1.0/doc/Resource-HOWTO.txt
+++ b/lib/resource-1.0/doc/Resource-HOWTO.txt
@@ -281,8 +281,7 @@ API was changed during the actual process to make it more intuitive.)
These modules will be written by you.
-- ``ParamGer``: parameter types
-- ``ResGer``: auxiliary operations (a resource for the resource grammar!)
+- ``ResGer``: parameter types and auxiliary operations (a resource for the resource grammar!)
- ``MorphoGer``: complete inflection engine
@@ -486,7 +485,6 @@ are only found in the comments of the modules.
===Resource modules===
-- [ParamGer ../german/ParamGer.gf]
- [ResGer ../german/ResGer.gf]
- [MorphoGer ../german/MorphoGer.gf]
- [ParadigmsGer gfdoc/ParadigmsGer.html], [ParadigmsGer.gf ../german/ParadigmsGer.gf]
diff --git a/lib/resource-1.0/finnish/AdverbFin.gf b/lib/resource-1.0/finnish/AdverbFin.gf
index 5e786a418..fed5a1e9b 100644
--- a/lib/resource-1.0/finnish/AdverbFin.gf
+++ b/lib/resource-1.0/finnish/AdverbFin.gf
@@ -1,21 +1,21 @@
concrete AdverbFin of Adverb = CatFin ** open ResFin, Prelude in {
lin
- PositAdvAdj a = {s = a.s ! AAdv} ;
+ PositAdvAdj a = {s = a.s ! Posit ! AAdv} ;
ComparAdvAdj cadv a np = {
- s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom
+ s = cadv.s ++ a.s ! Posit ! AAdv ++ "kuin" ++ np.s ! NPCase Nom
} ;
ComparAdvAdjS cadv a s = {
- s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s
+ s = cadv.s ++ a.s ! Posit ! AAdv ++ "kuin" ++ s.s
} ;
- PrepNP prep np = {s = prep.s ++ np.s ! Acc} ;
+ 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 ++ "than"} ;
+ AdnCAdv cadv = {s = cadv.s ++ "kuin"} ;
}
diff --git a/lib/resource-1.0/finnish/CatFin.gf b/lib/resource-1.0/finnish/CatFin.gf
index 9479ce490..d898fb29b 100644
--- a/lib/resource-1.0/finnish/CatFin.gf
+++ b/lib/resource-1.0/finnish/CatFin.gf
@@ -34,10 +34,7 @@ concrete CatFin of Cat = TenseX ** open ResFin, Prelude in {
-- Verb
- VP = {
- s : Tense => Anteriority => Polarity => Agr => {fin, inf : Str} ;
- s2 : Agr => Str
- } ;
+ VP = ResFin.VP ;
Comp = {s : Agr => Str} ;
SC = {s : Str} ;
@@ -49,7 +46,7 @@ concrete CatFin of Cat = TenseX ** open ResFin, Prelude in {
CN = {s : Bool => Number => Case => Str} ;
Pron = {s : NPForm => Str ; a : Agr} ;
- NP = {s : NPForm => Str ; a : Agr} ;
+ NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
Det = {s : Case => Str ; n : Number ; isNum : Bool} ;
QuantSg, QuantPl = {s : Case => Str} ;
Predet, Quant, Ord = {s : Number => Case => Str} ;
diff --git a/lib/resource-1.0/finnish/ConjunctionFin.gf b/lib/resource-1.0/finnish/ConjunctionFin.gf
index a37ef8c67..1b8298d40 100644
--- a/lib/resource-1.0/finnish/ConjunctionFin.gf
+++ b/lib/resource-1.0/finnish/ConjunctionFin.gf
@@ -11,19 +11,17 @@ concrete ConjunctionFin of Conjunction =
ConjAdv = conjunctSS ;
DConjAdv = conjunctDistrSS ;
- ConjNP conj ss = conjunctTable Case conj ss ** {
- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
+ 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 Case conj ss ** {
- a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
+ DConjNP conj ss = conjunctDistrTable NPForm conj ss ** {
+ a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p} ;
+ isPron = False
} ;
- ConjAP conj ss = conjunctTable Agr conj ss ** {
- isPre = ss.isPre
- } ;
- DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
- isPre = ss.isPre
- } ;
+-- ConjAP conj ss = conjunctTable Agr conj ss ;
+-- DConjAP conj ss = conjunctDistrTable Agr conj ss ;
-- These fun's are generated from the list cat's.
@@ -31,15 +29,15 @@ concrete ConjunctionFin of Conjunction =
ConsS = consrSS comma ;
BaseAdv = twoSS ;
ConsAdv = consrSS comma ;
- BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
- ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
- BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
+ 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 = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
+-- ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
lincat
[S] = {s1,s2 : Str} ;
[Adv] = {s1,s2 : Str} ;
- [NP] = {s1,s2 : Case => Str ; a : Agr} ;
- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
+ [NP] = {s1,s2 : NPForm => Str ; a : Agr} ;
+-- [AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
}
diff --git a/lib/resource-1.0/finnish/LangFin.gf b/lib/resource-1.0/finnish/LangFin.gf
index 1df23e389..d8c2980c9 100644
--- a/lib/resource-1.0/finnish/LangFin.gf
+++ b/lib/resource-1.0/finnish/LangFin.gf
@@ -3,12 +3,12 @@
concrete LangFin of Lang =
NounFin,
VerbFin,
- AdjectiveFin,
+-- AdjectiveFin,
AdverbFin,
- NumeralFin,
+-- NumeralFin,
SentenceFin,
- QuestionFin,
- RelativeFin,
+-- QuestionFin,
+-- RelativeFin,
ConjunctionFin,
PhraseFin,
StructuralFin,
diff --git a/lib/resource-1.0/finnish/LexiconFin.gf b/lib/resource-1.0/finnish/LexiconFin.gf
index 3c050369b..ba064c721 100644
--- a/lib/resource-1.0/finnish/LexiconFin.gf
+++ b/lib/resource-1.0/finnish/LexiconFin.gf
@@ -136,6 +136,7 @@ lin
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" ;
diff --git a/lib/resource-1.0/finnish/MorphoFin.gf b/lib/resource-1.0/finnish/MorphoFin.gf
index d281ebb81..bc2474975 100644
--- a/lib/resource-1.0/finnish/MorphoFin.gf
+++ b/lib/resource-1.0/finnish/MorphoFin.gf
@@ -19,81 +19,6 @@ resource MorphoFin = ResFin ** open Prelude in {
oper
- NounH : Type = {
- a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin : Str
- } ;
-
- CommonNoun = {s : NForm => 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.
@@ -167,33 +92,6 @@ oper
-- Here some useful special cases; more will be given in $paradigms.Fin.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
@@ -336,28 +234,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
@@ -730,23 +606,11 @@ vowelHarmony : Str -> Str = \liitin ->
NPCase Ablat => minu + ("lt" + a) ;
NPCase Allat => minu + "lle" ;
NPCase Abess => minu + ("tt" + a) ;
- NPAccNom | NPAccGen => Predef.tk 1 minun + "t"
+ NPAcc => Predef.tk 1 minun + "t"
} ;
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
@@ -919,22 +783,7 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
--2 Adjectives
--
--- To form an adjective, it is usually enough to give a noun declension: the
--- adverbial form is regular.
- Adj : Type = {s : AForm => Str} ;
-
- 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
- }
- } ;
-- For the comparison of adjectives, three noun declensions
-- are needed in the worst case.
@@ -957,106 +806,6 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
(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 ;
- 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" ;
- Impf Sg P2 => tuji + "t" ;
- Impf Sg P3 => tuli ;
- Impf Pl P1 => tuji + "mme" ;
- Impf Pl P2 => tuji + "tte" ;
- Impf Pl P3 => tuli + vat ;
- Condit Sg P1 => tulisi + "n" ;
- Condit Sg P2 => tulisi + "t" ;
- Condit Sg P3 => tulisi ;
- Condit Pl P1 => tulisi + "mme" ;
- Condit Pl P2 => tulisi + "tte" ;
- Condit 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
@@ -1315,50 +1064,6 @@ 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 | Condit n p => ei.s ! Presn n p ;
- Impf n p => ei.s ! Presn n p ;
- Condit n p => ei.s ! Presn n p ;
- v => ei.s ! v
- }
- } ;
-
---2 Some structural words
-
- kuinConj = "kuin" ;
-
- conjEtta = "että" ;
- advSiten = "siten" ;
-
-
- 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$.
diff --git a/lib/resource-1.0/finnish/NounFin.gf b/lib/resource-1.0/finnish/NounFin.gf
index f8580120a..3f07f6b71 100644
--- a/lib/resource-1.0/finnish/NounFin.gf
+++ b/lib/resource-1.0/finnish/NounFin.gf
@@ -3,13 +3,19 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
flags optimize=all_subs ;
lin
+{-
DetCN det cn = {
s = \\c => det.s ++ cn.s ! det.n ! c ;
a = agrP3 det.n
} ;
- UsePN pn = pn ** {a = agrP3 Sg} ;
- UsePron p = p ;
-
+-}
+ UsePN pn = {
+ s = \\c => pn.s ! npform2case c ;
+ a = agrP3 Sg ;
+ isPron = False
+ } ;
+ UsePron p = p ** {isPron = True} ;
+{-
PredetNP pred np = {
s = \\c => pred.s ++ np.s ! c ;
a = np.a
@@ -67,5 +73,5 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
-
+-}
}
diff --git a/lib/resource-1.0/finnish/ParadigmsFin.gf b/lib/resource-1.0/finnish/ParadigmsFin.gf
index c0746f9ab..51e02d767 100644
--- a/lib/resource-1.0/finnish/ParadigmsFin.gf
+++ b/lib/resource-1.0/finnish/ParadigmsFin.gf
@@ -65,9 +65,10 @@ oper
-- of many-place verbs and adjective. A complement can be defined by
-- just a case, or a pre/postposition and a case.
- prePrep : Case -> Str -> Prep ;
- postPrep : Case -> Str -> Prep ;
- casePrep : Case -> Prep ;
+ prePrep : Case -> Str -> Prep ; -- ilman, partitive
+ postPrep : Case -> Str -> Prep ; -- takana, genitive
+ postGenPrep : Str -> Prep ; -- takana
+ casePrep : Case -> Prep ; -- adessive
accusative : Prep ;
--2 Nouns
@@ -277,10 +278,9 @@ oper
caseV : Case -> V -> V ;
--- The verbs "be" and the negative auxiliary are special.
+-- The verbs "be" is special.
vOlla : V ;
- vEi : V ;
-- Two-place verbs need a case, and can have a pre- or postposition.
@@ -360,9 +360,10 @@ oper
\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 = NPAccNom ; s = [] ; isPre = True ; lock_Prep = <>} ;
+ accPrep = {c = NPAcc ; s = [] ; isPre = True ; lock_Prep = <>} ;
mkN = \a,b,c,d,e,f,g,h,i,j ->
mkNoun a b c d e f g h i j ** {lock_N = <>} ;
@@ -511,7 +512,6 @@ reg3N = \vesi,veden,vesi
caseV c v = {s = v.s ; sc = NPCase c ; lock_V = <>} ;
vOlla = verbOlla ** {sc = NPCase Nom ; lock_V = <>} ;
- vEi = verbEi ** {sc = NPCase Nom ; lock_V = <>} ;
vHuoltaa : (_,_,_,_ : Str) -> Verb = \ottaa,otan,otti,otin ->
v2v (MorphoFin.vHuoltaa ottaa otan otti otin) ** {sc = NPCase Nom ; lock_V = <>} ;
diff --git a/lib/resource-1.0/finnish/PhraseFin.gf b/lib/resource-1.0/finnish/PhraseFin.gf
index 35420e2eb..a02f55931 100644
--- a/lib/resource-1.0/finnish/PhraseFin.gf
+++ b/lib/resource-1.0/finnish/PhraseFin.gf
@@ -4,20 +4,20 @@ concrete PhraseFin of Phrase = CatFin ** open ResFin in {
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
UttS s = s ;
- UttQS qs = {s = qs.s ! QDir} ;
+ 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 ! Nom} ; --- Acc also
+ UttIP ip = {s = ip.s ! NPCase Nom} ;
UttIAdv iadv = iadv ;
- UttNP np = {s = np.s ! Acc} ;
- UttVP vp = {s = "to" ++ infVP vp (agrP3 Sg)} ;
+ UttNP np = {s = np.s ! NPCase Nom} ;
+-- UttVP vp = {s = "to" ++ infVP vp (agrP3 Sg)} ;
UttAdv adv = adv ;
NoPConj = {s = []} ;
PConjConj conj = conj ;
NoVoc = {s = []} ;
- VocNP np = {s = "," ++ np.s ! Nom} ;
+ VocNP np = {s = "," ++ np.s ! NPCase Nom} ;
}
diff --git a/lib/resource-1.0/finnish/ResFin.gf b/lib/resource-1.0/finnish/ResFin.gf
index ee2e9df09..980386d36 100644
--- a/lib/resource-1.0/finnish/ResFin.gf
+++ b/lib/resource-1.0/finnish/ResFin.gf
@@ -30,6 +30,8 @@ resource ResFin = ParamX ** open Prelude in {
oper
Agr = {n : Number ; p : Person} ;
+ NP = {s : NPForm => Str ; a : Agr ; isPron : Bool} ;
+
--
--2 Adjectives
--
@@ -50,8 +52,13 @@ oper
-- have a uniform, special accusative form ("minut", etc).
param
- NPForm = NPCase Case | NPAccNom | NPAccGen ;
+ NPForm = NPCase Case | NPAcc ;
+oper
+ npform2case : NPForm -> Case = \f -> case f of {
+ NPCase c => c ;
+ NPAcc => Gen -- appCompl does the job
+ } ;
--2 For $Verb$
@@ -59,7 +66,7 @@ param
param
VForm =
- Inf
+ Inf InfForm
| Presn Number Person
| Impf Number Person
| Condit Number Person
@@ -70,6 +77,10 @@ param
| Pass Bool
| PastPartAct AForm
| PastPartPass AForm
+ ;
+
+ InfForm =
+ Inf1
| Inf3Iness -- 5 forms acc. to Karlsson
| Inf3Elat
| Inf3Illat
@@ -103,60 +114,101 @@ param
Compl : Type = {s : Str ; c : NPForm ; isPre : Bool} ;
+ appCompl : Bool -> Polarity -> Compl -> NP -> Str = \isFin,b,co,np ->
+ let
+ c = case of {
+ <_, Neg, NPAcc,_,_> => NPCase Part ; -- en näe taloa/sinua
+ <_, Pos, NPAcc,True,_> => NPAcc ; -- näen/täytyy sinut
+ => NPCase Gen ; -- näen talon
+ => 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
+ | VIImper
+ ;
- VP : Type = {
- s : Tense => Anteriority => Polarity => Agr => {fin, inf : Str} ;
- s2 : Agr => Str
+oper
+ VP = {
+ s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
+ s2 : Polarity => Agr => Str ; -- itseni/itseäni
+ ext : Str ;
+ sc : NPForm
} ;
-
- predV : Verb -> VP = \verb -> {
- s = \\t,ant,b,agr => {fin = verb.s ! Presn agr.n agr.p ; inf = []} ;
- s2 = \\_ => []
- } ;
-{-
+
+ predV : (Verb ** {sc : NPForm}) -> VP = \verb -> {
+ s = \\vi,ant,b,agr =>
let
- inf = verb.s ! VInf ;
- fin = presVerb verb agr ;
- past = verb.s ! VPast ;
- part = verb.s ! VPPart ;
+
+ verbs = verb.s ;
+ part : Str = 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 of {
+ => ;
+ => ;
+ => ;
+ => ;
+ => <"älä", verbs ! Imper Sg, "ole"> ;
+ => <"älkää", verbs ! ImpNegPl, "olko"> ;
+ => <"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 of {
+ => vf (verbs ! p) [] ;
+ => vf ei neg ;
+ => vf (olla ! p) part ;
+ => vf ei (ole ++ part)
+ }
in
- case of {
- => vf fin [] ;
- => vf (does agr) inf ;
- => vf (doesnt agr) inf ;
- => vf (have agr) part ;
- => vf (havent agr) part ;
- => vf past [] ;
- => vf "did" inf ;
- => vf "didn't" inf ;
- => vf "had" part ;
- => vf "hadn't" part ;
- => vf "will" inf ;
- => vf "won't" inf ;
- => vf "will" ("have" ++ part) ;
- => vf "won't" ("have" ++ part) ;
- => vf "would" inf ;
- => vf "wouldn't" inf ;
- => vf "would" ("have" ++ part) ;
- => vf "wouldn't" ("have" ++ part)
+ case vi of {
+ VIFin Past => mkvf (Impf agr.n agr.p) ;
+ VIFin Cond => mkvf (Condit agr.n agr.p) ;
+ _ => mkvf (Presn agr.n agr.p)
} ;
- s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
+
+ s2 = \\_,_ => [] ;
+ ext = [] ;
+ sc = verb.sc
} ;
- insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
+ insertObj : (Polarity => Agr => Str) -> VP -> VP = \obj,vp -> {
s = vp.s ;
- s2 = \\a => vp.s2 ! a ++ obj ! a
+ s2 = \\b,a => vp.s2 ! b ! a ++ obj ! b ! a ;
+ ext = vp.ext ;
+ sc = vp.sc
} ;
+{-
--- This is not functional.
insertAdV : Str -> VP -> VP = \adv,vp -> {
@@ -219,21 +271,24 @@ param
s : Tense => Anteriority => Polarity => SType => Str
} ;
-{-
mkClause : Str -> Agr -> VP -> Clause =
\subj,agr,vp -> {
s = \\t,a,b,o =>
let
- verb = vp.s ! t ! a ! b ! o ! agr ;
- compl = vp.s2 ! agr
+ verb = vp.s ! VIFin t ! a ! b ! agr ;
+ compl = vp.s2 ! b ! agr ++ vp.ext
in
case o of {
- ODir => subj ++ verb.fin ++ verb.inf ++ compl ;
- OQuest => verb.fin ++ subj ++ verb.inf ++ compl
+ SDecl => subj ++ verb.fin ++ verb.inf ++ compl ;
+ SQuest => questPart verb.fin ++ subj ++ verb.inf ++ compl
}
} ;
+ questPart : Str -> Str = \on -> on ++ BIND ++ "ko" ; ----
+
+
+{-
-- For $Numeral$.
mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
@@ -260,4 +315,256 @@ param
_ => ten + "th"
} ;
-}
+
+-- The definitions below were moved here from $MorphoFin$ so that we the
+-- auxiliary of predication can be defined.
+
+ verbOlla : Verb =
+ mkVerb
+ "olla" "on" "olen" "ovat" "olkaa" "ollaan"
+ "oli" "olin" "olisi" "ollut" "oltu" "ollun" ;
+
+--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 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" ;
+ Impf Sg P2 => tuji + "t" ;
+ Impf Sg P3 => tuli ;
+ Impf Pl P1 => tuji + "mme" ;
+ Impf Pl P2 => tuji + "tte" ;
+ Impf Pl P3 => tuli + vat ;
+ Condit Sg P1 => tulisi + "n" ;
+ Condit Sg P2 => tulisi + "t" ;
+ Condit Sg P3 => tulisi ;
+ Condit Pl P1 => tulisi + "mme" ;
+ Condit Pl P2 => tulisi + "tte" ;
+ Condit 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 ;
+ 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 ;
+ 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
+ }
+ } ;
+-- 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") ;
+
}
diff --git a/lib/resource-1.0/finnish/SentenceFin.gf b/lib/resource-1.0/finnish/SentenceFin.gf
index ff4110f93..b0835ed90 100644
--- a/lib/resource-1.0/finnish/SentenceFin.gf
+++ b/lib/resource-1.0/finnish/SentenceFin.gf
@@ -4,8 +4,8 @@ concrete SentenceFin of Sentence = CatFin ** open ResFin in {
lin
- PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
-
+ PredVP np vp = mkClause (np.s ! vp.sc) np.a vp ;
+{-
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
ImpVP vp = {
@@ -42,5 +42,5 @@ concrete SentenceFin of Sentence = CatFin ** open ResFin in {
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! ODir} ;
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q} ;
UseRCl t a p cl = {s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r} ;
-
+-}
}
diff --git a/lib/resource-1.0/finnish/StructuralFin.gf b/lib/resource-1.0/finnish/StructuralFin.gf
index 885124092..e78b3d940 100644
--- a/lib/resource-1.0/finnish/StructuralFin.gf
+++ b/lib/resource-1.0/finnish/StructuralFin.gf
@@ -1,106 +1,121 @@
concrete StructuralFin of Structural = CatFin **
- open MorphoFin, Prelude in {
+ open MorphoFin, ParadigmsFin, Prelude in {
flags optimize=all ;
lin
- above_Prep = ss "above" ;
- after_Prep = ss "after" ;
- all_Predet = ss "all" ;
- almost_AdA, almost_AdN = ss "almost" ;
- although_Subj = ss "although" ;
- always_AdV = ss "always" ;
- and_Conj = ss "and" ** {n = Pl} ;
- because_Subj = ss "because" ;
- before_Prep = ss "before" ;
- behind_Prep = ss "behind" ;
- between_Prep = ss "between" ;
- both7and_DConj = sd2 "both" "and" ** {n = Pl} ;
- but_PConj = ss "but" ;
- by8agent_Prep = ss "by" ;
- by8means_Prep = ss "by" ;
- can8know_VV = verbPart (mkVerbIrreg "know" "knew" "known") "how"** {c2 = "to"} ;---
- can_VV = verbGen "manage" ** {c2 = "to"} ; ---
- during_Prep = ss "during" ;
- either7or_DConj = sd2 "either" "or" ** {n = Sg} ;
- everybody_NP = regNP "everybody" Sg ;
- every_Det = mkDeterminer Sg "every" ;
- everything_NP = regNP "everything" Sg ;
- everywhere_Adv = ss "everywhere" ;
- first_Ord = ss "first" ;
- from_Prep = ss "from" ;
- he_Pron = mkNP "he" "him" "his" Sg P3 ;
- here_Adv = ss "here" ;
- here7to_Adv = ss ["to here"] ;
- here7from_Adv = ss ["from here"] ;
- how_IAdv = ss "how" ;
- how8many_IDet = mkDeterminer Pl ["how many"] ;
- if_Subj = ss "if" ;
- in8front_Prep = ss ["in front of"] ;
- i_Pron = mkNP "I" "me" "my" Sg P1 ;
- in_Prep = ss "in" ;
- it_Pron = mkNP "it" "it" "its" Sg P3 ;
- less_CAdv = ss "less" ;
- many_Det = mkDeterminer Pl "many" ;
- more_CAdv = ss "more" ;
- most_Predet = ss "most" ;
- much_Det = mkDeterminer Sg "much" ;
- must_VV = mkVerb4 "have" "has" "had" "had" ** {c2 = "to"} ; ---
- no_Phr = ss "no" ;
- on_Prep = ss "on" ;
- one_Quant = mkDeterminer Sg "one" ;
- only_Predet = ss "only" ;
- or_Conj = ss "or" ** {n = Sg} ;
- otherwise_PConj = ss "otherwise" ;
- part_Prep = ss "of" ;
- please_Voc = ss "please" ;
- possess_Prep = ss "of" ;
- quite_Adv = ss "quite" ;
- she_Pron = mkNP "she" "her" "her" Sg P3 ;
- so_AdA = ss "so" ;
- somebody_NP = regNP "somebody" Sg ;
- someSg_Det = mkDeterminer Sg "some" ;
- somePl_Det = mkDeterminer Pl "some" ;
- something_NP = regNP "something" Sg ;
- somewhere_Adv = ss "somewhere" ;
- that_Quant = mkQuant "that" "those" ;
- that_NP = regNP "that" Sg ;
- there_Adv = ss "there" ;
- there7to_Adv = ss "there" ;
- there7from_Adv = ss ["from there"] ;
- therefore_PConj = ss "therefore" ;
- they_Pron = mkNP "they" "them" "their" Pl P3 ;
- this_Quant = mkQuant "this" "these" ;
- this_NP = regNP "this" Sg ;
- those_NP = regNP "those" Pl ;
- through_Prep = ss "through" ;
- too_AdA = ss "too" ;
- to_Prep = ss "to" ;
- under_Prep = ss "under" ;
- very_AdA = ss "very" ;
- want_VV = verbGen "want" ** {c2 = "to"} ;
- we_Pron = mkNP "we" "us" "our" Pl P1 ;
- whatPl_IP = mkIP "what" "what" "what's" Sg ;
- whatSg_IP = mkIP "what" "what" "what's" Sg ;
- when_IAdv = ss "when" ;
- when_Subj = ss "when" ;
- where_IAdv = ss "where" ;
- whichPl_IDet = mkDeterminer Pl ["which"] ;
- whichSg_IDet = mkDeterminer Sg ["which"] ;
- whoSg_IP = mkIP "who" "whom" "whose" Sg ;
- whoPl_IP = mkIP "who" "whom" "whose" Pl ;
- why_IAdv = ss "why" ;
- without_Prep = ss "without" ;
- with_Prep = ss "with" ;
- yes_Phr = ss "yes" ;
- youSg_Pron = mkNP "you" "you" "your" Sg P2 ;
- youPl_Pron = mkNP "you" "you" "your" Pl P2 ;
- youPol_Pron = mkNP "you" "you" "your" Sg P2 ;
+ above_Prep = postGenPrep "yläpuolella" ;
+ after_Prep = postGenPrep "jälkeen" ;
-oper
- mkQuant : Str -> Str -> {s : Number => Str} = \x,y -> {
- s = table Number [x ; y]
+ all_Predet = {s = \\n,c =>
+ let
+ kaiket = caseTable n (nhn (sKorpi "kaikki" "kaiken" "kaikkena"))
+ in
+ case c of {
+ Nom => "kaikki" ;
+ _ => kaiket ! c
+ }
} ;
+ 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 = 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 = regV "voida" ;
+ during_Prep = postGenPrep "aikana" ;
+ either7or_DConj = sd2 "joko" "tai" ** {n = Sg} ;
+-- everybody_NP = regNP "everybody" Sg ;
+-- every_Det = mkDeterminer Sg "every" ;
+-- everything_NP = regNP "everything" Sg ;
+ everywhere_Adv = ss "kaikkialla" ;
+-- first_Ord = ss "first" ;
+ 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 = mkDeterminer Pl ["how many"] ;
+ if_Subj = ss "jos" ;
+ in8front_Prep = postGenPrep "edessä" ;
+ i_Pron = mkPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
+ in_Prep = casePrep inessive ;
+ it_Pron = {
+ s = \\c => MorphoFin.pronSe.s ! npform2case c ;
+ a = agrP3 Sg ;
+ isPron = False
+ } ;
+ less_CAdv = ss "vähemmän" ;
+-- many_Det = mkDeterminer Pl "many" ;
+ more_CAdv = ss "enemmän" ;
+-- most_Predet = ss "eniten" ;
+-- much_Det = mkDeterminer Sg "much" ;
+-- must_VV = mkVerb4 "have" "has" "had" "had" ** {c2 = "to"} ; ---
+ no_Phr = ss "ei" ;
+ on_Prep = casePrep adessive ;
+-- one_Quant = mkDeterminer Sg "one" ;
+ 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 = regNP "somebody" Sg ;
+-- someSg_Det = mkDeterminer Sg "some" ;
+-- somePl_Det = mkDeterminer Pl "some" ;
+-- something_NP = regNP "something" Sg ;
+ somewhere_Adv = ss "jossain" ;
+-- that_Quant = mkQuant "that" "those" ;
+ that_NP =
+ mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3 **
+ {isPron = False} ;
+ there_Adv = ss "siellä" ; --- tuolla
+ there7to_Adv = ss "sinne" ;
+ there7from_Adv = ss "sieltä" ;
+ therefore_PConj = ss "siksi" ;
+ they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
+-- this_Quant = mkQuant "this" "these" ;
+ this_NP =
+ mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3 **
+ {isPron = False} ;
+ those_NP =
+ mkPronoun "nuo" "noiden" "noita" "noina" "noihin" Pl P3 **
+ {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 = mkIP "what" "what" "what's" Sg ;
+-- whatSg_IP = mkIP "what" "what" "what's" Sg ;
+ when_IAdv = ss "milloin" ;
+ when_Subj = ss "kun" ;
+ where_IAdv = ss "missä" ;
+-- whichPl_IDet = mkDeterminer Pl ["which"] ;
+-- whichSg_IDet = mkDeterminer Sg ["which"] ;
+-- whoSg_IP = mkIP "who" "whom" "whose" Sg ;
+-- whoPl_IP = mkIP "who" "whom" "whose" Pl ;
+ why_IAdv = ss "miksi" ;
+ 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
+
}
diff --git a/lib/resource-1.0/finnish/VerbFin.gf b/lib/resource-1.0/finnish/VerbFin.gf
index 432f7bf1c..90800584c 100644
--- a/lib/resource-1.0/finnish/VerbFin.gf
+++ b/lib/resource-1.0/finnish/VerbFin.gf
@@ -1,10 +1,12 @@
-concrete VerbFin of Verb = CatFin ** open ResFin in {
+concrete VerbFin of Verb = CatFin ** open Prelude, ResFin in {
flags optimize=all_subs ;
lin
UseV = predV ;
- ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
+
+ ComplV2 v np = insertObj (\\b,_ => appCompl True b v.c2 np) (predV v) ; ----
+{-
ComplV3 v np np2 =
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
@@ -32,6 +34,6 @@ concrete VerbFin of Verb = CatFin ** open ResFin in {
CompAP ap = ap ;
CompNP np = {s = \\_ => np.s ! Acc} ;
CompAdv a = {s = \\_ => a.s} ;
-
+-}
}