diff --git a/languages.csv b/languages.csv index 7497a7429..1259a866a 100644 --- a/languages.csv +++ b/languages.csv @@ -23,7 +23,7 @@ Ice,Icelandic,icelandic,,,,,,n,,y Ina,Interlingua,interlingua,,,y,,n,n,,n Ita,Italian,italian,Romance,,y,,,,y,y Jpn,Japanese,japanese,,,,,,,,y -Kor,Korean,korean,,,n,n,n,n,n,n +Kor,Korean,korean,,,n,y,y,y,n,n Lat,Latin,latin,,,,,y,y,n,y Lav,Latvian,latvian,,,,,,,y,y Mlt,Maltese,maltese,,,,,,,,y diff --git a/src/korean/AdjectiveKor.gf b/src/korean/AdjectiveKor.gf index d4d3fb7c7..d5a69c739 100644 --- a/src/korean/AdjectiveKor.gf +++ b/src/korean/AdjectiveKor.gf @@ -1,5 +1,5 @@ concrete AdjectiveKor of Adjective = CatKor ** - open ResKor, (AK=AdverbKor), Prelude in { + open ResKor, Prelude in { flags optimize=all_subs ; @@ -18,7 +18,7 @@ concrete AdjectiveKor of Adjective = CatKor ** -- : A2 -> NP -> AP ; -- married to her ComplA2 a2 np = a2 ** { - compar = (AK.PrepNP a2.p2 np).s ; + compar = (prepNP a2.c2 a2.p2 np).s ; } ; -- : A2 -> AP ; -- married to itself diff --git a/src/korean/AdverbKor.gf b/src/korean/AdverbKor.gf index 126cb3d81..b012f43e0 100644 --- a/src/korean/AdverbKor.gf +++ b/src/korean/AdverbKor.gf @@ -11,11 +11,7 @@ lin -- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs -- : Prep -> NP -> Adv ; - PrepNP prep np = { - s = case prep.attaches of { - True => glue (np.s ! Bare) (prep.s ! np.p) ; - False => np.s ! Bare ++ (prep.s ! np.p)} - } ; + PrepNP = prepNP Bare ; -- Adverbs can be modified by 'adadjectives', just like adjectives. diff --git a/src/korean/ConjunctionKor.gf b/src/korean/ConjunctionKor.gf index 6d81e0d49..42952fd8c 100644 --- a/src/korean/ConjunctionKor.gf +++ b/src/korean/ConjunctionKor.gf @@ -63,7 +63,8 @@ oper conjSScomma : Conj -> ConjSS -> SS = \co,ss -> { s = co.s1 - ++ glue (ss.firstSS ! co.c) co.s2 + ++ ss.firstSS ! co.c + ++ co.s2 ++ ss.s } ; @@ -151,6 +152,22 @@ lin oper mkFirstNP : ResKor.NounPhrase -> ConjType => Str = \np -> \\conj => glue (np.s ! Bare) (conjTable ! NStar ! conj) ; + -- Versions with commas, no repeated conjunctions + baseNPcomma : NP -> NP -> ListNP = \x,y -> y ** { + firstNP = \\conj => x.s ! Bare ++ BIND ++ "," ; + } ; + + consNPcomma : NP -> ListNP -> ListNP = \x,xs -> xs ** { + firstNP = \\conj => + x.s ! Bare ++ BIND ++ "," ++ xs.firstNP ! conj ; + } ; + + conjNPcomma : Conj -> ListNP -> NP = \co,xs -> xs ** { + s = \\nf => co.s1 + ++ xs.firstNP ! co.c + ++ co.s2 + ++ xs.s ! nf + } ; } diff --git a/src/korean/ExtendKor.gf b/src/korean/ExtendKor.gf index 345728b05..d0d462dd3 100644 --- a/src/korean/ExtendKor.gf +++ b/src/korean/ExtendKor.gf @@ -1,8 +1,11 @@ --# -path=.:../common:../abstract concrete ExtendKor of Extend = CatKor - -- ** ExtendFunctor - [] + -- ** ExtendFunctor - [ApposNP] -- with (Grammar=GrammarKor) - ** open Prelude, ResKor, NounKor in { + ** open Prelude, ResKor, NounKor, Coordination in { + lin + -- : NP -> NP -> NP + ApposNP np1 np2 = np1 ** {s = \\nf => np1.s ! nf ++ np2.s ! nf} ; } ; diff --git a/src/korean/Hangul.gf b/src/korean/Hangul.gf index 112649270..42793d561 100644 --- a/src/korean/Hangul.gf +++ b/src/korean/Hangul.gf @@ -183,6 +183,7 @@ oper "기" | "끼" | "니" | "디" | "띠" | "리" | "미" | "비" | "삐" | "시" | "씨" | "이" | "지" | "찌" | "치" | "키" | "티" | "피" | "히" ) ; a : pattern Str = #("가" | "까" | "나" | "다" | "따" | "라" | "마" | "바" | "빠" | "사" | "싸" | "아" | "자" | "짜" | "차" | "카" | "타" | "파" | "하") ; + e : pattern Str = #("게" | "께" | "네" | "데" | "떼" | "레" | "메" | "베" | "뻬" | "세" | "쎄" | "에" | "제" | "쩨" | "체" | "케" | "테" | "페" | "헤") ; eo : pattern Str = #("거" | "꺼" | "너" | "더" | "떠" | "러" | "머" | "버" | "뻐" | "서" | "써" | "어" | "저" | "쩌" | "처" | "커" | "터" | "퍼" | "허") ; eu : pattern Str = #("그" | "끄" | "느" | "드" | "뜨" | "르" | "므" | "브" | "쁘" | "스" | "쓰" | "으" | "즈" | "쯔" | "츠" | "크" | "트" | "프" | "흐") ; i : pattern Str = #("기" | "끼" | "니" | "디" | "띠" | "리" | "미" | "비" | "삐" | "시" | "씨" | "이" | "지" | "찌" | "치" | "키" | "티" | "피" | "히") ; diff --git a/src/korean/LexiconKor.gf b/src/korean/LexiconKor.gf index 8ea10252b..11e46d857 100644 --- a/src/korean/LexiconKor.gf +++ b/src/korean/LexiconKor.gf @@ -1,5 +1,5 @@ concrete LexiconKor of Lexicon = CatKor ** - open ParadigmsKor, ResKor in { + open ParadigmsKor, ResKor, StructuralKor in { ---- -- A @@ -36,7 +36,7 @@ lin big_A = mkA "크다" ; lin black_A = mkA "검다" ; -- lin blood_N = mkN "" ; -- lin blow_V = mkV "" ; -lin blue_A = mkA "푸르다" ; +lin blue_A = mkA "파랗다" "파래요" "파랗습니다" "파란" ; -- lin boat_N = mkN "" ; -- lin bone_N = mkN "" ; -- lin boot_N = mkN "" ; @@ -223,7 +223,7 @@ lin like_V2 = mkV2 (mkV "좋아" do_V) topic object ; -- M lin man_N = mkN "남자" ; --- lin married_A2 = mkA "" ; +lin married_A2 = mkA2 (mkA "결혼했다" "결혼했어요" "결혼했습니다" "결혼한") with_Prep ; -- TODO check: forced past tense -- lin meat_N = mkN "" ; lin milk_N = mkN "우유" ; -- lin moon_N = mkN "" ; @@ -279,7 +279,7 @@ lin person_N = mkN "사람" ; -- lin read_V2 = mkV2 "" ; -- lin ready_A = mkA "" ; -- lin reason_N = mkN "" ; -lin red_A = mkA "빨갛다" ; +lin red_A = mkA "빨갛다" "빨개요" "빨갛습니다" "빨간" ; -- lin religion_N = mkN "" ; -- lin restaurant_N = mkN "" ; -- lin river_N = mkN "" ; diff --git a/src/korean/MissingKor.gf b/src/korean/MissingKor.gf index 3fed47a82..cd6f68227 100644 --- a/src/korean/MissingKor.gf +++ b/src/korean/MissingKor.gf @@ -11,10 +11,11 @@ oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ; oper AdvAP : AP -> Adv -> AP = notYet "AdvAP" ; oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ; oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ; -oper AdvNP : NP -> Adv -> NP = notYet "AdvNP" ; oper AdvQVP : VP -> IAdv -> QVP = notYet "AdvQVP" ; oper AdvSlash : ClSlash -> Adv -> ClSlash = notYet "AdvSlash" ; +oper BaseAdV : AdV -> AdV -> ListAdV = notYet "BaseAdV" ; oper BaseCN : CN -> CN -> ListCN = notYet "BaseCN" ; +oper BaseIAdv : IAdv -> IAdv -> ListIAdv = notYet "BaseIAdv" ; oper CAdvAP : CAdv -> AP -> NP -> AP = notYet "CAdvAP" ; oper CleftAdv : Adv -> S -> Cl = notYet "CleftAdv" ; oper CleftNP : NP -> RS -> Cl = notYet "CleftNP" ; @@ -29,18 +30,17 @@ oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ; oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ; oper ComplVS : VS -> S -> VP = notYet "ComplVS" ; oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ; +oper ConjAdV : Conj -> ListAdV -> AdV = notYet "ConjAdV" ; oper ConjCN : Conj -> ListCN -> CN = notYet "ConjCN" ; oper ConjDet : Conj -> ListDAP -> Det = notYet "ConjDet" ; oper ConjIAdv : Conj -> ListIAdv -> IAdv = notYet "ConjIAdv" ; +oper ConsAdV : AdV -> ListAdV -> ListAdV = notYet "ConsAdV" ; oper ConsCN : CN -> ListCN -> ListCN = notYet "ConsCN" ; oper ConsIAdv : IAdv -> ListIAdv -> ListIAdv = notYet "ConsIAdv" ; oper CountNP : Det -> NP -> NP = notYet "CountNP" ; -oper D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 : Dig = notYet "D_9" ; oper DetDAP : Det -> DAP = notYet "DetDAP" ; oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ; oper EmbedQS : QS -> SC = notYet "EmbedQS" ; -oper EmbedS : S -> SC = notYet "EmbedS" ; -oper EmbedVP : VP -> SC = notYet "EmbedVP" ; oper ExistIP : IP -> QCl = notYet "ExistIP" ; oper ExistIPAdv : IP -> Adv -> QCl = notYet "ExistIPAdv" ; oper ExistNP : NP -> Cl = notYet "ExistNP" ; @@ -48,9 +48,6 @@ oper ExistNPAdv : NP -> Adv -> Cl = notYet "ExistNPAdv" ; oper ExtAdvVP : VP -> Adv -> VP = notYet "ExtAdvVP" ; oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ; oper GenericCl : VP -> Cl = notYet "GenericCl" ; -oper IDig : Dig -> Digits = notYet "IDig" ; -oper IIDig : Dig -> Digits -> Digits = notYet "IIDig" ; -oper IdRP : RP = notYet "IdRP" ; oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ; oper IdetIP : IDet -> IP = notYet "IdetIP" ; oper IdetQuant : IQuant -> Num -> IDet = notYet "IdetQuant" ; @@ -58,12 +55,9 @@ oper ImpP3 : NP -> VP -> Utt = notYet "ImpP3" ; oper ImpPl1 : VP -> Utt = notYet "ImpPl1" ; oper ImpVP : VP -> Imp = notYet "ImpVP" ; oper ImpersCl : VP -> Cl = notYet "ImpersCl" ; -oper MassNP : CN -> NP = notYet "MassNP" ; -oper NumDigits : Digits -> Card = notYet "NumDigits" ; oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ; oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ; oper OrdNumeralSuperl : Numeral -> A -> Ord = notYet "OrdNumeralSuperl" ; -oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ; oper PConjConj : Conj -> PConj = notYet "PConjConj" ; oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ; oper PartNP : CN -> NP -> CN = notYet "PartNP" ; @@ -71,7 +65,6 @@ oper PassV2 : V2 -> VP = notYet "PassV2" ; oper PositAdAAdj : A -> AdA = notYet "PositAdAAdj" ; oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ; oper PossNP : CN -> NP -> CN = notYet "PossNP" ; -oper PossPron : Pron -> Quant = notYet "PossPron" ; oper PrepIP : Prep -> IP -> IAdv = notYet "PrepIP" ; oper ProgrVP : VP -> VP = notYet "ProgrVP" ; oper QuestCl : Cl -> QCl = notYet "QuestCl" ; @@ -84,12 +77,12 @@ oper ReflA2 : A2 -> AP = notYet "ReflA2" ; oper ReflVP : VPSlash -> VP = notYet "ReflVP" ; oper RelNP : NP -> RS -> NP = notYet "RelNP" ; oper RelS : S -> RS -> S = notYet "RelS" ; +oper RelSlash : RP -> ClSlash -> RCl = notYet "RelSlash" ; oper SSubjS : S -> Subj -> S -> S = notYet "SSubjS" ; oper SelfAdVVP : VP -> VP = notYet "SelfAdVVP" ; oper SelfAdvVP : VP -> VP = notYet "SelfAdvVP" ; oper SelfNP : NP -> NP = notYet "SelfNP" ; oper SentAP : AP -> SC -> AP = notYet "SentAP" ; -oper SentCN : CN -> SC -> CN = notYet "SentCN" ; oper Slash2V3 : V3 -> NP -> VPSlash = notYet "Slash2V3" ; oper Slash3V3 : V3 -> NP -> VPSlash = notYet "Slash3V3" ; oper SlashPrep : Cl -> Prep -> ClSlash = notYet "SlashPrep" ; @@ -104,10 +97,15 @@ oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ; oper SubjS : Subj -> S -> Adv = notYet "SubjS" ; oper Use2N3 : N3 -> N2 = notYet "Use2N3" ; oper Use3N3 : N3 -> N2 = notYet "Use3N3" ; +oper UseQCl : Temp -> Pol -> QCl -> QS = notYet "UseQCl" ; oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ; +oper UttIAdv : IAdv -> Utt = notYet "UttIAdv" ; +oper UttIP : IP -> Utt = notYet "UttIP" ; oper UttImpPl : Pol -> Imp -> Utt = notYet "UttImpPl" ; oper UttImpPol : Pol -> Imp -> Utt = notYet "UttImpPol" ; oper UttImpSg : Pol -> Imp -> Utt = notYet "UttImpSg" ; +oper UttInterj : Interj -> Utt = notYet "UttInterj" ; +oper UttQS : QS -> Utt = notYet "UttQS" ; oper VPSlashPrep : VP -> Prep -> VPSlash = notYet "VPSlashPrep" ; oper VocNP : NP -> Voc = notYet "VocNP" ; oper above_Prep : Prep = notYet "above_Prep" ; @@ -146,7 +144,6 @@ oper between_Prep : Prep = notYet "between_Prep" ; oper bike_N : N = notYet "bike_N" ; oper bird_N : N = notYet "bird_N" ; oper bite_V2 : V2 = notYet "bite_V2" ; -oper black_A : A = notYet "black_A" ; oper blood_N : N = notYet "blood_N" ; oper blow_V : V = notYet "blow_V" ; oper boat_N : N = notYet "boat_N" ; @@ -165,8 +162,6 @@ oper burn_V : V = notYet "burn_V" ; oper but_PConj : PConj = notYet "but_PConj" ; oper butter_N : N = notYet "butter_N" ; oper buy_V2 : V2 = notYet "buy_V2" ; -oper by8agent_Prep : Prep = notYet "by8agent_Prep" ; -oper by8means_Prep : Prep = notYet "by8means_Prep" ; oper camera_N : N = notYet "camera_N" ; oper can8know_VV : VV = notYet "can8know_VV" ; oper can_VV : VV = notYet "can_VV" ; @@ -183,7 +178,6 @@ oper clean_A : A = notYet "clean_A" ; oper clever_A : A = notYet "clever_A" ; oper close_V2 : V2 = notYet "close_V2" ; oper cloud_N : N = notYet "cloud_N" ; -oper coat_N : N = notYet "coat_N" ; oper cold_A : A = notYet "cold_A" ; oper computer_N : N = notYet "computer_N" ; oper correct_A : A = notYet "correct_A" ; @@ -211,7 +205,6 @@ oper dn1000000c : Dig -> Dig -> Dig -> Dig -> Dig -> Dig -> Sub1000000 = notYet oper doctor_N : N = notYet "doctor_N" ; oper dog_N : N = notYet "dog_N" ; oper door_N : N = notYet "door_N" ; -oper drink_V2 : V2 = notYet "drink_V2" ; oper dry_A : A = notYet "dry_A" ; oper dull_A : A = notYet "dull_A" ; oper during_Prep : Prep = notYet "during_Prep" ; @@ -237,7 +230,6 @@ oper father_N2 : N2 = notYet "father_N2" ; oper fear_V2 : V2 = notYet "fear_V2" ; oper fear_VS : VS = notYet "fear_VS" ; oper feather_N : N = notYet "feather_N" ; -oper few_Det : Det = notYet "few_Det" ; oper few_X_short_of_Y : NP -> CN -> CN -> S = notYet "few_X_short_of_Y" ; oper fight_V2 : V2 = notYet "fight_V2" ; oper find_V2 : V2 = notYet "find_V2" ; @@ -275,7 +267,6 @@ oper has_age_VP : Card -> VP = notYet "has_age_VP" ; oper hat_N : N = notYet "hat_N" ; oper hate_V2 : V2 = notYet "hate_V2" ; oper have_name_Cl : NP -> NP -> Cl = notYet "have_name_Cl" ; -oper he_Pron : Pron = notYet "he_Pron" ; oper head_N : N = notYet "head_N" ; oper hear_V2 : V2 = notYet "hear_V2" ; oper heart_N : N = notYet "heart_N" ; @@ -298,7 +289,6 @@ oper how_old_QCl : NP -> QCl = notYet "how_old_QCl" ; oper hungry_VP : VP = notYet "hungry_VP" ; oper hunt_V2 : V2 = notYet "hunt_V2" ; oper husband_N : N = notYet "husband_N" ; -oper i_Pron : Pron = notYet "i_Pron" ; oper ice_N : N = notYet "ice_N" ; oper if_Subj : Subj = notYet "if_Subj" ; oper if_then_Conj : Conj = notYet "if_then_Conj" ; @@ -329,7 +319,6 @@ oper left_Ord : Ord = notYet "left_Ord" ; oper leg_N : N = notYet "leg_N" ; oper less_CAdv : CAdv = notYet "less_CAdv" ; oper lie_V : V = notYet "lie_V" ; -oper like_V2 : V2 = notYet "like_V2" ; oper listen_V2 : V2 = notYet "listen_V2" ; oper live_V : V = notYet "live_V" ; oper liver_N : N = notYet "liver_N" ; @@ -338,7 +327,6 @@ oper lose_V2 : V2 = notYet "lose_V2" ; oper louse_N : N = notYet "louse_N" ; oper love_N : N = notYet "love_N" ; oper love_V2 : V2 = notYet "love_V2" ; -oper many_Det : Det = notYet "many_Det" ; oper married_A2 : A2 = notYet "married_A2" ; oper married_Cl : NP -> NP -> Cl = notYet "married_Cl" ; oper meat_N : N = notYet "meat_N" ; @@ -376,12 +364,10 @@ oper oil_N : N = notYet "oil_N" ; oper old_A : A = notYet "old_A" ; oper on_Prep : Prep = notYet "on_Prep" ; oper open_V2 : V2 = notYet "open_V2" ; -oper or_Conj : Conj = notYet "or_Conj" ; oper otherwise_PConj : PConj = notYet "otherwise_PConj" ; oper paint_V2A : V2A = notYet "paint_V2A" ; oper paper_N : N = notYet "paper_N" ; oper paris_PN : PN = notYet "paris_PN" ; -oper part_Prep : Prep = notYet "part_Prep" ; oper peace_N : N = notYet "peace_N" ; oper pen_N : N = notYet "pen_N" ; oper planet_N : N = notYet "planet_N" ; @@ -405,7 +391,6 @@ oper read_V2 : V2 = notYet "read_V2" ; oper ready_A : A = notYet "ready_A" ; oper ready_VP : VP = notYet "ready_VP" ; oper reason_N : N = notYet "reason_N" ; -oper red_A : A = notYet "red_A" ; oper religion_N : N = notYet "religion_N" ; oper restaurant_N : N = notYet "restaurant_N" ; oper right_Ord : Ord = notYet "right_Ord" ; @@ -435,10 +420,8 @@ oper sell_V3 : V3 = notYet "sell_V3" ; oper send_V3 : V3 = notYet "send_V3" ; oper sew_V : V = notYet "sew_V" ; oper sharp_A : A = notYet "sharp_A" ; -oper she_Pron : Pron = notYet "she_Pron" ; oper sheep_N : N = notYet "sheep_N" ; oper ship_N : N = notYet "ship_N" ; -oper shirt_N : N = notYet "shirt_N" ; oper shoe_N : N = notYet "shoe_N" ; oper shop_N : N = notYet "shop_N" ; oper silver_N : N = notYet "silver_N" ; @@ -454,10 +437,7 @@ oper snake_N : N = notYet "snake_N" ; oper snow_N : N = notYet "snow_N" ; oper so_AdA : AdA = notYet "so_AdA" ; oper sock_N : N = notYet "sock_N" ; -oper somePl_Det : Det = notYet "somePl_Det" ; -oper someSg_Det : Det = notYet "someSg_Det" ; oper somebody_NP : NP = notYet "somebody_NP" ; -oper something_NP : NP = notYet "something_NP" ; oper somewhere_Adv : Adv = notYet "somewhere_Adv" ; oper song_N : N = notYet "song_N" ; oper speak_V2 : V2 = notYet "speak_V2" ; @@ -553,8 +533,5 @@ oper worm_N : N = notYet "worm_N" ; oper write_V2 : V2 = notYet "write_V2" ; oper year_N : N = notYet "year_N" ; oper yellow_A : A = notYet "yellow_A" ; -oper youPl_Pron : Pron = notYet "youPl_Pron" ; -oper youPol_Pron : Pron = notYet "youPol_Pron" ; -oper youSg_Pron : Pron = notYet "youSg_Pron" ; oper young_A : A = notYet "young_A" ; } diff --git a/src/korean/ParadigmsKor.gf b/src/korean/ParadigmsKor.gf index 268a4bea2..cfa77008b 100644 --- a/src/korean/ParadigmsKor.gf +++ b/src/korean/ParadigmsKor.gf @@ -27,6 +27,8 @@ oper mkA : overload { mkA : (adj : Str) -> A ; -- Regular adjective, given in -다 form mkA : (kiga : Str) -> (jakda : A) -> A ; -- Compound adjective, e.g. 키가 작다 'short', literally 'height (is) small'. 키가 'height' given as string, 작다 'small' given as preconstructed A. + mkA : (jaemi : Str) -> (itda : V) -> A ; -- Compound adjective from 있다/없다 (or any other preconstructed verb), e.g. 재미있다 'amusing; entertaining', literally from parts 'fun' (Str) and 'have' (V). + mkA : (plain,polite,formal,attr : Str) -> A ; -- Worst case constructor: e.g. mkA "파랗다" "파래요" "파랗습니다" "파란" } ; mkA2 : overload { @@ -43,6 +45,7 @@ oper mkV : overload { mkV : (plain : Str) -> V ; -- Predictable verb. Takes plain, uninflected -다 form, e.g. 가다 mkV : (nore : Str) -> (hada : V) -> V ; -- Add a prefix to an existing verb, e.g. 노래+하다 + mkV : (plain,polite,formal,attr : Str) -> V ; -- Worst case constructor: e.g. mkV "다르다" "달라요" "다릅니다" "다른" } ; copula : V ; -- The copula verb '' @@ -133,6 +136,10 @@ oper mkA : (adj : Str) -> A = \s -> lin A (mkAdj s) ; mkA : (kiga : Str) -> (jakda : A) -> A = \kiga,jakda -> jakda ** {s = \\af => kiga ++ jakda.s ! af} ; + 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}) ; } ; mkA2 = overload { @@ -140,14 +147,16 @@ oper mkA2 : Str -> Str -> A2 = \s,p -> let adj : Adjective = mkAdj s ; prep : Prep = mkPrep p - in lin A2 (adj ** {p2 = prep}) ; - mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (a ** {p2 = p}) ; + in lin A2 (atoa2 adj ** {p2 = prep}) ; + mkA2 : A -> Prep -> A2 = \a,p -> lin A2 (atoa2 a ** {p2 = p}) ; } ; mkV = overload { mkV : (plain : Str) -> V = \v -> lin V (mkVerb v) ; mkV : (nore : Str) -> (hada : V) -> V = \nore,hada -> hada ** { s = \\vf => nore + hada.s ! vf} ; + mkV : (plain,polite,formal,attr : Str) -> V + = \x1,x2,x3,x4 -> lin V (mkVerbReg x1 x2 x3 x4) ; } ; copula = ResKor.copula ; diff --git a/src/korean/ParamKor.gf b/src/korean/ParamKor.gf index 1b2a715db..b1811c199 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 a51bacbf7..e8907c245 100644 --- a/src/korean/ResKor.gf +++ b/src/korean/ResKor.gf @@ -142,16 +142,22 @@ oper -- Adjectives Adjective : Type = {s : VForm => Str} ; -- Adjectives are verbs - Adjective2 : Type = Adjective ** {p2 : Postposition} ; + Adjective2 : Type = Adjective ** {c2 : NForm ; p2 : Postposition} ; + + v2a : (attrpos : Str) -> Verb -> Adjective = \attrpos,v -> { + s = table { + VAttr Pos => attrpos ; -- Positive Attr is different in + vf => v.s ! vf } -- adjectives, otherwise adj forms == verb forms. + } ; mkAdj : Str -> Adjective = \plain -> - let stem = init plain ; - verb = mkVerb plain ; - in { - s = table { - VAttr Pos => add_N stem ; -- Positive Attr form is different in - vf => verb.s ! vf } -- adjectives, otherwise adj forms == verb forms. - } ; + let v : Verb = mkVerb plain ; + stem : Str = v.s ! VStem ; + attrpos : Str = add_N stem ; + in v2a attrpos v ; + + mkAdjReg : (x1,_,_,x4 : Str) -> Adjective = \plain,polite,formal,attr -> + v2a attr (mkVerbReg plain polite formal attr) ; atoa2 : Adjective -> Adjective2 = \a -> a ** {c2=Bare ; p2=emptyPP} ; @@ -173,12 +179,12 @@ oper mkVerb : (plain : Str) -> Verb = \plain -> let stem = init plain ; informal = add_eo stem ; -- not used in grammar yet - polpres = informal + "요" ; - formalpres = case vowFinal stem of { + polite = informal + "요" ; + formal = case vowFinal stem of { True => add_B stem + "니다" ; False => stem + "습니다" } ; - neg = stem + "지" ; - in mkVerbReg plain polpres formalpres neg ; + attrpos = stem + "는" ; + in mkVerbReg plain polite formal attrpos ; mkVerb2 : (plain : Str) -> Verb2 = \plain -> vtov2 (mkVerb plain) ; mkVerb3 : (plain : Str) -> Verb3 = \plain -> v2tov3 (mkVerb2 plain) ; @@ -186,10 +192,11 @@ oper vtov2 : Verb -> Verb2 = \v -> v ** {c2 = Object ; p2 = emptyPP} ; v2tov3 : Verb2 -> Verb3 = \v -> v ** {c3 = Bare ; p3 = datPP} ; + -- ㄹ-irregulars, ㅎ-irregular mkVerbReg : (x1,_,_,x4 : Str) -> Verb = - \plain,polite,formal,neg -> + \plain,polite,formal,attrpos -> let stem = init plain ; - attrpos = stem + "는" ; -- TODO: ㄹ-irregulars + neg = stem + "지" ; attrneg = neg ++ "않는" ; planeg = neg ++ negForms ! Plain ; polneg = neg ++ negForms ! Polite ; @@ -242,11 +249,19 @@ oper "없어요" "없습니다" ; + -- For building an adjective. Different attr from do_V. + do_A : Verb = mkVerbReg + "하다" + "해요" + "합니다" + "한" ; + hada_A = do_A ; -- Exposing both names (hada=transliteration, do=translation) + do_V : Verb = mkVerbReg "하다" "해요" "합니다" - "하지" ; + "하는" ; negForms : Style => Str = table { Plain => "않다" ; @@ -258,6 +273,11 @@ oper Adverb : Type = SS ; + prepNP : NForm -> Postposition -> NounPhrase -> Adverb = \nf,pp,np -> { + s = case pp.attaches of { + True => glue (np.s ! nf) (pp.s ! np.p) ; + False => np.s ! nf ++ (pp.s ! np.p)} + } ; ------------------ -- Conj @@ -267,17 +287,23 @@ oper -- Need to add conjunction already in ConsX funs. n : Number ; } ; + + -- Do not remove this. Used in a particular application grammar. + commaConj : Conj = { + s1, s2 = [] ; + c = Comma ; + n = Pl ; + } ; + ------------------ -- VP Complement : Type = { s : VForm => Str ; - -- compar : Str ; -- comparative is discontinuous } ; emptyComp : Complement = { s = \\_ => [] ; - -- compar : Str ; } ; BaseVP : Type = { diff --git a/src/korean/StructuralKor.gf b/src/korean/StructuralKor.gf index 60b3f7193..fe62f8352 100644 --- a/src/korean/StructuralKor.gf +++ b/src/korean/StructuralKor.gf @@ -69,7 +69,7 @@ lin only_Predet = {s = \\_ => "만" ; p = Consonant} ; --lin every_Det = ; -lin few_Det = mkDet "조금" Pl ; +lin few_Det = mkDet "조금의" Pl ; lin many_Det = mkDet "많은" Pl ; -- lin much_Det = ; @@ -115,7 +115,7 @@ lin possess_Prep = mkPrep "의" ; -- lin through_Prep = mkPrep ; lin to_Prep = mkPrep "에"; -- lin under_Prep = mkPrep "" ; --- lin with_Prep = mkPrep "" ; +lin with_Prep = mkPrep "와" "과" ; -- lin without_Prep = mkPrep "" ;