added missing extensions (Codex)

This commit is contained in:
Krasimir Angelov
2026-06-05 08:25:21 +02:00
parent 8458a74e25
commit e65469ffb2
7 changed files with 246 additions and 7 deletions
+1
View File
@@ -66,6 +66,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
Predet = {s : Number => NPForm => Str} ; Predet = {s : Number => NPForm => Str} ;
Quant = {s1,sp : Number => Case => Str ; s2 : Harmony => Str ; isPoss : Bool ; isDef : Bool ; isNeg : Bool} ; Quant = {s1,sp : Number => Case => Str ; s2 : Harmony => Str ; isPoss : Bool ; isDef : Bool ; isNeg : Bool} ;
Card = {s : Number => Case => Str ; n : Number} ; Card = {s : Number => Case => Str ; n : Number} ;
ACard = {s : Number => Case => Str ; n : Number} ;
Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ; Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ;
-- Numeral -- Numeral
+3
View File
@@ -29,6 +29,9 @@ lin
is_wrong_VP = mkVP (ParadigmsFin.mkAdv "väärässä") ; is_wrong_VP = mkVP (ParadigmsFin.mkAdv "väärässä") ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> (lin CN cn))))) (lin A a) ; n_units_AP card cn a = mkAP (lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> (lin CN cn))))) (lin A a) ;
n_units_of_NP card cn np =
mkNP (mkNP <lin Card card : Card> (lin CN cn))
(SyntaxFin.mkAdv part_Prep (lin NP np)) ;
bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "pullo") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "pullollinen") (mkPrep partitive))) (lin NP np); bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "pullo") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "pullollinen") (mkPrep partitive))) (lin NP np);
cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "kuppi") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "kupillinen") (mkPrep partitive))) (lin NP np) ; cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "kuppi") (mkPrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "kupillinen") (mkPrep partitive))) (lin NP np) ;
+188 -6
View File
@@ -3,15 +3,23 @@
concrete ExtendFin of Extend = concrete ExtendFin of Extend =
CatFin ** ExtendFunctor - [ CatFin ** ExtendFunctor - [
VPI2,VPS2,MkVPS,MkVPS2,ConjVPS2,ComplVPS2, ConsVPS, BaseVPS, ListVPS, VPS, ConjVPS,PredVPS, VPI2,VPS2,MkVPS,MkVPS2,ConjVPS2,ComplVPS2, ConsVPS, BaseVPS, ListVPS, VPS, ConjVPS,PredVPS,
MkVPI,BaseVPI,ConsVPI,ConjVPI,ComplVPIVV,
MkVPI2,ConjVPI2,ComplVPI2,ComplVPIVV MkVPI2,ConjVPI2,ComplVPI2,ComplVPIVV
,ListComp, BaseComp, ConsComp, ConjComp
,ListImp, BaseImp, ConsImp, ConjImp
,ExistCN, ExistMassCN, ICompAP, ByVP ,ExistCN, ExistMassCN, ICompAP, ByVP
,CompoundN, GenNP, GenIP, GenRP, AdvIsNP, EmbedSSlash ,CompoundN, CompoundAP, GenNP, GenIP, GenRP, AdvIsNP, EmbedSSlash
,PassVPSlash, PassAgentVPSlash ,PassVPSlash, PassAgentVPSlash
,CardCNCard ,CardCNCard
,UttAccNP ,UttAccNP
,AdjAsCN, AdjAsNP ,AdjAsCN, AdjAsNP, GerundCN, GerundNP, GerundAdv
,ApposNP ,ApposNP
,PresPartAP, PastPartAP ,PresPartAP, PastPartAP, PastPartAgentAP
,PositAdVAdj, ProgrVPSlash
,RNP,RNPList,ReflPron,ReflPoss,ReflVPSlash,ReflVPS2,ReflA2
,PredetRNP,AdvRNP,AdvRVP,AdvRAP,PossPronRNP
,Base_rr_RNP,Base_nr_RNP,Base_rn_RNP,Cons_rr_RNP,Cons_nr_RNP,ConjRNP
] ]
with with
(Grammar = GrammarFin) ** (Grammar = GrammarFin) **
@@ -97,13 +105,24 @@ oper
} ; } ;
BaseVPI = twoTable2 VVType Agr ; BaseVPI x y = {
ConsVPI = consrTable2 VVType Agr comma ; s1 = x.s ;
s2 = y.s ;
sc = x.sc
} ;
ConsVPI x xs = {
s1 = \\vt,agr => x.s ! vt ! agr ++ comma ;
s2 = \\vt,agr => xs.s1 ! vt ! agr ++ xs.s2 ! vt ! agr ;
sc = x.sc
} ;
ConjVPI conj xs = {
s = \\vt,agr => conj.s1 ++ xs.s1 ! vt ! agr ++ conj.s2 ++ xs.s2 ! vt ! agr ;
sc = xs.sc
} ;
MkVPI vp = mkVPI vp ; MkVPI vp = mkVPI vp ;
ConjVPI c xs = conjunctDistrTable2 VVType Agr c xs ;
ComplVPIVV vv vpi = ComplVPIVV vv vpi =
S.insertObj (\\_,_,a => vpi.s ! vv.vi ! a) S.insertObj (\\_,_,a => vpi.s ! vv.vi ! a)
(S.predV (vv ** {sc = case vpi.sc of { (S.predV (vv ** {sc = case vpi.sc of {
@@ -112,6 +131,16 @@ oper
) ; ) ;
lincat [Comp] = {s1,s2 : Agr => Str} ;
lin BaseComp = twoTable Agr ;
ConsComp = consrTable Agr comma ;
ConjComp conj xs = conjunctDistrTable Agr conj xs ;
lincat [Imp] = {s1,s2 : Polarity => Agr => Str} ;
lin BaseImp = twoTable2 Polarity Agr ;
ConsImp = consrTable2 Polarity Agr comma ;
ConjImp conj xs = conjunctDistrTable2 Polarity Agr conj xs ;
-------- two-place verb conjunction -------- two-place verb conjunction
lincat lincat
@@ -163,6 +192,13 @@ lin
h = n2.h h = n2.h
} ; } ;
CompoundAP n a =
let prefix = (S.snoun2nounBind n).s ! NCompound in {
s = \\_,af => prefix ++ BIND ++ sAdjFull2nforms Posit a ! af ;
p = [] ;
hasPrefix = True
} ;
---- copied from VerbFin.CompAP, should be shared ---- copied from VerbFin.CompAP, should be shared
ICompAP ap = { ICompAP ap = {
s = \\agr => s = \\agr =>
@@ -262,6 +298,145 @@ lin PastPartAP vps = {
p = vps.c2.s.p1 ; p = vps.c2.s.p1 ;
hasPrefix = False hasPrefix = False
} ; } ;
PastPartAgentAP vps np = {
s = \\_,nf => np.s ! NPCase Gen ++ preCompVP (lin VP vps) (AgentPart (AN nf)) ;
p = vps.c2.s.p1 ;
hasPrefix = False
} ;
lin GerundCN vp = {
s = \\nf => let infForm : InfForm =
case nf of {
NCase _ Part => Inf4Part ;
_ => Inf4Nom
}
in infVP vp.s.sc Pos (agrP3 (numN nf)) vp infForm ;
postmod = \\_ => [] ;
h = Back
} ;
GerundNP vp =
MassNP {
s = \\nf => let infForm : InfForm =
case nf of {
NCase _ Part => Inf4Part ;
_ => Inf4Nom
}
in infVP vp.s.sc Pos (agrP3 (numN nf)) vp infForm ;
postmod = \\_ => [] ;
h = Back
} ;
GerundAdv vp = {
s = infVP vp.s.sc Pos (agrP3 Sg) vp Inf3Adess
} ;
PositAdVAdj a = {s = a.s ! Posit ! sAAdv} ;
lin ProgrVPSlash vp =
let
inf = (sverb2verbSep vp.s).s ! Inf Inf3Iness ;
on = predV olla
in vp ** {
s = on.s ;
s2 = \\b,p,a => inf ++ vp.s2 ! b ! p ! a ;
} ;
lincat
RNP = {s : Agr => NPForm => Str ; isPron : Bool ; isNeg : Bool} ;
RNPList = {s1,s2 : Agr => NPForm => Str ; isPron : Bool ; isNeg : Bool} ;
lin ReflPron = {
s = \\agr,npf => (reflPron agr).s ! npf ;
isPron = True ;
isNeg = False
} ;
ReflPoss num cn = {
s = \\agr, npf =>
let
quant : Quant = lin Quant { -- possessive pronoun with suffix only
s2 : Harmony => Str = \\harm => possSuffixGen harm agr ;
s1,sp = \\_,_ => [] ; isNum,isNeg = False ; isPoss,isDef = True
}
in (DetCN (DetQuant quant num) cn).s ! npf ;
isPron = False ;
isNeg = False
} ;
ReflVPS2 vps rnp = {
s = \\agr => vps.s ! agr ++ appCompl True vps.p vps.c2 (rnp2np agr rnp) ;
sc = vps.sc ;
h = vps.h
} ;
PredetRNP pred rnp = {
s = \\agr,npf => pred.s ! complNumAgr agr ! npf ++ rnp.s ! agr ! npf ;
isPron = False ;
isNeg = rnp.isNeg
} ;
AdvRNP np prep rnp = {
s = \\agr,npf => np.s ! npf ++ appCompl True Pos prep (rnp2np agr rnp) ;
isPron = False ;
isNeg = orB np.isNeg rnp.isNeg
} ;
AdvRVP vp prep rnp =
insertObj (\\_,b,agr => appCompl True b prep (rnp2np agr rnp)) vp ;
AdvRAP ap prep rnp = ap ** {
s = \\isMod,af => ap.s ! isMod ! af ++ appCompl True Pos prep (rnp2np (agrP3 Sg) rnp) ;
hasPrefix = False
} ;
PossPronRNP p num cn rnp =
let np = DetCN (DetQuant (PossPron p) num) cn in
np ** {
s = \\npf => np.s ! npf ++ rnp.s ! p.a ! NPCase Gen ;
isNeg = orB np.isNeg rnp.isNeg
} ;
Base_rr_RNP x y = {
s1 = x.s ;
s2 = y.s ;
isPron = False ;
isNeg = orB x.isNeg y.isNeg
} ;
Base_nr_RNP x y = {
s1 = \\_,npf => x.s ! npf ;
s2 = y.s ;
isPron = False ;
isNeg = orB x.isNeg y.isNeg
} ;
Base_rn_RNP x y = {
s1 = x.s ;
s2 = \\_,npf => y.s ! npf ;
isPron = False ;
isNeg = orB x.isNeg y.isNeg
} ;
Cons_rr_RNP x xs = {
s1 = \\agr,npf => x.s ! agr ! npf ++ comma ;
s2 = \\agr,npf => xs.s1 ! agr ! npf ++ xs.s2 ! agr ! npf ;
isPron = False ;
isNeg = orB x.isNeg xs.isNeg
} ;
Cons_nr_RNP x xs = {
s1 = \\_,npf => x.s ! npf ++ comma ;
s2 = \\agr,npf => xs.s1 ! agr ! npf ++ xs.s2 ! agr ! npf ;
isPron = False ;
isNeg = orB x.isNeg xs.isNeg
} ;
ConjRNP conj xs = {
s = \\agr,npf => conj.s1 ++ xs.s1 ! agr ! npf ++ conj.s2 ++ xs.s2 ! agr ! npf ;
isPron = xs.isPron ;
isNeg = xs.isNeg
} ;
oper oper
-- ruohoa syövä, Ranskassa valmistettu -- ruohoa syövä, Ranskassa valmistettu
@@ -271,4 +446,11 @@ oper
vp.s.s ! vform ++ vp.s.s ! vform ++
vp.ext ; vp.ext ;
rnp2np agr rnp = {
s = \\npf => rnp.s ! agr ! npf ;
a = agr ;
isPron = rnp.isPron ;
isNeg = rnp.isNeg
} ;
} }
+4
View File
@@ -36,4 +36,8 @@ lin InLN ln =
let c = case ln.extCase of {True => Adess ; False => Iness} let c = case ln.extCase of {True => Adess ; False => Iness}
in {s = ln.s ! c} ; in {s = ln.s ! c} ;
lin AdjLN ap ln = ln ** {
s = \\c => ap.s ! True ! NCase ln.n c ++ ln.s ! c
} ;
} }
+5
View File
@@ -294,6 +294,11 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
isPron = False ; isNeg = det.isNeg isPron = False ; isNeg = det.isNeg
} ; } ;
AdjDAP dap ap = dap ** {
s1 = \\c => dap.s1 ! c ++ ap.s ! True ! NCase dap.n c ;
sp = \\c => dap.sp ! c ++ ap.s ! False ! NCase dap.n c
} ;
DetDAP d = d ; DetDAP d = d ;
QuantityNP n m = { QuantityNP n m = {
+41 -1
View File
@@ -75,10 +75,24 @@ lin
pot3as4 n = n ; pot3as4 n = n ;
pot3decimal d = {n = Pl ; s = \\c => d.s ! NCard (NCase Sg Nom) ++ BIND ++ tuhattaN.s ! Pl ! c} ; pot3decimal d = {n = Pl ; s = \\c => d.s ! NCard (NCase Sg Nom) ++ BIND ++ tuhattaN.s ! Pl ! c} ;
pot41 = {n = Pl ; s = miljoonaN.s} ;
pot4 d = {n = Pl ; s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljoonaaN.s ! d.n ! c} ;
pot4plus d e = {
n = Pl ;
s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljoonaaN.s ! d.n ! c ++
e.s ! c
} ;
pot4as5 n = n ; pot4as5 n = n ;
pot4decimal d = {n = Pl ; s = \\c => d.s ! NCard (NCase Sg Nom) ++ "miljoonaa"} ; -- KA: case inflection missing pot4decimal d = {n = Pl ; s = \\c => d.s ! NCard (NCase Sg Nom) ++ "miljoonaa"} ; -- KA: case inflection missing
pot51 = {n = Pl ; s = \\c => "miljardi"} ; -- KA: case inflection missing pot51 = {n = Pl ; s = miljardiN.s} ;
pot5 d = {n = Pl ; s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljardiaN.s ! d.n ! c} ;
pot5plus d e = {
n = Pl ;
s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljardiaN.s ! d.n ! c ++
e.s ! c
} ;
pot5decimal d = {n = Pl ; s = \\c => d.s ! NCard (NCase Sg Nom) ++ "miljardia"} ; -- KA: case inflection missing
oper oper
-- co : (c,o : {s : NForm => Str}) -> {s : CardOrd => Str} = \c,o -> { -- co : (c,o : {s : NForm => Str}) -> {s : CardOrd => Str} = \c,o -> {
@@ -157,6 +171,32 @@ oper
} }
} ; } ;
miljoonaN = co
(snoun2nounBind (mkN "miljoona"))
(ordN "s" "miljoonas") ;
miljoonaaN = {s = table {
Sg => miljoonaN.s ;
Pl => table {
NCard (NCase Sg Nom) => "miljoonaa" ;
k => miljoonaN.s ! k
}
}
} ;
miljardiN = co
(snoun2nounBind (mkN "miljardi"))
(ordN "s" "miljardis") ;
miljardiaN = {s = table {
Sg => miljardiN.s ;
Pl => table {
NCard (NCase Sg Nom) => "miljardia" ;
k => miljardiN.s ! k
}
}
} ;
lincat lincat
Dig = TDigit ; Dig = TDigit ;
+4
View File
@@ -18,6 +18,10 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin, StemFin in {
verb.fin ++ verb.inf ++ compl ; verb.fin ++ verb.inf ++ compl ;
} ; } ;
AdvImp adv imp = {
s = \\pol,agr => adv.s ++ imp.s ! pol ! agr
} ;
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$. -- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
SlashVP np vp = { SlashVP np vp = {