From cef3e428c2fb419eb90cd31c6fbf68987910e51f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 6 Apr 2020 17:41:48 +0200 Subject: [PATCH] (Kor) Make Prep's s field dependent on Phono parameter of NP --- src/korean/AdverbKor.gf | 4 ++-- src/korean/ParadigmsKor.gf | 5 ++++- src/korean/ResKor.gf | 10 +++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/korean/AdverbKor.gf b/src/korean/AdverbKor.gf index 01fb1ec68..126cb3d81 100644 --- a/src/korean/AdverbKor.gf +++ b/src/korean/AdverbKor.gf @@ -13,8 +13,8 @@ lin -- : Prep -> NP -> Adv ; PrepNP prep np = { s = case prep.attaches of { - True => glue (np.s ! Bare) prep.s ; - False => np.s ! Bare ++ prep.s } + True => glue (np.s ! Bare) (prep.s ! np.p) ; + False => np.s ! Bare ++ (prep.s ! np.p)} } ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/korean/ParadigmsKor.gf b/src/korean/ParadigmsKor.gf index 012970ef9..6eeb4de8b 100644 --- a/src/korean/ParadigmsKor.gf +++ b/src/korean/ParadigmsKor.gf @@ -77,7 +77,8 @@ oper --2 Structural categories mkPrep : overload { - mkPrep : (e : Str) -> Prep ; -- Particle like 에, attaches to the NP. + mkPrep : (e : Str) -> Prep ; -- Particle/postposition like 에: same form after vowel and consonant, attaches to the NP. Despite the name Prep, these are always postpositions. + mkPrep : (ro,euro : Str) -> Prep ; -- Particle like 로/으로: first argument is the form after vowel, second argument after consonant. Attaches to the NP. mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep ; -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP. } ; @@ -160,6 +161,8 @@ oper mkPrep = overload { mkPrep : (e : Str) -> Prep -- Particle like 에, attaches to the NP. = \e -> lin Prep (ResKor.mkPrep e) ; + mkPrep : (ro,euro : Str) -> Prep + = \ro,euro -> lin Prep (ResKor.mkPrep2 ro euro) ; mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP. = \dwie,f -> lin Prep (ResKor.mkPrep dwie ** {attaches = f}) ; } ; diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 5e48317e4..f980f9895 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -123,9 +123,13 @@ oper -------------------------------------------------------------------------------- -- Postpositions - Postposition : Type = {s : Str ; attaches : Bool} ; + Postposition : Type = {s : Phono => Str ; attaches : Bool} ; - mkPrep : Str -> Postposition = \str -> {s=str ; attaches=True} ; + mkPrep : Str -> Postposition = \str -> {s=\\_ => str ; attaches=True} ; + mkPrep2 : (ro,euro : Str) -> Postposition = \ro,euro -> { + s = table {Vowel => ro ; Consonant => euro} ; + attaches = True + } ; emptyPP : Postposition = mkPrep [] ** {attaches=False} ; datPP : Postposition = mkPrep "에게" ; @@ -296,7 +300,7 @@ oper useVc : Verb2 -> VPSlash = \v2 -> baseVP ** v2 ; insertComp : VPSlash -> NounPhrase -> VerbPhrase = \v2,np -> useV v2 ** { - nObj = np.s ! v2.c2 ++ v2.p2.s + nObj = np.s ! v2.c2 ++ v2.p2.s ! np.p } ; insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ;