1
0
forked from GitHub/gf-core

at last, proper possessive suffixes in Finnish Prep. This needs a parameter and vowel harmony: "opettajan mukaan" (according to the teacher), "meidän mukaamme" (according to us), "hänen jälkeensä" (after her).

This commit is contained in:
aarne
2013-12-10 20:35:52 +00:00
parent 3aadf5325b
commit 19d2e41781
9 changed files with 57 additions and 33 deletions

View File

@@ -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 ;

View File

@@ -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 ;

View File

@@ -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
} ;

View File

@@ -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" ;
_ => "ä"

View File

@@ -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 : {}} ;

View File

@@ -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 <isFin, b, co.c, np.isPron> of {
<_, Neg, NPAcc,_> => NPCase Part ; -- en näe taloa/sinua
<_, Pos, NPAcc,True> => NPAcc ; -- näen/täytyy sinut
<False,Pos, NPAcc,False> => 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ö"} ;

View File

@@ -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} ;

View File

@@ -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 ??

View File

@@ -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} ;