move UseDAP, UseDAPMasc, UseDAPFem to the RGL and implement it for several new languages

This commit is contained in:
krangelov
2021-04-27 18:00:54 +02:00
parent 156e193d47
commit 9d657a6f24
17 changed files with 182 additions and 7 deletions

View File

@@ -277,4 +277,13 @@ abstract Extend = Cat ** {
UttDatIP : IP -> Utt ; -- whom (dative)
-- UseDAP replaces DetNP from the RGL which is more limited.
-- Instead of (DetNP d) use (UseDAP (DetDAP d)). The advantage
-- is that now we can also have an adjective inserted, i.e.
-- (UseDAP (AdjDAP (DetDAP d) a). There are also versions of
-- UseDAP for different genders.
fun UseDAP : DAP -> NP ;
UseDAPMasc : DAP -> NP ;
UseDAPFem : DAP -> NP ;
}

View File

@@ -270,5 +270,35 @@ lin
p = NounP3 det.p
} ;
lin UseDAP dap = {
s = \\role => let s = dap.s ! False ! ANeut ! role
in case role of {
RObj c => linCase c dap.p ++ s;
_ => s
} ;
gn = gennum ANeut (numnnum dap.nn);
p = NounP3 dap.p
} ;
UseDAPMasc dap = {
s = \\role => let s = dap.s ! False ! (AMasc Human) ! role
in case role of {
RObj c => linCase c dap.p ++ s;
_ => s
} ;
gn = gennum (AMasc Human) (numnnum dap.nn);
p = NounP3 dap.p
} ;
UseDAPFem dap = {
s = \\role => let s = dap.s ! False ! AFem ! role
in case role of {
RObj c => linCase c dap.p ++ s;
_ => s
} ;
gn = gennum AFem (numnnum dap.nn);
p = NounP3 dap.p
} ;
}

View File

@@ -48,7 +48,7 @@ concrete CatDut of Cat =
Pron = Pronoun ;
Det = Determiner ;
Det, DAP = Determiner ;
Quant = Quantifier ;
Predet = {s : Number => Gender => Str} ;
Num = {s : Str ; n : Number ; isNum : Bool} ;

View File

@@ -101,4 +101,18 @@ lin
ICompAP ap = {s = \\agr => "hoe" ++ ap.s ! agr ! APred} ;
IAdvAdv adv = {s = "hoe" ++ adv.s} ;
lin
UseDAP dap = dap ** {
s = \\_ => dap.sp ! Neutr ;
a = agrP3 dap.n ;
isPron = False
} ;
UseDAPMasc, UseDAPFem = \dap -> dap ** {
s = \\_ => dap.sp ! Utr ;
a = agrP3 dap.n ;
isPron = False
} ;
}

View File

@@ -197,4 +197,6 @@ concrete NounDut of Noun = CatDut ** open ResDut, Prelude in {
g = cn.g
} ;
DetDAP det = det ;
}

View File

@@ -447,4 +447,19 @@ lin BaseImp = twoTable2 CPolarity ImpForm ;
UncontractedNeg = {s = [] ; p = CNeg False} ;
UttVPShort vp = {s = infVP VVAux vp False Simul CPos (agrP3 Sg)} ;
lin UseDAP dap = {
s = dap.sp ! Neutr ! False ;
a = agrP3 dap.n
} ;
lin UseDAPMasc dap = {
s = dap.sp ! Masc ! False ;
a = agrgP3 dap.n Masc
} ;
lin UseDAPFem dap = {
s = dap.sp ! Fem ! False ;
a = agrgP3 dap.n Fem
} ;
}

View File

@@ -210,4 +210,20 @@ lin
vptyp = vp.vptyp ;
} ;
UseDAP, UseDAPFem, UseDAPMasc = \dap ->
let
n : ParadigmsFin.Number = case dap.isNum of {
True => Sg ;
_ => dap.n
} ;
in {
s = \\c => let k = npform2case n c in
dap.sp ! k ; -- det.s2 is possessive suffix
a = agrP3 (case dap.isDef of {
False => Sg ; -- autoja menee; kolme autoa menee
_ => dap.n
}) ;
isPron = False ; isNeg = dap.isNeg
} ;
}

View File

@@ -57,7 +57,7 @@ concrete CatGer of Cat =
g : Gender} ;
NP = ResGer.NP ;
Pron = {s : NPForm => Str ; a : Agr} ;
Det = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ;
Det, DAP = {s,sp : Gender => PCase => Str ; n : Number ; a : Adjf ; isDef : Bool} ;
Quant = {
s : Bool => Number => Gender => PCase => Str ; -- Bool is True if a cardinal number is present
sp : Bool => Number => Gender => PCase => Str ;

View File

@@ -104,6 +104,25 @@ lin
ConjVPS = conjunctDistrTable2 Order Agr ;
UseDAP det = {
s = \\c => det.sp ! Neutr ! c ;
a = agrP3 det.n ;
w = case det.isDef of { True => WLight ; _ => WHeavy } ;
rc, ext = []
} ;
UseDAPMasc det = {
s = \\c => det.sp ! Masc ! c ;
a = agrP3 det.n ;
w = WLight ;
rc, ext = []
} ;
UseDAPFem det = {
s = \\c => det.sp ! Fem ! c ;
a = agrP3 det.n ;
w = WLight ;
rc, ext = []
} ;
}

