refactored adjectives in StemFin to get correct tags in tagged/

This commit is contained in:
aarne
2016-09-22 06:33:43 +00:00
parent 1eb83dad9e
commit ddf24a0a4e
5 changed files with 18 additions and 8 deletions

View File

@@ -6,10 +6,10 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
lin
PositA a = {
s = \\_ => (snoun2nounSep {s = \\f => a.s ! Posit ! sAN f ; h = a.h}).s
s = \\_ => sAdjFull2nforms Posit a ;
} ;
ComparA a np =
let acomp = (snoun2nounSep {s = \\f => a.s ! Compar ! sAN f ; h = a.h}).s in {
let acomp = sAdjFull2nforms Compar a in {
s = \\isMod,af => case isMod of {
True => np.s ! NPCase Part ++ acomp ! af ; -- minua isompi
_ => acomp ! af ++ "kuin" ++ np.s ! NPSep -- isompi kuin minä
@@ -19,7 +19,7 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPSep
} ;
UseComparA a = {
s = \\_ => (snoun2nounSep {s = \\f => a.s ! Compar ! sAN f ; h = a.h}).s
s = \\_ => sAdjFull2nforms Compar a
} ;
-- $SuperlA$ belongs to determiner syntax in $Noun$.
@@ -30,13 +30,13 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
ComplA2 a np = {
s = \\isMod,af =>
preOrPost isMod (appCompl True Pos a.c2 np) ((snoun2nounSep {s = \\f => a.s ! Posit ! sAN f ; h = a.h}).s ! af)
preOrPost isMod (appCompl True Pos a.c2 np) (sAdjFull2nforms Posit a ! af)
} ;
ReflA2 a = {
s = \\isMod,af =>
preOrPost isMod
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) ((snoun2nounSep {s = \\f => a.s ! Posit ! sAN f ; h = a.h}).s ! af)
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) (sAdjFull2nforms Posit a ! af)
} ;
SentAP ap sc = {
@@ -52,7 +52,7 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
} ;
UseA2 a = {
s = \\_ => (snoun2nounSep {s = \\f => a.s ! Posit ! sAN f ; h = a.h}).s
s = \\_ => sAdjFull2nforms Posit a
} ;
}

View File

@@ -151,7 +151,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
n = num.n
} ;
OrdSuperl a = snoun2nounSep {s = \\nc => a.s ! Superl ! sAN nc ; h = a.h} ;
OrdSuperl a = {s = sAdjFull2nforms Superl a ; h = a.h} ;
OrdNumeralSuperl n a = -- kolmanneksi suurin
{s = \\f => n.s ! NOrd (NCase Sg Transl) ++ (snoun2nounSep {s = \\nc => a.s ! Superl ! sAN nc ; h = a.h}).s ! f} ;

View File

@@ -51,6 +51,9 @@ oper
oper
SAdj = {s : SAForm => Str ; h : Harmony} ;
SAdjFull = {s : Degree => SAForm => Str ; h : Harmony} ;
sAdjFull2nforms : Degree -> SAdjFull -> NForm => Str = \d,a -> (snoun2nounSep {s = \\nc => a.s ! d ! sAN nc ; h = a.h}).s ;
snoun2sadj : SNoun -> SAdj = snoun2sadjComp True ;
@@ -70,7 +73,7 @@ oper
sAAdv : SAForm = AAdv ;
sANGen : (SAForm => Str) -> Str = \a -> a ! AN (NCase Sg Gen) ;
mkAdj : (hyva,parempi,paras : SNoun) -> (hyvin,paremmin,parhaiten : Str) -> {s : Degree => SAForm => Str ; h : Harmony} = \h,p,ps,hn,pn,ph -> {
mkAdj : (hyva,parempi,paras : SNoun) -> (hyvin,paremmin,parhaiten : Str) -> SAdjFull = \h,p,ps,hn,pn,ph -> {
s = table {
Posit => table {
AN nf => h.s ! nf ;

View File

@@ -125,6 +125,9 @@ param
oper
SAdj = {s : SAForm => Str ; h : Harmony} ;
SAdjFull = {s : Degree => SAForm => Str ; h : Harmony} ;
sAdjFull2nforms : Degree -> SAdjFull -> NForm => Str = \d,a -> (snoun2nounSep {s = \\nc => a.s ! d ! sAN nc ; h = a.h}).s ;
snoun2sadj : SNoun -> SAdj = snoun2sadjComp True ;

View File

@@ -49,6 +49,10 @@ oper
oper
SAForm : Type = SNForm ;
SAdj : Type = SNoun ;
SAdjFull = {s : Degree => SAForm => Str ; h : Harmony} ;
sAdjFull2nforms : Degree -> SAdjFull -> NForm => Str = \d,a ->
\\nf => tagWord (adjectiveTag ++ consTag (tagDegree d) (tagNForm nf)) (a.s ! Posit ! 0) ; ---- order diff from UD
snoun2sadj : SNoun -> SAdj = snoun2sadjComp True ;