From dbaa52be089a553239220ecc688fd5abcf3c6518 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 26 Mar 2020 20:43:52 +0100 Subject: [PATCH] (Kor) Fixes in adverbs + related unit tests --- src/korean/AdverbKor.gf | 6 +++++- src/korean/ParadigmsKor.gf | 12 ++++++++++-- src/korean/ResKor.gf | 6 +++--- src/korean/StructuralKor.gf | 2 +- src/korean/VerbKor.gf | 2 +- src/korean/unittest/adverb.gftest | 7 +++++++ 6 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 src/korean/unittest/adverb.gftest diff --git a/src/korean/AdverbKor.gf b/src/korean/AdverbKor.gf index d332f627a..01fb1ec68 100644 --- a/src/korean/AdverbKor.gf +++ b/src/korean/AdverbKor.gf @@ -11,7 +11,11 @@ lin -- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs -- : Prep -> NP -> Adv ; - PrepNP prep np = {s = glue (np.s ! Bare) prep.s} ; + PrepNP prep np = { + s = case prep.attaches of { + True => glue (np.s ! Bare) prep.s ; + False => np.s ! Bare ++ prep.s } + } ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/korean/ParadigmsKor.gf b/src/korean/ParadigmsKor.gf index a4d930019..6e2782835 100644 --- a/src/korean/ParadigmsKor.gf +++ b/src/korean/ParadigmsKor.gf @@ -65,8 +65,10 @@ oper --2 Structural categories - -- mkPrep = overload { - -- } ; + mkPrep : overload { + mkPrep : (e : Str) -> Prep ; -- Particle like 에, attaches to the NP. + mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep ; -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP. + } ; -- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num -> -- lin Conj { s = s1 ; s2 = s2 } ; @@ -128,6 +130,12 @@ oper -- mkVV = overload { -- } ; + mkPrep = overload { + mkPrep : (e : Str) -> Prep -- Particle like 에, attaches to the NP. + = \e -> lin Prep (ResKor.mkPrep e) ; + 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 3b29b6ac2..9892bc118 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -121,11 +121,11 @@ oper -------------------------------------------------------------------------------- -- Postpositions - Postposition : Type = SS ; + Postposition : Type = {s : Str ; attaches : Bool} ; - mkPrep : Str -> Postposition = \str -> ss str ; + mkPrep : Str -> Postposition = \str -> {s=str ; attaches=True} ; - emptyPP : Postposition = mkPrep [] ; + emptyPP : Postposition = mkPrep [] ** {attaches=False} ; datPP : Postposition = mkPrep "에게" ; -------------------------------------------------------------------------------- diff --git a/src/korean/StructuralKor.gf b/src/korean/StructuralKor.gf index 93e9c8427..498408da4 100644 --- a/src/korean/StructuralKor.gf +++ b/src/korean/StructuralKor.gf @@ -96,7 +96,7 @@ oper -- lin above_Prep = mkPrep "" -- lin after_Prep = mkPrep "" -- lin before_Prep = mkPrep "" ; --- lin behind_Prep = mkPrep "" ; +lin behind_Prep = mkPrep "뒤에" False ; -- lin between_Prep = = mkPrep "" ; -- lin by8agent_Prep = mkPrep ; -- lin by8means_Prep = mkPrep ; diff --git a/src/korean/VerbKor.gf b/src/korean/VerbKor.gf index 914d8215b..33dc4c180 100644 --- a/src/korean/VerbKor.gf +++ b/src/korean/VerbKor.gf @@ -130,7 +130,7 @@ lin -- : Adv -> Comp ; CompAdv adv = emptyComp ** { - s = \\vf => adv.s ++ copula.s ! vf ; + s = \\vf => adv.s ++ have_V.s ! vf ; } ; -- : VP -- Copula alone; diff --git a/src/korean/unittest/adverb.gftest b/src/korean/unittest/adverb.gftest new file mode 100644 index 000000000..af31bbb5b --- /dev/null +++ b/src/korean/unittest/adverb.gftest @@ -0,0 +1,7 @@ +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc +LangEng: the cat is in the house +LangKor: 고양이가 집 BIND 에서 있어요 + +Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP behind_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc +LangEng: the cat is behind the house +LangKor: 고양이가 집 뒤에 있어요