1
0
forked from GitHub/gf-core

bug fixes in Finnish

This commit is contained in:
aarne
2008-11-05 19:28:14 +00:00
parent 5f78c8fa67
commit bd6fb074aa
6 changed files with 74 additions and 33 deletions

View File

@@ -53,6 +53,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
Det = { Det = {
s1 : Case => Str ; -- minun kolme s1 : Case => Str ; -- minun kolme
s2 : Str ; -- -ni s2 : Str ; -- -ni
sp : Case => Str ; -- se (substantival form)
n : Number ; -- Pl (agreement feature for verb) n : Number ; -- Pl (agreement feature for verb)
isNum : Bool ; -- True (a numeral is present) isNum : Bool ; -- True (a numeral is present)
isPoss : Bool ; -- True (a possessive suffix 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} ; ---- QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
Ord = {s : NForm => Str} ; Ord = {s : NForm => Str} ;
Predet = {s : Number => NPForm => 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} ; Card = {s : Number => Case => Str ; n : Number} ;
Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ; Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ;

View File

@@ -5,7 +5,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
lin lin
GenNP np = { GenNP np = {
s1 = \\_,_ => np.s ! NPCase Gen ; s1,sp = \\_,_ => np.s ! NPCase Gen ;
s2 = [] ; s2 = [] ;
isNum = False ; isNum = False ;
isPoss = False ; isPoss = False ;

View File

@@ -828,13 +828,13 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
\\c => cn.s ! NCase n c ; \\c => cn.s ! NCase n c ;
mkDet : Number -> CommonNoun -> { mkDet : Number -> CommonNoun -> {
s1 : Case => Str ; -- minun kolme s1,sp : Case => Str ; -- minun kolme
s2 : Str ; -- -ni s2 : Str ; -- -ni
n : Number ; -- Pl (agreement feature for verb) n : Number ; -- Pl (agreement feature for verb)
isNum : Bool ; -- True (a numeral is present) isNum : Bool ; -- True (a numeral is present)
isPoss : Bool ; -- True (a possessive suffix is present) isPoss : Bool ; -- True (a possessive suffix is present)
isDef : Bool -- True (verb agrees in Pl, Nom is not Part) isDef : Bool -- True (verb agrees in Pl, Nom is not Part)
} = \n, noun -> { } = \n, noun -> heavyDet {
s1 = \\c => noun.s ! NCase n c ; s1 = \\c => noun.s ! NCase n c ;
s2 = [] ; s2 = [] ;
n = n ; n = n ;
@@ -902,4 +902,39 @@ oper
ProperName = {s : Case => Str} ; 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ä"
} ;
} ;
} }

View File

@@ -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 ; flags optimize=all_subs ;
@@ -43,7 +43,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
} ; } ;
in { in {
s = \\c => let k = npform2case n c 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 { a = agrP3 (case det.isDef of {
False => Sg ; -- autoja menee; kolme autoa menee False => Sg ; -- autoja menee; kolme autoa menee
_ => det.n _ => det.n
@@ -78,24 +78,26 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
DetQuantOrd quant num ord = { DetQuantOrd quant num ord = {
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase Pl c ; 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 ; s2 = quant.s2 ;
n = num.n ; n = num.n ;
isNum = num.isNum ; isNum = num.isNum ;
isPoss = quant.isPoss ; isPoss = quant.isPoss ;
isDef = True isDef = quant.isDef
} ; } ;
DetQuant quant num = { DetQuant quant num = {
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ; 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 ; s2 = quant.s2 ;
n = num.n ; n = num.n ;
isNum = case num.n of {Sg => False ; _ => True} ; isNum = case num.n of {Sg => False ; _ => True} ;
isPoss = quant.isPoss ; isPoss = quant.isPoss ;
isDef = True isDef = quant.isDef
} ; } ;
PossPron p = { PossPron p = {
s1 = \\_,_ => p.s ! NPCase Gen ; s1,sp = \\_,_ => p.s ! NPCase Gen ;
s2 = BIND ++ possSuffix p.a ; s2 = BIND ++ possSuffix p.a ;
isNum = False ; isNum = False ;
isPoss = True ; isPoss = True ;
@@ -128,6 +130,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
DefArt = { DefArt = {
s1 = \\_,_ => [] ; s1 = \\_,_ => [] ;
sp = table {Sg => pronSe.s ; Pl => pronNe.s} ;
s2 = [] ; s2 = [] ;
isNum,isPoss = False ; isNum,isPoss = False ;
isDef = True -- autot ovat isDef = True -- autot ovat
@@ -135,6 +138,9 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
IndefArt = { IndefArt = {
s1 = \\_,_ => [] ; -- Nom is Part in Pl: use isDef in DetCN 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 = [] ; s2 = [] ;
isNum,isPoss,isDef = False -- autoja on isNum,isPoss,isDef = False -- autoja on
} ; } ;
@@ -201,4 +207,5 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
_ => Sg --- _ => Sg ---
} ; } ;
} }

View File

@@ -586,4 +586,20 @@ oper
} ; } ;
etta_Conj : Str = "että" ; 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} ;
} }

