1
0
forked from GitHub/gf-rgl

(Fin) Update all functions that use CN to use postmod field

This commit is contained in:
Inari Listenmaa
2020-09-17 21:04:36 +02:00
parent dd813bc7cc
commit d4ee4addc5
8 changed files with 23 additions and 9 deletions

View File

@@ -48,7 +48,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
-- The $Bool$ tells if a possessive suffix is attached, which affects the case.
CN = {s : NForm => Str ; h : Harmony ; postmod : Number => Str} ;
CN = LinCN ; -- {s : NForm => Str ; h : Harmony ; postmod : Number => Str} ;
Pron = {s : NPForm => Str ; a : Agr ; hasPoss : Bool ; poss : Str} ;
NP = {s : NPForm => Str ; a : Agr ; isPron : Bool ; isNeg : Bool} ;
DAP, Det = {
@@ -101,6 +101,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
SSlash = \ss -> ss.s ++ ss.c2.s.p1 ;
ClSlash = \cls -> cls.s ! Pres ! Simul ! Pos ++ cls.c2.s.p1 ;
NP = \np -> np.s ! NPAcc ; ----NPSep ;
CN = cnRef ;
VP = vpRef ;
VPSlash = \vps -> vpRef vps ++ vps.c2.s.p1 ;
@@ -115,5 +116,5 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
oper
vpRef : StemFin.VP -> Str = \vp -> infVP SCNom Pos (agrP3 Sg) vp Inf1 ;
cnRef : LinCN -> Str = linCN (NCase Sg Nom) ;
}

View File

@@ -43,7 +43,6 @@ concrete ConjunctionFin of Conjunction =
BaseCN x y = twoTable NForm (mergeCN x) (mergeCN y) ; -- put postmod in s field
ConsCN x xs = consrTable NForm comma (mergeCN x) xs;
oper
LinCN : Type = {s : NForm => Str ; h : Harmony ; postmod : Number => Str} ;
-- RS, SC and Adv are in separate fields, to prevent "lasi viiniänsa" for "lasinsa viiniä".
-- But for coordination, we just give up and attach the postmod.
-- Really, if you want to have "lasinsa viiniä ja kuppinsa teetä", just use ConjNP instead.

View File

@@ -27,7 +27,9 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
} ;
GenRP num cn = {
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
s = \\n,c =>
let k = npform2case num.n c
in relPron ! n ! Gen ++ linCN (NCase num.n k) cn ;
a = RNoAg
--- a = RAg (agrP3 num.n)
} ;

View File

@@ -1,9 +1,9 @@
--# -path=.:../abstract:../common
concrete MarkupFin of Markup = CatFin, MarkHTMLX ** {
concrete MarkupFin of Markup = CatFin, MarkHTMLX ** open ResFin in {
lin
MarkupCN m cn = cn ** {s = \\nf => appMark m (cn.s ! nf)} ;
MarkupCN m cn = cn ** {s = \\nf => appMark m (linCN nf cn)} ;
MarkupNP m np = np ** {s = \\c => appMark m (np.s ! c)} ;
MarkupAP m ap = ap ** {s = \\b,nf => appMark m (ap.s ! b ! nf)} ;
MarkupAdv m adv = {s = appMark m adv.s} ;

View File

@@ -14,7 +14,7 @@ concrete PhraseFin of Phrase = CatFin ** open ResFin, StemFin, (P = Prelude) in
UttNP np = {s = addNegation np.isNeg ++ np.s ! NPSep} ;
UttVP vp = {s = addNegation vp.vptyp.isNeg ++ infVP SCNom Pos (agrP3 Sg) vp Inf1} ;
UttAdv adv = adv ;
UttCN np = {s = np.s ! NCase Sg Nom} ;
UttCN cn = {s = cnRef cn} ;
UttAP np = {s = np.s ! P.False ! NCase Sg Nom} ;
UttCard n = {s = n.s ! Sg ! Nom} ;
UttInterj i = i ;

View File

@@ -60,7 +60,7 @@ concrete QuestionFin of Question = CatFin ** open ResFin, StemFin, Prelude in {
_ => NCase n k -- mitkä kytkimet
}
in
idet.s ! k ++ cn.s ! ncase ;
idet.s ! k ++ linCN ncase cn ;
n = n
} ;

View File

@@ -55,6 +55,18 @@ oper
_ => SCNom
} ;
LinCN : Type = {s : NForm => Str ; h : Harmony ; postmod : Number => Str} ;
linCN : NForm -> LinCN -> Str = \nf,cn ->
let n : Number = case nf of {
NCase n _ => n ;
NPossNom n => n ;
NPossGen n => n ;
NPossIllat n => n ;
NPossTransl n => n ;
_ => Sg
} ;
in cn.s ! nf ++ cn.postmod ! n ;
-- Agreement of $NP$ has number*person and the polite second ("te olette valmis").
param

View File

@@ -121,7 +121,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
Sg => Nom ; -- minä olen iso ; te olette iso
Pl => Part -- me olemme isoja ; te olette isoja
} --- definiteness of NP ?
in cn.s ! (NCase n c)
in linCN (NCase n c) cn ;
} ;
CompNP np = {s = \\_ => np.s ! NPSep} ;
CompAdv a = {s = \\_ => a.s} ;