diff --git a/lib/src/finnish/AdverbFin.gf b/lib/src/finnish/AdverbFin.gf index 7b5a1ec9d..fdde5155e 100644 --- a/lib/src/finnish/AdverbFin.gf +++ b/lib/src/finnish/AdverbFin.gf @@ -10,7 +10,7 @@ concrete AdverbFin of Adverb = CatFin ** open ResFin, Prelude, StemFin in { s = cadv.s ++ a.s ! Posit ! sAAdv ++ cadv.p ++ s.s } ; - PrepNP prep np = {s = preOrPost prep.isPre prep.s (np.s ! prep.c)} ; + PrepNP prep np = {s = appCompl True Pos prep np} ; AdAdv = cc2 ; diff --git a/lib/src/finnish/CatFin.gf b/lib/src/finnish/CatFin.gf index 9778ed3d9..0946be746 100644 --- a/lib/src/finnish/CatFin.gf +++ b/lib/src/finnish/CatFin.gf @@ -98,17 +98,17 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in { PN = SPN ; linref - SSlash = \ss -> ss.s ++ ss.c2.s ; - ClSlash = \cls -> cls.s ! Pres ! Simul ! Pos ++ cls.c2.s ; + SSlash = \ss -> ss.s ++ ss.c2.s ! False ; + ClSlash = \cls -> cls.s ! Pres ! Simul ! Pos ++ cls.c2.s ! False ; VP = vpRef ; - VPSlash = \vps -> vpRef vps ++ vps.c2.s ; + VPSlash = \vps -> vpRef vps ++ vps.c2.s ! False ; V, VS, VQ, VA = \v -> vpRef (predV v) ; - V2, V2A, V2Q, V2S = \v -> vpRef (predV v) ++ v.c2.s ; - V3 = \v -> vpRef (predV v) ++ v.c2.s ++ v.c3.s ; + V2, V2A, V2Q, V2S = \v -> vpRef (predV v) ++ v.c2.s ! False ; + V3 = \v -> vpRef (predV v) ++ v.c2.s ! False ++ v.c3.s ! False ; VV = \v -> vpRef (predV v) ; - V2V = \v -> vpRef (predV v) ++ v.c2.s ; + V2V = \v -> vpRef (predV v) ++ v.c2.s ! False ; Conj = \c -> c.s1 ++ c.s2 ; diff --git a/lib/src/finnish/ExtraFin.gf b/lib/src/finnish/ExtraFin.gf index 9d526ce00..7081cc05d 100644 --- a/lib/src/finnish/ExtraFin.gf +++ b/lib/src/finnish/ExtraFin.gf @@ -7,9 +7,13 @@ concrete ExtraFin of ExtraFinAbs = CatFin ** lin GenNP np = { s1,sp = \\_,_ => np.s ! NPCase Gen ; - s2 = \\_ => [] ; + s2 = case np.isPron of { -- "isän auto", "hänen autonsa" + True => table {Front => BIND ++ possSuffixFront np.a ; + Back => BIND ++ possSuffix np.a } ; + False => \\_ => [] + } ; isNum = False ; - isPoss = False ; + isPoss = np.isPron ; --- also gives "sen autonsa" isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing isNeg = False } ; diff --git a/lib/src/finnish/MorphoFin.gf b/lib/src/finnish/MorphoFin.gf index b33567f8c..7f39e3ebf 100644 --- a/lib/src/finnish/MorphoFin.gf +++ b/lib/src/finnish/MorphoFin.gf @@ -888,6 +888,11 @@ resource MorphoFin = ResFin ** open Prelude in { ase => ase } ; + guessHarmony : Str -> Harmony = \s -> case s of { + _ + ("a" | "o" | "u" | "A" | "O" | "U") + _ => Back ; + _ => Front + } ; + vowHarmony : Str -> Str = \s -> case s of { _ + ("a" | "o" | "u" | "A" | "O" | "U") + _ => "a" ; _ => "ä" diff --git a/lib/src/finnish/ParadigmsFin.gf b/lib/src/finnish/ParadigmsFin.gf index 99769b884..08bd32594 100644 --- a/lib/src/finnish/ParadigmsFin.gf +++ b/lib/src/finnish/ParadigmsFin.gf @@ -85,7 +85,7 @@ oper } ; accusative : Prep - = {c = NPAcc ; s = [] ; isPre = True ; lock_Prep = <>} ; + = {c = NPAcc ; s : Bool => Str = \\_ => [] ; isPre = True ; h = Back ; lock_Prep = <>} ; NK : Type ; -- Noun from DictFin (Kotus) AK : Type ; -- Adjective from DictFin (Kotus) @@ -367,14 +367,21 @@ mkVS = overload { infFirst = Inf1 ; infElat = Inf3Elat ; infIllat = Inf3Illat ; infIness = Inf3Iness ; infPresPart = InfPresPart ; infPresPartAgr = InfPresPartAgr ; prePrep : Case -> Str -> Prep = - \c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ; + \c,p -> lin Prep {c = NPCase c ; s = \\_ => p ; isPre = True ; h = Back} ; --- no possessive suffix + 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 = <>} ; + \c,p -> let h = guessHarmony p in case p of { + mukaa + "n" => lin Prep {c = NPCase c ; s = table {False => p ; True => mukaa} ; isPre = False ; h = h} ; + _ => lin Prep {c = NPCase c ; s : Bool => Str = \\_ => p ; isPre = False ; h = h} + } ; + + postGenPrep = postPrep genitive ; + casePrep : Case -> Prep = - \c -> {c = NPCase c ; s = [] ; isPre = True ; lock_Prep = <>} ; - accPrep = {c = NPAcc ; s = [] ; isPre = True ; lock_Prep = <>} ; + \c -> lin Prep {c = NPCase c ; s : Bool => Str = \\_ => [] ; isPre = True ; h = Back} ; + + accPrep = + lin Prep {c = NPAcc ; s : Bool => Str = \\_ => [] ; isPre = True ; h = Back} ; NK = {s : NForms ; lock_NK : {}} ; AK = {s : NForms ; lock_AK : {}} ; diff --git a/lib/src/finnish/ResFin.gf b/lib/src/finnish/ResFin.gf index 8253d8915..026ba8721 100644 --- a/lib/src/finnish/ResFin.gf +++ b/lib/src/finnish/ResFin.gf @@ -166,7 +166,12 @@ param --- - Compl : Type = {s : Str ; c : NPForm ; isPre : Bool} ; + Compl : Type = { + s : Bool => Str ; -- perää(n) + c : NPForm ; -- NP Gen + isPre : Bool ; -- False postposition + h : Harmony -- hänen peräänsä + } ; appCompl : Bool -> Polarity -> Compl -> NP -> Str = \isFin,b,co,np -> let @@ -183,17 +188,19 @@ param } ; _ => co.c } ; -{- - c = case of { - <_, Neg, NPAcc,_> => NPCase Part ; -- en näe taloa/sinua - <_, Pos, NPAcc,True> => NPAcc ; -- näen/täytyy sinut - => NPCase Nom ; -- täytyy nähdä talo - <_,_,coc,_> => coc - } ; --} - nps = np.s ! c + nps = np.s ! c ; + cos = case c of { + NPCase Gen => case np.isPron of { + True => co.s ! True ++ BIND ++ case co.h of { + Back => possSuffix np.a ; + Front => possSuffixFront np.a + } ; + False => co.s ! False + } ; + _ => co.s ! False + } ; in - preOrPost co.isPre co.s nps ; + preOrPost co.isPre cos nps ; -- For $Verb$. @@ -261,7 +268,7 @@ oper -- This is used for subjects of passives: therefore isFin in False. subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b -> - appCompl False b {s = [] ; c = sc ; isPre = True} np ; + appCompl False b {s = \\_ => [] ; c = sc ; isPre = True ; h = Back} np ; questPart : Harmony -> Str = \b -> case b of {Back => "ko" ; _ => "kö"} ; diff --git a/lib/src/finnish/StemFin.gf b/lib/src/finnish/StemFin.gf index 0bdeb2a76..7ebf9ee72 100644 --- a/lib/src/finnish/StemFin.gf +++ b/lib/src/finnish/StemFin.gf @@ -317,7 +317,7 @@ oper passVP : VP -> Compl -> VP = \vp,pr -> { s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = pr.c} ; -- minusta pidetään ---- TODO minun katsotaan päälle - s2 = \\b,p,a => pr.s ++ vp.s2 ! b ! p ! a ; ---- prep after verb + s2 = \\b,p,a => pr.s ! False ++ vp.s2 ! b ! p ! a ; ---- prep after verb ext = vp.ext ; adv = vp.adv ; vptyp = {isNeg = vp.vptyp.isNeg ; isPass = True} ; diff --git a/lib/src/finnish/stemmed/ParseFin.gf b/lib/src/finnish/stemmed/ParseFin.gf index a788fee07..14ec83a6d 100644 --- a/lib/src/finnish/stemmed/ParseFin.gf +++ b/lib/src/finnish/stemmed/ParseFin.gf @@ -123,7 +123,8 @@ lin insertObj (\\_,b,a => vpi.s ! v.vi) (predSV v) ** {c2 = v.c2} ; VPSlashVS v vp = -- : VS -> VP -> VPSlash ; -- hän sanoo (minun) menevän (!) ---- menneen ? - insertObj (\\_,b,a => infVP v.sc b a vp InfPresPart) (predSV v) ** {c2 = {c = NPCase Gen ; s = [] ; isPre = True}} ; + insertObj (\\_,b,a => infVP v.sc b a vp InfPresPart) (predSV v) ** + {c2 = {c = NPCase Gen ; s = \\_ => [] ; h = Back ; isPre = True}} ; -- SlashSlashV2V v ant pol vps = -- : V2V -> Ant -> Pol -> VPSlash -> VPSlash ; --- not implemented in Eng so far -- insertObj (\\_,b,a => infVPGen pol.p v.sc b a vps v.vi) (predSV v) ** {c2 = v.c2} ; --- or vps.c2 ?? diff --git a/lib/src/finnish/stemmed/StemFin.gf b/lib/src/finnish/stemmed/StemFin.gf index 8087fbb2a..93633ab6c 100644 --- a/lib/src/finnish/stemmed/StemFin.gf +++ b/lib/src/finnish/stemmed/StemFin.gf @@ -510,7 +510,7 @@ oper (VP ** {c2 : Compl}) -> (VP ** {c2 : Compl}) = \v, np, vp -> { s = v ; - s2 = \\fin,b,a => np.s ! v.c2.c ++ vp.c2.s ++ v.s ! SVInf ; + s2 = \\fin,b,a => np.s ! v.c2.c ++ vp.c2.s ! False ++ v.s ! SVInf ; ---- infVP v.sc b a vp v.vi ; -- ignoring Acc variation and pre/postposition and proper inf form ext = [] ; @@ -666,8 +666,8 @@ oper } ; passVP : VP -> Compl -> VP = \vp,pr -> { - s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = pr.c} ; -- minusta pidetään ---- TODO minun katsotaan päälle - s2 = \\b,p,a => pr.s ++ vp.s2 ! b ! p ! a ; ---- prep after verb + s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = pr.c} ; -- minusta pidetään + s2 = \\b,p,a => pr.s ! False ++ vp.s2 ! b ! p ! a ; ---- prep after verb ---- TODO minun päälleni katsotaan ext = vp.ext ; adv = vp.adv ; vptyp = {isNeg = vp.vptyp.isNeg ; isPass = True} ;