View File

@@ -80,12 +80,12 @@ concrete StructuralFin of Structural = CatFin **
a = agrP3 Sg ; a = agrP3 Sg ;
isPron = False isPron = False
} ; } ;
someSg_Det = { someSg_Det = heavyDet {
s1 = jokuPron ! Sg ; s1 = jokuPron ! Sg ;
s2 = [] ; s2 = [] ;
isNum,isPoss = False ; isDef = True ; n = Sg isNum,isPoss = False ; isDef = True ; n = Sg
} ; } ;
somePl_Det = { somePl_Det = heavyDet {
s1 = jokuPron ! Pl ; s1 = jokuPron ! Pl ;
s2 = [] ; isNum,isPoss = False ; isDef = True ; s2 = [] ; isNum,isPoss = False ; isDef = True ;
n = Pl n = Pl
@@ -96,7 +96,7 @@ concrete StructuralFin of Structural = CatFin **
isPron = False isPron = False
} ; } ;
somewhere_Adv = ss "jossain" ; somewhere_Adv = ss "jossain" ;
that_Quant = { that_Quant = heavyQuant {
s1 = table (MorphoFin.Number) { s1 = table (MorphoFin.Number) {
Sg => table (MorphoFin.Case) { Sg => table (MorphoFin.Case) {
c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c c => (mkPronoun "tuo" "tuon" "tuota" "tuona" "tuohon" Sg P3).s ! NPCase c
@@ -112,7 +112,7 @@ concrete StructuralFin of Structural = CatFin **
there7from_Adv = ss "sieltä" ; there7from_Adv = ss "sieltä" ;
therefore_PConj = ss "siksi" ; therefore_PConj = ss "siksi" ;
they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne they_Pron = mkPronoun "he" "heidän" "heitä" "heinä" "heihin" Pl P3 ; --- ne
this_Quant = { this_Quant = heavyQuant {
s1 = table (MorphoFin.Number) { s1 = table (MorphoFin.Number) {
Sg => table (MorphoFin.Case) { Sg => table (MorphoFin.Case) {
c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c c => (mkPronoun "tämä" "tämän" "tätä" "tänä" "tähän" Sg P3).s ! NPCase c
@@ -164,14 +164,13 @@ concrete StructuralFin of Structural = CatFin **
oper oper
jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str = jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str =
let let
ku = mkN "ku" ;
kui = mkN "kuu" kui = mkN "kuu"
in in
table { table {
Sg => table { Sg => table {
Nom => "joku" ; Nom => "joku" ;
Gen => "jonkun" ; 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 { Pl => table {
Nom => "jotkut" ; 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 oper
makeNP : N -> MorphoFin.Number -> CatFin.NP ; makeNP : N -> MorphoFin.Number -> CatFin.NP ;
@@ -299,7 +281,7 @@ lin
nobody_but_Predet = nobody_but_Predet =
{s = \\n,c => "ei" ++ kukaanPron ! n ! npform2case n c ++ "paitsi"} ; {s = \\n,c => "ei" ++ kukaanPron ! n ! npform2case n c ++ "paitsi"} ;
no_Quant = { no_Quant = heavyQuant {
s1 = \\n,c => "ei" ++ mikaanPron ! n ! c ; s1 = \\n,c => "ei" ++ mikaanPron ! n ! c ;
s2 = [] ; isNum,isPoss = False ; isDef = True ; s2 = [] ; isNum,isPoss = False ; isDef = True ;
} ; } ;