From ec0173c587f33e53501789a9d13dc8f9ba27fe7b Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Fri, 27 Mar 2020 11:25:48 +0100 Subject: [PATCH] (Kor) Add conjunctions for AP and CN --- src/korean/CatKor.gf | 2 +- src/korean/ConjunctionKor.gf | 47 +++++++++++++++++++++++++++-------- src/korean/ParamKor.gf | Bin 2436 -> 2740 bytes src/korean/ResKor.gf | 9 +++++++ src/korean/StructuralKor.gf | 10 +++++++- 5 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/korean/CatKor.gf b/src/korean/CatKor.gf index f6d3f5c63..97939e9bf 100644 --- a/src/korean/CatKor.gf +++ b/src/korean/CatKor.gf @@ -85,7 +85,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in { --2 Structural words -- Constructed in StructuralKor. - Conj = {s2 : Bool => Str ; s1 : Str ; n : Number } ; + Conj = ResKor.Conj ; Subj = SS ; Prep = ResKor.Postposition ; diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index ea33c7155..6837d5542 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -58,15 +58,32 @@ lin ConsS x xs = xs ** { } ; ConjS co xs = {} ; - +-} lincat - [AP] = {} ; + [AP] = ResKor.AdjPhrase ** {firstAP : AForm => ConjType => Str} ; lin - BaseAP x y = twoTable … x y ** y ; --choose all the other fields from second argument - ConsAP as a = consrTable … comma as a ** as ; - ConjAP co as = conjunctDistrTable … co as ** as ; + BaseAP a1 a2 = a2 ** { + firstAP = mkFirstAP a1 ; + } ; + ConsAP a as = as ** { + firstAP = \\af,conj => + mkFirstAP a ! af ! conj ++ as.firstAP ! af ! conj ; + } ; + + ConjAP co as = as ** { + s = \\af => co.s1 ++ as.firstAP ! af ! co.c ++ as.s ! af + } ; + + +oper + mkFirstAP : ResKor.AdjPhrase -> AForm => ConjType => Str = \ap -> + \\af,conj => case af of { + AAttr => glue (ap.s ! AAttr) (conjTable ! NStar ! conj) ; + APred _ => glue (ap.s ! APred VStem) (conjTable ! VStar ! conj) } ; + +{- lincat [CN] = { } ; @@ -83,15 +100,23 @@ lin ConsDAP xs x = xs ** ConjDet conj xs = xs ** - +-} -- Noun phrases lincat - [NP] = + [NP] = ResKor.NounPhrase ** {firstNP : ConjType => Str} ; lin - BaseNP x y = - ConsNP x xs = - ConjNP conj xs = + BaseNP np1 np2 = np2 ** {firstNP = mkFirstNP np1} ; + ConsNP np nps = nps ** { + firstNP = \\conj => mkFirstNP np ! conj ++ nps.firstNP ! conj + } ; + ConjNP co nps = nps ** { + s = \\nf => co.s1 ++ nps.firstNP ! co.c ++ nps.s ! nf ; + n = co.n + } ; + +oper + mkFirstNP : ResKor.NounPhrase -> ConjType => Str = \np -> + \\conj => glue (np.s ! Bare) (conjTable ! NStar ! conj) ; --} } diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index f5e47bf96cc43b21f3f47c67b1ffadcdc1b5ee0f..41435567029f22740162d7214891072ca0b3aad2 100644 GIT binary patch delta 393 zcmZn>-XgkTJ1d`pf`X%CNl6ixf`WoV&E$iuDfQ0zd0C}-$t9WjdBt2@1&Kw8xm;Wd z3LxQ-%7Rn{TLs6w6oncE{~`rzkVJrgu!1dEzd~4WNn(+Lf`YEDLRe~1Qn5l}UW!6u zN>*xeNoHAUF-TF3f*)9sHAsod^ zTwtdVTvDW9s}K`Ypp&d%Yp0N$Se&Y0ldMxcuFtHUq|B1i#2iqlf;{@VYYLabjw0O$}Ip#T5? diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 9892bc118..da744d4c5 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -241,6 +241,15 @@ oper Adverb : Type = SS ; ------------------ +-- Conj + + Conj : Type = { + s1 : Str ; + c : ConjType ; -- if it's And, Or, … + -- Need to add conjunction already in ConsX funs. + n : Number ; + } ; +------------------ -- VP Complement : Type = { diff --git a/src/korean/StructuralKor.gf b/src/korean/StructuralKor.gf index 498408da4..ec2587720 100644 --- a/src/korean/StructuralKor.gf +++ b/src/korean/StructuralKor.gf @@ -38,7 +38,15 @@ lin there_Adv = ss "" ; ------- -- Conj --- lin and_Conj = {s2 = table {x => "" ; y => ""} ; s1 = [] ; n = Pl} ; + and_Conj = { + s1 = [] ; + -- no need for strings here, actual values come from ParamKor.conjTable + -- s2 = \\phono => table { + -- VStar => "고" ; + -- NStar => "하고"} ; + n = Pl ; + c = And + } ; -- lin or_Conj = {s2 = \\_ => "" ; s1 = [] ; n = Sg} ; -- lin if_then_Conj = mkConj -- lin both7and_DConj = mkConj "" "" pl ;