From 5153005d51331df8ac550e34894e786e235fbae5 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 14:11:50 +0200 Subject: [PATCH 1/7] (Kor) Tweaks in Adv+AdV --- src/korean/NounKor.gf | 2 +- src/korean/ResKor.gf | 2 +- src/korean/StructuralKor.gf | 6 +++--- src/korean/VerbKor.gf | 11 +++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/korean/NounKor.gf b/src/korean/NounKor.gf index 83f06e7d..0adf057d 100644 --- a/src/korean/NounKor.gf +++ b/src/korean/NounKor.gf @@ -171,7 +171,7 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in { -- : CN -> Adv -> CN ; AdvCN cn adv = cn ** { - rs = cn.rs ++ adv.s + rs = adv.s ++ cn.rs } ; -- Nouns can also be modified by embedded sentences and questions. diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 1cc6c373..b94414d4 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -335,7 +335,7 @@ oper nObj = np.s ! v2.c2 ++ v2.p2.s ! np.p } ; - insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s} ; + insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s ++ vp.adv} ; insertAdvSlash : VPSlash -> SS -> VPSlash = \v,a -> v ** insertAdv v a ; -------------------------------------------------------------------------------- -- Cl, S diff --git a/src/korean/StructuralKor.gf b/src/korean/StructuralKor.gf index fe62f835..a1deb6fa 100644 --- a/src/korean/StructuralKor.gf +++ b/src/korean/StructuralKor.gf @@ -21,9 +21,9 @@ lin how8much_IAdv = ss "" ; lin when_IAdv = ss "" ; lin where_IAdv = ss "" : lin why_IAdv = ss "" : - -lin always_AdV = ss "" ; - +-} +lin always_AdV = ss "항상" ; +{- lin everywhere_Adv = ss "" ; lin here7from_Adv = ss "" ; lin here7to_Adv = ss "" ; diff --git a/src/korean/VerbKor.gf b/src/korean/VerbKor.gf index 0273b542..6e93b691 100644 --- a/src/korean/VerbKor.gf +++ b/src/korean/VerbKor.gf @@ -89,17 +89,16 @@ lin -- : VPSlash -> Adv -> VPSlash ; -- use (it) here AdvVPSlash = insertAdvSlash ; -{- + -- : VP -> Adv -> VP ; -- sleep , even though ... - ExtAdvVP vp adv = ; + -- ExtAdvVP vp adv = ; -- : AdV -> VP -> VP ; -- always sleep - AdVVP adv vp = vp ** {adv = adv} ; - + AdVVP adv vp = vp ** {adv = vp.adv ++ adv.s} ; -- : AdV -> VPSlash -> VPSlash ; -- always use (it) - AdVVPSlash adv vps = vps ** { adv = adv.s ++ vps.adv } ; --} + AdVVPSlash adv vps = vps ** { adv = vps.adv ++ adv.s} ; + -- : VP -> Prep -> VPSlash ; -- live in (it) -- VPSlashPrep vp prep = -- let adv = prepNP prep emptyNP From ef364c295f69abfc22ca110c5d507837c4d1abb7 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 14:17:52 +0200 Subject: [PATCH 2/7] (Kor) Use all fields of VP in EmbedVP + tweak linref for VP --- src/korean/CatKor.gf | 3 ++- src/korean/PhraseKor.gf | 2 +- src/korean/ResKor.gf | 2 +- src/korean/SentenceKor.gf | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/korean/CatKor.gf b/src/korean/CatKor.gf index 84f7df4a..17a66ac2 100644 --- a/src/korean/CatKor.gf +++ b/src/korean/CatKor.gf @@ -119,5 +119,6 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in { PN = ResKor.NounPhrase ; linref - V, V2, V3, VP = linVerb ; + V, V2, V3 = linVerb ; + VP = linVP linVF ; } diff --git a/src/korean/PhraseKor.gf b/src/korean/PhraseKor.gf index 6a678f00..aaa6a434 100644 --- a/src/korean/PhraseKor.gf +++ b/src/korean/PhraseKor.gf @@ -16,7 +16,7 @@ concrete PhraseKor of Phrase = CatKor ** open Prelude, ResKor in { UttIP ip = {s = ip.s ! Bare} ; UttNP np = {s = np.s ! Bare} ; - UttVP vp = {s = linVP vp} ; + UttVP vp = {s = linVP linVF vp} ; UttCN cn = {s = cn.rs ++ cn.s ! Bare} ; UttCard n = {s = n.s ! NK ! Indep} ; UttAP ap = { s = ap.compar ++ ap.s ! VF Plain Pos} ; diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index b94414d4..d4725780 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -372,6 +372,6 @@ oper -- linrefs linVerb : Verb -> Str = \v -> v.s ! linVF ; -linVP : VerbPhrase -> Str = \vp -> vp.nObj ++ vp.adv ++ vp.s ! linVF ; +linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ++ vp.adv ++ vp.s ! vf ; } diff --git a/src/korean/SentenceKor.gf b/src/korean/SentenceKor.gf index cc9a7f47..59574a9f 100644 --- a/src/korean/SentenceKor.gf +++ b/src/korean/SentenceKor.gf @@ -43,7 +43,7 @@ lin -- EmbedQS qs = { } ; -- : VP -> SC ; - EmbedVP vp = {s = vp.s ! VAttr Pos ++ "것이"} ; + EmbedVP vp = {s = linVP (VAttr Pos) vp ++ "것이"} ; --2 Sentences From 8acf0da717edc3cc47c44b13576139d10e6598bb Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 14:52:54 +0200 Subject: [PATCH 3/7] (Kor) Add Style as a variable up to S. Utt chooses Polite. If different politeness levels are wanted in applications, UttS can be overriden. --- src/korean/CatKor.gf | 2 +- src/korean/ParamKor.gf | Bin 3787 -> 3894 bytes src/korean/PhraseKor.gf | 6 +++--- src/korean/ResKor.gf | 2 +- src/korean/SentenceKor.gf | 7 +++++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/korean/CatKor.gf b/src/korean/CatKor.gf index 17a66ac2..9f615449 100644 --- a/src/korean/CatKor.gf +++ b/src/korean/CatKor.gf @@ -8,7 +8,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in { -- Constructed in SentenceKor, and also in IdiomKor S = ResKor.Sentence ; - QS = SS ; -- Questions not implemented yet + QS = {s : Style => Str}; -- Questions not implemented yet RS = ResKor.Sentence ; -- relative sentence. Tense and polarity fixed, -- but agreement may depend on the CN/NP it modifies. diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 575db8b5cd61734fd28fe797c3552545ad33c5b0..bd852d3533c8a23cdf5970d8253b076487752e67 100644 GIT binary patch delta 151 zcmX>tyG?Gx3GRAbT?Loaw8YY!5{2TD%A8b%(&E$oXosnupzbz0r@$ZC8-M55YaF< h1zUwMH-v(K{9*-bE-r=5kGSVBu_=IcO|Ikf1pwf VAttr p ; WithConj => VStem p ; - _ => VF Polite p } -- TODO: more tenses, politeness + Statement st => VF st p } -- TODO: more tenses in np ++ vp.nObj -- an object, not copula complement ++ vp.adv diff --git a/src/korean/SentenceKor.gf b/src/korean/SentenceKor.gf index 59574a9f..9553d6f7 100644 --- a/src/korean/SentenceKor.gf +++ b/src/korean/SentenceKor.gf @@ -53,10 +53,13 @@ lin } ; -- : Temp -> Pol -> QCl -> QS ; - UseQCl t p cl = {s = t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Statement} ; + UseQCl t p cl = { + s = \\st => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! Statement st} ; -- : Temp -> Pol -> RCl -> RS ; - UseRCl t p rcl = {s = \\c => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! c} ; + UseRCl t p rcl = { + s = \\c => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! c + } ; -- AdvS : Adv -> S -> S ; -- then I will go home AdvS = advS "" ; From 7785afd2c3e919f763c76b6cf50f96dfb08b63d1 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 15:09:53 +0200 Subject: [PATCH 4/7] (Kor) Fix VStem Neg form in worstcase constructor --- src/korean/ResKor.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 588a2126..4fdf7a11 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -208,7 +208,7 @@ oper \stem,attrpos,attrneg,plain,polite,formal,planeg,polneg,formneg -> { s = table { VStem Pos => stem ; - VStem Neg => stem + "지" ++ "않" ; + VStem Neg => init planeg ; VAttr Pos => attrpos ; VAttr Neg => attrneg ; VF Plain Pos => plain ; From 737df2e2260ea6760466a733ae463d240dbefbe4 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 17:43:01 +0200 Subject: [PATCH 5/7] (Kor) Add allomorphs for conjunctions --- src/korean/CatKor.gf | 3 +-- src/korean/ConjunctionKor.gf | 11 ++++++----- src/korean/NounKor.gf | 2 +- src/korean/ParadigmsKor.gf | 2 +- src/korean/ParamKor.gf | Bin 3894 -> 3956 bytes src/korean/RelativeKor.gf | 4 ++-- src/korean/ResKor.gf | 21 ++++++++++++++++----- src/korean/SentenceKor.gf | 10 ++++++++-- src/korean/SymbolKor.gf | 4 ++-- 9 files changed, 37 insertions(+), 20 deletions(-) diff --git a/src/korean/CatKor.gf b/src/korean/CatKor.gf index 9f615449..94be91df 100644 --- a/src/korean/CatKor.gf +++ b/src/korean/CatKor.gf @@ -65,8 +65,7 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in { Predet = {s : Phono => Str ; p : Phono} ; Quant = ResKor.Quant ; Num = ResKor.Num ; - Ord = { - s : VForm => Str ; -- Ord can come from AP and become AP again + Ord = ResKor.Adjective ** { -- Ord can come from AP and become AP again n : Number -- Ord can come from Num, which has inherent number } ; DAP = ResKor.Determiner ; diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 01f407db..4f2ac1d1 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -39,11 +39,11 @@ oper ConjSS : Type = {s : ConjType => Str} ; baseSS : SS -> SS -> ConjSS = \s1,s2 -> { - s = \\conj => glue s1.s (conjTable ! NStar ! conj) ++ s2.s ; + s = \\conj => glue s1.s (conjTable ! NStar ! conj ! Vowel) ++ s2.s ; -- TODO check phono } ; consSS : SS -> ConjSS -> ConjSS = \s,ss -> ss ** { - s = \\conj => glue s.s (conjTable ! NStar ! conj) ++ ss.s ! conj ; + s = \\conj => glue s.s (conjTable ! NStar ! conj ! Vowel) ++ ss.s ! conj ; } ; conjSS : Conj -> ConjSS -> SS = \co,ss -> { @@ -79,7 +79,7 @@ lin oper mkFirstS : ResKor.Sentence -> ConjType => Str = \s -> - \\conj => glue (s.s ! WithConj) (conjTable ! VStar ! conj) ; + \\conj => glue (s.s ! WithConj) (conjTable ! VStar ! conj ! s.p) ; lincat [AP] = ResKor.AdjPhrase ** {firstAP : VForm => ConjType => Str} ; @@ -101,7 +101,8 @@ lin oper mkFirstAP : ResKor.AdjPhrase -> VForm => ConjType => Str = \ap -> - \\af,conj => ap.compar ++ glue (ap.s ! VStem Pos) (conjTable ! VStar ! conj) ; + \\af,conj => ap.compar + ++ glue (ap.s ! VStem Pos) (conjTable ! VStar ! conj ! ap.p) ; {- lincat @@ -137,7 +138,7 @@ lin oper mkFirstNP : ResKor.NounPhrase -> ConjType => Str = \np -> - \\conj => glue (np.s ! Bare) (conjTable ! NStar ! conj) ; + \\conj => glue (np.s ! Bare) (conjTable ! NStar ! conj ! np.p) ; -- Versions with commas, no repeated conjunctions baseNPcomma : NP -> NP -> ListNP = \x,y -> y ** { diff --git a/src/korean/NounKor.gf b/src/korean/NounKor.gf index 0adf057d..327cc8de 100644 --- a/src/korean/NounKor.gf +++ b/src/korean/NounKor.gf @@ -123,7 +123,7 @@ concrete NounKor of Noun = CatKor ** open ResKor, Prelude in { -- } ; -- : A -> Ord ; - OrdSuperl a = { + OrdSuperl a = a ** { s = \\vf => "가장" ++ a.s ! vf ; n = Sg -- ?? is this meaningful? } ; diff --git a/src/korean/ParadigmsKor.gf b/src/korean/ParadigmsKor.gf index 185cb147..aab5f2a5 100644 --- a/src/korean/ParadigmsKor.gf +++ b/src/korean/ParadigmsKor.gf @@ -149,7 +149,7 @@ oper mkA : (plain,polite,formal,attr : Str) -> A = \x1,x2,x3,x4 -> lin A (mkAdjReg x1 x2 x3 x4) ; mkA : (jaemi : Str) -> (itda : V) -> A - = \jaemi,itda -> lin A ({s = \\vf => jaemi ++ itda.s ! vf}) ; + = \jaemi,itda -> lin A (itda ** {s = \\vf => jaemi ++ itda.s ! vf}) ; } ; mkA2 = overload { diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index bd852d3533c8a23cdf5970d8253b076487752e67..f82924081807591e32054ce6b164ceec3dd9400b 100644 GIT binary patch delta 178 zcmdlc_eE}l6We4LwnX)SjQqTO1zS6X;F2N*TZNdI0-a=?f((#Ia$<3+f=#kcflfij z+kq4*=_n~!b15h&DA+jX=jJBrgawx*7U?+W=N0GY zCFYet6up_V=k>}BSXGAQm#5}HRJ~rgVe$<2A51#&lP7RUgQ(RUlA8~4l&}E+07W`% delta 114 zcmew&w@q$?6C0z#WJk6niQtkV1zUxfm;#+-1zS6X VP -> RCl ; - RelVP rp vp = { -- TODO no tenses yet in the grammar + RelVP rp vp = vp ** { -- TODO no tenses yet in the grammar s = \\t,a,p,cltyp => rp.s ++ vp.adv ++ vp.nObj ++ case cltyp of { @@ -25,7 +25,7 @@ lin --FunRP prep np rp = {} ; oper - relSlash : SS -> ClSlash -> ResKor.RClause = \rp,cls -> { + relSlash : SS -> ClSlash -> ResKor.RClause = \rp,cls -> cls ** { s = \\t,a,p,cltyp => rp.s ++ case cltyp of { WithConj => cls.s ! t ! a ! p ! WithConj ; diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index 4fdf7a11..d1b47262 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -142,10 +142,13 @@ oper -------------------------------------------------------------------------------- -- Adjectives - Adjective : Type = {s : VForm => Str} ; -- Adjectives are verbs + Adjective : Type = { + s : VForm => Str ; -- Adjectives are verbs + p, pNeg : Phono ; -- needed for attaching conjunction + } ; Adjective2 : Type = Adjective ** {c2 : NForm ; p2 : Postposition} ; - v2a : (attrpos : Str) -> Verb -> Adjective = \attrpos,v -> { + v2a : (attrpos : Str) -> Verb -> Adjective = \attrpos,v -> v ** { s = table { VAttr Pos => attrpos ; -- Positive Attr is different in vf => v.s ! vf } -- adjectives, otherwise adj forms == verb forms. @@ -168,6 +171,7 @@ oper BaseVerb : Type = { sc : NForm ; -- subject case + p, pNeg : Phono ; -- needed for attaching conjunction } ; Verb : Type = BaseVerb ** { s : VForm => Str ; @@ -218,7 +222,9 @@ oper VF Formal Pos => formal ; VF Formal Neg => formneg } ; - sc = Subject + sc = Subject ; + p = if_then_else Phono (vowFinal stem) Vowel Consonant ; + pNeg = if_then_else Phono (vowFinal (init planeg)) Vowel Consonant ; } ; copula : Verb = mkVerbFull @@ -340,7 +346,9 @@ oper -------------------------------------------------------------------------------- -- Cl, S - Clause : Type = {s : Tense => Anteriority => Polarity => ClType => Str} ; + Clause : Type = { + s : Tense => Anteriority => Polarity => ClType => Str ; + p, pNeg : Phono} ; {- After PredVP, we might still want to add more adverbs (QuestIAdv), but we're done with verb inflection. @@ -351,7 +359,10 @@ oper RClause : Type = Clause ; - Sentence : Type = {s : ClType => Str} ; + Sentence : Type = { + s : ClType => Str ; + p : Phono -- Needed for attaching conjunction + } ; predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> let npstr : Str = np.s ! vp.sc in predVP' npstr vp ; diff --git a/src/korean/SentenceKor.gf b/src/korean/SentenceKor.gf index 9553d6f7..869b93ff 100644 --- a/src/korean/SentenceKor.gf +++ b/src/korean/SentenceKor.gf @@ -49,7 +49,10 @@ lin -- : Temp -> Pol -> Cl -> S ; UseCl t p cl = { - s = \\c => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! c + s = \\c => t.s ++ p.s ++ cl.s ! t.t ! t.a ! p.p ! c ; + p = case p.p of { -- Phono of VStem + Pos => cl.p ; + Neg => cl.pNeg } ; } ; -- : Temp -> Pol -> QCl -> QS ; @@ -58,7 +61,10 @@ lin -- : Temp -> Pol -> RCl -> RS ; UseRCl t p rcl = { - s = \\c => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! c + s = \\c => t.s ++ p.s ++ rcl.s ! t.t ! t.a ! p.p ! c ; + p = case p.p of { -- Phono of VStem + Pos => rcl.p ; + Neg => rcl.pNeg } ; } ; -- AdvS : Adv -> S -> S ; -- then I will go home diff --git a/src/korean/SymbolKor.gf b/src/korean/SymbolKor.gf index 2ed90518..a90f4c4c 100644 --- a/src/korean/SymbolKor.gf +++ b/src/korean/SymbolKor.gf @@ -39,7 +39,7 @@ lin s = \\nf => cn.s ! nf ++ i.s ! cn.c.origin ! Indep}) ; -- : Symb -> S ; - SymbS sy = {s = \\_ => sy.s} ; + SymbS sy = {s = \\_ => sy.s ; p = Vowel} ; -- : Symb -> Card ; SymbNum sy = baseNum ** {s = \\_,_ => sy.s} ; @@ -47,7 +47,7 @@ lin -- : Symb -> Ord ; SymbOrd sy = let comp : Comp = VK.CompAdv (lin Adv sy) - in {s = comp.s ; n=Pl} ; + in {s = comp.s ; n = Pl ; p,pNeg = Vowel} ; lincat Symb, [Symb] = SS ; From b1c578025d9f0f04cb724b46f7587c38500856b2 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 17:43:26 +0200 Subject: [PATCH 6/7] (Kor) Change default style to Formal --- src/korean/ParamKor.gf | Bin 3956 -> 3956 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index f82924081807591e32054ce6b164ceec3dd9400b..7f34fdf583e40d2945884ee7f9555d0790810f4d 100644 GIT binary patch delta 19 acmew&_eE|)91ojYeo<~>&gK*z0cHSC{s!Ct delta 19 acmew&_eE|)91mMSeokgd>gE(40cHSDaR%rB From 8d8a089f535c4c551155ed9b08b3c5c60ecb3908 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Thu, 21 May 2020 19:51:15 +0200 Subject: [PATCH 7/7] (Kor) Add linref for AP --- src/korean/CatKor.gf | 1 + src/korean/ResKor.gf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/korean/CatKor.gf b/src/korean/CatKor.gf index 94be91df..a6fc9d84 100644 --- a/src/korean/CatKor.gf +++ b/src/korean/CatKor.gf @@ -120,4 +120,5 @@ concrete CatKor of Cat = CommonX ** open ResKor, Prelude in { linref V, V2, V3 = linVerb ; VP = linVP linVF ; + AP = linAP ; } diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index d1b47262..541884d6 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -384,5 +384,5 @@ oper linVerb : Verb -> Str = \v -> v.s ! linVF ; linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ++ vp.adv ++ vp.s ! vf ; - +linAP : AdjPhrase -> Str = \ap -> ap.compar ++ ap.s ! linVF ; }