From 54c02b4be458ebf1df9bf362177f8e16cfc07a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Thu, 12 Feb 2026 18:46:56 -0700 Subject: [PATCH] wip: noun morphology --- lab1/grammar/korean/MicroLangKor.gf | 12 ++++++------ lab1/grammar/korean/MicroResKor.gf | 15 ++++++++++++++- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/lab1/grammar/korean/MicroLangKor.gf b/lab1/grammar/korean/MicroLangKor.gf index b8a73a4..d10f6eb 100644 --- a/lab1/grammar/korean/MicroLangKor.gf +++ b/lab1/grammar/korean/MicroLangKor.gf @@ -11,11 +11,11 @@ concrete MicroLangKor of MicroLang = open MicroResKor, Prelude in { Utt = {s : Str} ; S = {s : Str} ; - VP = {verb : Verb ; compl : Str} ; ---s special case of Mini + VP = {verb : Verb ; compl : N} ; ---s special case of Mini Comp = Noun ; AP = Adjective ; CN = Noun ; - NP = {s : Str} ; + NP = Noun ; Pron = {s : Str} ; Det = {s : Str} ; Prep = {s : Str} ; @@ -27,9 +27,9 @@ concrete MicroLangKor of MicroLang = open MicroResKor, Prelude in { lin UttS s = {s = s.s} ; - UttNP np = {s = np.s} ; - PredVPS np vp = {s = np.s ++ vp.compl ++ vp.verb.s ! VPresent} ; - UseV v = {verb = v ; compl = []} ; + UttNP np = {s = np.s ! NBare} ; + PredVPS np vp = {s = np.s ! NSubject ++ vp.compl ! NObject ++ vp.verb.s ! VPresent} ; + UseV v = {verb = v ; compl = {s = \\_ => []}} ; ComplV2 v2 np = {verb = v2 ; compl = np.s}; UseN n = n ; DetCN det cn = {s = det.s ++ cn.s} ; @@ -143,7 +143,7 @@ lin woman_N = mkN "여자" ; oper mkN : Str -> Noun - = \s -> lin N {s = s} ; + = \s -> lin N (noun s) ; mkV : Str -> V = \lemma -> lin V (regVerb lemma) ; diff --git a/lab1/grammar/korean/MicroResKor.gf b/lab1/grammar/korean/MicroResKor.gf index f0a2ee7..cdda1b5 100644 --- a/lab1/grammar/korean/MicroResKor.gf +++ b/lab1/grammar/korean/MicroResKor.gf @@ -1,9 +1,10 @@ resource MicroResKor = open Prelude, HangulJamo in { param VForm = VLemma | VPresent | VPast | VAdnomial ; + NForm = NBare | NTopic | NSubject | NObject | NPluralSubject | NPluralTopic ; oper - Noun : Type = {s : Str} ; + Noun : Type = {s : NForm => Str} ; Verb : Type = {s : VForm => Str} ; Verb2 : Type = Verb ; Adjective : Type = Verb ; @@ -31,4 +32,16 @@ resource MicroResKor = open Prelude, HangulJamo in { regVerb : (lemma : Str) -> Verb = reg False ; regAdjective : (lemma : Str) -> Adjective = reg True ; + + noun : (bare : Str) -> Noun + = \bare -> { + s = table { + NBare => bare ; + NTopic => bare + vc_allomorph bare "는" "은" ; + NSubject => bare + vc_allomorph bare "이" "가" ; + NObject => bare + vc_allomorph bare "를" "을" ; + NPluralTopic => bare + "들은" ; + NPluralSubject => bare + "들이" + } + } ; }