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 f5e47bf96..414355670 100644 Binary files a/src/korean/ParamKor.gf and b/src/korean/ParamKor.gf differ 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 ;