diff --git a/lib/src/english/NounEng.gf b/lib/src/english/NounEng.gf index 7477bcdb5..b4b5261a5 100644 --- a/lib/src/english/NounEng.gf +++ b/lib/src/english/NounEng.gf @@ -32,7 +32,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in { } ; ExtAdvNP np adv = { - s = \\c => np.s ! c ++ frontComma ++ adv.s ++ finalComma; + s = \\c => np.s ! c ++ embedInCommas adv.s ; a = np.a } ; diff --git a/lib/src/finnish/ConjunctionFin.gf b/lib/src/finnish/ConjunctionFin.gf index e887cc28e..ba95340ad 100644 --- a/lib/src/finnish/ConjunctionFin.gf +++ b/lib/src/finnish/ConjunctionFin.gf @@ -7,7 +7,7 @@ concrete ConjunctionFin of Conjunction = ConjS = conjunctDistrSS ; - ConjAdv = conjunctDistrSS ; + ConjAdv, ConjAdV = conjunctDistrSS ; ConjIAdv = conjunctDistrSS ; @@ -30,8 +30,8 @@ concrete ConjunctionFin of Conjunction = BaseS = twoSS ; ConsS = consrSS comma ; - BaseAdv = twoSS ; - ConsAdv = consrSS comma ; + BaseAdv, BaseAdV = twoSS ; + ConsAdv, ConsAdV = consrSS comma ; BaseIAdv = twoSS ; ConsIAdv = consrSS comma ; BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a ; isNeg = orB x.isNeg y.isNeg} ; @@ -45,7 +45,7 @@ concrete ConjunctionFin of Conjunction = lincat [S] = {s1,s2 : Str} ; - [Adv] = {s1,s2 : Str} ; + [Adv],[AdV] = {s1,s2 : Str} ; [IAdv] = {s1,s2 : Str} ; [NP] = {s1,s2 : NPForm => Str ; a : Agr ; isNeg : Bool} ; [AP] = {s1,s2 : Bool => NForm => Str} ; diff --git a/lib/src/finnish/ExtraFinAbs.gf b/lib/src/finnish/ExtraFinAbs.gf index a6f8b0c98..d6d3d94d8 100644 --- a/lib/src/finnish/ExtraFinAbs.gf +++ b/lib/src/finnish/ExtraFinAbs.gf @@ -1,5 +1,6 @@ --# -coding=latin1 abstract ExtraFinAbs = Extra [ + IP, IQuant,Num,CN,VPSlash, GenNP,GenIP,GenRP, PassVPSlash, PassAgentVPSlash, VPI,ListVPI,BaseVPI,ConsVPI,MkVPI,ComplVPIVV,ConjVPI, @@ -9,7 +10,7 @@ abstract ExtraFinAbs = Extra [ fun GenCN : NP -> CN -> CN ; -- auton merkki - AdvExistNP : Adv -> NP -> Cl ; -- kuvassa olemme me + AdvExistNP : Adv -> NP -> Cl ; -- kuvassa olemme me --- now obsolete because of Idiom.ExistNPAdv AdvPredNP : Adv -> V -> NP -> Cl ; -- kuvassa hymyilee Veikko ICompExistNP : IComp -> NP -> QCl ; -- missä/kuka on Veikko diff --git a/lib/src/finnish/IdiomFin.gf b/lib/src/finnish/IdiomFin.gf index 5c21b379a..9cac5d68e 100644 --- a/lib/src/finnish/IdiomFin.gf +++ b/lib/src/finnish/IdiomFin.gf @@ -55,7 +55,14 @@ concrete IdiomFin of Idiom = CatFin ** let vps = (sverb2verbSep vp.s).s ! ImperP1Pl in {s = vps ++ - vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.ext + vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.adv ! Pos ++ vp.ext + } ; + + ImpP3 np vp = + let vps = (sverb2verbSep vp.s).s ! ImperP3 (verbAgr np.a).n + in + {s = np.s ! vp.s.sc ++ vps ++ + vp.s2 ! True ! Pos ! np.a ++ vp.adv ! Pos ++ vp.ext } ; SelfAdvVP vp = insertAdv (\\_ => "itse") vp ; @@ -67,6 +74,19 @@ concrete IdiomFin of Idiom = CatFin ** isNeg = np.isNeg } ; + ExistNPAdv np adv = + mkClause (\_ -> adv.s) np.a (insertObj + (\\_,b,_ => np.s ! NPCase Nom) (predV vpVerbOlla)) ; + + ExistIPAdv ip adv = + let + c = case ip.n of {Sg => Nom ; Pl => Part} ; + cl = mkClause (\_ -> ip.s ! NPCase c ++ adv.s) (agrP3 Sg) -- kuka täällä on ; keitä täällä on + (predV vpVerbOlla) ; + in { + s = \\t,a,p => cl.s ! t ! a ! p ! SDecl + } ; + oper olla = vpVerbOlla ; diff --git a/lib/src/finnish/NounFin.gf b/lib/src/finnish/NounFin.gf index 44a7b2ef4..4d1453d70 100644 --- a/lib/src/finnish/NounFin.gf +++ b/lib/src/finnish/NounFin.gf @@ -61,7 +61,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in a = agrP3 Sg ; isPron = False ; isNeg = False } ; - UsePron p = p ** {isPron = True ; isNeg = False} ; + UsePron p = p ** {isPron = p.hasPoss ; isNeg = False} ; -- to block "se"; possessive suffix is the only use of isPron PredetNP pred np = { s = \\c => pred.s ! complNumAgr np.a ! c ++ np.s ! c ; @@ -84,6 +84,13 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in isNeg = np.isNeg } ; + ExtAdvNP np adv = { + s = \\c => np.s ! c ++ adv.s ; + a = np.a ; + isPron = np.isPron ; -- minun täällä - ni + isNeg = np.isNeg + } ; + DetQuantOrd quant num ord = { s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ; sp = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ; diff --git a/lib/src/finnish/ParadigmsFin.gf b/lib/src/finnish/ParadigmsFin.gf index 08bd32594..58eb0cf61 100644 --- a/lib/src/finnish/ParadigmsFin.gf +++ b/lib/src/finnish/ParadigmsFin.gf @@ -332,11 +332,11 @@ mkVS = overload { mkDet = overload { mkDet : Number -> N -> Det - = \nu,noun -> MorphoFin.mkDet nu (snoun2nounBind noun) ; + = \nu,noun -> lin Det (MorphoFin.mkDet nu (snoun2nounBind noun)) ; mkDet : (isNeg : Bool) -> Number -> N -> Det -- use this with True to create a negative determiner - = \isNeg,nu,noun -> MorphoFin.mkDetPol isNeg nu (snoun2nounBind noun) ; + = \isNeg,nu,noun -> lin Det (MorphoFin.mkDetPol isNeg nu (snoun2nounBind noun)) ; mkDet : (isNeg : Bool) -> Number -> N -> Case -> Det -- paljon + False + partitive, ei yhtään + True + partitive - = \isNeg,nu,noun,_ -> MorphoFin.mkDetPol isNeg nu (snoun2nounBind noun) ; + = \isNeg,nu,noun,_ -> lin Det (MorphoFin.mkDetPol isNeg nu (snoun2nounBind noun)) ; } ; mkInterj : Str -> Interj @@ -403,8 +403,8 @@ mkVS = overload { : Str) -> N = mk10N ; mkN : (sora : Str) -> (tie : N) -> N = mkStrN ; mkN : (oma,tunto : N) -> N = mkNN ; - mkN : (sana : NK) -> N = \w -> nforms2snoun w.s ; - mkN : V -> N = \w -> sverb2snoun w ; + mkN : (sana : NK) -> N = \w -> lin N (nforms2snoun w.s) ; + mkN : V -> N = \w -> lin N (sverb2snoun w) ; } ; exceptNomN : N -> Str -> N = \noun,nom -> lin N (exceptNomSNoun noun nom) ; @@ -413,10 +413,10 @@ mkVS = overload { ---- mkNA : N -> A = snoun2sadj ; mk1N : (talo : Str) -> N = \s -> lin N (nforms2snoun (nForms1 s)) ; - mk2N : (talo,talon : Str) -> N = \s,t -> nforms2snoun (nForms2 s t) ; - mk3N : (talo,talon,taloja : Str) -> N = \s,t,u -> nforms2snoun (nForms3 s t u) ; + mk2N : (talo,talon : Str) -> N = \s,t -> lin N (nforms2snoun (nForms2 s t)) ; + mk3N : (talo,talon,taloja : Str) -> N = \s,t,u -> lin N (nforms2snoun (nForms3 s t u)) ; mk4N : (talo,talon,taloa,taloja : Str) -> N = \s,t,u,v -> - nforms2snoun (nForms4 s t u v) ; + lin N (nforms2snoun (nForms4 s t u v)) ; mk10N : (talo,talon,taloa,talona,taloon,talojen,taloja,taloina,taloissa,taloihin : Str) -> N = \a,b,c,d,e,f,g,h,i,j -> diff --git a/lib/src/finnish/StructuralFin.gf b/lib/src/finnish/StructuralFin.gf index 7c9f04ed1..9c693997f 100644 --- a/lib/src/finnish/StructuralFin.gf +++ b/lib/src/finnish/StructuralFin.gf @@ -33,7 +33,7 @@ concrete StructuralFin of Structural = CatFin ** can_VV = mkVV (mkV "voida" "voi") ; during_Prep = postGenPrep "aikana" ; either7or_DConj = sd2 "joko" "tai" ** {n = Sg} ; - everybody_NP = makeNP (snoun2nounBind (mkN "jokainen")) Sg ; + everybody_NP = lin NP (makeNP (lin N (snoun2nounBind (mkN "jokainen"))) Sg) ; every_Det = MorphoFin.mkDet Sg (snoun2nounBind (mkN "jokainen")) ; everything_NP = makeNP (((snoun2nounBind (mkN "kaikki" "kaiken" "kaikkena"))) ** {lock_N = <>}) Sg ; diff --git a/lib/src/finnish/VerbFin.gf b/lib/src/finnish/VerbFin.gf index 5aaf8f698..364d7963f 100644 --- a/lib/src/finnish/VerbFin.gf +++ b/lib/src/finnish/VerbFin.gf @@ -82,6 +82,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in { SlashV2VNP = StemFin.slashV2VNP ; ---- compilation to pgf takes too long 6/8/2013 hence a simplified version in stemmed/ AdvVP vp adv = insertAdv (\\_ => adv.s) vp ; + ExtAdvVP vp adv = insertAdv (\\_ => embedInCommas adv.s) vp ; AdVVP adv vp = insertAdv (\\_ => adv.s) vp ; diff --git a/lib/src/finnish/stemmed/ParseFin.gf b/lib/src/finnish/stemmed/ParseFin.gf index 14ec83a6d..3429c0956 100644 --- a/lib/src/finnish/stemmed/ParseFin.gf +++ b/lib/src/finnish/stemmed/ParseFin.gf @@ -94,7 +94,8 @@ lin } ; SlashV2V v ant p vp = - insertObj (\\_,b,a => infVPGen p.p v.sc b a vp v.vi) (predSV v) ** {c2 = v.c2} ; + insertObj (\\_,b,a => infVP v.sc b a vp v.vi) (predSV v) ** {c2 = v.c2} ; ---- + ---- insertObj (\\_,b,a => infVPGen p.p v.sc b a vp v.vi) (predSV v) ** {c2 = v.c2} ; CompS s = {s = \\_ => "että" ++ s.s} ; -- S -> Comp ---- what are these expected to do ? 29/3/2013 CompVP ant pol vp = {s = \\a => infVPGen pol.p vp.s.sc Pos a vp Inf1} ; -- VP -> Comp diff --git a/lib/src/prelude/Prelude.gf b/lib/src/prelude/Prelude.gf index 893fd340a..2d8e41199 100644 --- a/lib/src/prelude/Prelude.gf +++ b/lib/src/prelude/Prelude.gf @@ -113,6 +113,11 @@ oper PARA : Str = "&-" ; CAPIT : Str = "&|" ; +-- Embed between commas, where the latter one disappears in front of other punctuation + + embedInCommas : Str -> Str = \s -> SOFT_BIND ++ "," ++ s ++ endComma ; + endComma : Str = pre {"," | "." => []; "" => SOFT_BIND ++ ","; _ => []} ; + --2 Miscellaneous -- Identity function