bugfixes and extensions by Codex

This commit is contained in:
Krasimir Angelov
2026-09-27 06:35:03 +02:00
parent a557b49c95
commit 5703b6d1b1
7 changed files with 109 additions and 27 deletions
+2
View File
@@ -31,6 +31,7 @@ lin
---- is_wrong_VP = mkVP (mkVA I.estar_V) (mkAP (mkA "equivocat")) ;
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
n_units_of_NP card cn np = mkNP card (mkCN (lin N2 cn) np) ;
bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "ampolla" feminine) part_Prep)) np ; -- "botella" (val)
cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "tassa") part_Prep)) np ;
@@ -83,6 +84,7 @@ lin InLanguage l = SyntaxCat.mkAdv (mkPrep "en") (mkNP l) ;
lin
weekdayN w = w ;
monthN m = m ;
weekdayPN w = mkPN w ;
monthPN m = mkPN m ;
+6 -5
View File
@@ -52,13 +52,13 @@ oper
artIndef = \isNP,g,n,c -> case isNP of {
True => case <n,c> of {
<Sg,CPrep P_de> => genForms ("d' ++ Predef.BIND ++ un") ("d' ++ Predef.BIND ++ una") ! g ;
<Sg,CPrep P_de> => genForms ("d'un") ("d'una") ! g ;
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
<Pl,CPrep P_de> => genForms ("d' ++ Predef.BIND ++ uns") ("d' ++ Predef.BIND ++ unes") ! g ; -- AR 3/12/2014
<Pl,CPrep P_de> => genForms ("d'uns") ("d'unes") ! g ; -- AR 3/12/2014
<Pl,_> => prepCase c ++ genForms "uns" "unes" ! g
} ;
_ => case <n,c> of {
<Sg,CPrep P_de> => genForms ("d' ++ Predef.BIND ++ un") ("d' ++ Predef.BIND ++ una") ! g ;
<Sg,CPrep P_de> => genForms ("d'un") ("d'una") ! g ;
<Sg,_> => prepCase c ++ genForms "un" "una" ! g ;
<Pl,_> => prepCase c --- ++ genForms "uns" "unes" ! g --- take this as a determiner
}
@@ -81,7 +81,7 @@ oper
} ;
piuComp = "més" ;
possCase = \_,_,c -> prepCase c ;
possCase = \g,n,c -> artDef False g n c ;
partitive = \g,c -> case c of {
CPrep P_de => "de" ;
@@ -214,7 +214,8 @@ oper
_ => False
} ;
haver_V, auxPassive : Verb = verbBeschH (estar_54 "estar") ;
haver_V : Verb = verbBeschH (haver_59 "haver" (True|False)) ;
auxPassive : Verb = verbBeschH (ser_52 "ser" True) ;
essere_V, copula = verbBeschH (ser_52 "ser" True) ;
stare_V, estar_V = verbBeschH (estar_54 "estar") ;
+67 -6
View File
@@ -1,9 +1,10 @@
--# -path=alltenses:../common:../abstract:../romance
concrete ExtendCat of Extend = CatCat ** ExtendRomanceFunctor-- -
-- [
-- ]
concrete ExtendCat of Extend = CatCat ** ExtendRomanceFunctor -
[EmptyRelSlash,
BaseVPI, ConsVPI, ConjVPI, MkVPI, ComplVPIVV,
BaseComp, ConsComp, ConjComp, BaseImp, ConsImp, ConjImp,
ProgrVPSlash, ReflPoss, AdvRNP, AdvRVP, AdvRAP, PossPronRNP,
CompoundAP, InOrderToVP]
-- don't forget to put the names of your own
-- definitions here
with
@@ -14,9 +15,69 @@ concrete ExtendCat of Extend = CatCat ** ExtendRomanceFunctor-- -
MorphoCat,
Coordination,
Prelude,
ParadigmsCat in {
ParadigmsCat,
(P = ParamX) in {
-- put your own definitions here
lin EmptyRelSlash = RelSlash IdRP ;
lincat
VPI = {s : Agr => Str} ;
[VPI] = {s1,s2 : Agr => Str} ;
lin
MkVPI vp = {s = \\a => infVP vp RPos a} ;
BaseVPI = twoTable Agr ;
ConsVPI = consrTable Agr comma ;
ConjVPI = conjunctDistrTable Agr ;
ComplVPIVV vv vpi =
insertComplement (\\a => prepCase vv.c2.c ++ vpi.s ! a) (predV vv) ;
lincat [Comp] = {s1,s2 : Agr => Str ; cop : CopulaType} ;
lin
BaseComp x y = twoTable Agr x y ** {cop = x.cop} ;
ConsComp xs x = consrTable Agr comma xs x ** xs ;
ConjComp conj cs = conjunctDistrTable Agr conj cs ** {cop = cs.cop} ;
lincat [Imp] = {s1,s2 : RPolarity => P.ImpForm => Gender => Str} ;
lin
BaseImp = twoTable3 RPolarity P.ImpForm Gender ;
ConsImp = consrTable3 RPolarity P.ImpForm Gender comma ;
ConjImp = conjunctDistrTable3 RPolarity P.ImpForm Gender ;
ProgrVPSlash vps = GrammarCat.ProgrVP (lin VP vps) ** {c2 = vps.c2} ;
ReflPoss num cn = {
s = \\agr,c => possCase cn.g num.n c ++ he_Pron.poss ! num.n ! cn.g ++ cn.s ! num.n
} ;
AdvRNP np prep rnp = {
s = \\agr,c => (np.s ! c).ton ++ prep.s ++ rnp.s ! agr ! prep.c
} ;
AdvRVP vp prep rnp =
insertComplement (\\a => prep.s ++ rnp.s ! verbAgr a ! prep.c) vp ;
AdvRAP ap prep rnp = ap ** {
s = \\af => ap.s ! af ++ prep.s ++
rnp.s ! (aform2aagr af ** {p = P3}) ! prep.c ;
isPre = False
} ;
PossPronRNP pron num cn rnp = heavyNP {
s = \\c => possCase cn.g num.n c ++ pron.poss ! num.n ! cn.g ++
cn.s ! num.n ++ rnp.s ! pron.a ! ResCat.genitive ;
a = agrP3 cn.g num.n ;
hasClit = False ;
isNeg = False
} ;
CompoundAP noun adj = {
s = \\af => adj.s ! af ++ "de" ++ noun.s ! (aform2number af) ;
isPre = adj.isPre ;
copTyp = adj.copTyp
} ;
InOrderToVP vp = {s = "per tal de" ++ infStr vp} ;
} ;
+7 -7
View File
@@ -6,13 +6,13 @@ flags coding = utf8 ;
lin
i8fem_Pron = mkPronoun
"jo" "em" "em" "mi"
["el meu"] ["la meva"] ["els meus"] ["les meves"]
"meu" "meva" "meus" "meves"
Fem Sg P1 ;
these8fem_NP = makeNP "aquestes" Fem Pl ;
they8fem_Pron = mkPronoun
"elles" "les" "les" "elles"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
"seu" "seva" "seus" "seves"
Fem Pl P3 ;
this8fem_NP = pn2np (mkPN ["aquesta"] Fem) ;
those8fem_NP = makeNP ["aquestes"] Fem Pl ;
@@ -20,7 +20,7 @@ lin
we8fem_Pron =
mkPronoun
"nosaltres" "ens" "ens" "nosaltres"
["el nostre"] ["la nostra"] ["els nostres"] ["les nostres"]
"nostre" "nostra" "nostres" "nostres"
Fem Pl P1 ;
whoPl8fem_IP = {s = \\c => prepCase c ++ "qui" ; a = aagr Fem Pl} ;
@@ -28,18 +28,18 @@ lin
youSg8fem_Pron = mkPronoun
"tu" "et" "et" "tu"
["el teu"] ["la teva"] ["els teus"] ["les teves"]
"teu" "teva" "teus" "teves"
Fem Sg P2 ;
youPl8fem_Pron = mkPronoun
"vosaltres" "us" "us" "vosaltres"
["el vostre"] ["la vostra"] ["els vostres"] ["les vostres"]
"vostre" "vostra" "vostres" "vostres"
Fem Pl P2 ;
youPol8fem_Pron = mkPronoun
"vostè" "la" "li" "vostè"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
"seu" "seva" "seus" "seves"
Fem Sg P3 ;
--they_Pron (StructuralCat) and they8fem_Pron (ExtraCat) use "el seu / la seva" as possessive.
-- Possessive articles are supplied by possCase in DiffCat.
theyLlur_Pron = mkPronoun
"ells" "els" "els" "ells"
"llur" "llur" "llurs" "llurs"
+10
View File
@@ -6,6 +6,8 @@ concrete IdiomCat of Idiom = CatCat **
lin
ExistNP np = mkClause [] True False (agrP3 Masc Sg)
(insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton) (predV haver_V))) ;
ExistNPAdv np adv = mkClause [] True False (agrP3 Masc Sg)
(insertClit3 "hi" (insertComplement (\\_ => (np.s ! Acc).ton ++ adv.s) (predV haver_V))) ;
GenericCl vp = mkClause "hom" True False (agrP3 Masc Sg) vp ;
ImpersCl vp = mkClause [] True False (agrP3 Masc Sg) vp ;
@@ -36,6 +38,14 @@ concrete IdiomCat of Idiom = CatCat **
(insertClit3 "hi" (predV haver_V)))
.s ! DDir ! t ! a ! p ! Indic
} ;
ExistIPAdv ip adv = {
s = \\t,a,p,_ =>
ip.s ! Nom ++
(mkClause [] True False
(agrP3 Masc Sg)
(insertClit3 "hi" (insertComplement (\\_ => adv.s) (predV haver_V))))
.s ! DDir ! t ! a ! p ! Indic
} ;
ImpPl1 vp = {s =
mkImperative False P1 vp ! RPos ! Masc ! Pl --- fem
+8
View File
@@ -129,7 +129,15 @@ lin
n= Pl} ;
pot3as4 n = n ;
pot41 = {s = \\co => cardOrd1 co "un milió" "un milió" "milionès" ; n = Sg} ;
pot4 n = {s = \\co => n.s ! NCard Masc ++ "milions" ; n = Pl} ;
pot4plus n m = {s = \\co => n.s ! NCard Masc ++ "milions" ++ m.s ! co ; n = Pl} ;
pot4decimal d = {s = \\co => d.s ! NCard Masc ++ "milions" ; n = Pl} ;
pot4as5 n = n ;
pot51 = {s = \\co => case co of {NCard _ => "mil milions" ; _ => "mil milionèsim"} ; n = Pl} ;
pot5 n = {s = \\co => n.s ! NCard Masc ++ "mil milions" ; n = Pl} ;
pot5plus n m = {s = \\co => n.s ! NCard Masc ++ "mil milions" ++ m.s ! co ; n = Pl} ;
pot5decimal d = {s = \\co => d.s ! NCard Masc ++ "mil milions" ; n = Pl} ;
param
DForm = unit | teen | ten | tenplus | Aunit | OrdF ;
+9 -9
View File
@@ -45,7 +45,7 @@ lin
from_Prep = complGen ; ---
he_Pron =
mkPronoun
"ell" "el" "li" "ell" ["el seu"] ["la seva"] ["els seus"] ["les seves"]
"ell" "el" "li" "ell" "seu" "seva" "seus" "seves"
Masc Sg P3 ;
here_Adv = mkAdv "aquí" ; -- acÌ
here7to_Adv = mkAdv ["cap aquí"] ;
@@ -59,12 +59,12 @@ lin
i_Pron =
mkPronoun
"jo" "em" "em" "mi"
["el meu"] ["la meva"] ["els meus"] ["les meves"]
"meu" "meva" "meus" "meves"
Fem Sg P1 ;
in_Prep = mkPrep "en" ;
it_Pron = mkPronoun
"ell" "ho" "li" "ell"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
"seu" "seva" "seus" "seves"
Masc Sg P3 ;
less_CAdv = X.mkCAdv "menys" conjThan ; ----
@@ -94,7 +94,7 @@ lin
she_Pron =
mkPronoun
"ella" "la" "li" "ella"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
"seu" "seva" "seus" "seves"
Fem Sg P3 ;
so_AdA = ss "tan" ;
somebody_NP = pn2np (mkPN ["alg˙"] Masc) ;
@@ -125,7 +125,7 @@ lin
therefore_PConj = ss ["per tant"] ;
they_Pron = mkPronoun
"ells" "els" "els" "ells"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
"seu" "seva" "seus" "seves"
Masc Pl P3 ;
this_Quant =
@@ -148,7 +148,7 @@ lin
we_Pron =
mkPronoun
"nosaltres" "ens" "ens" "nosaltres"
["el nostre"] ["la nostra"] ["els nostres"] ["les nostres"]
"nostre" "nostra" "nostres" "nostres"
Masc Pl P1 ;
whatSg_IP = {s = \\c => prepCase c ++ ["què"] ; a = aagr Masc Sg} ;
whatPl_IP = {s = \\c => prepCase c ++ ["què"] ; a = aagr Masc Pl} ; ---
@@ -167,16 +167,16 @@ lin
yes_Utt = ss "sí" ;
youSg_Pron = mkPronoun
"tu" "et" "et" "tu"
["el teu"] ["la teva"] ["els teus"] ["les teves"]
"teu" "teva" "teus" "teves"
Masc Sg P2 ;
youPl_Pron =
mkPronoun
"vosaltres" "us" "us" "vosaltres"
["el vostre"] ["la vostra"] ["els vostres"] ["les vostres"]
"vostre" "vostra" "vostres" "vostres"
Masc Pl P2 ;
youPol_Pron = mkPronoun
"vosté" "el" "li" "vosté"
["el seu"] ["la seva"] ["els seus"] ["les seves"]
"seu" "seva" "seus" "seves"
Masc Sg P3 ;
not_Predet = {s = \\a,c => prepCase c ++ "no pas" ; c = Nom ;
a = PNoAg} ;