diff --git a/lectures/lecture-03/MorphologySwe.gf b/lectures/lecture-03/MorphologySwe.gf index d3d92cd..da81cca 100644 --- a/lectures/lecture-03/MorphologySwe.gf +++ b/lectures/lecture-03/MorphologySwe.gf @@ -27,6 +27,29 @@ oper g = g } ; + addS : Str -> Str = \s -> case s of { + _ + ("s" | "x" | "z") => s ; + _ => s + "s" + } ; + + mk4Noun : (sin, sdn, pin, pdn : Str) -> Noun = + \sin, sdn, pin, pdn -> { + s = table { + NF Sg Ind Nom => sin ; + NF Sg Ind Gen => addS sin ; + NF Sg Def Nom => sdn ; + NF Sg Def Gen => addS sdn ; + NF Pl Ind Nom => pin ; + NF Pl Ind Gen => addS pin ; + NF Pl Def Nom => pdn ; + NF Pl Def Gen => addS pdn + } ; + g = case sdn of { + _ + "n" => Com ; + _ => Neut + } + } ; + smartNoun : Str -> Noun = \mamma -> case mamma of { mamm + "a" => mkNoun mamma (mamma + "s") (mamma + "n") (mamma + "ns") (mamm + "or") (mamm + "ors") (mamm + "orna") (mamm + "ornas")