From c31c00dd831ddb998f40eb33de3826bbe92400fc Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Wed, 11 Mar 2020 16:54:02 +0100 Subject: [PATCH] (Kor) Add AForm, change VP and Comp. --- src/korean/AdjectiveKor.gf | 1 + src/korean/LexiconKor.gf | 4 ++-- src/korean/ParamKor.gf | 12 +++++++----- src/korean/ResKor.gf | 23 +++++++++++++++-------- src/korean/VerbKor.gf | 6 +++--- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/korean/AdjectiveKor.gf b/src/korean/AdjectiveKor.gf index 440a473b1..04a6b82be 100644 --- a/src/korean/AdjectiveKor.gf +++ b/src/korean/AdjectiveKor.gf @@ -37,6 +37,7 @@ concrete AdjectiveKor of Adjective = CatKor ** open ResKor, Prelude in { -- : Ord -> AP ; -- warmest AdjOrd ord = ord ** { + s = \\_ => ord.s ; compar = [] } ; diff --git a/src/korean/LexiconKor.gf b/src/korean/LexiconKor.gf index 958640353..ee5e6080b 100644 --- a/src/korean/LexiconKor.gf +++ b/src/korean/LexiconKor.gf @@ -29,7 +29,7 @@ concrete LexiconKor of Lexicon = CatKor ** -- lin beer_N = mkN "" ; -- lin beg_V2V = mkV2 "" ; -- lin belly_N = mkN "" ; --- lin big_A = mkA "" ; +lin big_A = mkA "크다" ; -- lin bike_N = mkN "" ; -- lin bird_N = mkN "" ; -- lin bite_V2 = mkV2 "" ; @@ -325,7 +325,7 @@ lin person_N = mkN "사람" ; -- lin skin_N = mkN "" ; -- lin sky_N = mkN "" ; -- lin sleep_V = mkV "" ; -lin small_A = mkA "작아" ; +lin small_A = mkA "작아다" ; -- lin smell_V = mkV "" ; -- lin smoke_N = mkN "" ; -- lin smooth_A = mkA "" ; diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 38f081d4d..b862cc2bd 100644 --- a/src/korean/ParamKor.gf +++ b/src/korean/ParamKor.gf @@ -9,7 +9,7 @@ The difference in the way these words are written has to do with the productivit oper v : pattern Str = #("아" | "이" | "어" | - "가" | "개" | "갸" | "걔" | "거" | "게" | "겨" | "계" | "고" | "과" | "괘" | "괴" | "교" | "구" | "궈" | "궤" | "귀" | "규" | "그" | "긔" | "기") ; -- TODO: figure out if this is a smart way to do it; if no better way, then complete the table. + "가" | "개" | "갸" | "걔" | "거" | "게" | "겨" | "계" | "고" | "과" | "괘" | "괴" | "교" | "구" | "궈" | "궤" | "귀" | "규" | "그" | "긔" | "기" | "크") ; -- TODO: figure out if this is a smart way to do it; if no better way, then complete the table. -- maybe subpatterns for diphthongs? -- c : pattern Str = #("m"|"n"|"p"|"b"|"t"|"d"|"k"|"g"|"f"|"v" @@ -22,6 +22,8 @@ oper -- _ => s } ; + vowFinal : Str -> Bool = \str -> + case str of {_ + #v => True ; _ => False} ; -------------------------------------------------------------------------------- -- Morphophonology @@ -41,11 +43,11 @@ param oper allomorph : NForm -> Str -> Str = \nf,s -> - let endsInV : Bool = case s of {_ + #v => True ; _ => False} ; + let finalV : Bool = vowFinal s ; in case nf of { - Topic => if_then_Str endsInV "은" "는" ; - Subject => if_then_Str endsInV "이" "가" ; - Object => if_then_Str endsInV "을" "를" ; + Topic => if_then_Str finalV "은" "는" ; + Subject => if_then_Str finalV "이" "가" ; + Object => if_then_Str finalV "을" "를" ; Bare => [] } ; -------------------------------------------------------------------------------- diff --git a/src/korean/ResKor.gf b/src/korean/ResKor.gf index a7fcf317d..a6cb8277d 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -100,20 +100,28 @@ oper -------------------------------------------------------------------------------- -- Adjectives - Adjective : Type = SS ; -- {s : AForm => Str} ; + Adjective : Type = {s : AForm => Str} ; Adjective2 : Type = Adjective ; - mkAdj : Str -> Adjective = \str -> {s = str} ; + mkAdj : Str -> Adjective = \inf -> let stem = init inf in { + s = table { + AAttr => stem + if_then_Str (vowFinal stem) "ᆫ" "은" ; + APred VInf => inf ; + APred (VFin Gnomic Pos) => stem + "ᆸ니다" ; + APred (VFin Gnomic Pos) => "안" ++ stem + "ᆸ니다" ; -- TODO check + APred _ => stem ++ "TODO: proper adjective inflection" + } + } ; AdjPhrase : Type = Adjective ** {compar : Str} ; -------------------------------------------------------------------------------- -- Verbs BaseVerb : Type = { - s : VForm => Str ; type : VerbType ; } ; Verb : Type = BaseVerb ** { + s : VForm => Str ; } ; Verb2 : Type = Verb ; -- ** {c2 : Postposition} ; Verb3 : Type = Verb ; -- ** {c3 : Postposition} ; @@ -143,13 +151,13 @@ oper -- VP Complement : Type = { - aComp : Str ; -- AForm => Str ; + s : VForm => Str ; nComp : Str ; -- compar : Str ; -- comparative is discontinuous } ; emptyComp : Complement = { - aComp = [] ; + s = \\_ => [] ; nComp = [] ; -- compar : Str ; } ; @@ -164,9 +172,8 @@ oper VPSlash : Type = VerbPhrase ; useV : Verb -> VerbPhrase = \v -> v ** { - aComp = [] ; -- \\_ => [] ; + vComp, nComp = [] ; - vComp = [] ; } ; -------------------------------------------------------------------------------- -- Cl, S @@ -188,7 +195,7 @@ oper predVP : NounPhrase -> VerbPhrase -> ClSlash = \np,vp -> vp ** { s = \\t,a,p => np.s ! Topic - ++ vp.aComp ++ vp.nComp -- TODO: embed copula into complement + ++ vp.nComp -- TODO: embed copula into complement ++ vp.s ! VFin Gnomic Pos -- TODO: actual forms } ; diff --git a/src/korean/VerbKor.gf b/src/korean/VerbKor.gf index 2c419583c..60f6966e3 100644 --- a/src/korean/VerbKor.gf +++ b/src/korean/VerbKor.gf @@ -114,12 +114,12 @@ lin -- : AP -> Comp ; CompAP ap = emptyComp ** { - aComp = ap.s ; + s = \\vf => ap.s ! APred vf ; } ; -- : CN -> Comp ; CompCN cn = emptyComp ** { - aComp = cn.s ! Bare ; -- TODO: num. I am [a house that sleeps here] vs. we are [houses that sleep here] + nComp = cn.s ! Bare ; -- TODO: num. I am [a house that sleeps here] vs. we are [houses that sleep here] } ; -- NP -> Comp ; @@ -129,7 +129,7 @@ lin -- : Adv -> Comp ; CompAdv adv = emptyComp ** { - aComp = adv.s ; + nComp = adv.s ; } ; -- : VP -- Copula alone;