forked from GitHub/gf-rgl
(Fin) Add prefix field to A
This commit is contained in:
@@ -5,54 +5,63 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
|
||||
|
||||
lin
|
||||
|
||||
PositA a = {
|
||||
PositA a = a ** {
|
||||
s = \\_ => sAdjFull2nforms Posit a ;
|
||||
} ;
|
||||
ComparA a np =
|
||||
let acomp = sAdjFull2nforms Compar a in {
|
||||
let acomp = sAdjFull2nforms Compar a in a ** {
|
||||
s = \\isMod,af => case isMod of {
|
||||
True => np.s ! NPCase Part ++ acomp ! af ; -- minua isompi
|
||||
_ => acomp ! af ++ "kuin" ++ np.s ! NPSep -- isompi kuin minä
|
||||
}
|
||||
} ;
|
||||
CAdvAP ad ap np = {
|
||||
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPSep
|
||||
hasPrefix = False
|
||||
} ;
|
||||
UseComparA a = {
|
||||
CAdvAP ad ap np = ap ** {
|
||||
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPSep ;
|
||||
hasPrefix = False
|
||||
} ;
|
||||
UseComparA a = a ** {
|
||||
s = \\_ => sAdjFull2nforms Compar a
|
||||
} ;
|
||||
|
||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||
AdjOrd ord = {
|
||||
s = \\_ => ord.s
|
||||
s = \\_ => ord.s ;
|
||||
p = [] ; hasPrefix = False
|
||||
} ;
|
||||
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\isMod,af =>
|
||||
preOrPost isMod (appCompl True Pos a.c2 np) (sAdjFull2nforms Posit a ! af)
|
||||
preOrPost isMod (appCompl True Pos a.c2 np) (sAdjFull2nforms Posit a ! af) ;
|
||||
p = [] ; hasPrefix = False
|
||||
} ;
|
||||
|
||||
ReflA2 a = {
|
||||
s = \\isMod,af =>
|
||||
preOrPost isMod
|
||||
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) (sAdjFull2nforms Posit a ! af)
|
||||
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) (sAdjFull2nforms Posit a ! af) ;
|
||||
p = [] ; hasPrefix = False
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
s = \\b,a => ap.s ! b ! a ++ sc.s
|
||||
SentAP ap sc = ap ** {
|
||||
s = \\b,a => ap.s ! b ! a ++ sc.s ;
|
||||
hasPrefix = False
|
||||
} ;
|
||||
|
||||
AdAP ada ap = {
|
||||
s = \\b,af => ada.s ++ ap.s ! b ! af
|
||||
AdAP ada ap = ap ** {
|
||||
s = \\b,af => ada.s ++ ap.s ! b ! af ;
|
||||
hasPrefix = False
|
||||
} ;
|
||||
|
||||
AdvAP ap adv = {
|
||||
s = \\b,af => adv.s ++ ap.s ! b ! af -- luonnostaan vaalea
|
||||
AdvAP ap adv = ap ** {
|
||||
s = \\b,af => adv.s ++ ap.s ! b ! af ; -- luonnostaan vaalea
|
||||
hasPrefix = False
|
||||
} ;
|
||||
|
||||
UseA2 a = {
|
||||
s = \\_ => sAdjFull2nforms Posit a
|
||||
s = \\_ => sAdjFull2nforms Posit a ;
|
||||
p = [] ; hasPrefix = False
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
|
||||
-- The $Bool$ tells whether usage is modifying (as opposed to
|
||||
-- predicative), e.g. "x on suurempi kuin y" vs. "y:tä suurempi luku".
|
||||
|
||||
AP = {s : Bool => NForm => Str} ;
|
||||
AP = {s : Bool => NForm => Str ; p : Str ; hasPrefix : Bool} ;
|
||||
|
||||
-- Noun
|
||||
|
||||
@@ -89,7 +89,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
|
||||
V2V = SVerb1 ** {c2 : Compl ; vi : VVType} ; ---- infinitive form
|
||||
V3 = SVerb1 ** {c2, c3 : Compl} ;
|
||||
|
||||
A = {s : Degree => SAForm => Str ; h : Harmony} ;
|
||||
A = {s : Degree => SAForm => Str ; h : Harmony ; p : Str ; hasPrefix : Bool} ;
|
||||
A2 = {s : Degree => SAForm => Str ; h : Harmony ; c2 : Compl} ;
|
||||
|
||||
N = SNoun ;
|
||||
|
||||
@@ -16,7 +16,7 @@ concrete ConjunctionFin of Conjunction =
|
||||
isPron = False ; isNeg = ss.isNeg
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctDistrTable2 Bool NForm conj ss ;
|
||||
ConjAP conj ss = conjunctDistrTable2 Bool NForm conj ss ** { hasPrefix = False ; p = [] } ;
|
||||
|
||||
ConjRS conj ss = conjunctDistrTable Agr conj ss ** {
|
||||
c = ss.c
|
||||
|
||||
@@ -215,7 +215,9 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
|
||||
} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\nf => ap.s ! True ! (n2nform nf) ++ cn.s ! nf ;
|
||||
s = case ap.hasPrefix of {
|
||||
True => \\nf => ap.p ++ BIND ++ cn.s ! nf ;
|
||||
False => \\nf => ap.s ! True ! (n2nform nf) ++ cn.s ! nf } ;
|
||||
h = cn.h } ;
|
||||
|
||||
RelCN cn rs = {s = \\nf => cn.s ! nf ++ BIND ++ "," ++ rs.s ! agrP3 (numN nf) ;
|
||||
|
||||
@@ -177,17 +177,23 @@ oper
|
||||
} ;
|
||||
|
||||
invarA : Str -> A -- invariant adjective, e.g. "kelpo"
|
||||
= \s -> lin A {s = \\_,_ => s ; h = Back} ; ----- stemming adds bogus endings
|
||||
= \s -> lin A {s = \\_,_ => s ; h = Back ; p = [] ; hasPrefix = False} ; ----- stemming adds bogus endings
|
||||
|
||||
prefixA : Str -> A -> A = \pr,a -> a ** {
|
||||
p = pr ;
|
||||
hasPrefix = True
|
||||
} ;
|
||||
|
||||
-- Two-place adjectives need a case for the second argument.
|
||||
|
||||
mkA2 = overload {
|
||||
mkA2 : Str -> A2 -- e.g. "vihainen" (jollekin)
|
||||
= \s -> mkA s ** {c2 = mkPrep allative ; lock_A2 = <>} ;
|
||||
= \a -> let adj = mkA a ;
|
||||
in lin A2 (adj ** {c2 = casePrep allative}) ;
|
||||
mkA2 : Str -> Prep -> A2 -- e.g. "jaollinen" (mkPrep adessive)
|
||||
= \a,p -> mkA a ** {c2 = p ; lock_A2 = <>} ;
|
||||
= \a,p -> let adj = mkA a in lin A2 (adj ** {c2=p}) ;
|
||||
mkA2 : A -> Prep -> A2 -- e.g. "jaollinen" (mkPrep adessive)
|
||||
= \a,p -> a ** {c2 = p ; lock_A2 = <>} ;
|
||||
= \a,p -> lin A2 (a ** {c2 = p}) ;
|
||||
} ;
|
||||
|
||||
|
||||
@@ -637,25 +643,26 @@ mkVS = overload {
|
||||
mkA = overload {
|
||||
mkA : Str -> A = mkA_1 ;
|
||||
mkA : N -> A = \n -> noun2adjDeg n ** {lock_A = <>} ;
|
||||
mkA : N -> (kivempaa,kivinta : Str) -> A = \n -> regAdjective n ;
|
||||
mkA : N -> (kivempi,kivin : Str) -> A = \n -> regAdjective n ;
|
||||
mkA : (sana : AK) -> A = \w -> noun2adjDeg (nforms2snoun w.s) ;
|
||||
|
||||
mkA : (hyva,parempi,paras : N) -> (hyvin,paremmin,parhaiten : Str) -> A
|
||||
= \h,p,ps,hn,pn,ph -> lin A (mkAdj h p ps hn pn ph) ;
|
||||
mkA : V -> A = presPartA ;
|
||||
= \h,p,ps,hn,pn,ph -> lin A (mkAdj h p ps hn pn ph ** {p=[]; hasPrefix=False}) ;
|
||||
mkA : V -> A = presActA ;
|
||||
} ;
|
||||
|
||||
mkA_1 : Str -> A = \x -> lin A (noun2adjDeg (mk1N x)) ;
|
||||
|
||||
-- auxiliaries
|
||||
mkAdjective : (_,_,_ : SAdj) -> A = \hyva,parempi,paras ->
|
||||
mkAdjective : (_,_,_ : SAdj) -> A = \hyva,parempi,paras -> lin A
|
||||
{s = table {
|
||||
Posit => hyva.s ;
|
||||
Compar => parempi.s ;
|
||||
Superl => paras.s
|
||||
} ;
|
||||
h = hyva.h ; ---- different for parempi, paras
|
||||
lock_A = <>
|
||||
p = [] ;
|
||||
hasPrefix = False
|
||||
} ;
|
||||
regAdjective : SNoun -> Str -> Str -> A = \kiva, kivempi, kivin ->
|
||||
mkAdjective
|
||||
|
||||
Reference in New Issue
Block a user