From bd6fb074aa928e95a4b6a12a0e1b270b3d14cbc6 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 5 Nov 2008 19:28:14 +0000 Subject: [PATCH] bug fixes in Finnish --- next-lib/src/finnish/CatFin.gf | 3 ++- next-lib/src/finnish/ExtraFin.gf | 2 +- next-lib/src/finnish/MorphoFin.gf | 39 +++++++++++++++++++++++++-- next-lib/src/finnish/NounFin.gf | 17 ++++++++---- next-lib/src/finnish/ResFin.gf | 16 +++++++++++ next-lib/src/finnish/StructuralFin.gf | 30 +++++---------------- 6 files changed, 74 insertions(+), 33 deletions(-) diff --git a/next-lib/src/finnish/CatFin.gf b/next-lib/src/finnish/CatFin.gf index f0ca5784a..3af7ad0b6 100644 --- a/next-lib/src/finnish/CatFin.gf +++ b/next-lib/src/finnish/CatFin.gf @@ -53,6 +53,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in { Det = { s1 : Case => Str ; -- minun kolme s2 : Str ; -- -ni + sp : Case => Str ; -- se (substantival form) n : Number ; -- Pl (agreement feature for verb) isNum : Bool ; -- True (a numeral is present) isPoss : Bool ; -- True (a possessive suffix is present) @@ -61,7 +62,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in { ---- QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss, isDef : Bool} ; Ord = {s : NForm => Str} ; Predet = {s : Number => NPForm => Str} ; - Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss : Bool ; isDef : Bool} ; + Quant = {s1,sp : Number => Case => Str ; s2 : Str ; isPoss : Bool ; isDef : Bool} ; Card = {s : Number => Case => Str ; n : Number} ; Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ; diff --git a/next-lib/src/finnish/ExtraFin.gf b/next-lib/src/finnish/ExtraFin.gf index 5af232ef0..2cb86d506 100644 --- a/next-lib/src/finnish/ExtraFin.gf +++ b/next-lib/src/finnish/ExtraFin.gf @@ -5,7 +5,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin ** lin GenNP np = { - s1 = \\_,_ => np.s ! NPCase Gen ; + s1,sp = \\_,_ => np.s ! NPCase Gen ; s2 = [] ; isNum = False ; isPoss = False ; diff --git a/next-lib/src/finnish/MorphoFin.gf b/next-lib/src/finnish/MorphoFin.gf index 3c274a3de..56eb7863a 100644 --- a/next-lib/src/finnish/MorphoFin.gf +++ b/next-lib/src/finnish/MorphoFin.gf @@ -828,13 +828,13 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn -> \\c => cn.s ! NCase n c ; mkDet : Number -> CommonNoun -> { - s1 : Case => Str ; -- minun kolme + s1,sp : Case => Str ; -- minun kolme s2 : Str ; -- -ni n : Number ; -- Pl (agreement feature for verb) isNum : Bool ; -- True (a numeral is present) isPoss : Bool ; -- True (a possessive suffix is present) isDef : Bool -- True (verb agrees in Pl, Nom is not Part) - } = \n, noun -> { + } = \n, noun -> heavyDet { s1 = \\c => noun.s ! NCase n c ; s2 = [] ; n = n ; @@ -902,4 +902,39 @@ oper ProperName = {s : Case => Str} ; + pronSe : ProperName = { + s = table { + Nom => "se" ; + Gen => "sen" ; + Part => "sitä" ; + Transl => "siksi" ; + Ess => "sinä" ; + Iness => "siinä" ; + Elat => "siitä" ; + Illat => "siihen" ; + Adess => "sillä" ; + Ablat => "siltä" ; + Allat => "sille" ; + Abess => "sittä" + } ; + } ; + + pronNe : ProperName = { + s = table { + Nom => "ne" ; + Gen => "niiden" ; + Part => "niitä" ; + Transl => "niiksi" ; + Ess => "niinä" ; + Iness => "niissä" ; + Elat => "niitä" ; + Illat => "niihin" ; + Adess => "niillä" ; + Ablat => "niiltä" ; + Allat => "niille" ; + Abess => "niittä" + } ; + } ; + + } diff --git a/next-lib/src/finnish/NounFin.gf b/next-lib/src/finnish/NounFin.gf index 3d0d79bcf..6923fe45f 100644 --- a/next-lib/src/finnish/NounFin.gf +++ b/next-lib/src/finnish/NounFin.gf @@ -1,4 +1,4 @@ -concrete NounFin of Noun = CatFin ** open ResFin, Prelude in { +concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, Prelude in { flags optimize=all_subs ; @@ -43,7 +43,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in { } ; in { s = \\c => let k = npform2case n c in - det.s1 ! k ; -- det.s2 is possessive suffix + det.sp ! k ; -- det.s2 is possessive suffix a = agrP3 (case det.isDef of { False => Sg ; -- autoja menee; kolme autoa menee _ => det.n @@ -78,24 +78,26 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in { DetQuantOrd quant num ord = { s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase Pl c ; + sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase Pl c ; s2 = quant.s2 ; n = num.n ; isNum = num.isNum ; isPoss = quant.isPoss ; - isDef = True + isDef = quant.isDef } ; DetQuant quant num = { s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ; + sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ; s2 = quant.s2 ; n = num.n ; isNum = case num.n of {Sg => False ; _ => True} ; isPoss = quant.isPoss ; - isDef = True + isDef = quant.isDef } ; PossPron p = { - s1 = \\_,_ => p.s ! NPCase Gen ; + s1,sp = \\_,_ => p.s ! NPCase Gen ; s2 = BIND ++ possSuffix p.a ; isNum = False ; isPoss = True ; @@ -128,6 +130,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in { DefArt = { s1 = \\_,_ => [] ; + sp = table {Sg => pronSe.s ; Pl => pronNe.s} ; s2 = [] ; isNum,isPoss = False ; isDef = True -- autot ovat @@ -135,6 +138,9 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in { IndefArt = { s1 = \\_,_ => [] ; -- Nom is Part in Pl: use isDef in DetCN + sp = \\n,c => + (nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi" + "yksien" "yksiä" "yksiin")).s ! NCase n c ; s2 = [] ; isNum,isPoss,isDef = False -- autoja on } ; @@ -201,4 +207,5 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in { _ => Sg --- } ; + } diff --git a/next-lib/src/finnish/ResFin.gf b/next-lib/src/finnish/ResFin.gf index 5fc68384d..e26c96b26 100644 --- a/next-lib/src/finnish/ResFin.gf +++ b/next-lib/src/finnish/ResFin.gf @@ -586,4 +586,20 @@ oper } ; etta_Conj : Str = "että" ; + + heavyDet : PDet -> PDet ** {sp : Case => Str} = \d -> d ** {sp = d.s1} ; + PDet : Type = { + s1 : Case => Str ; + s2 : Str ; + n : Number ; + isNum : Bool ; + isPoss : Bool ; + isDef : Bool + } ; + + heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d -> + d ** {sp = d.s1} ; + PQuant : Type = + {s1 : Number => Case => Str ; s2 : Str ; isPoss : Bool ; isDef : Bool} ; + } diff --git a/next-lib/src/finnish/StructuralFin.gf b/next-lib/src/finnish/StructuralFin.gf index a5fae7bfe..f013ad665 100644 --- a/next-lib/src/finnish/StructuralFin.gf +++ b/next-lib/src/finnish/StructuralFin.gf @@ -80,12 +80,12 @@ concrete StructuralFin of Structural = CatFin ** a = agrP3 Sg ; isPron = False } ; - someSg_Det = { + someSg_Det = heavyDet { s1 = jokuPron ! Sg ; s2 = [] ; isNum,isPoss = False ; isDef = True ; n = Sg } ; - somePl_Det = { + somePl_Det = heavyDet { s1 = jokuPron ! Pl ; s2 = [] ; isNum,isPoss = False ; isDef = True ; n = Pl @@ -96,7 +96,7 @@ concrete StructuralFin of Structural = CatFin ** isPron = False } ; somewhere_Adv = ss "jossain" ; - that_Quant = { + that_Quant = heavyQuant { s1 = table (MorphoFin.Number) { Sg => table (MorphoFin.Case) { c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c @@ -112,7 +112,7 @@ concrete StructuralFin of Structural = CatFin ** there7from_Adv = ss "sieltä" ; therefore_PConj = ss "siksi" ; they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne - this_Quant = { + this_Quant = heavyQuant { s1 = table (MorphoFin.Number) { Sg => table (MorphoFin.Case) { c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c @@ -164,14 +164,13 @@ concrete StructuralFin of Structural = CatFin ** oper jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str = let - ku = mkN "ku" ; kui = mkN "kuu" in table { Sg => table { Nom => "joku" ; Gen => "jonkun" ; - c => relPron ! Sg ! c + ku.s ! NCase Sg c + c => relPron ! Sg ! c + "ku" + Predef.drop 3 (kui.s ! NCase Sg c) } ; Pl => table { Nom => "jotkut" ; @@ -265,23 +264,6 @@ oper } } ; - pronSe : ProperName = { - s = table { - Nom => "se" ; - Gen => "sen" ; - Part => "sitä" ; - Transl => "siksi" ; - Ess => "sinä" ; - Iness => "siinä" ; - Elat => "siitä" ; - Illat => "siihen" ; - Adess => "sillä" ; - Ablat => "siltä" ; - Allat => "sille" ; - Abess => "sittä" - } ; - } ; - oper makeNP : N -> MorphoFin.Number -> CatFin.NP ; @@ -299,7 +281,7 @@ lin nobody_but_Predet = {s = \\n,c => "ei" ++ kukaanPron ! n ! npform2case n c ++ "paitsi"} ; - no_Quant = { + no_Quant = heavyQuant { s1 = \\n,c => "ei" ++ mikaanPron ! n ! c ; s2 = [] ; isNum,isPoss = False ; isDef = True ; } ;