View File

@@ -235,4 +235,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, MorphoGer, Prelude in {
PossNP cn np = cn ** {
s = \\a,n,c => cn.s ! a ! n ! c ++ np.s ! NPP CVonDat ++ bigNP np } ;
DetDAP det = det ;
}

View File

@@ -58,7 +58,7 @@ concrete CatPol of Cat = CommonX - [CAdv] ** open ResPol, Prelude, (R = ParamX)
Pron = ResPol.Pron;
Det = Determiner;
Det, DAP = Determiner;
Predet = {s : AForm => Str; np:NounPhrase; adj:Bool };
-- 'all', 'most' and 'only' belong in Polish to three completly different parts of speach
Quant = {s,sp : AForm => Str};

View File

@@ -21,4 +21,20 @@ lin ProDrop p = {
gn = p.gn ;
} ;
lin
UseDAP = dap2np Neut ;
UseDAPMasc = dap2np (Masc Personal) ;
UseDAPFem = dap2np Fem ;
oper
dap2np : Gender -> DAP -> NP ;
dap2np g dap = lin NP {
nom = dap.sp ! Nom ! g;
voc = dap.sp ! VocP ! g;
dep = \\cc => let c = extract_case ! cc
in dap.sp ! c ! g;
gn = accom_gennum ! <dap.a, g, dap.n>;
p = P3
};
}

View File

@@ -205,4 +205,7 @@ concrete NounPol of Noun = CatPol ** open ResPol, Prelude, PronounMorphoPol, Mor
s= \\n,c=> cn.s!n!c ++ sc.s;
g= cn.g
};
DetDAP d = d ;
}

View File

@@ -62,7 +62,7 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
CN = {s : Number => Str ; g : Gender} ;
Pron = Pronoun ;
NP = NounPhrase ;
Det = {
Det,DAP = {
s : Gender => Case => Str ;
n : Number ;
s2 : Str ; -- -ci
@@ -75,7 +75,6 @@ incomplete concrete CatRomance of Cat = CommonX - [SC,Pol]
sp : Number => Gender => Case => Str ;
isNeg : Bool -- negative element, e.g. aucun
} ;
DAP = {s : Gender => Case => Str ; n : Number} ;
Predet = {
s : AAgr => Case => Str ;
c : Case ; -- c : la plupart de

View File

@@ -239,6 +239,26 @@ incomplete concrete ExtendRomanceFunctor of Extend =
hasClit = False
} ;
UseDAP, UseDAPMasc = \dap ->
let
g = Masc ;
n = dap.n
in heavyNPpol dap.isNeg {
s = dap.sp ! g ;
a = agrP3 g n ;
hasClit = False
} ;
UseDAPFem dap =
let
g = Fem ;
n = dap.n
in heavyNPpol dap.isNeg {
s = dap.sp ! g ;
a = agrP3 g n ;
hasClit = False
} ;
lin
iFem_Pron = i_Pron ; -- DEFAULT I (masc)
youFem_Pron = youSg_Pron ; -- DEFAULT you (masc)

View File

@@ -192,8 +192,11 @@ incomplete concrete NounRomance of Noun =
AdjDAP det ap = {
s = \\g,c => det.s ! g ! c ++ ap.s ! genNum2Aform g det.n ;
n = det.n ;
s2 = det.s2 ; -- -ci
sp = \\g,c => det.s ! g ! c ++ ap.s ! genNum2Aform g det.n ;
isNeg = det.isNeg
} ;
DetDAP det = {s = \\g,c => det.s ! g ! c ; n = det.n } ;
DetDAP det = det ;
}

View File

@@ -368,4 +368,30 @@ lin BaseImp = twoTable2 Polarity Number ;
EmbedSSlash ss = {s = "det" ++ ss.s ! Main ++ ss.c2.s ++ ss.n3 ! agrUSgP3} ;
UttAccNP np = {s = np.s ! NPAcc} ;
lin UseDAP dap =
let
g = neutrum ; ----
m = True ; ---- is this needed for other than Art?
in {
s = table {
NPPoss _ _ => dap.sp ! m ! g ++ BIND ++ "s" ;
_ => dap.sp ! m ! g
} ;
a = agrP3 (ngen2gen g) dap.n ;
isPron = False
} ;
lin UseDAPMasc, UseDAPFem = \dap ->
let
g = utrum ; ----
m = True ; ---- is this needed for other than Art?
in {
s = table {
NPPoss _ _ => dap.sp ! m ! g ++ BIND ++ "s" ;
_ => dap.sp ! m ! g
} ;
a = agrP3 (ngen2gen g) dap.n ;
isPron = False
} ;
}