From f6871ec3c6ed306ee2e70af2ec0e3646f2d8c59f Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Sun, 12 Apr 2020 22:07:53 +0200 Subject: [PATCH 1/3] (Kor) Cleanup in conjunctions --- src/korean/ConjunctionKor.gf | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 42952fd8c..1aeaa4913 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -36,43 +36,29 @@ lin ConjAdv, ConjAdV, ConjIAdv = conjSS ; oper - ConjSS : Type = SS ** {firstSS : ConjType => Str} ; + ConjSS : Type = {s : ConjType => Str} ; - baseSS : SS -> SS -> ConjSS = \s1,s2 -> s2 ** { - firstSS = mkFirstSS s1 ; + baseSS : SS -> SS -> ConjSS = \s1,s2 -> { + s = \\conj => glue s1.s (conjTable ! NStar ! conj) ++ s2.s ; } ; consSS : SS -> ConjSS -> ConjSS = \s,ss -> ss ** { - firstSS = \\conj => - mkFirstSS s ! conj ++ ss.firstSS ! conj ; + s = \\conj => glue s.s (conjTable ! NStar ! conj) ++ ss.s ! conj ; } ; conjSS : Conj -> ConjSS -> SS = \co,ss -> { - s = co.s1 ++ ss.firstSS ! co.c ++ ss.s - } ; - --- Versions with commas, no repeated conjunctions - baseSScomma : SS -> SS -> ConjSS = \s1,s2 -> s2 ** { - firstSS = \\conj => s1.s ++ SOFT_BIND ++ "," ; + s = co.s1 ++ ss.s ! co.c } ; + -- Version with commas, no repeated conjunctions! + -- baseSS works for both: always conjunction between penultimate and last. + -- Difference from consSS: conjTable ! NStar ! conj isn't used, only comma. consSScomma : SS -> ConjSS -> ConjSS = \s,ss -> ss ** { - firstSS = \\conj => - s.s ++ SOFT_BIND ++ "," ++ ss.firstSS ! conj ; + s = \\conj => s.s + ++ SOFT_BIND ++ "," -- Don't add conjunction, only comma + ++ ss.s ! conj ; } ; - conjSScomma : Conj -> ConjSS -> SS = \co,ss -> { - s = co.s1 - ++ ss.firstSS ! co.c - ++ co.s2 - ++ ss.s - } ; - -oper - mkFirstSS : SS -> ConjType => Str = \s -> - \\conj => glue s.s (conjTable ! VStar ! conj) ; - - lincat [S], [RS] = ResKor.Sentence ** {firstS : ConjType => Str} ; From 2c83fd8691a141239c9aece0ac4f86dca55cafb7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 14 Apr 2020 17:53:04 +0200 Subject: [PATCH 2/3] =?UTF-8?q?(Kor)=20Don't=20add=20=EB=93=A4=20with=20nu?= =?UTF-8?q?merals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/korean/NumeralKor.gf | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/korean/NumeralKor.gf b/src/korean/NumeralKor.gf index ff1a04e68..ac21579a1 100644 --- a/src/korean/NumeralKor.gf +++ b/src/korean/NumeralKor.gf @@ -37,7 +37,7 @@ lin -- : Digit -> Sub100 ; -- 10 + d pot1to19 d = let newS = xPlus "십" "열" d.s in d ** { s = newS ; - n = Pl ; + n = numNumber ; ord = newS ! NK ! Attrib ++ "번째" ; } ; @@ -98,7 +98,7 @@ oper SK => \\_ => sk ; NK => table {Indep => nk ; _ => nkAttr } } ; - n = Pl ; + n = numNumber ; numtype = IsNum ; isTwo = False ; ten = ten ; @@ -117,7 +117,7 @@ oper potTimes : (sk,nk : Str) -> ResKor.Numeral -> ResKor.Numeral = \sk,nk,num -> let newS = xTimes sk nk num.s in num ** { s = newS ; - n = Pl ; + n = numNumber ; ord = newS ! NK ! Attrib ++ "번째" ; -- TODO check } ; @@ -136,7 +136,7 @@ lin -- : Dig -> Digits -> Digits ; -- 876 IIDig d i = { s = \\o => d.s ! NCard ++ BIND ++ i.s ! o ; - n = Pl + n = numNumber } ; D_0 = mkDig "0" ; @@ -151,7 +151,7 @@ lin D_9 = mkDig "9" ; oper - mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o ResKor.Pl ; + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o numNumber ; mkDig : Str -> TDigit = \c -> mk2Dig c (c + "번째") ; mk3Dig : Str -> Str -> ResKor.Number -> TDigit = \c,o,n -> { @@ -163,4 +163,6 @@ oper n : ResKor.Number ; s : CardOrd => Str } ; + + numNumber = Sg ; -- No need for 들 with numerals } From 1ffa53c3b2bf4038111d5de3eccded18c2ee4c21 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Tue, 14 Apr 2020 20:58:17 +0200 Subject: [PATCH 3/3] (Kor) Add negative form in V where conjunction attaches --- src/korean/ConjunctionKor.gf | 2 +- src/korean/ParamKor.gf | Bin 3733 -> 3787 bytes src/korean/RelativeKor.gf | 2 +- src/korean/ResKor.gf | 7 ++++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 1aeaa4913..01f407db2 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -101,7 +101,7 @@ lin oper mkFirstAP : ResKor.AdjPhrase -> VForm => ConjType => Str = \ap -> - \\af,conj => ap.compar ++ glue (ap.s ! VStem) (conjTable ! VStar ! conj) ; + \\af,conj => ap.compar ++ glue (ap.s ! VStem Pos) (conjTable ! VStar ! conj) ; {- lincat diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 24832b20a1aaee3106a3319d9fa67d5214ebc9cd..575db8b5cd61734fd28fe797c3552545ad33c5b0 100644 GIT binary patch delta 83 zcmbO#ds=ow5I09aeokUhW=ZAdKyF1wi-7!M1zS4>rD6q*u;7x^T!n!AVofClYc2%^ W1qFzRUurt462H`R&CRtu5=;OiY8Vj! delta 29 kcmX>tJ5_c=5clS2ZUsheTRR1%Vui5alGNPIn|UOd0EsyWxBvhE diff --git a/src/korean/RelativeKor.gf b/src/korean/RelativeKor.gf index 4150f6e49..7fbe1030d 100644 --- a/src/korean/RelativeKor.gf +++ b/src/korean/RelativeKor.gf @@ -10,7 +10,7 @@ lin s = \\t,a,p,cltyp => rp.s ++ vp.adv ++ vp.nObj ++ case cltyp of { - WithConj => vp.s ! VStem ; + WithConj => vp.s ! VStem p ; _ => vp.s ! VAttr p } ; } ; diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 59bf669a1..1cc6c3736 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -153,7 +153,7 @@ oper mkAdj : Str -> Adjective = \plain -> let v : Verb = mkVerb plain ; - stem : Str = v.s ! VStem ; + stem : Str = v.s ! VStem Pos ; attrpos : Str = add_N stem ; in v2a attrpos v ; @@ -207,7 +207,8 @@ oper mkVerbFull : (x1,_,_,_,_,_,_,_,x9 : Str) -> Verb = \stem,attrpos,attrneg,plain,polite,formal,planeg,polneg,formneg -> { s = table { - VStem => stem ; + VStem Pos => stem ; + VStem Neg => stem + "지" ++ "않" ; VAttr Pos => attrpos ; VAttr Neg => attrneg ; VF Plain Pos => plain ; @@ -359,7 +360,7 @@ oper s = \\t,a,p,cltyp => let vf = case cltyp of { Subord => VAttr p ; - WithConj => VStem ; + WithConj => VStem p ; _ => VF Polite p } -- TODO: more tenses, politeness in np ++ vp.nObj -- an object, not copula complement