From 3b66a870d1fbfedffb38873bf8cf4dc516aa70b8 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 15 Mar 2013 08:55:14 +0000 Subject: [PATCH] stemmed version of verbs: from 102 forms to 13 "technical stems" in Fin --- lib/src/finnish/stemmed/CatFin.gf | 14 ++++++-------- lib/src/finnish/stemmed/NounFin.gf | 2 +- lib/src/finnish/stemmed/StemFin.gf | 15 ++++++--------- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lib/src/finnish/stemmed/CatFin.gf b/lib/src/finnish/stemmed/CatFin.gf index 6a84f5237..7a6039a1c 100644 --- a/lib/src/finnish/stemmed/CatFin.gf +++ b/lib/src/finnish/stemmed/CatFin.gf @@ -81,12 +81,12 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in { -- Open lexical classes, e.g. Lexicon - V, VS, VQ = Verb1 ; -- = {s : VForm => Str ; sc : Case} ; - V2, VA, V2Q, V2S = Verb1 ** {c2 : Compl} ; - V2A = Verb1 ** {c2, c3 : Compl} ; - VV = Verb1 ** {vi : InfForm} ; ---- infinitive form - V2V = Verb1 ** {c2 : Compl ; vi : InfForm} ; ---- infinitive form - V3 = Verb1 ** {c2, c3 : Compl} ; + V, VS, VQ = SVerb1 ; + V2, VA, V2Q, V2S = SVerb1 ** {c2 : Compl} ; + V2A = SVerb1 ** {c2, c3 : Compl} ; + VV = SVerb1 ** {vi : InfForm} ; ---- infinitive form + V2V = SVerb1 ** {c2 : Compl ; vi : InfForm} ; ---- infinitive form + V3 = SVerb1 ** {c2, c3 : Compl} ; A = {s : Degree => SAForm => Str ; h : Harmony} ; A2 = {s : Degree => SAForm => Str ; h : Harmony ; c2 : Compl} ; @@ -96,6 +96,4 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in { N3 = SNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool} ; PN = SNoun ; -oper Verb1 = {s : VForm => Str ; sc : NPForm ; qp : Bool ; p : Str} ; - } diff --git a/lib/src/finnish/stemmed/NounFin.gf b/lib/src/finnish/stemmed/NounFin.gf index 202222bf4..6d1b05b1d 100644 --- a/lib/src/finnish/stemmed/NounFin.gf +++ b/lib/src/finnish/stemmed/NounFin.gf @@ -74,7 +74,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in } ; PPartNP np v2 = { - s = \\c => np.s ! c ++ v2.s ! PastPartPass (AN (NCase (complNumAgr np.a) Ess)) ; + s = \\c => np.s ! c ++ (sverb2verbSep v2).s ! PastPartPass (AN (NCase (complNumAgr np.a) Ess)) ; a = np.a ; isPron = np.isPron ; -- minun täällä - ni isNeg = np.isNeg diff --git a/lib/src/finnish/stemmed/StemFin.gf b/lib/src/finnish/stemmed/StemFin.gf index 768da6dbd..989b9ad7e 100644 --- a/lib/src/finnish/stemmed/StemFin.gf +++ b/lib/src/finnish/stemmed/StemFin.gf @@ -7,7 +7,6 @@ flags coding = utf8 ; oper SNForm : Type = Predef.Ints 9 ; SNoun : Type = {s : SNForm => Str ; h : Harmony} ; --- SVerb : Type ; nforms2snoun : NForms -> SNoun = \nf -> { s = table { @@ -30,11 +29,7 @@ oper snoun2noun : Bool -> SNoun -> Noun = \b,sn -> let - plus : Str -> Str -> Str = \x,y -> case b of { - True => x + y ; - False => glue x y - } ; - + plus = plusIf b ; f = sn.s ; ukko = f ! 0 ; @@ -102,11 +97,13 @@ oper aHarmony : Str -> Harmony = \a -> case a of {"a" => Back ; _ => Front} ; - harmonyA : Harmony -> Str = \h -> case h of - {Back => "a" ; Front => "ä"} ; + harmonyA : Harmony -> Str = harmonyV "a" "ä" ; + + harmonyV : Str -> Str -> Harmony -> Str = \u,y,h -> case h of + {Back => u ; Front => y} ; --- Adjectives +-- Adjectives --- could be made more compact by pressing comparison forms down to a few param SAForm = SAN SNForm | SAAdv ;